/* ═══════════════════════════════════════════════════════════
   App Shell 设计系统 v2 — 跨境电商 ERP
   侧边栏应用外壳 / 玻璃顶栏 / 卡片化内容 / 深浅双主题
   加载顺序：style.css → app-shell.css（本文件覆盖为主）
   ═══════════════════════════════════════════════════════════ */

/* ─────────── 主题令牌 ─────────── */
:root {
    /* 深色（默认） */
    --app-bg: #0b0e16;
    --app-bg-image:
        radial-gradient(1100px 600px at 12% -8%, rgba(99, 102, 241, 0.16), transparent 62%),
        radial-gradient(900px 520px at 88% 4%, rgba(203, 17, 171, 0.12), transparent 60%),
        radial-gradient(800px 500px at 50% 108%, rgba(0, 91, 255, 0.10), transparent 65%);
    --surface: rgba(23, 27, 40, 0.86);
    --surface-solid: #171b28;
    --surface-elevated: #1d2231;
    --surface-hover: #232838;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);

    --text-strong: #f2f4f9;
    --text-body: #c8cddd;
    --text-dim: #8a90a6;
    --text-faint: #626878;

    --brand: #6366f1;
    --brand-2: #8b5cf6;
    --brand-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #d946ef 100%);
    --accent-glow: 0 8px 24px -8px rgba(99, 102, 241, 0.55);

    --wb-color: #d946ef;
    --ozon-color: #4d8dff;

    --radius-xl: 18px;
    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .28);
    --shadow-md: 0 8px 24px -12px rgba(0, 0, 0, .55);
    --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, .7);
    --ease: cubic-bezier(.4, 0, .2, 1);

    /* 兼容回退（不依赖 color-mix / 新语法） */
    --topbar-bg: rgba(17, 21, 32, 0.82);
    --chip-brand-bg: rgba(99, 102, 241, 0.14);
    --chip-brand-line: rgba(139, 92, 246, 0.34);
    --focus-ring: rgba(99, 102, 241, 0.22);

    /* 兼容旧变量名（style.css 组件仍在用） */
    --bg-primary: #0b0e16;
    --bg-secondary: #141926;
    --bg-card: rgba(23, 27, 40, 0.9);
    --bg-hover: #232838;
    --border: rgba(255, 255, 255, 0.09);
    --text-primary: #f2f4f9;
    --text-secondary: #8a90a6;
    --text-muted: #626878;
    --accent: #6366f1;
    --accent-hover: #7c7ff5;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #f43f5e;
    --info: #6366f1;
    --radius: 14px;
    --shadow: var(--shadow-md);
    --transition: .18s var(--ease);

    --sidebar-w: 250px;
    --sidebar-w-collapsed: 76px;
    --topbar-h: 62px;
}

html[data-theme="light"] {
    --app-bg: #f4f6fb;
    --app-bg-image:
        radial-gradient(1100px 600px at 10% -10%, rgba(99, 102, 241, 0.14), transparent 60%),
        radial-gradient(900px 520px at 92% 0%, rgba(217, 70, 239, 0.10), transparent 58%);
    --surface: rgba(255, 255, 255, 0.9);
    --surface-solid: #ffffff;
    --surface-elevated: #ffffff;
    --surface-hover: #f1f4fb;
    --line: rgba(15, 23, 42, 0.09);
    --line-strong: rgba(15, 23, 42, 0.16);

    --text-strong: #0f172a;
    --text-body: #334155;
    --text-dim: #64748b;
    --text-faint: #94a3b8;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow-md: 0 10px 30px -12px rgba(15, 23, 42, .22);
    --shadow-lg: 0 28px 64px -28px rgba(15, 23, 42, .3);

    --topbar-bg: rgba(255, 255, 255, 0.82);
    --chip-brand-bg: rgba(99, 102, 241, 0.12);
    --chip-brand-line: rgba(99, 102, 241, 0.28);
    --focus-ring: rgba(99, 102, 241, 0.18);

    --bg-primary: #f4f6fb;
    --bg-secondary: #eef1f8;
    --bg-card: #ffffff;
    --bg-hover: #f1f4fb;
    --border: rgba(15, 23, 42, 0.1);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --wb-color: #c026d3;
    --ozon-color: #2563eb;
}

/* ─────────── 基础 ─────────── */
html, body { height: 100%; }

