* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f0f0f0;
    color: #333;
}

header {
    background:
        linear-gradient(rgba(44,62,80,0.7), rgba(44,62,80,0.7)),
        url('images/header-bg.webp') center/cover no-repeat;
    position: relative;
    color: white;
    padding: 2.2rem 0 2.5rem 0;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.search-container {
    margin: 2.2rem auto 0 auto;
    display: flex;
    justify-content: center;
    gap: 0.7rem;
    width: 100%;
    background: none;
    box-shadow: none;
    padding: 0;
}

#search-input {
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 6px;
    width: 220px;
    max-width: 100%;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(44,62,80,0.06);
}

#search-button {
    padding: 0.6rem 1.1rem;
    font-size: 1rem;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(44,62,80,0.08);
    background-color: #e74c3c;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

#search-button:hover {
    background-color: #c0392b;
}

main {
    max-width: 1500px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  justify-items: center;
  margin: 0 auto;
  max-width: 1600px;
  padding: 0 1rem;
}

/* 卡牌悬停效果 */
.card {
  position: relative;
  width: 300px;
  box-sizing: border-box;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  box-shadow: none;
  background-color: transparent;
  display: block;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 1000;
    overflow: auto;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    position: relative;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {opacity: 0; transform: translateY(-50px);}
    to {opacity: 1; transform: translateY(0);}
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover {
    color: black;
}

/* 无结果提示样式 */
.no-results {
    text-align: center;
    color: #666;
    font-size: 18px;
    margin: 40px 0;
}

/* 详情页样式 */
#modalCardDetails h2 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

#modalCardDetails p {
    margin: 12px 0;
    line-height: 1.6;
}

#modalCardDetails .card-desc {
    font-size: inherit;
}

#modalCardDetails strong {
    color: #2c3e50;
    min-width: 100px;
    display: inline-block;
}

.card-image {
    width: 300px;
    height: 300px;
    background-color: #ddd;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.card-image {
    margin: 0;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    border-top: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
    box-sizing: border-box;
}

.card > div:not(.card-image) {
  border: 1px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 1rem;
  margin: 0;
  background-color: #ffffff;
  box-shadow: none;
  width: 100%;
  box-sizing: border-box;
}

.card-image {
  width: 300px;
  height: 300px;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
}

/* 灵摆卡图片顶部对齐 */
.pendulum-image {
  object-position: top;
}

.card-details {
    padding: 1rem;
    position: relative;
}

.card-name {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.card-type {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.card-description {
    font-size: 0.9rem;
    color: #555;
}

.card-pendulum-desc {
  font-size: 0.9rem;
  color: #555;
}

/* 搜索结果文本样式 */
.search-result {
  text-align: center;
  margin: 5px 0 15px 0; /* 减少上方margin实现上移效果 */
  font-weight: bold;
}

.search-result-empty {
  color: #666;
}

.search-result-none {
  color: #ff4444;
}

.search-result-match {
  color: #3498db; /* 更美观的蓝色替代原来的绿色 */
}

/* 分割线样式 */
.divider {
  border-top: 1px solid #e0e0e0;
  margin: 8px 0;
}

.theme-toggle-container {
    margin-top: 0.2rem;
    text-align: center;
}

#theme-toggle {
    font-size: 1.01rem;
    padding: 0.45rem 1.2rem;
    border-radius: 6px;
    background: #3498db;
    color: #fff;
    border: none;
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: background 0.3s;
}

#theme-toggle:hover {
    background: #217dbb;
}

body.dark-mode #theme-toggle {
    background: #444;
    color: #fff;
}

body.dark-mode {
    background-color: #181a1b;
    color: #e0e0e0;
}

body.dark-mode header {
    background-color: #181a1b;
    color: #e0e0e0;
}

body.dark-mode main,
body.dark-mode .card-details,
body.dark-mode .card-detail-info {
    color: #f3f6fa;
}

body.dark-mode .card > div:not(.card-image) {
    background-color: #23272a;
    color: #e0e0e0;
    border-color: #333;
}

