@charset "UTF-8";
/* ==========================================================================
   王牌对决数据查询 · 界面样式
   风格：亮色赛事记分牌（Scoreboard）—— 青瓷白底 + 紫蓝主色／青绿／蜜金
         紫蓝负责「电」，青绿负责「正」，蜜金负责「冠」；规则线仍保留印刷名册的克制
   --------------------------------------------------------------------------
   目录
     01 设计令牌
     02 基础重置
     03 布局骨架
     04 页头 / 导航
     05 页面标题
     06 卡片与区块标题
     07 提示条
     08 按钮
     09 表单控件
     10 表格（含明细表 / 移动端转卡片）
     11 标签与徽章
     12 进度 / 比率条
     13 分页
     14 空状态
     15 个人档案 / 登录卡
     16 图表
     17 后台框架 / 嵌入导航
     18 录入组件（天赋 / 英雄 / 装备选择器）
     19 通用工具类
     20 响应式
     21 无障碍与动效
   ========================================================================== */

/* ==========================================================================
   01 设计令牌
   ========================================================================== */
:root {
    /* — 墨：文字（冷调近黑，压在青绿底上不发灰） — */
    --ink: #17251f;
    --ink-2: #43584f;
    --ink-3: #6b8078;

    /* — 纸：底与面（青瓷白：浅绿，压得极淡，只留一层环境色） — */
    --paper: #f2faf6;
    --surface: #ffffff;
    --surface-2: #f8fdfa;

    /* — 线：发丝分隔 — */
    --line: #e2f1e9;
    --line-2: #eff9f4;
    --line-strong: #cbe6d8;

    /* — 主色：紫蓝（按钮 / 链接 / 当前页）
         比正蓝多一分紫，冷色里带一点电光感，白字对比 6.9:1 — */
    --blue: #2a49d8;
    --blue-ink: #2038b6;
    --blue-soft: #eceffd;
    --blue-line: #c6cdf8;

    /* — 语义色：青绿（正向）/ 珊瑚红（危险）/ 蜜金（冠军） — */
    --jade: #0fa37f;
    --jade-ink: #0a7d61;
    --jade-soft: #e6f8f1;
    --jade-line: #b3e7d4;
    --red: #e04a33;
    --red-ink: #b8371f;
    --red-soft: #fff1ed;
    --red-line: #ffd2c8;
    --gold: #e09a17;
    --gold-ink: #9a6c0b;
    --gold-soft: #fff5dd;
    --gold-line: #f6dda4;

    /* — 兼容旧语义别名（历史代码按 win / lose / accent / primary 取色） — */
    --win: var(--jade);
    --lose: var(--red);
    --accent: var(--gold);
    --primary: var(--blue);
    --primary-dark: var(--blue-ink);
    /* 焦点环：输入框与控件获得焦点时的描边色，跟随主色，不再用红 */
    --focus-ring: var(--blue);
    --text: var(--ink);
    --text-muted: var(--ink-3);
    --border: var(--line);
    --bg: var(--paper);
    --card: var(--surface);

    /* — 圆角 — */
    --r-xs: 4px;
    --r-sm: 6px;
    --r-md: 8px;
    --r-lg: 12px;
    --r-xl: 16px;

    /* — 阴影（仅浮层使用；平面一律靠发丝线分隔） — */
    --shadow-card: 0 1px 2px rgba(21, 62, 48, 0.05);
    --shadow-pop: 0 12px 30px rgba(21, 62, 48, 0.16), 0 2px 8px rgba(21, 62, 48, 0.07);

    /* — 字体 — */
    /* 中文子链单列一份，正文与等宽共用：这样「19点」「历史赛季」这类
       数字+汉字混排，汉字永远落到和界面其余文字同一个字族上。 */
    --font-cjk: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei";
    --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
        var(--font-cjk), sans-serif;
    /* 等宽链末尾必须挂 --font-cjk：等宽字体都没有汉字，不挂的话
       「点」「历史赛季」会回落到 monospace 的默认中文字体（Windows 是宋体），
       笔画粗细节奏和旁边的数字完全不同，一眼就能看出是两种字体。 */
    --font-mono: "SF Mono", "Cascadia Mono", ui-monospace, Consolas,
        "Liberation Mono", "Courier New", var(--font-cjk), monospace;

    /* — 节奏 — */
    --gap: 16px;
    --gutter: 20px;
    --header-h: 58px;

    /* — 下拉箭头（内联 SVG，避免额外请求） — */
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%236b8078' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ==========================================================================
   02 基础重置
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-ui);
    /* 顶部两团极淡的紫蓝 / 青绿光晕，光晕比底色略重，把浅底撑出一点空气感 */
    background-color: var(--paper);
    background-image:
        radial-gradient(880px 420px at 8% -10%, rgba(42, 73, 216, 0.13), transparent 62%),
        radial-gradient(760px 400px at 94% -6%, rgba(15, 163, 127, 0.11), transparent 64%);
    background-repeat: no-repeat;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--ink);
    text-decoration: none;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--blue-ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
}

img {
    max-width: 100%;
}

/* 关键：移动端把 tr/td 改成 block 后会覆盖 UA 的 [hidden] 规则，
   导致「展开明细」等本应隐藏的元素一直显示，这里强制兜底 */
[hidden] {
    display: none !important;
}

h1, h2, h3, h4 {
    line-height: 1.3;
    letter-spacing: -0.005em;
}

/* 数字统一等宽对齐：所有数据列纵向能对得上 */
.num,
.rate-value,
.stat-value,
td,
th {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

/* ==========================================================================
   03 布局骨架
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.main {
    padding: 26px var(--gutter) 56px;
}

/* ==========================================================================
   04 页头 / 导航
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 255, 252, 0.86);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}

/* 页头下沿的细线：紫蓝 → 青绿，给顶栏一点体育转播的劲儿 */
.site-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, var(--blue), var(--jade));
    opacity: 0.6;
    pointer-events: none;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    height: var(--header-h);
}

/* — 铭牌：一枚朱砂印章 — */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
    flex: 0 0 auto;
}

.brand:hover {
    color: var(--ink);
    text-decoration: none;
}

.brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 3px;
    display: block;
    object-fit: contain;
    flex: 0 0 auto;
}

