/* ============================================================
   hearthstone 网站共享样式 —— 炉石深蓝 + 金色主题
   制作者：大神丨啤酒屋南曦
   ============================================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #1c1140;
    --surface: #261853;
    --card: #2f2069;
    --card-hover: #3a2a80;
    --border: #4c3c96;
    --gold: #f3cd74;
    --gold-dim: #c89b52;
    --blue: #9b6cf8;
    --blue-soft: rgba(155, 108, 248, 0.24);
    --red: #ef6b6b;
    --green: #74d99a;
    --text: #f3effd;
    --text-muted: #bcaadb;
    --font: 'Segoe UI', system-ui, -apple-system, 'Microsoft YaHei', 'PingFang SC', sans-serif;
    --radius: 12px;
    --shadow: 0 10px 32px rgba(12, 4, 40, 0.55);
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: 64px;
}

/* ---------- 首页赛事通告横幅 ---------- */
.hb-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(243, 205, 116, 0.1), rgba(155, 108, 248, 0.06));
    border: 1px solid rgba(243, 205, 116, 0.3);
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s;
}
.hb-card:last-child { margin-bottom: 0; }
.hb-card:hover {
    border-color: var(--gold);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}
.hb-ico { font-size: 1.6rem; flex: none; }
.hb-main { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.hb-main b { font-size: 1.05rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hb-sub { color: var(--text-muted); font-size: 0.85rem; line-height: 1.6; }
.hb-pill { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 10px; flex: none; }
.hb-pill.soon { color: #ffd76a; background: rgba(243, 205, 116, 0.12); border: 1px solid rgba(243, 205, 116, 0.4); }
.hb-pill.live { color: #ff9a9a; background: rgba(227, 107, 107, 0.12); border: 1px solid rgba(227, 107, 107, 0.45); }
.hb-go { flex: none; color: var(--gold); font-size: 13px; font-weight: 700; }
/* 抽奖宣传条：金色描边，与普通赛事通告区分 */
.hb-card.hb-lottery {
    border-color: rgba(243, 205, 116, 0.45);
    background: linear-gradient(120deg, rgba(243, 205, 116, 0.1), rgba(255, 255, 255, 0.02));
}
.hb-card.hb-lottery .hb-main b { color: var(--gold); }
@media (max-width: 767px) { .hb-go { display: none; } .hb-card { flex-wrap: wrap; } }

/* ---------- 背景 ---------- */
#bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse at 18% 0%, rgba(139, 92, 246, 0.42) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 90%, rgba(243, 205, 116, 0.14) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 40%, rgba(74, 40, 160, 0.45) 0%, transparent 60%),
        var(--bg);
}

/* ---------- 导航 ---------- */
#nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(28, 17, 64, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    height: 64px;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 1.5px;
    color: #fff;
    text-decoration: none;
}

.nav-brand .mana {
    color: var(--blue);
}

.nav-brand .gold {
    color: var(--gold);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 26px;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: color 0.25s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 26px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: 0.25s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 720px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(11, 14, 20, 0.96);
        backdrop-filter: blur(14px);
        padding: 20px 28px;
        gap: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        transform: scaleY(0);
        transform-origin: top;
        opacity: 0;
        pointer-events: none;
        transition: 0.3s ease;
    }

    .nav-links.open {
        transform: scaleY(1);
        opacity: 1;
        pointer-events: auto;
    }
}

/* ---------- 容器 ---------- */
.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

.section {
    padding: 56px 0 44px;
    position: relative;
    z-index: 1;
}

.sec-label {
    font-size: 0.75rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 6px;
}

.sec-title {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 26px;
    background: linear-gradient(135deg, #fff 45%, var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---------- HERO ---------- */
#hero {
    min-height: 66vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px 36px;
    position: relative;
    z-index: 1;
}

.hero-kicker {
    font-size: 0.82rem;
    letter-spacing: 5px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.hero-title {
    font-size: clamp(2.4rem, 8vw, 4.6rem);
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.15;
    background: linear-gradient(135deg, #fff 25%, var(--gold) 75%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-sub {
    margin-top: 14px;
    font-size: 1.05rem;
    color: var(--gold-dim);
    letter-spacing: 2px;
}

.hero-meta {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ---------- 首页门户按钮 ---------- */
.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}
.hero-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 12px;
    background: var(--card);
    color: var(--text);
    font-weight: 600;
    letter-spacing: 1px;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.hero-btn:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
    color: var(--gold);
}
.hero-btn.primary {
    background: linear-gradient(135deg, #2f5f9e, #1c3a63);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}
.hero-btn.primary:hover {
    border-color: var(--gold);
    color: #ffd76a;
}
/* 报名按钮：无赛事开放报名时由脚本 hidden 隐藏（类选择器会覆盖 [hidden] 默认值，需显式声明） */
.hero-btn[hidden] { display: none; }

/* 移动端：主按钮独占一行，其余按钮均分一行 */
@media (max-width: 767px) {
    .hero-cta .hero-btn {
        flex: 1 1 calc(50% - 5px);
        text-align: center;
    }
    .hero-cta .hero-btn.primary {
        flex-basis: 100%;
    }
}

/* ---------- 统计卡 ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 28px;
}

.stat-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}

.stat-box:hover {
    transform: translateY(-3px);
    border-color: var(--gold-dim);
}

.stat-num {
    display: block;
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--gold);
    line-height: 1.2;
}

.stat-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ---------- 卡片块 ---------- */
.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.panel h2 {
    font-size: 1.25rem;
    margin-bottom: 14px;
}

/* ---------- 功能入口卡 ---------- */
.entry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 28px;
}

.entry-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 24px;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.entry-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold-dim);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}

.entry-icon {
    font-size: 1.8rem;
}

.entry-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.entry-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
    flex: 1;
}

.entry-more {
    font-size: 0.85rem;
    color: var(--gold);
    font-weight: 600;
}

/* ---------- 表格 ---------- */
.tbl-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.data-table th {
    background: #161d2e;
    color: var(--text-muted);
    font-weight: 600;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background 0.15s;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.data-table .num {
    text-align: center;
}

.data-table .rk {
    color: var(--text-muted);
}

.data-table .cls-c {
    display: inline-block;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

/* 卡牌名：可点击查看详情（完整效果等） */
.data-table .name-link {
    cursor: pointer;
    color: var(--blue);
    transition: color 0.15s;
}

.data-table .name-link:hover {
    color: #7fb6ff;
    text-decoration: underline;
}

/* ---------- 卡牌详情弹层 ---------- */
.card-pop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
}

.card-pop.show {
    display: block;
}

.card-pop-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.card-pop-panel {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 560px;
    max-width: calc(100vw - 28px);
    max-height: calc(100vh - 56px);
    background: #171c2a;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
}

.card-pop-close {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 2;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 14px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
}

.card-pop-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.card-pop-scroll {
    overflow-y: auto;
    padding: 22px 24px;
}

.card-pop-top {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.card-pop-img {
    width: 150px;
    max-width: 38%;
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.card-pop-head {
    flex: 1;
    min-width: 0;
}

.card-pop-class {
    color: var(--text-muted);
    font-size: 12.5px;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.card-pop-title {
    color: #fff;
    font-size: 1.35rem;
    line-height: 1.3;
    margin-bottom: 6px;
}

.card-pop-meta {
    color: var(--gold);
    font-size: 13px;
    margin-bottom: 8px;
}

.card-pop-kw {
    min-height: 22px;
}

.card-pop-kw .kw-none {
    color: var(--text-muted);
    font-size: 12px;
}

.card-pop-text {
    color: #d8d9e3;
    font-size: 13.5px;
    line-height: 1.9;
    margin-top: 16px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    border-left: 3px solid var(--gold-dim);
    white-space: normal;
    overflow-wrap: anywhere;
}

.card-pop-scores {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.card-pop-scores span {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 6px 12px;
}

.card-pop-scores b {
    color: var(--text);
    font-weight: 700;
}

.card-pop-scores .neg { color: var(--red); }
.card-pop-scores .pos { color: var(--green); }
.card-pop-scores .tot { color: var(--gold); }

.data-table .tot {
    font-weight: 700;
    color: var(--gold);
}

.data-table .neg {
    color: var(--red);
}

.data-table .kw-tag {
    display: inline-block;
    background: var(--blue-soft);
    color: var(--blue);
    border-radius: 999px;
    padding: 1px 9px;
    font-size: 11.5px;
    margin: 1px 3px 1px 0;
}

.rar-普通 { color: #b8c2d6; }
.rar-稀有 { color: #4f9df7; }
.rar-史诗 { color: #b06ef0; }
.rar-传说 { color: #f0a64f; }
.rar-免费 { color: #9aa3b5; }

/* ---------- 社区额外加分投票 ---------- */
.vote-badge {
    display: inline-block;
    min-width: 26px;
    color: var(--gold);
    font-weight: 700;
    font-size: 13px;
    margin-right: 6px;
}

.vote-badge.voted {
    color: var(--green);
}

.vote-btn {
    background: linear-gradient(135deg, var(--gold), #d9a94e);
    color: #111;
    border: none;
    border-radius: 999px;
    padding: 2px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    vertical-align: middle;
    transition: transform 0.15s, opacity 0.15s;
}

.vote-btn:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.vote-btn:active {
    transform: scale(0.96);
}

.vote-btn:disabled {
    opacity: 0.45;
    cursor: default;
    transform: none;
}

/* 投票状态提示条 */
.vote-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.vote-tip.on {
    background: rgba(111, 208, 140, 0.1);
    border: 1px solid rgba(111, 208, 140, 0.35);
    color: var(--green);
}

.vote-tip.off {
    background: rgba(240, 201, 111, 0.08);
    border: 1px dashed rgba(240, 201, 111, 0.45);
    color: var(--gold-dim);
}

.vote-tip b {
    color: #fff;
}

/* ---------- 筛选项 ---------- */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
}

.filters input,
.filters select {
    background: #121828;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filters input:focus,
.filters select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-soft);
}

.filters select {
    cursor: pointer;
}

#search {
    width: 220px;
}

.chip {
    background: #121828;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.chip:hover {
    border-color: var(--gold-dim);
    color: #fff;
}

.chip.on {
    background: var(--gold);
    color: #111;
    border-color: var(--gold);
    font-weight: 600;
}

/* ---------- 图表 ---------- */
svg.chart {
    display: block;
    width: 100%;
    height: auto;
}

.bar {
    cursor: pointer;
    transition: opacity 0.15s;
}

.bar:hover {
    opacity: 0.82;
}

.dot {
    cursor: pointer;
    transition: r 0.15s;
}

.dot:hover {
    r: 8;
}

.legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: -1px;
}

/* ---------- 状态提示 ---------- */
.loading-tip {
    color: var(--text-muted);
    font-size: 0.95rem;
    padding: 30px 0;
    text-align: center;
}

.loading-tip::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: -2px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-tip {
    color: var(--red);
    font-size: 0.95rem;
    padding: 24px 0;
    text-align: center;
    background: rgba(227, 107, 107, 0.08);
    border: 1px solid rgba(227, 107, 107, 0.3);
    border-radius: var(--radius);
}

/* ---------- 评分模型说明 ---------- */
.model-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.model-item {
    background: #121828;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
}

.model-item h4 {
    color: var(--gold);
    margin-bottom: 8px;
    font-size: 1rem;
}

.model-item p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.8;
}

/* ---------- 页脚 ---------- */
#footer {
    border-top: 1px solid var(--border);
    padding: 28px 24px 24px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 1;
}

#footer a {
    color: var(--gold-dim);
    text-decoration: none;
}

#footer a:hover {
    color: var(--gold);
    text-decoration: underline;
}

/* ---------- 响应式 ----------
   表格列随屏宽分档递减，保证任意宽度下都排得整齐：
   12 列 = # 名称 攻/血 职业 种族 稀有度 优质词条 身材分 词条分 负面扣分 总得分 社区加分
   （效果不占表格列，点击卡牌名弹出详情查看） */

/* 大屏 ≥1151px：只隐藏种族列 → 11 列 */
@media (min-width: 1151px) {
    .data-table th:nth-child(5),
    .data-table td:nth-child(5) {
        display: none;
    }
}

/* 中屏 993~1150px：再隐藏稀有度、优质词条 → 10 列 */
@media (min-width: 993px) and (max-width: 1150px) {
    .data-table th:nth-child(5),
    .data-table td:nth-child(5),
    .data-table th:nth-child(6),
    .data-table td:nth-child(6),
    .data-table th:nth-child(7),
    .data-table td:nth-child(7) {
        display: none;
    }

    .data-table th:nth-child(2),
    .data-table td:nth-child(2) {
        min-width: 120px;
    }
}

/* 窄桌面/平板 768~992px：只留核心列 + 效果图标（# 名称 攻/血 职业 总得分 社区加分 效果）→ 7 列 */
@media (min-width: 768px) and (max-width: 992px) {
    .data-table th:nth-child(5),
    .data-table td:nth-child(5),
    .data-table th:nth-child(6),
    .data-table td:nth-child(6),
    .data-table th:nth-child(7),
    .data-table td:nth-child(7),
    .data-table th:nth-child(8),
    .data-table td:nth-child(8),
    .data-table th:nth-child(9),
    .data-table td:nth-child(9),
    .data-table th:nth-child(10),
    .data-table td:nth-child(10) {
        display: none;
    }

    .data-table th:nth-child(2),
    .data-table td:nth-child(2) {
        min-width: 110px;
    }
}

/* 投票不可用（纯静态 / 本地预览）：整列隐藏"社区加分"，避免满屏横杠 */
body.vote-off .data-table th:nth-child(12),
body.vote-off .data-table td:nth-child(12) {
    display: none;
}

/* 移动端：表格转卡片，逐张纵向排列 */
@media (max-width: 767px) {
    .tbl-wrap {
        overflow: visible;
    }

    table.data-table {
        min-width: 0;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody tr {
        display: flex;
        flex-wrap: wrap;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: #121828;
        padding: 10px 14px 6px;
        margin-bottom: 12px;
    }

    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 14px;
        padding: 4px 0;
        border-bottom: none;
        white-space: normal;
        flex-basis: 100%;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .data-table .kw-tag {
        overflow-wrap: anywhere;
    }

    .data-table .cls-c {
        max-width: none;
        overflow: visible;
        white-space: normal;
    }

    .data-table td::before {
        content: attr(data-label);
        color: var(--text-muted);
        font-size: 11.5px;
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* 卡头：排名 + 名称 + 攻/血 放同一行 */
    .data-table td:nth-child(1),
    .data-table td:nth-child(2),
    .data-table td:nth-child(3) {
        flex-basis: auto;
        align-items: center;
        justify-content: flex-start;
    }

    .data-table td:nth-child(1)::before,
    .data-table td:nth-child(2)::before,
    .data-table td:nth-child(3)::before {
        display: none;
    }

    .data-table td:nth-child(1) {
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--gold);
        margin-right: 10px;
    }

    .data-table td:nth-child(2) {
        flex: 1;
    }

    .data-table td:nth-child(2) b {
        font-size: 1.02rem;
    }

    .data-table td:nth-child(3) {
        margin-left: auto;
    }

    .data-table td:nth-child(3) b {
        background: var(--blue-soft);
        color: var(--blue);
        border-radius: 6px;
        padding: 2px 9px;
        font-size: 0.85rem;
    }

    .data-table .rk {
        color: var(--gold);
    }

    /* 移动端：卡牌详情弹层改为整屏布局 */
    .card-pop-panel {
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        transform: none;
        width: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
        border: none;
    }

    .card-pop-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .card-pop-img {
        width: 200px;
        max-width: 72%;
    }

    .card-pop-text {
        text-align: left;
    }

    /* 移动端：社区加分按钮加大，方便点击 */
    .data-table td:nth-child(12) {
        flex-wrap: wrap;
    }

    .data-table td:nth-child(12) .vote-badge {
        font-size: 14px;
    }

    .data-table td:nth-child(12) .vote-btn {
        padding: 6px 20px;
        font-size: 13.5px;
    }

    #search {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .sec-title {
        font-size: 1.5rem;
    }

    .section {
        padding: 36px 0 28px;
    }

}

/* ============================================================
   投票管理后台样式（admin.html）
   ============================================================ */
.admin-login {
    max-width: 420px;
    margin: 0 auto 24px;
}

.admin-login-title {
    color: var(--gold);
    margin-bottom: 8px;
}

.admin-tip {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 14px;
    line-height: 1.7;
}

.admin-tip code {
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 6px;
    border-radius: 5px;
    font-size: 12px;
    color: var(--gold-dim);
}

.admin-login-row {
    display: flex;
    gap: 10px;
}

.admin-login-row input {
    flex: 1;
    background: #0e1422;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

.admin-login-row input:focus {
    border-color: var(--gold-dim);
}

.admin-msg {
    color: var(--red);
    font-size: 13px;
    margin-top: 10px;
    min-height: 18px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.admin-stats .stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.admin-stats .stat-card b {
    display: block;
    font-size: 1.6rem;
    color: var(--gold);
}

.admin-stats .stat-card span {
    font-size: 12px;
    color: var(--text-muted);
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.admin-btn {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}

.admin-btn:hover {
    border-color: var(--gold-dim);
    color: #fff;
}

.admin-btn.primary {
    background: linear-gradient(135deg, var(--gold), #d9a94e);
    color: #111;
    font-weight: 700;
    border: none;
}

.admin-btn.danger {
    color: var(--red);
}

.admin-btn.danger:hover {
    border-color: var(--red);
}

.admin-btn.ghost {
    background: none;
}

.admin-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.admin-alert {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 14px;
    display: none;
}

.admin-alert:not(:empty) {
    display: block;
}

.admin-alert.ok {
    background: rgba(111, 208, 140, 0.1);
    border: 1px solid rgba(111, 208, 140, 0.35);
    color: var(--green);
}

.admin-alert.err {
    background: rgba(227, 107, 107, 0.1);
    border: 1px solid rgba(227, 107, 107, 0.35);
    color: var(--red);
}

.admin-alert.info {
    background: rgba(79, 157, 247, 0.1);
    border: 1px solid rgba(79, 157, 247, 0.35);
    color: var(--blue);
}

.admin-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.admin-filters input,
.admin-filters select {
    background: #0e1422;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.admin-filters input {
    flex: 1;
    max-width: 320px;
}

.admin-filters input:focus,
.admin-filters select:focus {
    border-color: var(--gold-dim);
}

.admin-table .pos {
    color: var(--green);
    font-weight: 700;
}

.admin-table .tot {
    font-weight: 700;
    color: var(--gold);
}

.admin-info {
    color: var(--text-muted);
    font-size: 12.5px;
    margin-top: 10px;
}

.admin-preview {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.admin-preview-title {
    color: var(--gold);
    margin-bottom: 6px;
    font-size: 1rem;
}

.admin-preview-sub {
    color: var(--text-muted);
    font-size: 12.5px;
    margin-bottom: 10px;
}

.admin-preview-table th {
    font-size: 12.5px;
}

.admin-preview-table td {
    font-size: 13px;
}

@media (max-width: 767px) {
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-login-row {
        flex-direction: column;
    }
}

/* ============================================================
   主页访问统计（index.html + api/visit.php）
   ============================================================ */
#visit-sec .stat-desc {
    display: block;
    margin-top: 6px;
}

#visit-sec .stat-num.blue {
    color: #7fb6ff;
}

#visit-sec .stat-num.green {
    color: var(--green);
}

.visit-chart {
    margin-top: 22px;
    padding: 14px 12px 8px;
    background: #121828;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.visit-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--text-muted);
    padding: 2px 0 10px;
}

.visit-note {
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.7;
}

.visit-note code {
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 6px;
    border-radius: 5px;
    font-size: 11px;
    color: var(--gold-dim);
}

@media (max-width: 480px) {
    .visit-chart {
        padding: 10px 2px 4px;
        overflow-x: auto;
    }
}

/* ============================================================
   无障碍（a11y）增强 —— 只影响键盘操作，不改变鼠标用户的观感
   ============================================================ */

/* 键盘焦点可见：仅键盘（Tab）操作时出现，鼠标点击不显示 */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
select:focus-visible,
summary:focus-visible,
.admin-btn:focus-visible,
.vs-export:focus-visible,
.nav-toggle:focus-visible,
.tg-modal-x:focus-visible {
    outline: 3px solid var(--gold, #f3cd74);
    outline-offset: 2px;
    border-radius: 6px;
}

/* 「跳到主要内容」：默认移出屏幕，键盘聚焦时才出现（鼠标用户看不到） */
.skip-link {
    position: absolute;
    left: 12px;
    top: -72px;
    z-index: 9999;
    background: var(--gold, #f3cd74);
    color: #1c1140;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transition: top .18s ease;
}
.skip-link:focus { top: 12px; outline: 3px solid #fff; outline-offset: 2px; }

/* 仅供读屏使用的文本（视觉隐藏） */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* 尊重系统「减少动态效果」设置：仅在用户主动开启该偏好时生效 */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto !important; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}