body.dark-mode .card-image {
    background-color: #23272a;
    border-color: #333;
}

body.dark-mode .modal-content {
    background-color: #23272a;
    color: #e0e0e0;
}

body.dark-mode .search-result-match {
    color: #4fc3f7;
}

body.dark-mode .search-result-none {
    color: #ff8888;
}

body.dark-mode .divider {
    border-top: 1.5px solid #444;
}

body.dark-mode .card-name,
body.dark-mode .card-detail-info h2 {
    color: #fff;
}

body.dark-mode .card-type,
body.dark-mode .card-pendulum-desc,
body.dark-mode .card-description {
    color: #b0b8c1;
}

body.dark-mode .card-detail-info p,
body.dark-mode .card-detail-info .card-stats p {
    color: #e0e0e0;
}

body.dark-mode .no-results {
    color: #b0b8c1;
}

body.dark-mode .version-info p {
    color: #8ca0b3;
}

/* 详情页专用布局 */
.card-detail-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    justify-content: center;
    align-items: flex-start;
    margin: 2.5rem auto;
    max-width: 1100px;
    background: rgba(255,255,255,0.95);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(44,62,80,0.12);
    padding: 2.5rem 2rem;
}

.card-detail-image {
    flex: 0 0 400px;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f7f7f7;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(44,62,80,0.10);
    padding: 1.5rem 1rem;
    position: relative;
}

.card-detail-image img {
    width: 100%;
    max-width: 380px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(44,62,80,0.18);
    background: #e0e0e0;
    display: block;
}

.card-detail-info {
    flex: 1 1 350px;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.card-detail-info h2 {
    font-size: 2.1rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.card-detail-info p {
    font-size: 1.1rem;
    color: #444;
    margin: 0.2rem 0;
    line-height: 1.7;
}

.card-detail-info .card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem 2.5rem;
    margin-top: 1.2rem;
    font-size: 1.08rem;
}

.card-detail-info .card-stats p {
    margin: 0;
    color: #2c3e50;
    font-weight: 500;
}

.card-detail-info .divider {
    border-top: 1.5px solid #e0e0e0;
    margin: 1.2rem 0;
}

@media (max-width: 900px) {
    .card-detail-layout {
        flex-direction: column;
        align-items: center;
        padding: 1.2rem 0.5rem;
    }
    .card-detail-image {
        max-width: 95vw;
    }
    header {
        background-size: cover;
        background-position: center;
    }
}

body.dark-mode .card-detail-layout {
    background: rgba(24,26,27,0.98);
    box-shadow: 0 8px 32px rgba(44,62,80,0.22);
}
body.dark-mode .card-detail-image {
    background: #23272a;
}
body.dark-mode .card-detail-info h2 {
    color: #4fc3f7;
    border-bottom: 2px solid #4fc3f7;
}
body.dark-mode .card-detail-info p,
body.dark-mode .card-detail-info .card-stats p {
    color: #e0e0e0;
}
body.dark-mode .card-detail-info .divider {
    border-top: 1px solid #333;
}

/* 页脚版本信息样式 */
footer {
    width: 100%;
    background: #f8f8f8;
    border-top: 0.5px solid #e0e0e0;
    padding: 18px 0 10px 0;
    margin-top: 40px;
    text-align: center;
}

.version-info {
    width: 100%;
    text-align: center;
    margin: 0 auto;
}

.version-info p {
    color: #888;
    font-size: 12px;
    letter-spacing: 1px;
    line-height: 1.7;
    margin: 0;
}

body.dark-mode footer {
    background-color: #2c3e50;
    border-top: 1px solid #34495e;
}

body.dark-mode .version-info p {
    color: #8ca0b3;
}

/* 欢迎卡片美化 */
/* 移除 .welcome-card 样式 */

.name-mode-container {
    margin: 0.2rem auto 0 auto;
    text-align: center;
    font-size: 0.98rem;
}
.name-mode-container label {
    margin-right: 0.5rem;
    color: #2c3e50;
}
#name-mode-select {
    padding: 0.28rem 0.9rem 0.28rem 0.5rem;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 0.98rem;
    background: #fff;
    color: #2c3e50;
    outline: none;
    transition: border 0.2s;
    height: 2rem;
    min-width: 80px;
}
#name-mode-select:focus {
    border: 1.5px solid #3498db;
}
body.dark-mode .name-mode-container label {
    color: #e0e0e0;
}
body.dark-mode #name-mode-select {
    background: #23272a;
    color: #e0e0e0;
    border: 1px solid #444;
}
body.dark-mode #name-mode-select:focus {
    border: 1.5px solid #4fc3f7;
}