.brand-text {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.brand-text small {
    display: block;
    font-size: 10px;
    font-weight: 500;
    color: var(--ink-3);
    letter-spacing: 0.24em;
    margin-top: 1px;
}

/* — 主导航：下划线指示当前页 — */
.nav {
    display: flex;
    align-items: center;
    gap: 0;
    margin-left: auto;
}

.nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: var(--header-h);
    padding: 0 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-2);
    white-space: nowrap;
}

.nav a:hover {
    color: var(--ink);
    text-decoration: none;
}

.nav a.active {
    color: var(--ink);
    font-weight: 600;
}

.nav a.active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -1px;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
}

/* — 右侧工具区 — */
.header-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 16px;
    border-left: 1px solid var(--line);
    flex: 0 0 auto;
}

.nav-user {
    display: inline-flex;
    align-items: center;
    max-width: 150px;
    padding: 4px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-2);
    font-size: 13px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-link {
    font-size: 13px;
    color: var(--ink-3);
    white-space: nowrap;
}

.icon-link:hover {
    color: var(--blue-ink);
}

/* — 赛季切换 — */
.season-switch {
    display: flex;
    align-items: center;
    gap: 7px;
}

.season-switch label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-3);
    white-space: nowrap;
    letter-spacing: 0.04em;
}

.season-switch select {
    height: 30px;
    min-width: 104px;
    padding: 0 26px 0 9px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background-color: var(--surface);
    background-image: var(--chevron);
    background-repeat: no-repeat;
    background-position: right 8px center;
    color: var(--ink);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.season-switch select:hover {
    border-color: var(--line-strong);
}

.season-switch select:focus {
    outline: none;
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 3px rgba(42, 73, 216, 0.20);
}

/* ==========================================================================
   05 页面标题
   ========================================================================== */
.page-head {
    margin: 0 0 18px;
}

.page-head h1 {
    margin: 0 0 6px;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.page-head .subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--ink-3);
    line-height: 1.6;
}

.collect-note {
    display: inline-block;
    font-size: 12px;
    font-weight: 400;
    color: var(--ink-3);
    letter-spacing: 0;
    margin-left: 8px;
}

.page-head-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.page-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 面包屑 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--ink-3);
    margin: 0 0 14px;
}

.breadcrumb a {
    color: var(--ink-3);
}

.breadcrumb a:hover {
    color: var(--blue-ink);
}

.breadcrumb span {
    margin: 0;
}

/* ==========================================================================
   06 卡片与区块标题
   ========================================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-card);
    padding: 20px 22px;
    margin-bottom: var(--gap);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 16px;
    padding: 0 0 11px;
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.01em;
    border-bottom: 1px solid var(--line);
}

/* 标题前的细竖条：上紫蓝下青绿，区块的「色标」 */
.section-title::before {
    content: "";
    width: 4px;
    height: 15px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--blue), var(--jade));
    flex: 0 0 auto;
}

.section-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 11px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.section-title-row .section-title {
    margin: 0;
    padding: 0;
    border-bottom: 0;
}

/* 表单卡片：筛选用，视觉上比数据卡片更轻 */
.filter-card {
    padding: 16px 20px;
    background: var(--surface);
}

/* ==========================================================================
   07 提示条
   ========================================================================== */
.alert {
    padding: 11px 14px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-left-width: 3px;
    border-radius: var(--r-md);
    font-size: 13.5px;
    line-height: 1.55;
}

.alert-success {
    background: var(--jade-soft);
    color: var(--jade-ink);
    border-color: var(--jade-line);
    border-left-color: var(--jade);
}

.alert-info {
    background: var(--surface-2);
    color: var(--ink-2);
    border-color: var(--line);
    border-left-color: var(--ink-3);
}

.alert-error {
    background: var(--red-soft);
    color: var(--red-ink);
    border-color: var(--red-line);
    border-left-color: var(--red-ink);
}

/* ==========================================================================
   08 按钮
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--r-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 10px rgba(42, 73, 216, 0.30);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
    box-shadow: 0 4px 16px rgba(42, 73, 216, 0.38);
}

.btn-ghost {
    background: var(--surface);
    color: var(--ink-2);
    border-color: var(--line);
}

.btn-ghost:hover {
    background: var(--surface-2);
    border-color: var(--line-strong);
    color: var(--ink);
}

.btn-danger {
    background: var(--surface);
    color: var(--red-ink);
    border-color: var(--red-line);
}

.btn-danger:hover {
    background: var(--red-soft);
    color: var(--red-ink);
}

.btn-danger.armed {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
    font-weight: 700;
}

.btn-sm {
    height: 30px;
    padding: 0 11px;
    font-size: 13px;
    border-radius: 7px;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:disabled:hover,
.btn[disabled]:hover {
    background: var(--surface);
    color: var(--ink-3);
    border-color: var(--line);
}

.btn-primary:disabled:hover,
.btn-primary[disabled]:hover {
    background: var(--primary);
    color: #fff;
    border-color: transparent;
}

/* ==========================================================================
   09 表单控件
   ========================================================================== */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-3);
    letter-spacing: 0.02em;
}

/* 文本类控件统一外观（checkbox / radio / file 除外）。
   :not() 链会把优先级抬高到 (0,4,1)，足以盖掉组件自己的尺寸规则，
   所以用 :where() 把它压回 1 个类的权重——这条只作为“默认外观”，
   不该赢过 .hero-level-input 这类明确指定宽高的组件规则。 */