body {
    background: var(--app-bg);
    background-image: var(--app-bg-image);
    background-attachment: fixed;
    color: var(--text-body);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::before {
    /* 极淡网格纹理，增加质感 */
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(to right, var(--line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--line) 1px, transparent 1px);
    background-size: 56px 56px;
    opacity: .35;
    mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 78%);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 99px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--brand); background-clip: padding-box; }

/* ─────────── 布局骨架 ─────────── */
/* ⚠️ 这里**不要**设 z-index：一旦创建层叠上下文，页内所有 position:fixed 弹层
   （智能擦除 1100 / 图片预览 1000 / toast 300 …）都会被压到侧边栏(z-index 60)之下，
   表现为弹框左侧被侧边栏盖住、点不动。背景网格 body::before 是文档序更靠前的
   fixed 元素，去掉 z-index 后依然垫在最底层。 */
.app-shell {
    position: relative;
    z-index: auto;
    min-height: 100vh;
    padding-left: var(--sidebar-w);
    transition: padding-left .25s var(--ease);
}
body.sidebar-collapsed .app-shell { padding-left: var(--sidebar-w-collapsed); }

/* ─────────── 侧边栏 ─────────── */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    z-index: 60;
    display: flex;
    flex-direction: column;
    background: var(--surface-solid);
    border-right: 1px solid var(--line);
    transition: width .25s var(--ease), transform .25s var(--ease);
}
body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }

.sidebar-brand {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    border-bottom: 1px solid var(--line);
    flex: none;
}
.brand-mark {
    width: 34px; height: 34px;
    flex: none;
    border-radius: 11px;
    background: var(--brand-gradient);
    box-shadow: var(--accent-glow);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: -.5px;
}
.brand-text { min-width: 0; }
.brand-name {
    font-size: 14.5px; font-weight: 700; color: var(--text-strong);
    white-space: nowrap; letter-spacing: .2px;
}
.brand-sub {
    font-size: 11px; color: var(--text-faint); white-space: nowrap;
    letter-spacing: .3px;
}
body.sidebar-collapsed .brand-text { display: none; }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 12px 20px;
}
.nav-group { margin-bottom: 18px; }
.nav-group-title {
    font-size: 10.5px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: 0 10px 8px;
    font-weight: 600;
}
body.sidebar-collapsed .nav-group-title {
    text-align: center; padding: 0 0 8px; font-size: 0; height: 8px; overflow: hidden;
}
body.sidebar-collapsed .nav-group-title::after {
    content: ""; display: block; height: 1px; background: var(--line); margin: 3px 6px;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    margin-bottom: 2px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: none;
    color: var(--text-dim);
    font-size: 13.5px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    position: relative;
    transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.nav-item .ni-icon {
    width: 26px; height: 26px; flex: none;
    display: grid; place-items: center;
    border-radius: 8px;
    background: var(--surface-hover);
    font-size: 13px;
    transition: var(--transition);
}
.nav-item .ni-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { background: var(--surface-hover); color: var(--text-strong); }
.nav-item:hover .ni-icon { background: var(--line-strong); }
.nav-item.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(99, 102, 241, .26), rgba(139, 92, 246, .12) 60%, transparent);
    border-color: rgba(139, 92, 246, .32);
}
.nav-item.active .ni-icon {
    background: var(--brand-gradient);
    box-shadow: 0 4px 12px -4px rgba(139, 92, 246, .8);
}
.nav-item.active::before {
    content: "";
    position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 18px; border-radius: 0 3px 3px 0;
    background: var(--brand-gradient);
}
body.sidebar-collapsed .nav-item { justify-content: center; padding: 9px 0; }
body.sidebar-collapsed .nav-item .ni-label { display: none; }
body.sidebar-collapsed .nav-item.active::before { left: 0; }

.nav-badge {
    margin-left: auto;
    min-width: 18px;
    padding: 1px 6px;
    border-radius: 99px;
    background: var(--danger);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    text-align: center;
}
body.sidebar-collapsed .nav-badge { display: none; }

.sidebar-foot {
    flex: none;
    border-top: 1px solid var(--line);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-foot .env-chip {
    font-size: 11px;
    color: var(--text-faint);
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 99px;
    white-space: nowrap;
}
body.sidebar-collapsed .sidebar-foot { flex-direction: column; }
body.sidebar-collapsed .sidebar-foot .env-chip { display: none; }

.icon-btn {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface-hover);
    color: var(--text-dim);
    cursor: pointer;
    font-size: 15px;
    transition: var(--transition);
}
.icon-btn:hover { color: var(--text-strong); border-color: var(--line-strong); transform: translateY(-1px); }