.download-link {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem auto 0 auto;
    padding: 0.55rem 1.5rem;
    background: #3498db;
    color: #fff;
    border-radius: 6px;
    font-size: 1.08rem;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(44,62,80,0.08);
    transition: background 0.2s, color 0.2s;
    min-width: 120px;
}
.download-link:hover {
    background: #217dbb;
    color: #fff;
}
.download-icon {
    display: inline-flex;
    align-items: center;
    color: #fff;
    margin-right: 6px;
}
body.dark-mode .download-link {
    background: #444;
    color: #fff;
}
body.dark-mode .download-link:hover {
    background: #217dbb;
    color: #fff;
}
body.dark-mode .download-icon {
    color: #fff;
}

.mini-download-btn-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 0.2rem 0.5rem 0.3rem 0;
    border-top: 1px solid #e0e0e0;
    padding-top: 0.5rem;
}
@media (max-width: 600px) {
    .mini-download-btn-bar {
        justify-content: center;
        margin-right: 0;
    }
}
.card:hover .mini-download-btn {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    background: #217dbb;
    color: #fff;
    box-shadow: 0 4px 16px rgba(44,62,80,0.18);
}
body.dark-mode .mini-download-btn-bar {
    border-top: 1px solid #333;
}
.mini-download-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e74c3c !important;
    color: #fff !important;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(44,62,80,0.10);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s, transform 0.2s, background 0.2s;
    z-index: 2;
    cursor: pointer;
}
.card:hover .mini-download-btn {
    opacity: 1;
    transform: translateY(0);
}
.mini-download-btn:hover {
    background: #c0392b !important;
}
body.dark-mode .mini-download-btn {
    background: #c0392b !important;
    color: #fff !important;
}
body.dark-mode .mini-download-btn:hover {
    background: #e74c3c !important;
}
.mini-download-btn svg {
    color: #fff !important;
    fill: none;
}
.mini-download-btn svg path,
.mini-download-btn svg rect {
    stroke: #fff !important;
    fill: none !important;
}

@media (max-width: 600px) {
    .search-container {
        max-width: 98vw;
        padding: 1.2rem 0.5rem 0.7rem 0.5rem;
    }
    #search-input {
        width: 120px;
        font-size: 0.98rem;
    }
    .name-mode-container label {
        font-size: 0.98rem;
    }
}