.field :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"])),
.field select,
.field textarea,
.edit-form textarea {
    width: 100%;
    height: 38px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background-color: var(--surface);
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    line-height: normal;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field select {
    padding-right: 30px;
    background-image: var(--chevron);
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.field textarea,
.edit-form textarea {
    height: auto;
    min-height: 84px;
    padding: 9px 11px;
    line-height: 1.6;
    resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #9aada5;
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.edit-form textarea:hover {
    border-color: var(--line-strong);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.edit-form textarea:focus {
    outline: none;
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 3px rgba(42, 73, 216, 0.20);
}

/* 校验不通过时标红：用 :user-invalid，只在用户实际交互后才出现，
   避免空表单刚打开就一片红框 */
.field input:user-invalid {
    border-color: var(--focus-ring);
    background: var(--red-soft);
}

/* 日期控件：等宽数字，像票根 */
.field input[type="date"] {
    font-variant-numeric: tabular-nums;
}

/* 文件选择 */
.talent-upload {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.talent-upload input[type="file"] {
    font-family: inherit;
    font-size: 13px;
    color: var(--ink-2);
    max-width: 100%;
}

.talent-upload input[type="file"]::file-selector-button {
    height: 30px;
    margin-right: 10px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-2);
    color: var(--ink-2);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.talent-upload input[type="file"]::file-selector-button:hover {
    background: var(--surface-2);
    color: var(--ink);
}

/* 筛选行 */
.filter-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.field.actions {
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.range-inputs input {
    flex: 1;
    min-width: 0;
}

.range-sep {
    color: var(--ink-3);
    flex: 0 0 auto;
}

/* 录入表单 */
.edit-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.players-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.form-actions {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

/* 单行表单 */
.form-inline {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 14px;
}

.form-inline .form-grid {
    display: contents;
}

.form-inline .field {
    flex: 1 1 150px;
    min-width: 130px;
}

.form-inline .form-actions {
    margin-top: 0;
    flex: 0 0 auto;
}

.check-col {
    width: 42px;
    text-align: center;
}

.check-col input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--primary);
    vertical-align: middle;
}

/* 表格内的行选择框与批量操作框 */
.row-check,
.merge-check,
#checkAll {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--primary);
    vertical-align: middle;
}

/* ==========================================================================
   10 表格
   ========================================================================== */
.table-card {
    /* 注意：不要在此加 overflow，嵌入 iframe 时由 header.php 单独开启 */
    position: relative;
}

.table-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--ink-3);
}

.table-meta strong {
    color: var(--ink);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* 赛程管理：计数靠左，操作按钮靠右相邻 */
.schedule-table-meta {
    justify-content: flex-start;
    gap: 8px;
}

.schedule-table-meta > span:first-child {
    margin-right: auto;
}

table.responsive {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

/* 表头：底部 1.5px 墨色粗线 —— 记分板的签名笔画 */
table.responsive thead th {
    padding: 0 14px 10px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-3);
    letter-spacing: 0.04em;
    white-space: nowrap;
    vertical-align: bottom;
    background: transparent;
    border-bottom: 1.5px solid var(--ink);
}

table.responsive tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line-2);
    vertical-align: middle;
    color: var(--ink);
}

table.responsive tbody tr:last-child td {
    border-bottom: 0;
}

table.responsive tbody tr:hover td {
    background: var(--surface-2);
}

/* 短名次类短文本列：阵营 / 选手名字 / 装备名。列宽由内容撑开，
   不允许在窄列里折成两行（曾出现「无阵 / 营」「守护者之 / 铠」） */
table.responsive tbody td[data-label="阵营"],
table.responsive tbody td[data-label="选手名字"],
.talent-name-cell {
    white-space: nowrap;
}

/* 数字列右对齐（提高优先级，压过 thead th 的 left） */
table.responsive thead th.num,
table.responsive tbody td.num {
    text-align: right;
}

/* 可排序表头 */
table.responsive thead th.sortable {
    cursor: pointer;
    user-select: none;
}

table.responsive thead th.sortable a {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: inherit;
    text-decoration: none;
}

table.responsive thead th.sortable a:hover {
    color: var(--ink);
}

table.responsive thead th.sortable .sort-arrow {
    font-size: 10px;
    line-height: 1;
    opacity: 0.35;
}

table.responsive thead th.sortable.sorted {
    color: var(--ink);
}

table.responsive thead th.sortable.sorted .sort-arrow {
    opacity: 1;
    color: var(--blue-ink);
}

/* 夺冠排行排序后的锚点定位：避开吸顶页头 */
#rank-card {
    scroll-margin-top: calc(var(--header-h) + 14px);
}

/* 单元格语义修饰 */
table.responsive td.date-cell {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--ink-2);
    white-space: nowrap;
    letter-spacing: -0.01em;
}

table.responsive td.ua-cell {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
    color: var(--ink-2);
}

table.responsive tbody td.rank {
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}

table.responsive tbody td.rank.rank-top {
    color: var(--blue-ink);
    font-weight: 800;
}

.players-cell {
    min-width: 200px;
    line-height: 1.55;
    font-size: 13px;
    color: var(--ink-2);
}

.pieces-cell,
.lineup-cell {
    min-width: 160px;
    line-height: 1.5;
}

.actions-cell {
    white-space: nowrap;
}

.inline-form {
    display: inline;
}

/* 可展开的行 */
.game-row,
.piece-row {
    cursor: pointer;
}

table.responsive tbody tr.game-row:hover td,
table.responsive tbody tr.piece-row:hover td {
    background: var(--surface-2);
}

/* 明细展开区：左侧朱砂竖线标识层级 */
.detail-row > td.detail-cell {
    padding: 14px;
    background: var(--surface-2);
    border: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: none;
}

.detail-row > td.detail-cell::before {
    display: none;
}

.detail-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
}

.detail-table thead th:first-child {
    border-top-left-radius: 7px;
}

.detail-table thead th:last-child {
    border-top-right-radius: 7px;
}

.detail-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 7px;
}

.detail-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 7px;
}

.detail-table thead th {
    padding: 8px 12px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink-3);
    letter-spacing: 0.04em;
    white-space: nowrap;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.detail-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--line-2);
    vertical-align: middle;
}

.detail-table tbody tr:last-child td {
    border-bottom: 0;
}

.detail-table tbody tr:hover td {
    background: var(--surface-2);
}

/* 明细表嵌在 table.responsive 内部，必须提高一级优先级，
   否则会被外层表头的 1.5px 墨线、单元格内边距等规则覆盖 */
table.responsive .detail-table thead th {
    padding: 8px 12px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink-3);
    letter-spacing: 0.04em;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

/* 明细表数字列：表头与内容统一右对齐（需高于上方 text-align:left 的优先级） */
table.responsive .detail-table thead th.num,
table.responsive .detail-table tbody td.num,
.detail-table thead th.num,
.detail-table tbody td.num {
    text-align: right;
}

table.responsive .detail-table tbody td {
    padding: 8px 12px;
    vertical-align: middle;
    border-bottom: 1px solid var(--line-2);
    background: transparent;
}

table.responsive .detail-table tbody tr:hover td {
    background: var(--surface-2);
}

table.responsive .detail-table tbody tr:last-child td {
    border-bottom: 0;
}

.detail-player {
    font-weight: 600;
    white-space: nowrap;
}

