/* ============================================================
   选品工具 · 全站样式（Google 风格，纯 CSS，无外链，离线可用）
   设计基调：Google Blue (#1a73e8) + Grey 色板 + 细边框低阴影卡片
        + 胶囊按钮 + Material 弹窗。结构：变量 → 基础 → 顶部导航
        → 后台侧栏布局 → 卡片/栅格 → 表格 → 表单 → 按钮
        → 提示/徽标 → 折叠/占位 → 复制弹窗 → 页脚
   ============================================================ */

:root {
    --bg: #f8f9fa;            /* Grey 50 */
    --panel: #ffffff;
    --border: #dadce0;        /* Grey 200 */
    --border-light: #f1f3f4;  /* Grey 100 */
    --text: #202124;          /* Grey 900 */
    --muted: #5f6368;         /* Grey 700 */
    --primary: #1a73e8;       /* Blue 600 */
    --primary-hover: #1765cc;
    --primary-deep: #174ea6;
    --primary-soft: #e8f0fe;  /* Blue 50 */
    --danger: #d93025;        /* Red 600 */
    --danger-soft: #fce8e6;
    --success: #137333;       /* Green 800 */
    --success-soft: #e6f4ea;
    --warning: #b06000;
    --warning-soft: #fef7e0;  /* Yellow 50 */
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(60, 64, 67, .10), 0 1px 3px 1px rgba(60, 64, 67, .06);
    --shadow-modal: 0 4px 8px 3px rgba(60, 64, 67, .15), 0 1px 3px rgba(60, 64, 67, .30);
    --container-max: 1680px;
    --font: "Google Sans", Roboto, "Helvetica Neue", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

::selection { background: var(--primary-soft); color: var(--primary-deep); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c4c7c5; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #a8abb0; }
::-webkit-scrollbar-track { background: transparent; }

/* ===== 顶部导航（前台） ===== */
.topbar { background: var(--panel); border-bottom: 1px solid var(--border); }
.topbar-inner {
    max-width: var(--container-max); margin: 0 auto; padding: 0 24px; height: 64px;
    display: flex; align-items: center; gap: 24px;
}
.brand {
    font-size: 18px; font-weight: 500; color: var(--text);
    display: flex; align-items: center; gap: 10px; white-space: nowrap;
    letter-spacing: .2px;
}
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px;
    background: conic-gradient(from 45deg, #4285f4, #34a853, #fbbc05, #ea4335, #4285f4);
    color: #fff; font-size: 14px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .25);
}
.topbar-nav { display: flex; gap: 4px; flex: 1; }
.topbar-nav a {
    padding: 8px 16px; border-radius: 999px; color: var(--muted); font-weight: 500;
    transition: background .15s ease, color .15s ease;
}
.topbar-nav a:hover { background: var(--border-light); color: var(--text); text-decoration: none; }
.topbar-nav a.active { background: var(--primary-soft); color: var(--primary-deep); }
.topbar-user { display: flex; align-items: center; gap: 14px; color: var(--muted); white-space: nowrap; }
.topbar-user .username { color: var(--text); font-weight: 500; }

.container { max-width: var(--container-max); margin: 0 auto; padding: 28px 24px 56px; }

/* 页面标题行：标题居左、操作按钮（刷新等）居右 */
.page-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin: 8px 0 16px;
}
.page-head h1 { margin: 0; font-size: 22px; font-weight: 400; letter-spacing: 0; }
.page-head h1 .badge { vertical-align: 3px; margin-left: 6px; }

/* ===== 后台布局（侧栏 + 顶栏） ===== */
.admin-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 224px; flex: 0 0 224px; background: #202124; color: #9aa0a6;
    display: flex; flex-direction: column;
}
.sidebar-brand {
    padding: 20px 20px; color: #e8eaed; font-weight: 500; font-size: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    display: flex; align-items: center; gap: 10px; letter-spacing: .2px;
}
.sidebar-nav { padding: 12px 10px; flex: 1; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; margin-bottom: 2px; border-radius: 999px;
    color: #9aa0a6; font-weight: 500; transition: background .15s ease, color .15s ease;
}
.sidebar-nav a:hover { background: #303134; color: #e8eaed; text-decoration: none; }
.sidebar-nav a.active { background: var(--primary); color: #fff; }
.sidebar-footer { padding: 14px 20px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 13px; }
.sidebar-footer a { color: #9aa0a6; }
.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-topbar {
    background: var(--panel); border-bottom: 1px solid var(--border); height: 64px;
    display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
}
.admin-topbar .page-title { font-size: 17px; font-weight: 500; margin: 0; }
.admin-topbar-right { display: flex; align-items: center; gap: 14px; color: var(--muted); }
.admin-content { padding: 24px; flex: 1; }

/* ===== 卡片与栅格 ===== */
.card {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 22px; margin-bottom: 20px;
}
.card-title { margin: 0 0 12px; font-size: 17px; font-weight: 500; }
.card-sub { color: var(--muted); margin: -6px 0 14px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) {
    .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
    /* 侧栏不再折叠为 64px 空条（纯文字导航无图标，折叠后入口全部不可见） */
}
.stat-card { padding: 18px 20px; margin-bottom: 0; }
.stat-card .stat-label { color: var(--muted); font-size: 12px; letter-spacing: .5px; font-weight: 500; }
.stat-card .stat-value { font-size: 28px; font-weight: 400; margin-top: 6px; word-break: break-all; font-variant-numeric: tabular-nums; }

/* ===== 表格 ===== */
.table-wrap {
    overflow-x: auto; background: var(--panel);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow);
}
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.table th {
    color: var(--muted); font-weight: 500; font-size: 12px;
    background: #f8f9fa; white-space: nowrap; letter-spacing: .3px;
}
.table td { font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s ease; }
.table tbody tr:hover { background: #f1f8ff; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.form-hint { color: var(--muted); font-size: 12px; margin-top: 5px; }
.input, .select, .textarea {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
}
.input-error { border-color: var(--danger); }
.form-error { color: var(--danger); font-size: 12px; margin-top: 5px; }
.form-inline { display: inline; }

/* ===== 按钮（Material 胶囊） ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 20px; border-radius: 999px; border: 1px solid transparent;
    font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit;
    background: transparent; color: var(--text); letter-spacing: .2px;
    transition: background .15s ease, box-shadow .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 1px 2px rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15); }
.btn-outline { background: #fff; border-color: var(--border); color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); border-color: #d2e3fc; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c5221f; box-shadow: 0 1px 2px rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15); }
.btn-sm { padding: 5px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ===== 按钮内圆形加载指示（Material） ===== */
@keyframes spin-to { to { transform: rotate(360deg); } }
.spinner {
    width: 14px; height: 14px; border-radius: 50%; flex: 0 0 14px;
    border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
    animation: spin-to .8s linear infinite; display: inline-block;
}
.btn-outline .spinner {
    border-color: rgba(26, 115, 232, .25); border-top-color: var(--primary);
}
.btn.running { cursor: progress; }
.btn.running:disabled { opacity: 1; }

/* ===== 提示与徽标 ===== */
.alert {
    border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 16px;
    border: 1px solid transparent; font-size: 14px;
}
.alert ul { margin: 0; padding-left: 18px; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: #a8dab5; }
.alert-error, .alert-danger { background: var(--danger-soft); color: #c5221f; border-color: #f6aea9; }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: #feefc3; }
.alert-info { background: var(--primary-soft); color: var(--primary-deep); border-color: #d2e3fc; }

.badge {
    display: inline-block; padding: 2px 11px; border-radius: 999px;
    font-size: 12px; font-weight: 500; letter-spacing: .2px;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: #c5221f; }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-muted { background: var(--border-light); color: var(--muted); }

.muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

/* ===== 折叠区（excluded 明细等） ===== */
details.collapse {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 10px 16px; background: #fff;
}
details.collapse summary { cursor: pointer; font-weight: 500; color: var(--muted); }

/* ===== 占位页 ===== */
.placeholder-hero { text-align: center; padding: 48px 20px; }
.placeholder-hero .icon {
    width: 60px; height: 60px; border-radius: 50%; margin-bottom: 16px;
    background: var(--primary-soft); color: var(--primary); font-size: 26px;
    display: inline-flex; align-items: center; justify-content: center;
}
.placeholder-hero h1 { margin: 0 0 8px; font-size: 20px; font-weight: 500; }
.placeholder-hero p { margin: 0; color: var(--muted); }

/* ===== 官方活动横幅（双11 红包等） ===== */
.activity-banner { display: flex; flex-direction: column; gap: 10px; margin: 0 0 16px; }
.activity-card {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--danger);
    border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 12px 16px;
}
.activity-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.activity-name { font-size: 15px; font-weight: 500; }
.activity-info { color: var(--muted); font-size: 13px; }
.activity-window { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.activity-actions { display: flex; align-items: center; gap: 8px; white-space: nowrap; }

/* ===== 手动复制弹窗（HTTP 环境兜底） ===== */
.copy-mask {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(32, 33, 36, .55);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.copy-mask[hidden] { display: none; }
.copy-modal {
    background: #fff; border-radius: var(--radius); max-width: 560px; width: 100%;
    padding: 24px; box-shadow: var(--shadow-modal);
}
.copy-modal h3 { margin: 0 0 8px; font-size: 18px; font-weight: 500; }
.copy-modal .copy-modal-img {
    max-width: 100%; max-height: 220px; border-radius: 8px;
    border: 1px solid var(--border); margin-bottom: 12px; display: block;
}
.copy-modal .hint { color: var(--muted); font-size: 13px; margin: 0 0 14px; line-height: 1.7; }
.copy-modal textarea {
    width: 100%; height: 150px; padding: 10px 14px; resize: vertical;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-family: inherit; font-size: 13px; color: var(--text); background: #f8f9fa;
}
.copy-modal textarea:focus { outline: none; border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.copy-modal kbd {
    background: var(--border-light); border: 1px solid var(--border); border-bottom-width: 2px;
    border-radius: 4px; padding: 1px 6px; font-size: 12px; font-family: inherit;
}
.copy-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ===== 页脚 ===== */
.footer { color: var(--muted); font-size: 12px; text-align: center; padding: 24px 0; }