.main-navbar {
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(44,62,80,0.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.2rem;
    min-height: 62px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar-left {
    display: flex;
    align-items: center;
}
.site-title {
    font-family: 'Arial Black', 'Arial', sans-serif;
    font-size: 1.18rem;
    font-weight: 900;
    color: #2c3e50;
    margin-left: 0.7rem;
    letter-spacing: 1px;
    vertical-align: middle;
    text-shadow: 0 1px 0 #fff, 0 2px 4px rgba(44,62,80,0.08);
    cursor: pointer;
    transition: color 0.2s, text-shadow 0.2s;
}

.site-title:hover {
    color: #3498db;
    text-shadow: 0 1px 0 #fff, 0 2px 4px rgba(52,152,219,0.15);
}

body.dark-mode .site-title {
    color: #e0e0e0;
}

body.dark-mode .site-title:hover {
    color: #4fc3f7;
    text-shadow: 0 1px 0 #23272a, 0 2px 4px rgba(79,195,247,0.15);
}

.theme-mode-container {
    display: flex;
    align-items: center;
    margin-left: 1.1rem;
    font-size: 0.98rem;
}
.theme-mode-container label {
    margin-right: 0.3rem;
    color: #2c3e50;
}
body.dark-mode .theme-mode-container label {
    color: #e0e0e0;
}
#theme-mode-select {
    padding: 0.28rem 0.9rem 0.28rem 0.5rem;
    border-radius: 5px;
    border: 1px solid #d0d0d0;
    font-size: 0.98rem;
    background: #fff;
    color: #2c3e50;
    outline: none;
    transition: border 0.2s;
    height: 2rem;
    min-width: 80px;
}
#theme-mode-select:focus {
    border: 1.5px solid #3498db;
}
body.dark-mode #theme-mode-select {
    background: #23272a;
    color: #e0e0e0;
    border: 1px solid #444;
}
body.dark-mode #theme-mode-select:focus {
    border: 1.5px solid #4fc3f7;
}
.navbar-logo {
    width: 44px;
    height: 44px;
    background: #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    color: #3498db;
    margin-right: 1.2rem;
    letter-spacing: 2px;
    overflow: hidden;
    cursor: pointer;
    transition: background 0.2s;
}

.navbar-logo:hover {
    background: #d0d0d0;
}

.navbar-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.navbar-logo .logo-text {
    display: none;
    font-weight: bold;
    font-size: 1.2rem;
    color: #3498db;
    letter-spacing: 2px;
}

.navbar-logo img[style*="display: none"] + .logo-text {
    display: block;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 1.8rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.navbar-menu li a {
    color: #2c3e50;
    font-size: 1.08rem;
    text-decoration: none;
    font-weight: 500;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}
.navbar-menu li a:hover {
    background: #f0f4fa;
    color: #217dbb;
}
.navbar-right {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}
.navbar-inline {
    display: flex;
    align-items: center;
}
.navbar-inline label {
    margin-right: 0.3rem;
    color: #2c3e50;
    font-size: 1.01rem;
}
@media (max-width: 900px) {
    .main-navbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 0.5rem;
        min-height: 54px;
    }
    .navbar-menu {
        gap: 1rem;
    }
    .navbar-logo {
        margin-right: 0.7rem;
    }
    .navbar-right {
        gap: 0.5rem;
    }
}
body.dark-mode .main-navbar {
    background: #23272a;
    box-shadow: 0 2px 8px rgba(44,62,80,0.18);
}
body.dark-mode .navbar-menu li a {
    color: #e0e0e0;
}
body.dark-mode .navbar-menu li a:hover {
    background: #2c3e50;
    color: #4fc3f7;
}
body.dark-mode .navbar-logo {
    background: #34495e;
    color: #4fc3f7;
}
body.dark-mode .navbar-logo:hover {
    background: #2c3e50;
}
body.dark-mode .navbar-logo .logo-text {
    color: #4fc3f7;
}
body.dark-mode .navbar-inline label {
    color: #e0e0e0;
}

.puzzle-layout {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 2.5rem;
    margin-top: 2.5rem;
}
.puzzle-board-area,
.puzzle-info-area {
    flex: 0 0 400px;
    max-width: 400px;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.puzzle-info-area {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(44,62,80,0.12);
    padding: 1.2rem 2rem 2.5rem 2rem;
    box-sizing: border-box;
    height: 100%;
    justify-content: flex-start;
}
.puzzle-info-area .card-details {
    margin-top: 0;
}
.puzzle-info-area h2 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}
.puzzle-row {
    margin-bottom: 10px;
    font-size: 1.08rem;
}
.puzzle-board {
    position: relative;
    display: grid;
    background: #fff;
    box-shadow: 0 4px 24px rgba(44,62,80,0.10);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #eee;
}
.puzzle-board .puzzle-tile {
    border: 1px solid #e0e0e0 !important;
    box-sizing: border-box;
    background-clip: padding-box;
}
.puzzle-pieces {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 32px auto 0 auto;
    min-height: 60px;
    min-width: 400px;
    max-width: 900px;
}
body.dark-mode .puzzle-info-area {
    background: #23272a;
    color: #e0e0e0;
    box-shadow: 0 4px 24px rgba(44,62,80,0.18);
}
body.dark-mode .puzzle-board {
    background: #23272a;
    border: 2px solid #444;
}
body.dark-mode .puzzle-board .puzzle-tile {
    border: 1px solid #444 !important;
}
.puzzle-difficulty-large {
    font-size: 1.25rem;
    padding: 0.4em 1.2em;
    min-width: 120px;
    border-radius: 6px;
    margin: 0.2em 0;
}
.puzzle-info-area .puzzle-row {
    margin-bottom: 1.1em;
}
.puzzle-info-area .puzzle-btn {
    width: 100%;
    margin-bottom: 0.5em;
}