.detail-player-link {
    color: var(--ink);
}

.detail-player-link:hover {
    color: var(--blue-ink);
}

/* 冠军行：赭金底 + 左侧奖牌色竖条 */
table.responsive tbody tr.row-champion td,
table.detail-table tbody tr.row-champion td {
    background: var(--gold-soft);
}

table.responsive tbody tr.row-champion:hover td {
    background: #fff0c9;
}

table.responsive tbody tr.row-champion td:first-child {
    box-shadow: inset 2px 0 0 var(--gold);
}

.rank-champion {
    color: var(--gold-ink);
    font-weight: 700;
    white-space: nowrap;
}

/* ==========================================================================
   11 标签与徽章
   ========================================================================== */
/* 统一"印章"语言：4px 直角，不用胶囊 */
.slot-tag,
.camp-tag,
.piece-tag,
.champion-badge {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid transparent;
    border-radius: var(--r-xs);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

/* 时间档位 / 耗时：中性纸色 */
.slot-tag {
    background: var(--paper);
    border-color: var(--line);
    color: var(--ink-2);
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* 阵营：中性描边 */
.camp-tag {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink-2);
    font-weight: 500;
}

/* 禁止阵营：红字 + 淡红底。一列十几个标签排下来仍然压得住，
   不会盖过蓝色主按钮和金色冠军 */
.camp-tag-ban {
    background: var(--red-soft);
    border-color: var(--red-line);
    color: var(--red-ink);
}

/* 棋手：靛蓝浅底，和数据绿、冠军金、禁止红都区分开 */
.piece-tag {
    background: var(--blue-soft);
    border-color: var(--blue-line);
    color: var(--blue-ink);
    font-weight: 500;
}

/* 冠军 */
.champion-badge {
    background: var(--gold-soft);
    border-color: var(--gold-line);
    color: var(--gold-ink);
    font-weight: 600;
}

.champion-name {
    margin-left: 8px;
    font-size: 12px;
    color: var(--ink-3);
}

/* ==========================================================================
   12 进度 / 比率条
   ========================================================================== */
.rate-cell {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.rate-value {
    font-weight: 700;
    color: var(--ink);
}

.rate-sub {
    font-size: 12px;
    color: var(--ink-3);
}

.rate-none {
    color: var(--ink-3);
}

.rate-bar {
    width: 84px;
    height: 4px;
    background: var(--line);
    border-radius: 2px;
    overflow: hidden;
}

.rate-bar span {
    display: block;
    height: 100%;
    background: var(--jade);
    border-radius: 2px;
}

/* 胜 / 负 / 结果 */
.win-num {
    color: var(--jade-ink);
    font-weight: 700;
}

.lose-num {
    color: var(--red-ink);
    font-weight: 700;
}

.sep {
    color: var(--line);
    margin: 0 5px;
}

.result-badge {
    display: inline-block;
    min-width: 40px;
    padding: 2px 12px;
    border: 1px solid transparent;
    border-radius: var(--r-xs);
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}

.result-badge.win {
    background: var(--jade-soft);
    border-color: var(--jade-line);
    color: var(--jade-ink);
}

.result-badge.lose {
    background: var(--red-soft);
    border-color: var(--red-line);
    color: var(--red-ink);
}

/* ==========================================================================
   13 分页
   ========================================================================== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line-2);
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--ink-2);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.page-btn:hover {
    background: var(--surface-2);
    border-color: var(--line-strong);
    color: var(--ink);
    text-decoration: none;
}

.page-btn.current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
    cursor: default;
}

.page-ellipsis {
    align-self: center;
    padding: 0 2px;
    color: var(--ink-3);
    font-size: 13px;
}

/* ==========================================================================
   14 空状态
   ========================================================================== */
.empty-row {
    text-align: center !important;
    color: var(--ink-3) !important;
    padding: 34px 14px !important;
    font-size: 13.5px;
    background: transparent !important;
}

.empty {
    text-align: center;
    padding: 48px 20px;
}

.empty h2 {
    margin: 0 0 8px;
    font-size: 16px;
}

.chart-empty {
    padding: 44px 0;
    text-align: center;
    color: var(--ink-3);
    font-size: 13.5px;
}

/* ==========================================================================
   15 个人档案
   ========================================================================== */
.player-profile {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-main {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
}

.profile-info {
    min-width: 0;
}

.avatar {
    width: 58px;
    height: 58px;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, var(--blue), var(--jade));
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    overflow: hidden;
    letter-spacing: 0;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-name {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin-top: 7px;
}

.meta-item {
    font-size: 12.5px;
    color: var(--ink-3);
}

.meta-item + .meta-item::before {
    content: "·";
    margin-right: 9px;
    color: var(--line);
}

/* 统计条：去底色，用竖分隔线，像记分板 */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding-top: 4px;
    border-top: 1px solid var(--line-2);
}

.stat {
    padding: 12px 8px;
    text-align: center;
    background: transparent;
    border-radius: 0;
    border-left: 1px solid var(--line-2);
}

.stat:first-child {
    border-left: 0;
}

.stat-value {
    display: block;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.015em;
    color: var(--ink);
}

.stat-label {
    display: block;
    margin-top: 3px;
    font-size: 11.5px;
    color: var(--ink-3);
    letter-spacing: 0.02em;
}

/* ==========================================================================
   15b 登录 / 独立表单卡
   ========================================================================== */
.login-card {
    max-width: 404px;
    margin: 44px auto;
    padding: 30px 28px 28px;
}

.login-head {
    margin-bottom: 20px;
    text-align: center;
}

.login-seal {
    display: block;
    width: 38px;
    height: 38px;
    margin: 0 auto 12px;
    border-radius: 3px;
}

.login-head h2 {
    margin: 0 0 6px;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.login-head p {
    margin: 0;
    font-size: 12.5px;
    color: var(--ink-3);
    line-height: 1.6;
}

/* 卡片内直接出现的说明文字 */
.card .subtitle {
    margin: -8px 0 16px;
    font-size: 12.5px;
    color: var(--ink-3);
}

.login-card .edit-form {
    gap: 15px;
}

.login-card .form-actions {
    margin-top: 4px;
}

.login-card .form-actions .btn {
    flex: 1;
}

/* ==========================================================================
   16 图表
   ========================================================================== */
.chart-note {
    margin: -4px 0 12px;
    font-size: 12px;
    color: var(--ink-3);
}

.chart-wrap {
    width: 100%;
    overflow-x: auto;
}

.trend-svg {
    display: block;
    width: 100%;
    height: auto;
    min-width: 480px;
}

.grid-line {
    stroke: var(--line-2);
    stroke-width: 1;
}

.axis-text {
    font-family: var(--font-mono);
    font-size: 10px;
    fill: var(--ink-3);
}

/* ==========================================================================
   17 后台框架 / 嵌入导航
   ========================================================================== */
.admin-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-content {
    width: 100%;
    min-width: 0;
}

.admin-content iframe {
    display: block;
    width: 100%;
    min-height: 360px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.admin-embed-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 5px;
    margin-bottom: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
}

.admin-nav-link {
    display: block;
    padding: 7px 13px;
    border-radius: var(--r-sm);
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.admin-nav-link:hover {
    background: var(--surface-2);
    color: var(--ink);
    text-decoration: none;
}

.admin-nav-link.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.admin-nav-link.active:hover {
    color: #fff;
}

/* ==========================================================================
   18 录入组件（天赋 / 英雄 / 装备选择器）
   ========================================================================== */
/* — 快捷新增条 — */
.quick-add-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding: 11px 13px;
    background: var(--surface-2);
    border: 1px dashed var(--line);
    border-radius: var(--r-md);
}

.piece-add {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.piece-add input[type="text"] {
    width: 150px;
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    color: var(--ink);
    font-family: inherit;
    font-size: 13px;
}

.piece-add select,
.quick-add-row .piece-add select {
    width: 140px;
    height: 30px;
    padding: 0 26px 0 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background-color: var(--surface);
    background-image: var(--chevron);
    background-repeat: no-repeat;
    background-position: right 8px center;
    color: var(--ink);
    font-family: inherit;
    font-size: 13px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.quick-add-row .piece-add input[type="text"] {
    width: 128px;
}

.piece-add input[type="text"]:focus,
.piece-add select:focus,
.quick-add-row .piece-add select:focus {
    outline: none;
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 3px rgba(42, 73, 216, 0.20);
}

.piece-add-msg {
    font-size: 12px;
    line-height: 1.4;
}

.piece-add-msg.ok {
    color: var(--jade-ink);
}

.piece-add-msg.bad {
    color: var(--red-ink);
}

/* — 录入行 — */
.card-inner {
    padding: 14px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
}

.entry-input {
    padding: 14px;
}

.entry-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.entry-head {
    margin-bottom: 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-2);
    letter-spacing: 0.02em;
}

.players-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.entry-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-entry {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 13px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
}

.entry-table tbody tr.entry-editing td {
    background: var(--jade-soft);
}

.entry-table tbody tr.entry-editing td:first-child {
    box-shadow: inset 2px 0 0 var(--jade);
}

/* — 棋手 / 棋手图标组 — */
.piece-icons {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
}

.piece-item {
    position: relative;
    display: inline-block;
    cursor: help;
}

.piece-item:hover .talent-tip {
    display: block;
    opacity: 1;
    visibility: visible;
}

.piece-icon-md {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    object-fit: cover;
    background: var(--paper);
    border: 1px solid var(--line);
}

.piece-icon-sm {
    width: 24px;
    height: 24px;
    border-radius: var(--r-xs);
    object-fit: cover;
    flex: 0 0 auto;
    background: var(--paper);
    border: 1px solid var(--line);
}

.piece-name-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.piece-item-none .piece-name-text {
    color: var(--ink-3);
    font-weight: 400;
}

.piece-name-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

/* — 天赋 — */
.talent-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.talent-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--r-sm);
    object-fit: cover;
    vertical-align: middle;
    background: var(--paper);
    flex-shrink: 0;
}

.talent-icon-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--ink-3);
}