/* ─────────── 顶栏 ─────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 22px;
    background: var(--topbar-bg);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.crumb {
    display: flex; align-items: center; gap: 8px; min-width: 0;
}
.crumb-root { font-size: 12px; color: var(--text-faint); }
.crumb-sep { color: var(--text-faint); font-size: 12px; }
.crumb-title {
    font-size: 15px; font-weight: 650; color: var(--text-strong);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-logo { display: none; }  /* 品牌已移到侧边栏 */

.status-pill {
    display: inline-flex; align-items: center; gap: 6px;
    height: 30px; padding: 0 11px;
    border-radius: 99px;
    border: 1px solid var(--line);
    background: var(--surface-hover);
    font-size: 12px;
    color: var(--text-dim);
    transition: var(--transition);
}
.status-pill .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--text-faint);
    box-shadow: 0 0 0 0 currentColor;
}
.status-pill .dot.wb { background: var(--wb-color); }
.status-pill .dot.ozon { background: var(--ozon-color); }
.status-pill .dot.err { background: var(--danger); }
.status-pill.ok { color: var(--success); }
.status-pill.err { color: var(--danger); }
.status-pill.live { animation: pulseDot 2.4s infinite; }

@keyframes pulseDot {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); }
    70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.mode-chip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 30px; padding: 0 11px;
    border-radius: 99px;
    font-size: 11.5px; font-weight: 600;
    color: var(--brand-2);
    background: var(--chip-brand-bg);
    border: 1px solid var(--chip-brand-line);
}

.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--brand-gradient);
    color: #fff; font-size: 12.5px; font-weight: 700;
    display: grid; place-items: center;
    box-shadow: var(--accent-glow);
    flex: none;
}

/* 顶部加载细条 */
.page-progress {
    position: fixed; top: 0; left: 0; height: 2px; width: 0;
    background: var(--brand-gradient);
    z-index: 999;
    opacity: 0;
    transition: width .5s var(--ease), opacity .35s var(--ease);
    box-shadow: 0 0 12px rgba(139, 92, 246, .8);
}
.page-progress.run { width: 92%; opacity: 1; transition: width .6s var(--ease), opacity .2s var(--ease); }
.page-progress.done { width: 100%; opacity: 0; }

/* 移动端遮罩 */
.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0; z-index: 55;
    background: rgba(4, 6, 12, .55);
    backdrop-filter: blur(2px);
}
body.sidebar-open .sidebar-backdrop { display: block; }

/* ─────────── 内容区 ─────────── */
.main-content {
    padding: 26px 30px 60px;
    max-width: 1560px;
    margin: 0 auto;
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeUp .28s var(--ease) both; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.page-head { margin-bottom: 20px; }
.page-head h1 {
    font-size: 21px; font-weight: 700; color: var(--text-strong);
    letter-spacing: -.2px; margin-bottom: 4px;
}
.page-head p { font-size: 13px; color: var(--text-dim); }

/* ─────────── 卡片 / 表格 ─────────── */
.data-table-wrap,
.stat-card,
.listing-card,
.attr-card,
.panel,
.modal,
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.data-table-wrap { overflow-x: auto; }

html[data-theme="dark"] .data-table-wrap:hover,
html:not([data-theme]) .data-table-wrap:hover { border-color: var(--line-strong); }

.data-table-wrap .table-header {
    padding: 14px 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent);
}
.data-table-wrap .table-title {
    font-size: 14.5px; font-weight: 650; color: var(--text-strong);
    display: inline-flex; align-items: center; gap: 8px;
}
.data-table-wrap .table-title::before {
    content: ""; width: 3px; height: 14px; border-radius: 2px;
    background: var(--brand-gradient);
}

table { font-size: 13px; }
th {
    background: var(--surface-elevated);
    color: var(--text-dim);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .6px;
    padding: 11px 16px;
    position: sticky; top: 0; z-index: 2;
}
td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--line);
    color: var(--text-body);
    vertical-align: middle;
}
tbody tr { transition: background .14s var(--ease); }
tbody tr:hover { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: none; }