/* 网站导航板块样式 */
.site-nav-section {
    margin: 2.5rem auto 0 auto;
    max-width: 1600px;
    padding: 0 1rem;
}
.site-nav-title {
    text-align: left;
    font-size: 1.45rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    margin-top: 0;
    color: #2c3e50;
}
body.dark-mode .site-nav-title {
    color: #e0e0e0;
}
.site-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1.5rem;
}
.site-nav-card {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(44,62,80,0.10);
    padding: 0.7rem 0.8rem;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
    min-height: 64px;
    position: relative;
    text-decoration: none;
}
.site-nav-card:hover {
    box-shadow: 0 4px 16px rgba(44,62,80,0.18);
    transform: translateY(-2px) scale(1.02);
}
.site-nav-card:visited,
.site-nav-card:hover,
.site-nav-card:active {
    text-decoration: none;
}
.site-nav-card * {
    text-decoration: none !important;
}
.site-nav-icon {
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
    margin-right: 0.7rem;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.site-nav-info {
    flex: 1;
    min-width: 0;
}
.site-nav-name {
    font-size: 0.98rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}
.site-nav-desc {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}
@media (max-width: 900px) {
    .site-nav-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1rem;
    }
    .site-nav-card {
        padding: 0.8rem 0.7rem;
        min-height: 70px;
    }
    .site-nav-icon {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
        margin-right: 0.7rem;
    }
    .site-nav-title {
        font-size: 1.15rem;
    }
}
body.dark-mode .site-nav-card {
    background: #23272a;
    box-shadow: 0 4px 18px rgba(44,62,80,0.22);
}
body.dark-mode .site-nav-name {
    color: #fff;
}
body.dark-mode .site-nav-desc {
    color: #b0b8c1;
}
body.dark-mode .site-nav-icon {
    background: #181a1b;
}

#newest-cards-section {
    margin-top: 2.8rem;
}

.site-nav-section,
#newest-cards-section {
    padding-left: 1rem;
    padding-right: 1rem;
}

#sponsor-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    overflow: visible;
}
#sponsor-modal .modal-content {
    background: #fff;
    padding: 2.2rem 2.5rem 2rem 2.5rem;
    border-radius: 12px;
    width: 95%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(44,62,80,0.18);
    position: relative;
    color: #2c3e50;
    text-align: left;
    margin: 0;
}
#sponsor-modal h2 {
    font-size: 1.35rem;
    font-weight: bold;
    margin-bottom: 1.1rem;
}
#sponsor-modal h3 {
    font-size: 1.08rem;
    margin: 1.2rem 0 0.5rem 0;
}
#sponsor-modal ul {
    list-style: disc inside;
    padding-left: 1.2rem;
}
#sponsor-modal ul li {
  color: #333;
  font-size: 15px;
  margin-bottom: 4px;
}
#sponsor-modal .close-btn {
    position: absolute;
    top: 1.1rem;
    right: 1.3rem;
    font-size: 2rem;
    color: #aaa;
    cursor: pointer;
    font-weight: bold;
    transition: color 0.2s;
}
#sponsor-modal .close-btn:hover {
    color: #e74c3c;
}
body.dark-mode #sponsor-modal .modal-content {
    background: #23272a;
    color: #e0e0e0;
    box-shadow: 0 8px 32px rgba(44,62,80,0.28);
}
body.dark-mode #sponsor-modal .close-btn {
    color: #888;
}
body.dark-mode #sponsor-modal .close-btn:hover {
    color: #ff8888;
}