.talent-icon-lg {
    width: 44px;
    height: 44px;
    border-radius: var(--r-md);
    object-fit: cover;
    background: var(--paper);
}

.talent-name-cell {
    font-weight: 600;
}

.talent-desc-cell {
    color: var(--ink-3);
    font-size: 13px;
}

/* 天赋展示：40x40 图标，每行 3 个 */
.talent-icons {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    width: 128px;
}

.talent-item {
    position: relative;
    display: inline-block;
}

.talent-icon-md {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--r-sm);
    object-fit: cover;
    background: var(--paper);
    border: 1px solid var(--line);
    cursor: help;
    flex-shrink: 0;
}

.talent-icon-md-empty {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink-2);
}

/* 悬浮说明：向上弹出；用 display 控制显隐，避免隐藏时撑高页面 */
.talent-tip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    display: none;
    width: max-content;
    max-width: 360px;
    padding: 9px 12px;
    background: var(--ink);
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.65;
    text-align: left;
    white-space: normal;
    word-break: break-word;
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-pop);
    pointer-events: none;
    opacity: 0;
}

.talent-item:hover .talent-tip {
    display: block;
    opacity: 1;
    visibility: visible;
}

.talent-tip strong {
    display: inline-block;
    margin-bottom: 2px;
    color: #ffd166;
    font-weight: 700;
}

/* — 天赋选择器 — */
.talent-picker {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.talent-pick-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.talent-pick-row select {
    flex: 1;
    min-width: 0;
    height: 32px;
    padding: 0 26px 0 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background-color: var(--surface);
    background-image: var(--chevron);
    background-repeat: no-repeat;
    background-position: right 8px center;
    color: var(--ink);
    font-family: inherit;
    font-size: 13px;
    -webkit-appearance: none;
    appearance: none;
}

.talent-picked {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 24px;
}

.talent-search {
    position: relative;
    flex: 1;
    min-width: 0;
}

.talent-search input[type="text"] {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    color: var(--ink);
    font-family: inherit;
    font-size: 13px;
}

.talent-search input[type="text"]:focus {
    outline: none;
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 3px rgba(42, 73, 216, 0.20);
}

.talent-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 30;
    max-height: 260px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-pop);
}

.talent-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid var(--line-2);
}

.talent-option:last-child {
    border-bottom: 0;
}

.talent-option:hover,
.talent-option.active {
    background: var(--surface-2);
}

.talent-option.picked {
    color: var(--ink-3);
    background: var(--surface-2);
    cursor: not-allowed;
}