/* 统计卡 */
.stats-grid { gap: 18px; margin-bottom: 22px; }
.stat-card {
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: "";
    position: absolute; right: -30px; top: -30px;
    width: 110px; height: 110px; border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, .18), transparent 70%);
    pointer-events: none;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card .label { font-size: 11.5px; color: var(--text-dim); letter-spacing: .6px; }
.stat-card .value {
    font-size: 30px; font-weight: 750; color: var(--text-strong); letter-spacing: -.6px;
    line-height: 1.15;
}
.stat-card .sub { font-size: 12px; color: var(--text-faint); }
.stat-card.wb { border-left: 3px solid var(--wb-color); }
.stat-card.ozon { border-left: 3px solid var(--ozon-color); }
.stat-card.both { border-left: 3px solid var(--brand); }

/* ─────────── 控件 ─────────── */
.btn {
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: var(--surface-hover);
    color: var(--text-body);
    font-weight: 550;
    font-family: inherit;
    padding: 7px 14px;
    transition: transform .14s var(--ease), box-shadow .18s var(--ease),
                background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.btn:hover { transform: translateY(-1px); border-color: var(--brand); color: var(--text-strong); }
.btn:active { transform: translateY(0); }
.btn-primary {
    background: var(--brand-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: var(--accent-glow);
}
.btn-primary:hover { color: #fff; box-shadow: 0 12px 28px -10px rgba(99, 102, 241, .8); }
.btn-success { background: linear-gradient(135deg, #10b981, #059669); border-color: transparent; color: #fff; }
.btn-success:hover { color: #fff; }
.btn-danger { background: linear-gradient(135deg, #f43f5e, #e11d48); border-color: transparent; color: #fff; }
.btn-danger:hover { color: #fff; }
.btn-sm { padding: 4px 11px; font-size: 12px; border-radius: 7px; }

.form-field input,
.form-field textarea,
.form-field select,
.filter-bar select,
.filter-bar input,
.modal input, .modal select, .modal textarea {
    background: var(--surface-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text-strong);
    padding: 8px 11px;
    transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus,
.filter-bar select:focus,
.filter-bar input:focus,
.modal input:focus, .modal select:focus, .modal textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--focus-ring);
    outline: none;
}
.form-field label { color: var(--text-dim); font-size: 12.5px; }

.listing-card { padding: 18px; }
.card-title { font-size: 14.5px; font-weight: 650; color: var(--text-strong); }
.card-hint { font-size: 12px; color: var(--text-faint); font-weight: 400; }

/* 徽章 */
.platform-badge, .status-badge, .field-diff {
    border-radius: 99px;
    font-weight: 600;
    letter-spacing: .2px;
}
.status-badge.published, .status-badge.active { box-shadow: 0 0 0 1px rgba(34, 197, 94, .25) inset; }

/* Modal */
.modal-overlay {
    background: rgba(6, 8, 15, .62);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center; justify-content: center;
}
.modal {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 22px 24px;
    max-width: 680px;
    animation: modalIn .22s var(--ease) both;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: none; }
}
.modal h3 { font-size: 17px; font-weight: 700; color: var(--text-strong); }

/* Toast */
.toast-container { top: calc(var(--topbar-h) + 14px); right: 24px; gap: 10px; }
.toast {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    padding: 11px 16px;
    background: var(--surface-elevated);
    color: var(--text-strong);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    backdrop-filter: blur(10px);
    animation: toastIn .24s var(--ease) both;
}
.toast.success { background: var(--surface-elevated); border-left-color: var(--success); color: var(--text-strong); }
.toast.error { background: var(--surface-elevated); border-left-color: var(--danger); color: var(--text-strong); }
.toast.warning { background: var(--surface-elevated); border-left-color: var(--warning); color: var(--text-strong); }
.toast.info { background: var(--surface-elevated); border-left-color: var(--info); color: var(--text-strong); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: none; }
}

/* 空状态 */
.empty-state { color: var(--text-faint); }

/* ─────────── 响应式 ─────────── */
@media (max-width: 1180px) {
    .main-content { padding: 22px 20px 56px; }
}

@media (max-width: 900px) {
    .app-shell { padding-left: 0; }
    body.sidebar-collapsed .app-shell { padding-left: 0; }
    .sidebar { transform: translateX(-100%); width: var(--sidebar-w); box-shadow: var(--shadow-lg); }
    body.sidebar-collapsed .sidebar { width: var(--sidebar-w); }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-collapsed .brand-text,
    body.sidebar-collapsed .nav-item .ni-label,
    body.sidebar-collapsed .sidebar-foot .env-chip { display: revert; }
    body.sidebar-collapsed .nav-item { justify-content: flex-start; padding: 9px 11px; }
    .topbar { padding: 0 14px; }
    .crumb-root, .crumb-sep { display: none; }
    .mode-chip { display: none; }
}

@media print {
    .sidebar, .topbar, .page-progress { display: none !important; }
    .app-shell { padding-left: 0; }
}

/* ═══════════════════════════════════════════════════════════
   UI 2.1 布局宽松化 — 参考竞品「如斯达ERP」卡片式分区风格
   原则：区块留白加大 / 卡片标题分区线 / 表单行距加大 /
        上架页步骤导航（左栏）+ 状态摘要条
   ═══════════════════════════════════════════════════════════ */

/* ─────────── 全局留白 ─────────── */
.main-content { padding: 30px 36px 72px; }
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 22px; }

/* 表单：行距与输入框高度全面加大 */
.form-grid { gap: 16px 20px; }
.form-field label { font-size: 12.5px; margin-bottom: 6px; line-height: 1.5; }
.form-field input,
.form-field textarea,
.form-field select { padding: 9px 12px; font-size: 13.5px; line-height: 1.45; }
.field-hint { display: block; font-weight: 400; font-size: 11.5px; color: var(--text-faint); margin-top: 1px; }

/* 「上送」模块标识：徽标 + 输入区高亮（描述是上送 WB/Ozon 的正式内容） */
.badge-upload {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .5px;
    color: #fff;
    background: var(--accent);
    vertical-align: middle;
    box-shadow: 0 2px 8px -2px rgba(99, 102, 241, .55);
}
textarea.textarea-upload {
    border-color: rgba(99, 102, 241, .38);
    background: rgba(99, 102, 241, .05);
}
html[data-theme="light"] textarea.textarea-upload { background: rgba(99, 102, 241, .04); }
textarea.textarea-upload:focus { border-color: var(--accent); }

/* 工具条统一：更大的内距与间距，弱化为一整条「操作面板」 */
.attr-bar, .inv-bar, .img-toolbar {
    padding: 10px 14px;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-elevated);
    margin-bottom: 14px;
}
.img-toolbar { row-gap: 10px; }

/* 上架页：卡片间距与内距加大，标题做成分区头 */
.listing-page { gap: 22px; }
.listing-card {
    padding: 22px 26px 24px;
    scroll-margin-top: calc(var(--topbar-h) + 20px);
}
.listing-page .card-title {
    font-size: 15.5px;
    padding-bottom: 12px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
}
.listing-page .card-title .card-hint { margin-left: 2px; }

/* 采集输入行加大 */
.scrape-row { gap: 10px; }
.scrape-input { padding: 11px 14px; font-size: 14px; }

/* 变体表：行高放宽 */
.variants-table th { padding: 8px 6px; }
.variants-table td { padding: 6px 6px; }

/* ─────────── 上架页步骤导航（左栏） ─────────── */
.listing-page { display: grid; grid-template-columns: 188px minmax(0, 1fr); align-items: start; column-gap: 24px; }
.listing-rail {
    position: sticky;
    top: calc(var(--topbar-h) + 18px);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.rail-title {
    font-size: 11px; font-weight: 600; letter-spacing: 1.2px;
    color: var(--text-faint); text-transform: uppercase;
    padding: 0 10px 8px;
}
.rail-step {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: none;
    color: var(--text-dim);
    font-size: 13px; font-family: inherit; text-align: left;
    cursor: pointer;
    transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.rail-step .rs-num {
    width: 22px; height: 22px; flex: none;
    display: grid; place-items: center;
    border-radius: 7px;
    background: var(--surface-hover);
    border: 1px solid var(--line);
    font-size: 11px; font-weight: 700; color: var(--text-faint);
    transition: var(--transition);
}
.rail-step:hover { background: var(--surface-hover); color: var(--text-strong); }
.rail-step.active {
    color: var(--text-strong);
    background: linear-gradient(90deg, rgba(99, 102, 241, .22), rgba(139, 92, 246, .08) 65%, transparent);
    border-color: rgba(139, 92, 246, .3);
}
.rail-step.active .rs-num {
    background: var(--brand-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 10px -4px rgba(139, 92, 246, .8);
}
.rail-step.done .rs-num { color: var(--success); border-color: rgba(34, 197, 94, .4); }

/* ─────────── 上架页状态摘要条（参考竞品顶部信息卡） ─────────── */
.listing-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.ls-cell {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 12px 16px;
    min-width: 0;
}
.ls-cell .ls-label { font-size: 11px; color: var(--text-faint); letter-spacing: .5px; margin-bottom: 4px; }
.ls-cell .ls-value {
    font-size: 13.5px; font-weight: 600; color: var(--text-strong);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ls-cell .ls-value.muted { color: var(--text-dim); font-weight: 500; }

@media (max-width: 1280px) {
    .listing-page { display: flex; flex-direction: column; }
    .listing-rail {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }
    .rail-title { display: none; }
    .rail-step { width: auto; padding: 6px 10px; }
    .listing-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .listing-summary { grid-template-columns: 1fr; }
}

/* ─────────── 店铺授权页（sa-） ─────────── */
.sa-subtabs { display: flex; gap: 10px; margin-bottom: 22px; }
.sa-subtab {
    padding: 10px 22px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-dim);
    font-size: 13.5px; font-weight: 600; font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}
.sa-subtab:hover { color: var(--text-strong); border-color: var(--line-strong); }
.sa-subtab.active {
    color: #fff;
    background: var(--brand-gradient);
    border-color: transparent;
    box-shadow: var(--accent-glow);
}
.sa-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.sa-toolbar input, .sa-toolbar select {
    background: var(--surface-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text-strong);
    padding: 8px 12px;
    font-size: 13px;
}
.sa-toolbar input { width: 200px; }
.sa-toolbar input:focus, .sa-toolbar select:focus {
    border-color: var(--brand); outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.sa-filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.sa-filter {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px;
    border-radius: 99px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-dim);
    font-size: 12px; font-weight: 600; font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}
.sa-filter span {
    min-width: 18px; text-align: center;
    background: var(--surface-hover);
    border-radius: 99px; padding: 0 5px;
    font-size: 11px;
}
.sa-filter:hover { color: var(--text-strong); }
.sa-filter.active { color: var(--brand-2); border-color: var(--chip-brand-line); background: var(--chip-brand-bg); }
.sa-hint {
    font-size: 12.5px; color: var(--text-dim);
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 10px 14px; margin-bottom: 14px;
}
.sa-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sa-table td .btn { margin-right: 4px; }
.sa-status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 10px; border-radius: 99px;
    font-size: 11.5px; font-weight: 600;
}
.sa-status-badge.authorized { color: var(--success); background: rgba(34, 197, 94, .12); }
.sa-status-badge.invalid { color: var(--danger); background: rgba(244, 63, 94, .12); }
.sa-status-badge.unauthorized { color: var(--text-dim); background: var(--surface-hover); }
.sa-default-chip {
    display: inline-block; margin-left: 6px;
    padding: 1px 7px; border-radius: 99px;
    font-size: 10.5px; font-weight: 700;
    color: var(--brand-2); background: var(--chip-brand-bg);
    border: 1px solid var(--chip-brand-line);
}
.sa-token { font-family: monospace; font-size: 12px; color: var(--text-dim); }
.sa-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.sa-form-grid .full { grid-column: 1 / -1; }
.sa-form-grid label {
    display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 5px;
}
.sa-form-grid label .req { color: var(--danger); margin-right: 2px; }
.sa-form-grid input, .sa-form-grid select, .sa-form-grid textarea {
    width: 100%; box-sizing: border-box;
    background: var(--surface-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text-strong);
    padding: 8px 11px; font-size: 13px; font-family: inherit;
}
.sa-form-grid input:focus, .sa-form-grid select:focus, .sa-form-grid textarea:focus {
    border-color: var(--brand); outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.sa-form-grid textarea { resize: vertical; }
.sa-modal-foot {
    display: flex; justify-content: flex-end; gap: 10px;
    margin-top: 20px; padding-top: 14px;
    border-top: 1px solid var(--line);
}
.sa-platform-pick { display: flex; gap: 8px; }
.sa-platform-pick button {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: var(--surface-hover);
    color: var(--text-dim);
    font-size: 12.5px; font-weight: 700; letter-spacing: .3px; font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}
.sa-platform-pick button.active {
    color: #fff; background: var(--brand-gradient);
    border-color: transparent;
}
@media (max-width: 720px) {
    .sa-form-grid { grid-template-columns: 1fr; }
}