.qr-hover-item {
  position: relative;
  display: inline-block;
  cursor: pointer;
  color: #1976d2;
  font-weight: 500;
  margin-right: 0;
  list-style-type: disc;
  list-style-position: inside;
}
.qr-hover-item .qr-popup {
  display: none;
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  margin-top: 8px;
  width: 150px;
  padding: 8px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(44,62,80,0.18);
  z-index: 10;
  border: 1.5px solid #e0e0e0;
  text-align: center;
  color: #223a5a;
}
.qr-hover-item .qr-popup::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 10px 12px 10px;
  border-style: solid;
  border-color: transparent transparent #fff transparent;
  filter: drop-shadow(0 -2px 2px rgba(44,62,80,0.08));
}
.qr-hover-item:hover .qr-popup {
  display: block;
}
body.dark-mode .qr-hover-item .qr-popup {
  background: #23272a;
  border: 1.5px solid #444;
  box-shadow: 0 4px 24px rgba(44,62,80,0.28);
}
body.dark-mode .qr-hover-item .qr-popup::before {
  border-color: transparent transparent #23272a transparent;
}

.qr-popup-small {
    width: 300px !important;
    height: 300px !important;
    min-width: 0;
    min-height: 0;
    max-width: 300px;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(44,62,80,0.10);
    border: 1px solid #eee;
}

/* 缩小版网站导航标签切换样式 */
.category-tabs {
  display: flex;
  background: #e5e6e8;
  border-radius: 1.2em;
  padding: 2px 6px;
  gap: 6px;
  width: fit-content;
  margin-left: 12px;
  height: 32px;
}
.tab {
  border: none;
  background: none;
  color: #888;
  font-size: 15px;
  padding: 3px 14px;
  border-radius: 1.2em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  height: 28px;
  line-height: 22px;
  display: flex;
  align-items: center;
}
.tab.active {
  background: #3a559b;
  color: #fff;
  font-weight: bold;
}
.tab:focus {
  outline: none;
}
body.dark-mode .category-tabs {
  background: #23272f;
}
body.dark-mode .tab {
  color: #aaa;
}
body.dark-mode .tab.active {
  background: #2d3e6b;
  color: #fff;
}

/* OCG新卡图片展示样式 */
.ocg-new-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(44,62,80,0.08);
  padding: 12px 10px 10px 10px;
  margin: 6px;
  width: 160px;
  transition: box-shadow 0.2s;
}
.ocg-new-card:hover {
  box-shadow: 0 6px 18px rgba(44,62,80,0.16);
}
.ocg-new-img {
  width: 120px;
  height: 120px;
  background: #f3f3f3;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 8px;
}
.ocg-new-img img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}
.ocg-new-name {
  font-size: 16px;
  color: #222;
  text-align: center;
  margin-top: 2px;
  word-break: break-all;
}
body.dark-mode .ocg-new-card {
  background: #23272f;
  box-shadow: 0 2px 8px rgba(30,34,40,0.18);
}
body.dark-mode .ocg-new-name {
  color: #eee;
}
body.dark-mode .ocg-new-img {
  background: #181a1f;
}

/* 按钮同排 */
.puzzle-btn-row {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    margin-top: 0.8rem;
}
.puzzle-btn {
    min-width: 120px;
    font-size: 1.08rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}