.talent-option .talent-option-name {
    font-weight: 600;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

.talent-option .talent-option-desc {
    flex: 1;
    min-width: 0;
    color: var(--ink-3);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.talent-option .talent-option-flag {
    color: var(--jade-ink);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.talent-option-empty {
    padding: 14px 10px;
    text-align: center;
    color: var(--ink-3);
    font-size: 13px;
}

.talent-tag-pick {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 7px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-xs);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 600;
    cursor: grab;
}

.talent-tag-pick.dragging,
.hero-entry.dragging {
    opacity: 0.4;
    cursor: grabbing;
}

.talent-tag-pick.drag-over,
.hero-entry.drag-over {
    outline: 2px dashed var(--ink-3);
    outline-offset: 2px;
}

/* 仅用于标签内的小叉号（列表中的「删除」按钮是 btn-danger，不能套这条规则） */
.talent-tag-del {
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: var(--ink-3);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.talent-tag-del:hover {
    color: var(--red-ink);
}

/* 天赋列表即时搜索 */
.talent-list-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.talent-list-search input[type="text"] {
    width: 240px;
    max-width: 100%;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    color: var(--ink);
    font-family: inherit;
    font-size: 13px;
}

.talent-list-search input[type="text"]:focus {
    outline: none;
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 3px rgba(42, 73, 216, 0.20);
}

.talent-list-count {
    font-size: 12px;
    color: var(--ink-3);
    white-space: nowrap;
}

/* — 英雄阵容选择器 — */
.hero-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hero-entries {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-entry {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 176px;
    padding: 7px 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    cursor: grab;
}

.hero-entry.dragging {
    cursor: grabbing;
}

/* 装备面板定位在英雄卡片正下方（固定宽度，不撑动卡片布局） */
.hero-entry > .equip-picker-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 40;
    width: 280px;
    box-shadow: var(--shadow-pop);
}

.hero-entry-head {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hero-entry-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: var(--r-sm);
    background: var(--paper);
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 700;
}

.hero-entry-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-entry-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
}

/* 等级输入：固定 46px 的小格子，不参与剩余空间分配，
   否则会把英雄名挤成 0 宽、整行错位 */
.hero-entry input.hero-level-input {
    flex: 0 0 auto;
    width: 46px;
    min-width: 46px;
    height: 24px;
    padding: 0 4px;
    border: 1px solid var(--line);
    border-radius: var(--r-xs);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 12px;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}

.hero-entry input.hero-level-input:hover {
    border-color: var(--line-strong);
}

.hero-entry input.hero-level-input::-webkit-outer-spin-button,
.hero-entry input.hero-level-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.hero-entry input.hero-level-input:focus {
    outline: none;
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 3px rgba(42, 73, 216, 0.20);
}

.hero-awaken-btn {
    padding: 2px 8px;
    border: 1px solid var(--line);
    border-radius: var(--r-xs);
    background: var(--surface);
    color: var(--ink-3);
    font-family: inherit;
    font-size: 11px;
    white-space: nowrap;
    cursor: pointer;
}

.hero-awaken-btn.on {
    background: var(--gold-soft);
    border-color: var(--gold-line);
    color: var(--gold-ink);
    font-weight: 700;
}

.hero-entry-del {
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: var(--ink-3);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

.hero-entry-del:hover {
    color: var(--red-ink);
}

.hero-entry-items {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.hero-equip-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    border: 1px solid var(--line);
    border-radius: var(--r-xs);
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 11px;
    font-weight: 600;
}

.hero-equip-tag img {
    width: 15px;
    height: 15px;
    border-radius: 3px;
    object-fit: cover;
}

.hero-equip-del {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink-3);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

.hero-equip-del:hover {
    color: var(--red-ink);
}

.hero-equip-add {
    padding: 2px 8px;
    border: 1px dashed var(--line);
    border-radius: var(--r-xs);
    background: transparent;
    color: var(--ink-3);
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
}

.hero-equip-add:hover {
    border-color: var(--ink-3);
    background: var(--surface-2);
    color: var(--ink);
}

.equip-picker-panel {
    position: relative;
    margin-top: 6px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
}

.equip-picker-panel input[type="text"] {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    color: var(--ink);
    font-family: inherit;
    font-size: 13px;
}

.equip-picker-panel input[type="text"]:focus {
    outline: none;
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 3px rgba(42, 73, 216, 0.20);
}

.equip-picker-panel .equip-dropdown {
    position: absolute;
    top: 46px;
    left: 8px;
    right: 8px;
    z-index: 30;
    max-height: 220px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-pop);
}

/* — 阵容展示 — */
.hero-lineup {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
}

.lineup-cell {
    min-width: 300px;
}

.lineup-cell .hero-lineup {
    max-width: 520px;
}

.hero-card {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.hero-avatar {
    position: relative;
    display: inline-block;
}

.hero-avatar img {
    display: block;
    width: 34px;
    height: 34px;
    border-radius: var(--r-sm);
    object-fit: cover;
    background: var(--paper);
    border: 1px solid var(--line);
}

.hero-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--r-sm);
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 700;
}

/* 觉醒：赭金环 + 柔光，不遮挡头像 */
.hero-card.awakened .hero-avatar img,
.hero-card.awakened .hero-avatar .hero-avatar-fallback {
    border-color: var(--gold);
    box-shadow:
        0 0 0 2px var(--gold),
        0 0 10px 2px rgba(224, 154, 23, 0.5);
}

/* 等级：头像上方小标签（浅底暖框，避免在一行头像上方压出一排黑块） */
.hero-level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    height: 15px;
    margin-bottom: 3px;
    padding: 0 5px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-xs);
    background: var(--surface);
    color: var(--ink-2);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.hero-level-badge.empty {
    visibility: hidden;
}

.hero-avatar:hover .talent-tip {
    display: block;
    opacity: 1;
    visibility: visible;
}

.hero-items {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    max-width: 36px;
}

.hero-item {
    position: relative;
    display: inline-block;
}

.hero-item:hover .talent-tip {
    display: block;
    opacity: 1;
    visibility: visible;
}

.hero-item-icon {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    object-fit: cover;
    background: var(--paper);
}

.hero-item-icon-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: var(--ink-3);
}

/* ==========================================================================
   19 通用工具类
   ========================================================================== */
.date-stat {
    font-size: 16px !important;
    font-variant-numeric: tabular-nums;
}

