/* 赛道之上 · 电脑端网页管理后台 */
:root {
    /* v4 对齐：主色与小程序队色一致；侧栏、圆角、投影跟小程序同一套口径。
       后台刻意保持浅色 —— 它是白天办公场景（表格、截图、打印），
       强行染黑只会伤可读性；只把「品牌气质」搬过来。 */
    --brand: #ff6b12;
    --brand-dark: #e5520a;
    --ink: #0c1017;
    --muted: #5c6470;
    --line: #e7e9ee;
    --bg: #f7f8fa;
    --panel: #ffffff;
    --side: #0b0f14;
    --side-hover: #1a222c;
    --green: #1a9a62;
    --amber: #d98718;
    --blue: #2a6fd6;
    --radius: 14px;
    --shadow: 0 6px 24px rgba(4, 8, 13, .08);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; }
.hidden { display: none !important; }

/* ---------- 登录 ---------- */
.login-view {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 20% 15%, #26303f 0%, #0b0f14 46%, #070a0e 100%);
    padding: 40px 20px;
}
.login-panel {
    width: 440px;
    max-width: 100%;
    background: #fff;
    border-radius: 18px;
    padding: 38px 40px 32px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.login-mark, .side-mark {
    width: 44px; height: 44px; border-radius: 12px;
    background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 17px; letter-spacing: .5px;
}
.login-brand h1 { margin: 0; font-size: 20px; letter-spacing: 2px; }
.login-en { margin: 2px 0 0; font-size: 10px; color: var(--muted); letter-spacing: 1.6px; }
.login-title { margin: 0 0 8px; font-size: 22px; }
.login-desc { margin: 0 0 26px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.form-label { display: block; margin: 16px 0 7px; font-size: 13px; font-weight: 600; }
.form-input {
    width: 100%; height: 44px; padding: 0 13px;
    border: 1px solid var(--line); border-radius: 9px;
    background: #f7f8fa; color: var(--ink); outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.form-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(238, 96, 14, .1); background: #fff; }
textarea.form-input { height: auto; min-height: 92px; padding: 10px 13px; line-height: 1.6; resize: vertical; }
select.form-input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8a919c 50%), linear-gradient(135deg, #8a919c 50%, transparent 50%); background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.login-error { margin-top: 14px; padding: 10px 12px; border-radius: 8px; background: #fff3ea; color: var(--brand-dark); font-size: 13px; }
.login-tip { margin: 18px 0 0; color: #8a919c; font-size: 12px; line-height: 1.6; }
.login-foot { margin-top: 26px; color: rgba(255, 255, 255, .45); font-size: 12px; letter-spacing: 1px; }

/* 登录方式切换：小程序登录码 / 管理口令 */
.login-tabs {
    display: flex; gap: 6px; padding: 4px; margin: 0 0 6px;
    background: #f7f8fa; border-radius: 10px;
}
.login-tab {
    flex: 1; height: 36px; border: 0; border-radius: 8px;
    background: transparent; color: var(--muted);
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: background .15s, color .15s;
}
.login-tab:hover { color: var(--ink); }
.login-tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }
.code-input {
    height: 52px; font-size: 22px; font-weight: 700; letter-spacing: 4px;
    text-align: center; text-transform: uppercase; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- 布局 ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 232px; flex: 0 0 232px;
    background: var(--side); color: #d8dce4;
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 24px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.side-mark { width: 38px; height: 38px; border-radius: 10px; font-size: 14px; }
.side-brand-text strong { display: block; font-size: 15px; letter-spacing: 1.5px; color: #fff; }
.side-brand-text span { display: block; font-size: 9px; letter-spacing: 1.4px; color: #727b8b; margin-top: 2px; }
.side-section-label { padding: 20px 22px 8px; font-size: 11px; letter-spacing: 1.5px; color: #5c6470; }
/* 两个后台中心（平台 / 球迷会）：侧栏顶部分段按钮。只有一个中心的角色不显示 */
.desk-switch { display: flex; gap: 6px; padding: 16px 14px 0; }
.desk-switch.hidden { display: none; }
.desk-btn {
    flex: 1; padding: 8px 6px; border-radius: 9px; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .03);
    color: #b9c0cc; font-size: 12px; line-height: 1.3; text-align: center;
}
.desk-btn:hover { color: #fff; border-color: rgba(255, 255, 255, .26); }
.desk-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.nav-list { flex: 1; overflow-y: auto; padding: 0 10px 16px; }
.nav-item {
    display: flex; align-items: center; gap: 11px;
    width: 100%; padding: 10px 12px; margin: 2px 0;
    border: 0; border-radius: 9px; background: transparent;
    color: #b9c0cc; text-align: left; cursor: pointer;
    font-size: 13.5px;
}
.nav-item:hover { background: var(--side-hover); color: #fff; }
.nav-item.active { background: var(--brand); color: #fff; font-weight: 600; }
.nav-icon { width: 20px; text-align: center; font-size: 15px; opacity: .9; }
.side-foot { padding: 16px 20px 20px; border-top: 1px solid rgba(255, 255, 255, .07); }
.side-role { display: inline-block; padding: 4px 10px; border-radius: 20px; background: rgba(238, 96, 14, .16); color: #ffb990; font-size: 12px; }
.side-sync { margin-top: 10px; font-size: 11px; color: #5c6470; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    height: 68px; flex: 0 0 68px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px; background: #fff; border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20;
}
.topbar-left { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.topbar h2 { margin: 0; font-size: 18px; white-space: nowrap; }
.page-desc { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.conn-state { font-size: 12px; color: var(--green); display: flex; align-items: center; gap: 6px; }
.conn-state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.conn-state.bad { color: var(--brand); }
.content { padding: 24px 28px 48px; flex: 1; }

/* ---------- 通用组件 ---------- */
.btn {
    height: 34px; padding: 0 14px; border-radius: 8px;
    border: 1px solid var(--line); background: #fff; color: var(--ink);
    cursor: pointer; font-size: 13px; white-space: nowrap;
    transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: #f7f8fa; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-ghost { background: #fff; }
.btn-danger { color: var(--brand-dark); border-color: #f6d5c2; }
.btn-danger:hover { background: #fff3ea; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; height: 44px; margin-top: 22px; font-size: 15px; }
.btn-link { border: 0; background: transparent; color: var(--blue); padding: 0 4px; }
.btn-link:hover { background: transparent; text-decoration: underline; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 15px; }
.panel-body { padding: 18px 20px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.hint-text { color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.notice-bar { padding: 11px 14px; margin-bottom: 16px; border-radius: 8px; background: #fff8e8; border: 1px solid #f6e3bb; color: #916211; font-size: 12.5px; line-height: 1.6; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat-num { font-size: 27px; font-weight: 700; line-height: 1.2; letter-spacing: -.5px; }
.stat-label { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.stat-card.accent .stat-num { color: var(--brand); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 18px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
    text-align: left; padding: 11px 14px; background: #f7f8fa; color: #5c6470;
    font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td { padding: 11px 14px; border-bottom: 1px solid #f7f8fa; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f7f8fa; }
.data-table .cell-main { font-weight: 600; color: #22262e; }
.data-table .cell-actions { white-space: nowrap; }
.data-table .cell-actions .btn { margin-right: 5px; }
.data-table td.cell-muted { color: var(--muted); }
.empty-row { padding: 44px 20px !important; text-align: center; color: var(--muted); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 11.5px; line-height: 1.6; white-space: nowrap; }
.tag-on { background: #e7f7ee; color: var(--green); }
.tag-off { background: #f7f8fa; color: #8a919c; }
.tag-warn { background: #fff3ea; color: var(--amber); }
.tag-info { background: #e9f1ff; color: var(--blue); }
.tag-red { background: #fff3ea; color: var(--brand-dark); }
.tag-gold { background: #fff4d9; color: #a7720a; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12px; }

/* 筛选 */
.filters { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-btn { padding: 6px 13px; border-radius: 20px; border: 1px solid var(--line); background: #fff; color: #5c6470; cursor: pointer; font-size: 12.5px; }
.filter-btn.active { border-color: var(--brand); background: var(--brand); color: #fff; }
/* 候选太多的筛选（球队 95 支 / 赛季几十个）走下拦，一排按钮会撑爆一行 */
.filter-line { align-items: center; }
.filter-label { font-size: 12.5px; color: var(--muted); margin-right: 2px; }
.filter-select {
    min-width: 240px; max-width: 360px; padding: 7px 10px; border-radius: 8px;
    border: 1px solid var(--line); background: #fff; color: #20242b; font-size: 12.5px; cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--brand); }

/* 文案表单 */
.text-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; }
.text-item label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 13px; }
.text-item .field-hint { color: var(--muted); font-size: 12px; margin-bottom: 7px; }
.field-hint { color: var(--muted); font-size: 12px; line-height: 1.6; margin-top: 5px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-row { min-width: 0; }
.form-row.span-2 { grid-column: 1 / -1; }
.form-row > label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.form-row .req { color: var(--brand); margin-left: 3px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; height: 44px; }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--brand); }
.form-section-title { margin: 22px 0 12px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 700; }

/* 长文本输入（页面文案等） */
.form-textarea { display: block; width: 100%; min-height: 110px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink, #1c2029); font-size: 13px; line-height: 1.7; box-sizing: border-box; resize: vertical; }
.form-textarea:focus { outline: none; border-color: var(--brand); }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 18, 24, .5); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 60px 20px 30px; overflow-y: auto; }
.modal { width: 720px; max-width: 100%; background: #fff; border-radius: 14px; box-shadow: 0 24px 70px rgba(0, 0, 0, .3); }
.modal.small { width: 440px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { border: 0; background: transparent; font-size: 22px; color: #8a919c; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 20px 22px; max-height: calc(100vh - 230px); overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); }

/* 提示 */
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 200; padding: 11px 20px; border-radius: 9px; background: #22262e; color: #fff; font-size: 13px; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); max-width: 70vw; }
.toast.error { background: var(--brand-dark); }
.toast.success { background: #157a4e; }
.loading { padding: 48px 20px; text-align: center; color: var(--muted); }
.spinner { width: 22px; height: 22px; margin: 0 auto 12px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { padding: 16px 18px; border-radius: var(--radius); background: #fff3ea; border: 1px solid #f9dac8; color: var(--brand-dark); }

@media (max-width: 980px) {
    .sidebar { width: 68px; flex-basis: 68px; }
    .side-brand-text, .side-section-label, .side-foot, .nav-item span.nav-name { display: none; }
    /* 窄屏侧栏只剩图标，中心切换器放不下也不该占位 */
    .desk-switch { display: none; }
    .nav-item { justify-content: center; }
    .content { padding: 18px; }
    .form-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   结构化编辑控件（与小程序后台功能对齐）
   标签多选 / 图片选择 / 行表格 / 分组表单 / 双方阵容 / 批量导入
   ============================================================ */

/* 分组表单（如球员「个人介绍页」） */
.group-row > label { font-size: 13px; }
.group-box {
    border: 1px solid var(--line); border-radius: 10px;
    padding: 14px 16px 6px; background: #f7f8fa;
}
.group-box .form-grid { gap: 12px 16px; }
.group-box .form-row { margin-bottom: 8px; }

/* 标签胶囊 */
.tag-chip {
    display: inline-flex; align-items: center;
    height: 26px; padding: 0 10px; margin: 0 6px 6px 0;
    border-radius: 13px; border: 1px solid var(--line);
    background: #fff; color: #7a828e;
    font-size: 12px; line-height: 1; white-space: nowrap;
}
.tag-picker { display: flex; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.tag-picker .tag-chip { cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.tag-picker .tag-chip:hover { border-color: #c9ced8; color: var(--ink); }
.tag-chip.on { font-weight: 600; }
.tag-chip.tone-gold.on { background: #fff4d9; color: #a7720a; border-color: #f0d79a; }
.tag-chip.tone-green.on { background: #e7f7ee; color: #157a4e; border-color: #b9e5cd; }
.tag-chip.tone-blue.on { background: #e9f1ff; color: #2359b5; border-color: #c2d6f7; }
.tag-chip.tone-slate.on { background: #f7f8fa; color: #566072; border-color: #d5dbe5; }
.tag-chip.tone-purple.on { background: #f2ecfd; color: #6a44b8; border-color: #dccdf8; }
.tag-chip.tone-orange.on { background: #fff3ea; color: #b0570b; border-color: #f6d3b4; }
.tag-chip.tone-red.on { background: #ffeceb; color: #b3362c; border-color: #f6c8c4; }
.tag-chip.tone-neutral.on { background: #f7f8fa; color: #5c6572; border-color: #dcdfe6; }
.data-table .tag-chip { height: 22px; margin: 0 4px 0 0; font-size: 11.5px; padding: 0 8px; }

/* 图片字段 + 复用已有图片 */
.image-field-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.img-thumb {
    width: 46px; height: 46px; border-radius: 8px;
    /* contain：徽章图只限高度、宽度不限，cover 会把横向 logo 的左右切掉 */
    object-fit: contain; border: 1px solid var(--line); background: #f7f8fa;
}
.img-thumb.tiny {
    width: 26px; height: 26px; border-radius: 6px; vertical-align: middle;
}
.img-thumb.pending, .img-thumb.empty {
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; color: var(--muted); text-align: center; line-height: 1.25;
}
.image-pop {
    margin-top: 10px; padding: 10px;
    border: 1px solid var(--line); border-radius: 10px; background: #fff;
    max-height: 240px; overflow: auto;
}
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.image-cell {
    display: flex; flex-direction: column; gap: 6px;
    padding: 6px; border: 1px solid var(--line); border-radius: 8px;
    background: #fff; cursor: pointer; text-align: left;
}
.image-cell:hover { border-color: var(--brand); background: #fff3ea; }
.image-cell img { width: 100%; height: 62px; object-fit: cover; border-radius: 6px; }
.image-cell-ph {
    display: flex; align-items: center; justify-content: center; height: 62px;
    border-radius: 6px; background: #f7f8fa; color: #8a919c; font-size: 11px;
}
.image-cell-path { font-size: 10.5px; color: var(--muted); word-break: break-all; line-height: 1.3; }
.image-pop-empty { color: var(--muted); font-size: 12px; line-height: 1.7; padding: 4px; }

/* 行表格（赛季数据 / 历史交锋 / 重点球员 / 直播链接 / 效力履历） */
.rows { overflow-x: auto; }
.rows-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rows-table th {
    text-align: left; padding: 7px 8px; white-space: nowrap;
    background: #f7f8fa; color: #5c6470; font-weight: 600; font-size: 12px;
    border-bottom: 1px solid var(--line);
}
.rows-table td { padding: 3px 5px; border-bottom: 1px solid #f7f8fa; }
.rows-table tr:last-child td { border-bottom: 0; }
.rows-table .rows-ops-head { width: 92px; text-align: right; }
.cell-input {
    width: 100%; height: 32px; padding: 0 8px;
    border: 1px solid transparent; border-radius: 6px;
    background: #fff; color: var(--ink); font-size: 12.5px; outline: none;
}
.cell-input:hover { border-color: #e3e6ec; }
.cell-input:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(238, 96, 14, .12); }
.cell-input.wide { min-width: 180px; }
.rows-ops { white-space: nowrap; text-align: right; }
.row-op {
    width: 24px; height: 24px; margin-left: 3px; padding: 0;
    border: 1px solid var(--line); border-radius: 6px; background: #fff;
    color: #5c6470; font-size: 12px; line-height: 1; cursor: pointer;
}
.row-op:hover { background: #f7f8fa; color: var(--ink); }
.row-op.danger:hover { background: #fff3ea; border-color: #f6d5c2; color: var(--brand-dark); }
.rows-add { margin-top: 10px; }
.lp-starter { text-align: center; }
.lp-starter input { width: 15px; height: 15px; accent-color: var(--brand); }

/* 规格与组合库存：一套规格 + 自动生成的组合表 */
.sku-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fbfcfd; }
.sku-groups { display: flex; flex-direction: column; gap: 6px; }
.sku-group { display: flex; align-items: center; gap: 6px; }
.sku-group .sku-gname { width: 132px; flex-shrink: 0; }
.sku-group .sku-gvals { flex: 1; }
.sku-group .cell-input { background: #fff; border-color: var(--line); }
.sku-matrix { margin-top: 10px; }
.sku-table th:first-child { border-top-left-radius: 8px; }
.sku-table th:last-child { border-top-right-radius: 8px; }
.sku-table .sku-name { color: var(--ink); font-weight: 600; white-space: nowrap; padding-left: 8px; }
.sku-table .cell-input { border-color: #e8ebf1; background: #fff; }
.sku-table .sku-num { text-align: right; font-variant-numeric: tabular-nums; }
.sku-total { margin-top: 8px; color: var(--muted); font-size: 12px; }
.sku-note { color: var(--muted); font-size: 12px; line-height: 1.7; padding: 6px 2px; }

/* 双方阵容 */
.lineup-side {
    border: 1px solid var(--line); border-radius: 10px;
    padding: 12px 14px 10px; margin-bottom: 12px; background: #f7f8fa;
}
.lineup-side:last-child { margin-bottom: 0; }
.lineup-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.lineup-head strong { font-size: 13px; }
.lineup-formation { height: 32px; max-width: 220px; }

/* 批量导入 */
.import-cols { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.import-col { padding: 3px 9px; border-radius: 6px; background: #f7f8fa; color: #4d5665; font-size: 12px; }
.import-col.req { background: #fff3ea; color: #a8500a; font-weight: 600; }
.import-notes { color: var(--muted); font-size: 12px; line-height: 1.75; margin-bottom: 10px; }
.import-text { min-height: 168px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.import-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 12px; }
.import-file {
    display: inline-flex; align-items: center; height: 28px; padding: 0 10px;
    border: 1px solid var(--line); border-radius: 6px; background: #fff;
    font-size: 12px; cursor: pointer;
}
.import-file:hover { background: #f7f8fa; }
.import-errors {
    margin-top: 10px; padding: 10px 12px; border-radius: 8px;
    background: #fff3ea; color: var(--brand-dark); font-size: 12px; line-height: 1.75;
}

/* 标签管理 */
.tag-table .cell-input { height: 34px; }
.tag-add { display: grid; grid-template-columns: 1fr 150px auto; gap: 10px; align-items: center; margin-top: 16px; }
.tag-add .form-input { height: 38px; }
.modal.wide { width: 900px; }

/* ---------- 商品防伪码 / 礼品码 / 推流码 ---------- */
.barcode-box {
    display: flex;
    justify-content: center;
    padding: 18px 12px 10px;
    margin-bottom: 14px;
    border-radius: var(--radius-md, 12px);
    background: #fff;
    border: 1px solid var(--line, #e8e3da);
}
.barcode-svg { display: block; max-width: 100%; }

.detail-grid { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 14px; }
.detail-row {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 16px; padding: 10px 14px; border-radius: 10px; background: #f6f5f3;
}
.detail-label { color: #8a857c; font-size: 13px; flex-shrink: 0; }
.detail-value {
    color: #0c1017; font-size: 14px; font-weight: 600;
    word-break: break-all; text-align: right;
}

.gift-result { margin-top: 16px; }
.gift-codes-head { font-size: 13px; color: #6b6459; margin-bottom: 8px; }
.gift-codes-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 1px; line-height: 1.7; resize: vertical; margin-bottom: 8px;
}

.stream-box {
    margin-top: 14px; padding: 14px 16px; border-radius: 12px;
    background: #0c1017; color: #f6f5f3;
}
.stream-warn {
    display: flex; flex-direction: column; gap: 4px;
    margin-bottom: 12px; padding: 12px 14px; border-radius: 12px;
    background: #fdecea; border: 1px solid #f3c2bc; color: #8c2f24;
}
.stream-warn-soft { background: #fdf6e6; border-color: #ecd9a8; color: #7a5c12; }
.stream-warn b { font-size: 13px; font-weight: 700; }
.stream-warn span { font-size: 12.5px; line-height: 1.6; }
.stream-box.stream-empty { background: #f6f5f3; color: #6b6459; font-size: 13px; }
.stream-row {
    display: flex; gap: 14px; align-items: baseline;
    padding: 7px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
}
.stream-row:last-child { border-bottom: 0; }
.stream-row span { color: rgba(255, 255, 255, 0.55); font-size: 12px; flex-shrink: 0; width: 76px; }
.stream-row b { font-weight: 600; font-size: 13px; word-break: break-all; }

/* ---------- 库存：扫码入库 / 出库 / 防伪标签 ---------- */

.spec-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* 入库选组合：每个组合一颗可点的胶囊，带当前剩余库存 */
.stock-skus { display: flex; flex-wrap: wrap; gap: 8px; }
.stock-sku {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 12px; border-radius: 9px; cursor: pointer;
    border: 1px solid var(--line); background: #fff; color: #3d4552; font-size: 12.5px;
}
.stock-sku:hover { border-color: #d8dbe2; }
.stock-sku.on {
    border-color: var(--brand); background: #fff5ec; color: var(--brand-dark); font-weight: 600;
}
.stock-sku-stock { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.stock-sku.on .stock-sku-stock { color: var(--brand-dark); }

.stock-card {
    margin-top: 14px; padding: 6px 4px; border-radius: 12px;
    background: #f6f5f3; border: 1px solid #efece5;
}
/* 商品信息卡后面紧跟的数量输入组，需要一段呼吸，否则 label 会贴着卡片下沿 */
.stock-card + .form-grid { margin-top: 18px; }
.stock-card .detail-row { background: transparent; padding: 8px 12px; }
.stock-card-done { background: #f2f8f1; border-color: #cfe4cc; }

.stock-done-head {
    padding: 8px 14px 6px; color: #2f6b28;
    font-size: 14px; font-weight: 700;
}

.stock-code-list {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin: 12px 0 4px;
}
.code-chip {
    padding: 4px 8px; border-radius: 7px;
    background: #0c1017; color: #f6f5f3;
    font-size: 12px; letter-spacing: 0.4px;
}

.stock-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.qr-svg { display: block; width: 190px; height: 190px; }

/* 入驻邀请二维码：白底黑码，深色页面里也是硬例外 */
.invite-qr {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    margin-top: 16px; padding: 20px 18px; border-radius: 14px;
    background: #fff; border: 1px solid var(--line, #e8e3da);
}
.invite-qr-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 20px; font-weight: 700; letter-spacing: 3px; color: #0c1017;
}
.invite-qr-tip { font-size: 12px; line-height: 1.7; color: #8a857c; text-align: center; }

/* 活动报名名单弹窗 */
.ev-head { padding: 0 0 12px; border-bottom: 1px solid var(--line, #e8e3da); margin-bottom: 12px; }
.ev-title { font-size: 15px; font-weight: 700; color: var(--text, #1d2129); }
.ev-meta { margin-top: 4px; font-size: 12px; color: var(--muted, #8a857c); }
.ev-list { max-height: 46vh; overflow: auto; }
.ev-empty { padding: 28px 0; text-align: center; font-size: 13px; color: var(--muted, #8a857c); }
.ev-warn { color: #c9821f; font-size: 12px; }
.ev-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ev-table th, .ev-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line, #f0ece4); white-space: nowrap; }
.ev-table th { font-size: 12px; font-weight: 600; color: var(--muted, #8a857c); background: #faf8f4; }
.ev-table tbody tr:hover { background: #fcfbf8; }
/* 徽章授予弹层：勾选列窄，其余自适应 */
.ev-table th.grant-pick, .ev-table td.grant-pick { width: 34px; }
.ev-table input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; }

/* ---------- 保存按钮三段变化（提交时浮层播放，不受面板重渲染影响） ---------- */
.morph-ghost {
    position: fixed; z-index: 9999; margin: 0; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--brand, #e8621a);
    background: var(--brand, #e8621a);
    color: #fff; font-weight: 600; font-size: 13px; letter-spacing: .3px;
    border-radius: 8px; box-sizing: border-box; overflow: hidden;
    cursor: default; pointer-events: none;
    transition: width .3s cubic-bezier(.4, 0, .2, 1), border-radius .3s cubic-bezier(.4, 0, .2, 1), background .18s linear, border-color .18s linear;
}
.morph-ghost .mg-label { transition: opacity .12s linear; white-space: nowrap; }
.morph-ghost.is-shrink, .morph-ghost.is-done { border-radius: 50%; }
.morph-ghost.is-shrink .mg-label, .morph-ghost.is-done .mg-label { opacity: 0; }
.morph-ghost.is-done { background: #12a05e; border-color: #12a05e; }
.morph-ghost .mg-ring {
    position: absolute; left: 50%; top: 50%; width: 15px; height: 15px;
    margin: -7.5px 0 0 -7.5px; box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, .32); border-top-color: #fff;
    border-radius: 50%; animation: mg-spin .62s linear infinite;
}
.mg-tick {
    position: absolute; left: 50%; top: 50%; width: 18px; height: 18px;
    margin: -9px 0 0 -9px; box-sizing: border-box;
}
.mg-tick::before, .mg-tick::after {
    content: ''; position: absolute; height: 2px; border-radius: 1px;
    background: #fff; transform-origin: left center;
}
.mg-tick::before { left: 2px; top: 9px; width: 7px; animation: mg-line-a .15s cubic-bezier(.3,0,.4,1) both; transform: rotate(45deg) scaleX(1); }
.mg-tick::after { left: 6.5px; top: 13.5px; width: 12px; animation: mg-line-b .19s .12s cubic-bezier(.3,0,.4,1) both; transform: rotate(-45deg) scaleX(1); }
@keyframes mg-spin { to { transform: rotate(360deg); } }
@keyframes mg-line-a { from { transform: rotate(45deg) scaleX(0); } to { transform: rotate(45deg) scaleX(1); } }
@keyframes mg-line-b { from { transform: rotate(-45deg) scaleX(0); } to { transform: rotate(-45deg) scaleX(1); } }

/* ============================================================
   双层导航：72px 图标轨（一级分组）+ 240px 面板（二级菜单）
   ============================================================ */
.rail {
    width: 72px; flex: 0 0 72px;
    background: var(--side); color: #d8dce4;
    display: flex; flex-direction: column; align-items: center;
    position: sticky; top: 0; height: 100vh;
    border-right: 1px solid rgba(255, 255, 255, .06);
}
.rail-brand {
    width: 40px; height: 40px; margin: 16px 0 8px; border-radius: 11px;
    background: linear-gradient(140deg, var(--brand), #c94a06); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; letter-spacing: .5px; flex: 0 0 auto;
}
.rail-list {
    flex: 1 1 auto; min-height: 0; width: 100%; overflow-y: auto;
    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0 8px;
    scrollbar-width: none;
}
.rail-list::-webkit-scrollbar { width: 0; }
.rail-item {
    width: 58px; padding: 8px 2px 6px; border: 0; border-radius: 10px; background: transparent;
    color: #8d95a3; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    transition: background .15s, color .15s;
}
.rail-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.rail-item.active { background: rgba(255, 107, 18, .16); color: #ffb990; }
.rail-icon { font-size: 18px; line-height: 1; color: #a6aebb; }
.rail-label { font-size: 10.5px; line-height: 1.2; text-align: center; letter-spacing: .2px; }
.rail-item.active .rail-label { color: #fff; font-weight: 600; }
.rail-foot { flex: 0 0 auto; padding: 10px 0 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rail-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255, 107, 18, .18); color: #ffb990;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
}

.nav-panel {
    width: 240px; flex: 0 0 240px;
    background: #121a24; color: #d8dce4;
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    border-right: 1px solid rgba(255, 255, 255, .05);
}
.nav-panel-head { flex: 0 0 auto; padding: 20px 18px 14px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.nav-panel-head h2 { margin: 0; font-size: 15px; letter-spacing: .5px; color: #fff; }
.nav-panel-desc { margin: 6px 0 0; font-size: 11.5px; color: #6e7787; line-height: 1.5; }
.nav-panel .nav-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px 12px 14px; }
.nav-panel .nav-item { padding: 9px 12px; margin: 1px 0; font-size: 13px; }
.nav-panel .nav-item.active { background: var(--brand); }
/* 中心切换：面板底部两个小按钮，只有超管（能进两个中心）才出现 */
.nav-panel .desk-switch { display: flex; gap: 6px; padding: 0 14px 12px; }
.nav-panel .desk-switch.hidden { display: none; }
@media (max-width: 1080px) {
    .nav-panel { width: 208px; flex-basis: 208px; }
}
/* 合并页的页内分段（会员名单 / 邀请口令、球迷会相关三段） */
.page-tabs { display: flex; gap: 2px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.page-tab {
    padding: 8px 14px; border: 0; background: transparent; color: var(--muted);
    font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.page-tab:hover { color: var(--ink); }
.page-tab.active { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 600; }

/* ---------- 扫码登录 ---------- */
.scan-box { margin: 20px 0 4px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.scan-stage {
    position: relative; width: 232px; height: 232px; padding: 8px; box-sizing: border-box;
    background: #fff; border-radius: 14px; border: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .07);
    display: flex; align-items: center; justify-content: center;
}
.scan-canvas { width: 216px; height: 216px; display: block; }
.scan-mask {
    position: absolute; inset: 8px; border-radius: 10px;
    background: rgba(255, 255, 255, .95);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    font-size: 13px; color: var(--muted);
}
.scan-mask.hidden { display: none; }
.scan-hint { font-size: 13px; color: var(--ink); font-weight: 600; text-align: center; }
.scan-tip { margin: 0; font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.6; }
.login-alt { margin-top: 20px; border-top: 1px dashed var(--line); padding-top: 14px; }
.login-alt > summary { cursor: pointer; font-size: 12.5px; color: var(--muted); list-style: none; }
.login-alt > summary::-webkit-details-marker { display: none; }
.login-alt > summary::before { content: '▸ '; }
.login-alt[open] > summary::before { content: '▾ '; }
.login-alt .login-tabs { margin-top: 12px; }

/* ---------- 球员池合并 ---------- */
.merge-src {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg);
}
.merge-item-meta { color: var(--muted); font-size: 12px; }
.merge-list {
    margin-top: 10px;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.merge-item {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
}
.merge-item:last-child { border-bottom: 0; }
.merge-item:hover { background: var(--bg); }
.merge-item.on { background: rgba(255, 107, 18, .08); box-shadow: inset 3px 0 0 var(--brand); }
.merge-item-name { margin-right: 10px; font-weight: 600; }
.merge-item .merge-item-meta { display: inline; }
.empty-hint { padding: 18px 12px; color: var(--muted); font-size: 13px; text-align: center; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