.puzzle-btn .btn-icon {
    margin-right: 0.4em;
    font-size: 1.2em;
}
/* 重新开始按钮红色 */
#puzzle-restart.puzzle-btn {
    background: #e74c3c;
}
#puzzle-restart.puzzle-btn:hover {
    background: #c0392b;
}
/* 难度选择框与导航栏一致 */
#puzzle-difficulty {
    font-size: 1rem;
    padding: 0.3em 1.1em;
    min-width: 90px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #fff;
    transition: border 0.2s;
}
#puzzle-difficulty:focus {
    outline: none;
    border: 1.5px solid #3498db;
}
body.dark-mode #puzzle-difficulty {
    background: #23272a;
    color: #fff;
    border: 1px solid #444;
}
body.dark-mode #puzzle-difficulty:focus {
    border: 1.5px solid #3498db;
}
.puzzle-info-area .card-details {
    border: none;
    background: none;
    box-shadow: none;
    padding: 0.5rem 0 0.5rem 0;
    margin-bottom: 0.5rem;
}
.puzzle-info-area .card-name {
    font-size: 1.25rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.2rem;
}
.puzzle-info-area .card-type,
.puzzle-info-area .card-description,
.puzzle-info-area .card-pendulum-desc {
    font-size: 0.98rem;
    color: #555;
}
.puzzle-info-area .divider {
    border-top: 1px solid #e0e0e0;
    margin: 0.5rem 0;
}
.puzzle-info-area .puzzle-info-row {
    margin-bottom: 0.7rem;
}
.puzzle-info-area .puzzle-btn-row {
    margin-bottom: 0.7rem;
}

.puzzle-info-box {
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.7rem 1.2rem;
    background: #fafbfc;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
}
.puzzle-btn-row {
    margin-top: 2.2rem !important;
}

.time-badge {
    display: inline-block;
    background: #f3f6fa;
    border: 1.2px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.18em 0.85em;
    font-size: 1.01em;
    color: #2c3e50;
    margin-left: 0.3em;
    min-width: 3.2em;
    text-align: center;
}
.puzzle-btn-row {
    margin-top: 1.1rem !important;
    margin-bottom: 0.5rem !important;
}
.puzzle-info-area {
    padding-bottom: 1.2rem;
}

.puzzle-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.45);
    align-items: center;
    justify-content: center;
}
.puzzle-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 2.2rem 2.5rem 1.5rem 2.5rem;
    box-shadow: 0 8px 32px rgba(44,62,80,0.18);
    text-align: center;
    min-width: 260px;
    max-width: 90vw;
    position: relative;
}
.puzzle-modal-close {
    position: absolute;
    right: 1.2rem;
    top: 1.2rem;
    font-size: 1.8rem;
    color: #aaa;
    cursor: pointer;
}
.puzzle-modal-close:hover {
    color: #e74c3c;
}
.puzzle-modal-content h2 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1.2rem;
    margin-top: 0.2rem;
    letter-spacing: 1px;
}
#puzzle-modal-msg {
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7em;
}
#puzzle-modal-ok {
    display: block;
    margin: 0 auto;
    min-width: 120px;
    font-size: 1.12rem;
    margin-top: 0.5rem;
    margin-bottom: 0.2rem;
}

@media (max-width: 600px) {
  .hide-mobile {
    display: none !important;
  }
  .main-navbar {
    flex-wrap: wrap;
    padding: 8px 0;
  }
  .navbar-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .navbar-sponsor {
    margin-left: 8px;
    font-size: 15px;
    color: #e74c3c;
    text-decoration: none;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 4px;
    background: #fff5f5;
  }
  .navbar-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    margin-bottom: 2px;
  }
  .navbar-inline {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px;
    margin-bottom: 0;
  }
  .name-mode-container, .theme-mode-container {
    margin-bottom: 0 !important;
  }
}

.qr-tip {
  color: #888;
  font-size: 15px;
}

.qr-tip-normal {
  color: #222;
  font-size: 15px;
  font-weight: normal;
}

.qr-link {
  color: #1976d2;
  font-size: 15px;
  text-decoration: none;
}
.qr-link:hover {
  color: #125199;
}
.sponsor-tip {
  color: #223a5a;
}

.qr-popup a {
  color: #223a5a;
  text-decoration: none;
}