.site-footer {
    margin-top: 8px;
    padding: 22px 0 26px;
    background: transparent;
    border-top: 1px solid var(--line);
    text-align: center;
    color: var(--ink-3);
    font-size: 12px;
}

.site-footer p {
    margin: 0;
    letter-spacing: 0.02em;
}

/* ==========================================================================
   20 响应式
   ========================================================================== */
/* — 桌面栅格 — */
@media (min-width: 768px) {
    .page-head h1 {
        font-size: 28px;
    }

    /* 名次列收窄，避免被等宽分配拉得过宽；数字列不换行 */
    table.responsive tbody td.rank {
        width: 68px;
    }

    table.responsive thead th.num,
    table.responsive tbody td.num {
        white-space: nowrap;
    }

    .filter-row {
        grid-template-columns: 1.5fr 1fr 1.4fr auto;
        align-items: end;
    }

    .schedule-filter-row {
        grid-template-columns: 1.3fr 1fr 1fr auto;
    }

    .index-filter-row {
        grid-template-columns: 1.1fr 1fr 1fr 1.4fr auto;
    }

    /* 三列筛选（如棋手榜）：操作按钮贴右，不独占空列 */
    .filter-row > .field.actions:last-child:nth-child(3) {
        grid-column: 3 / -1;
        justify-self: end;
    }

    .filter-row > .field.actions:last-child:nth-child(2) {
        grid-column: 2 / -1;
        justify-self: end;
    }

    /* 选手详情页顶部搜索：窄表单，不铺满整行 */
    .player-search-row {
        grid-template-columns: minmax(0, 300px) auto;
        justify-content: start;
    }

    .form-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .form-grid-4 {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .form-grid-2 {
        grid-template-columns: 1fr 1fr;
    }

    .players-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .entry-row {
        grid-template-columns: 1.1fr 1.1fr 1fr 0.9fr 0.6fr 0.7fr;
    }

    .entry-row .talent-field {
        grid-column: span 2;
    }

    .entry-row .lineup-field {
        grid-column: span 3;
    }

    /* 档案横排 */
    .player-profile {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
    }

    .profile-main {
        flex: 1;
    }

    .profile-stats {
        flex: 0 0 auto;
        /* 横排时容器宽度由内容决定，auto-fit 会塌成 1 列，
           这里固定 7 列（档案固定 7 项统计） */
        grid-template-columns: repeat(7, minmax(74px, auto));
        padding-top: 0;
        border-top: 0;
    }

    .stat {
        padding: 4px 12px;
    }
}

/* — 中等宽度：录入表列多，先收列宽，别顶破卡片边框 — */
/* 现象：8 列的最小内容宽度约 1090px（选手名 nowrap 199 + 阵容 300 + 天赋 128 …），
   ~1240px 以下就会超出卡片内宽，最后一个「删除」按钮被顶到卡片外面。
   处理：阵容列最小宽度 300→240、操作按钮改竖排、左右内距 14→10（共省约 190px）；
   1001–1080 这段再窄一点，选手名允许只在「·」处折行（keep-all 禁止汉字断字）。
   再窄（≤1000）改用卡片式，见下方「录入表提前降级」。 */
@media (min-width: 1001px) and (max-width: 1240px) {
    /* 选手名只在「·」处折行：「19888888 · 我真的是新一」折成两行，而不是把名字劈开 */
    .entry-table td.detail-player {
        white-space: normal;
        word-break: keep-all;
    }

    .entry-table .lineup-cell {
        min-width: 240px;
    }

    .entry-table td[data-label="操作"] {
        white-space: normal;
    }

    .entry-table tbody td {
        padding-right: 10px;
        padding-left: 10px;
    }

    .entry-table td[data-label="操作"] .btn {
        display: flex;
        width: 100%;
        justify-content: center;
        padding-right: 6px;
        padding-left: 6px;
    }

    .entry-table td[data-label="操作"] .btn + .btn {
        margin-top: 6px;
    }
}

/* 1081 以上有富余空间，名字回到单行（否则 auto 布局会把多出的宽度全给阵容列） */
@media (min-width: 1081px) and (max-width: 1240px) {
    .entry-table td.detail-player {
        white-space: nowrap;
        word-break: normal;
    }
}

/* — 录入表提前降级为卡片 —
   全站表格在 ≤640px 才转卡片，但这张表有 8 列，压缩到最小仍要约 900px；
   只对这张表提前到 1000px，避免出现「删除按钮跑到卡片外」的错位。 */
@media (max-width: 1000px) {
    .entry-table thead {
        display: none;
    }

    .entry-table,
    .entry-table tbody,
    .entry-table tr,
    .entry-table td {
        display: block;
        width: 100%;
    }

    .entry-table tbody tr {
        margin-bottom: 10px;
        padding: 2px 13px;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 10px;
    }

    .entry-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .entry-table tbody td,
    .entry-table tbody td.num {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 9px 0;
        text-align: right;
        border-bottom: 1px solid var(--line-2);
    }

    .entry-table tbody td:last-child {
        border-bottom: 0;
    }

    .entry-table tbody td::before {
        content: attr(data-label);
        flex-shrink: 0;
        color: var(--ink-3);
        font-size: 11.5px;
        font-weight: 600;
        letter-spacing: 0.03em;
        text-align: left;
    }

    .entry-table tbody td.lineup-cell {
        display: block;
        text-align: left;
        max-width: 100%;
        min-width: 0;
    }

    /* 「操作」一行：标签靠左，两个按钮并排靠右（否则 space-between 会把
       编辑甩到中间，看起来像丢了按钮） */
    .entry-table tbody td[data-label="操作"] {
        justify-content: flex-end;
        gap: 8px;
    }

    .entry-table tbody td[data-label="操作"]::before {
        margin-right: auto;
    }

    .entry-table tbody td.lineup-cell::before {
        display: block;
        margin-bottom: 5px;
    }

    .entry-table .lineup-cell .hero-lineup {
        max-width: 100%;
    }
}

/* — 中等宽度：页头折成两行 — */
@media (max-width: 860px) {
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        gap: 0;
        /* 注意：.header-inner 同时是 .container，横向留白必须带上 var(--gutter)，
           否则页头文字会贴到屏幕边缘（页面内容却仍内缩，看起来像错位） */
        padding: 9px var(--gutter) 0;
    }

    .brand {
        order: 1;
        margin-bottom: 9px;
    }

    .header-tools {
        order: 2;
        margin-left: auto;
        margin-bottom: 9px;
        padding-left: 0;
        border-left: 0;
        gap: 8px;
    }

    .nav {
        order: 3;
        flex: 0 0 100%;
        margin-left: 0;
        gap: 0;
        overflow-x: auto;
        scrollbar-width: none;
        border-top: 1px solid var(--line-2);
    }

    .nav::-webkit-scrollbar {
        display: none;
    }

    .nav a {
        height: 40px;
        padding: 0 10px;
        font-size: 13.5px;
    }

    .nav a.active::after {
        left: 10px;
        right: 10px;
        bottom: 0;
    }
}

/* — 手机：表格转卡片 — */
@media (max-width: 640px) {
    :root {
        --gutter: 12px;
    }

    .main {
        padding: 18px var(--gutter) 40px;
    }

    .card {
        padding: 16px 15px;
        border-radius: 10px;
    }

    .section-title {
        font-size: 14px;
    }

    .page-head h1 {
        font-size: 21px;
    }

    .season-switch label {
        display: none;
    }

    .season-switch select {
        min-width: 92px;
    }

    .nav-user {
        max-width: 92px;
    }

    table.responsive thead {
        display: none;
    }

    table.responsive,
    table.responsive tbody,
    table.responsive tr,
    table.responsive td {
        display: block;
        width: 100%;
    }

    table.responsive tbody tr {
        margin-bottom: 10px;
        padding: 2px 13px;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 10px;
    }

    table.responsive tbody tr:last-child {
        margin-bottom: 0;
    }

    table.responsive tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 9px 0;
        border-bottom: 1px solid var(--line-2);
        text-align: right;
    }

    table.responsive tbody td:last-child {
        border-bottom: 0;
    }

    table.responsive tbody td::before {
        content: attr(data-label);
        flex-shrink: 0;
        color: var(--ink-3);
        font-size: 11.5px;
        font-weight: 600;
        letter-spacing: 0.03em;
        text-align: left;
    }

    table.responsive tbody td.num {
        text-align: right;
    }

    /* 无 data-label 的单元格不显示前置标签 */
    table.responsive tbody td.detail-cell::before,
    table.responsive tbody td.empty-row::before,
    table.responsive tbody td.check-col::before {
        display: none;
    }

    table.responsive tbody td.empty-row {
        display: block;
        text-align: center;
        padding: 26px 0 !important;
    }

    table.responsive tbody td.check-col {
        justify-content: flex-start;
        padding: 10px 0 2px;
    }

    /* 展开的明细块去掉卡片化外观，避免嵌套两层边框 */
    table.responsive tbody tr.detail-row {
        padding: 0;
        background: transparent;
        border: 0;
        margin-bottom: 10px;
    }

    table.responsive tbody tr.detail-row td.detail-cell {
        display: block;
        padding: 10px 0;
        background: transparent;
        border-bottom: 0;
    }

    /* 明细表在手机上保持真实表格（横向滚动），不参与卡片化。
       注意选择器必须带 table.responsive 前缀，否则优先级低于上面的 td{display:flex} */
    table.responsive .detail-table {
        display: table;
        width: 100%;
    }

    table.responsive .detail-table thead {
        display: table-header-group;
    }

    table.responsive .detail-table tbody {
        display: table-row-group;
    }

    table.responsive .detail-table tr {
        display: table-row;
    }

    table.responsive .detail-table th {
        display: table-cell;
    }

    table.responsive .detail-table td {
        display: table-cell;
        padding: 8px 10px;
        text-align: left;
        border-bottom: 1px solid var(--line-2);
        white-space: nowrap;
    }

    table.responsive .detail-table td::before {
        content: none;
    }

    table.responsive .detail-table thead th {
        padding: 8px 10px;
        border-bottom: 1px solid var(--line);
    }

    /* 手机端输入控件用 16px，避免 iOS 聚焦时自动放大页面 */
    .field :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"])),
    .field select,
    .field textarea,
    .season-switch select {
        font-size: 16px;
    }

    .field input[type="date"],
    .season-switch select {
        font-size: 15px;
    }

    /* 长文本单元格：标签放上面、内容左对齐，避免多行文字右侧参差 */
    table.responsive tbody td.players-cell,
    table.responsive tbody td.pieces-cell,
    table.responsive tbody td.lineup-cell,
    table.responsive tbody td.ua-cell {
        display: block;
        text-align: left;
        white-space: normal;
        overflow: visible;
        max-width: 100%;
    }

    table.responsive tbody td.players-cell::before,
    table.responsive tbody td.pieces-cell::before,
    table.responsive tbody td.lineup-cell::before,
    table.responsive tbody td.ua-cell::before {
        display: block;
        margin-bottom: 5px;
    }

    table.responsive tbody td.players-cell,
    table.responsive tbody td.pieces-cell,
    table.responsive tbody td.lineup-cell {
        min-width: 0;
    }

    .lineup-cell .hero-lineup {
        max-width: 100%;
    }

    .rate-cell {
        align-items: flex-end;
    }

    .entry-row {
        grid-template-columns: 1fr 1fr;
    }

    .entry-row .talent-field,
    .entry-row .lineup-field {
        grid-column: 1 / -1;
    }

    .table-meta {
        flex-wrap: wrap;
        gap: 8px;
    }

    .pagination {
        gap: 4px;
    }

    .page-btn {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 12.5px;
    }

    .profile-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat {
        padding: 12px 6px;
        border-left: 1px solid var(--line-2);
    }

    .stat:nth-child(odd) {
        border-left: 0;
    }

    .stat-value {
        font-size: 19px;
    }

    .talent-icons {
        width: auto;
    }
}

/* ==========================================================================
   21 无障碍与动效
   ========================================================================== */
a:focus-visible,
button:focus-visible,
.page-btn:focus-visible,
.admin-nav-link:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
    border-radius: var(--r-xs);
}

/* 键盘导航时不显示鼠标式 hover 变化 */
@media (hover: none) {
    table.responsive tbody tr:hover td {
        background: transparent;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* 打印：去掉底色与多余装饰 */
@media print {
    .site-header,
    .site-footer,
    .filter-card,
    .pagination,
    .admin-embed-nav,
    .page-head-actions {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .card {
        border-color: #ccc;
        box-shadow: none;
        break-inside: avoid;
    }
}
