/* ============================================================
   黔韵澜杉小酒馆 · 运营后台 设计系统
   - 无外部依赖，纯 CSS 变量驱动的明/暗主题
   - 组件化：卡片 / 按钮 / 表格 / 弹窗 / 抽屉 / 提示 / 图表容器
   ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
    /* 品牌色：山林墨青 + 暖砂金 */
    --brand-50:  #f0fdfa;
    --brand-100: #ccfbf1;
    --brand-200: #99f6e4;
    --brand-300: #5eead4;
    --brand-400: #2dd4bf;
    --brand-500: #14b8a6;
    --brand-600: #0d9488;
    --brand-700: #0f766e;
    --brand-800: #115e59;

    --accent-400: #fbbf24;
    --accent-500: #f59e0b;
    --accent-600: #d97706;

    --danger-50:  #fef2f2;
    --danger-500: #ef4444;
    --danger-600: #dc2626;
    --warn-50:    #fffbeb;
    --warn-500:   #f59e0b;
    --ok-50:      #ecfdf5;
    --ok-500:     #10b981;
    --info-50:    #eff6ff;
    --info-500:   #3b82f6;
    --violet-500: #8b5cf6;

    /* 中性色 */
    --bg:          #f4f7fa;
    --bg-soft:     #eef2f7;
    --surface:     #ffffff;
    --surface-2:   #f8fafc;
    --border:      #e3e8ef;
    --border-strong:#cbd5e1;
    --text:        #0f172a;
    --text-2:      #475569;
    --text-3:      #94a3b8;

    /* 尺寸与形状 */
    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow:    0 4px 16px rgba(15, 23, 42, .07);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, .14);
    --shadow-brand: 0 8px 24px rgba(13, 148, 136, .28);

    --sidebar-w: 236px;
    --topbar-h:  64px;

    --font: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
            "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: "SF Mono", "JetBrains Mono", Consolas, "Courier New", monospace;

    --ease: cubic-bezier(.22, .61, .36, 1);
    --dur: .22s;
}

/* 暗色主题 */
[data-theme="dark"] {
    --bg:        #0a1220;
    --bg-soft:   #0e1729;
    --surface:   #121d31;
    --surface-2: #17243c;
    --border:    #22304a;
    --border-strong:#334663;
    --text:      #e8eefb;
    --text-2:    #a8b6cf;
    --text-3:    #6b7c99;

    --danger-50: rgba(239, 68, 68, .12);
    --warn-50:   rgba(245, 158, 11, .12);
    --ok-50:     rgba(16, 185, 129, .12);
    --info-50:   rgba(59, 130, 246, .12);
    --brand-50:  rgba(20, 184, 166, .12);
    --brand-100: rgba(20, 184, 166, .22);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .35);
    --shadow:    0 6px 20px rgba(0, 0, 0, .38);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 10px;
    border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ============================================================
   登录页
   ============================================================ */
.login-view {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    background: var(--bg);
}

.login-hero {
    position: relative;
    overflow: hidden;
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background: linear-gradient(150deg, #0f766e 0%, #0d9488 42%, #0891b2 100%);
}
.login-hero::before,
.login-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(8px);
    opacity: .32;
}
.login-hero::before {
    width: 480px; height: 480px;
    background: radial-gradient(circle, #5eead4, transparent 68%);
    top: -160px; right: -140px;
    animation: floaty 13s ease-in-out infinite;
}
.login-hero::after {
    width: 360px; height: 360px;
    background: radial-gradient(circle, #fbbf24, transparent 70%);
    bottom: -140px; left: -100px;
    animation: floaty 17s ease-in-out infinite reverse;
}
@keyframes floaty {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(26px, -22px) scale(1.08); }
}

.login-brand {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: .3px;
}
.login-brand .logo {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .18);
    display: grid; place-items: center;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, .25);
}

.login-hero-body { position: relative; z-index: 2; }
.login-hero-body h1 {
    font-size: 40px;
    line-height: 1.22;
    margin: 0 0 16px;
    font-weight: 800;
    letter-spacing: -.6px;
}
.login-hero-body p {
    font-size: 15px;
    opacity: .9;
    max-width: 420px;
    margin: 0 0 30px;
}
.login-hero-features { display: grid; gap: 14px; }
.login-feature {
    display: flex; align-items: center; gap: 12px;
    font-size: 14px; opacity: .95;
}
.login-feature .ico {
    width: 34px; height: 34px; flex: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, .14);
    display: grid; place-items: center;
    border: 1px solid rgba(255, 255, 255, .2);
}
.login-hero-foot {
    position: relative; z-index: 2;
    font-size: 12.5px; opacity: .72;
}

.login-panel {
    display: grid;
    place-items: center;
    padding: 40px;
    background: var(--surface);
}
.login-card { width: 100%; max-width: 372px; }
.login-card h2 {
    font-size: 24px; margin: 0 0 6px; font-weight: 750; letter-spacing: -.3px;
}
.login-card .sub { color: var(--text-2); margin: 0 0 28px; font-size: 14px; }
.login-card .field { margin-bottom: 16px; }
.login-card .btn { width: 100%; height: 46px; font-size: 15px; margin-top: 8px; }
.login-hint {
    margin-top: 22px; padding: 12px 14px;
    background: var(--brand-50); color: var(--brand-700);
    border-radius: var(--radius); font-size: 12.5px;
    border: 1px solid var(--brand-200);
}
[data-theme="dark"] .login-hint { color: var(--brand-300); }
.login-error {
    margin-top: 14px; padding: 11px 14px;
    background: var(--danger-50); color: var(--danger-600);
    border-radius: var(--radius); font-size: 13px;
    display: flex; align-items: center; gap: 8px;
    animation: shake .4s var(--ease);
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ============================================================
   应用外壳
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: none;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 40;
}

.sidebar-head {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    flex: none;
}
.sidebar-head .logo {
    width: 34px; height: 34px; border-radius: 10px; flex: none;
    background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
    display: grid; place-items: center;
    box-shadow: var(--shadow-brand);
}
.sidebar-head .name { font-weight: 750; font-size: 15px; letter-spacing: -.2px; }
.sidebar-head .name small { display: block; font-weight: 500; font-size: 11px; color: var(--text-3); }

.nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav-group-title {
    font-size: 11px; text-transform: uppercase; letter-spacing: .09em;
    color: var(--text-3); padding: 14px 12px 7px; font-weight: 650;
}
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; border-radius: var(--radius);
    color: var(--text-2); font-size: 13.5px; font-weight: 550;
    cursor: pointer; position: relative;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
    user-select: none;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
    background: var(--brand-50);
    color: var(--brand-700);
    font-weight: 650;
}
[data-theme="dark"] .nav-item.active { color: var(--brand-300); }
.nav-item.active::before {
    content: "";
    position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px; border-radius: 0 3px 3px 0;
    background: var(--brand-500);
}
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item .badge-count {
    margin-left: auto;
    background: var(--danger-500); color: #fff;
    font-size: 10.5px; font-weight: 700;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; display: grid; place-items: center;
}

.sidebar-foot {
    padding: 12px;
    border-top: 1px solid var(--border);
    flex: none;
}
.user-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: var(--radius);
    cursor: pointer; transition: background var(--dur) var(--ease);
}
.user-chip:hover { background: var(--surface-2); }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; flex: none;
    background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
    color: #fff; display: grid; place-items: center;
    font-weight: 700; font-size: 13px;
}
.user-chip .meta { min-width: 0; }
.user-chip .meta b { display: block; font-size: 13px; font-weight: 650; }
.user-chip .meta span { font-size: 11.5px; color: var(--text-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: var(--topbar-h);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 14px;
    padding: 0 24px;
    position: sticky; top: 0; z-index: 30;
}
.topbar .page-title { font-size: 17px; font-weight: 720; letter-spacing: -.2px; }
.topbar .page-title small {
    display: block; font-size: 12px; color: var(--text-3); font-weight: 500;
}
.topbar-spacer { flex: 1; }

.icon-btn {
    width: 38px; height: 38px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text-2); display: grid; place-items: center;
    cursor: pointer; transition: all var(--dur) var(--ease);
}
.icon-btn:hover { color: var(--brand-600); border-color: var(--brand-300); background: var(--brand-50); }
.icon-btn svg { width: 18px; height: 18px; }
.hamburger { display: none; }

/* 顶栏「预览用户端」入口 */
.btn-h5-preview {
    display: inline-flex; align-items: center; gap: 6px;
    height: 38px; padding: 0 14px; margin-right: 10px;
    border-radius: var(--radius); border: 1px solid var(--brand-300);
    background: var(--brand-50); color: var(--brand-700, var(--brand-600));
    font-size: 13px; font-weight: 600; text-decoration: none;
    white-space: nowrap; transition: all var(--dur) var(--ease);
}
.btn-h5-preview:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-h5-preview svg { width: 16px; height: 16px; }
@media (max-width: 720px) { .btn-h5-preview span { display: none; } .btn-h5-preview { padding: 0 11px; } }

.content { padding: 24px; flex: 1; max-width: 1320px; width: 100%; margin: 0 auto; }

.page-enter { animation: pageIn .34s var(--ease); }
@keyframes pageIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sidebar-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(15, 23, 42, .45); z-index: 39;
    backdrop-filter: blur(2px);
}

/* ============================================================
   基础组件
   ============================================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}
.card-head {
    padding: 17px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
}
.card-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.card-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--text-3); }
.card-head .spacer { flex: 1; }
.card-body { padding: 20px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 38px; padding: 0 16px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-family: inherit; font-size: 13.5px; font-weight: 620;
    cursor: pointer; white-space: nowrap;
    transition: all var(--dur) var(--ease);
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
    background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
    color: #fff; box-shadow: var(--shadow-brand);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 10px 28px rgba(13,148,136,.4); }

.btn-ghost {
    background: var(--surface); color: var(--text-2); border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) { color: var(--brand-600); border-color: var(--brand-300); background: var(--brand-50); }

.btn-danger { background: var(--danger-500); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--danger-600); }

.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn-sm svg { width: 14px; height: 14px; }
.btn-icon { width: 34px; padding: 0; }

.field { display: block; }
.field > label {
    display: block; font-size: 12.5px; font-weight: 620;
    color: var(--text-2); margin-bottom: 7px;
}
.input, .select, .textarea {
    width: 100%; height: 40px;
    padding: 0 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text); font-family: inherit; font-size: 13.5px;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.textarea { height: auto; padding: 11px 13px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--brand-400);
    box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--brand-400) 26%, transparent);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input-group { display: flex; gap: 10px; flex-wrap: wrap; }

.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 20px;
    font-size: 11.5px; font-weight: 650; line-height: 1.5;
    background: var(--surface-2); color: var(--text-2);
}
.badge::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; opacity: .85;
}
.badge.no-dot::before { display: none; }
.badge svg { width: 12px; height: 12px; flex: none; }
.badge-ok     { background: var(--ok-50);     color: var(--ok-500); }
.badge-warn   { background: var(--warn-50);   color: var(--warn-500); }
.badge-danger { background: var(--danger-50); color: var(--danger-500); }
.badge-info   { background: var(--info-50);   color: var(--info-500); }
.badge-brand  { background: var(--brand-50);  color: var(--brand-600); }
.badge-muted  { background: var(--surface-2); color: var(--text-3); }

.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px; border-radius: 20px; cursor: pointer;
    background: var(--surface); border: 1px solid var(--border);
    font-size: 12.5px; font-weight: 550; color: var(--text-2);
    transition: all var(--dur) var(--ease);
}
.chip:hover { border-color: var(--brand-300); color: var(--brand-600); }
.chip.active { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl thead th {
    text-align: left; padding: 11px 16px;
    font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em;
    color: var(--text-3); background: var(--surface-2);
    position: sticky; top: 0; z-index: 1;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
table.tbl tbody td {
    padding: 13px 16px; border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
table.tbl tbody tr { transition: background var(--dur) var(--ease); }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl tbody tr:last-child td { border-bottom: none; }
.td-actions { display: flex; gap: 6px; justify-content: flex-end; }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* 空状态 */
.empty {
    padding: 56px 24px; text-align: center; color: var(--text-3);
}
.empty .ico {
    width: 62px; height: 62px; margin: 0 auto 16px;
    border-radius: 18px; display: grid; place-items: center;
    background: var(--surface-2); color: var(--text-3);
}
.empty h4 { margin: 0 0 6px; color: var(--text-2); font-size: 15px; }
.empty p { margin: 0 0 18px; font-size: 13px; }

/* 骨架屏 */
.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 25%,
                color-mix(in srgb, var(--border) 55%, var(--surface-2)) 37%, var(--surface-2) 63%);
    background-size: 400% 100%;
    animation: shimmer 1.4s ease infinite;
    border-radius: var(--radius-sm);
}
@keyframes shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ============================================================
   仪表盘
   ============================================================ */
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-1-2 { grid-template-columns: 1fr 2fr; }

.stat {
    position: relative; overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-xs);
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat .stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat .stat-ico {
    width: 40px; height: 40px; border-radius: 12px;
    display: grid; place-items: center;
    background: var(--brand-50); color: var(--brand-600);
}
.stat .stat-ico svg { width: 20px; height: 20px; }
.stat .stat-label { font-size: 12.5px; color: var(--text-3); font-weight: 600; margin-top: 14px; }
.stat .stat-value {
    font-size: 30px; font-weight: 780; letter-spacing: -1px; line-height: 1.15;
    font-variant-numeric: tabular-nums;
}
.stat .stat-value small { font-size: 15px; font-weight: 600; color: var(--text-3); margin-left: 3px; }
.stat .stat-foot { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.stat .spark { position: absolute; right: 0; bottom: 0; opacity: .5; pointer-events: none; }
.stat.accent-brand  .stat-ico { background: var(--brand-50); color: var(--brand-600); }
.stat.accent-ok     .stat-ico { background: var(--ok-50);    color: var(--ok-500); }
.stat.accent-warn   .stat-ico { background: var(--warn-50);  color: var(--warn-500); }
.stat.accent-info   .stat-ico { background: var(--info-50);  color: var(--info-500); }
.stat.accent-violet .stat-ico { background: color-mix(in srgb, var(--violet-500) 14%, transparent); color: var(--violet-500); }
.stat.accent-brand::after,
.stat.accent-ok::after,
.stat.accent-warn::after,
.stat.accent-info::after,
.stat.accent-violet::after {
    content: ""; position: absolute; inset: 0 0 auto auto;
    width: 120px; height: 120px; border-radius: 50%;
    background: currentColor; opacity: .04; transform: translate(38px, -54px);
}

/* 迷你进度条 */
.meter { height: 8px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 6px; background: var(--brand-500);
             transition: width .7s var(--ease); }
.meter.ok > i { background: var(--ok-500); }
.meter.warn > i { background: var(--warn-500); }
.meter.danger > i { background: var(--danger-500); }

.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }

/* 图表 */
.chart-box { width: 100%; }
.chart-box svg { display: block; width: 100%; overflow: visible; }
.chart-grid line { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-axis { font-size: 10.5px; fill: var(--text-3); }
.chart-area { animation: fadeUp .8s var(--ease); }
.chart-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
              stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: draw 1.4s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.chart-point { transition: r .2s var(--ease); }
.chart-point:hover { r: 5.5; }

.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { position: relative; flex: none; }
.donut svg { transform: rotate(-90deg); }
.donut .donut-seg { transition: stroke-dasharray .9s var(--ease); }
.donut .donut-center {
    position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
}
.donut .donut-center b { display: block; font-size: 24px; font-weight: 780; letter-spacing: -.5px; }
.donut .donut-center span { font-size: 11px; color: var(--text-3); }

.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 76px 1fr 44px; align-items: center; gap: 12px; font-size: 12.5px; }
.bar-track { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar-track > i { display: block; height: 100%; border-radius: 6px;
                 background: linear-gradient(90deg, var(--brand-400), var(--brand-600));
                 animation: growX .8s var(--ease); }
@keyframes growX { from { width: 0 !important; } }
.bar-row .val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* 活动流 */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
    content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px;
    width: 2px; background: var(--border);
}
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
    content: ""; position: absolute; left: -22px; top: 4px;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--surface); border: 2.5px solid var(--brand-500);
}
.tl-item.ok::before { border-color: var(--ok-500); }
.tl-item.warn::before { border-color: var(--warn-500); }
.tl-item.danger::before { border-color: var(--danger-500); }
.tl-item .tl-time { font-size: 11.5px; color: var(--text-3); }
.tl-item .tl-text { font-size: 13px; }
.tl-item .tl-text b { font-weight: 650; }

/* ============================================================
   弹窗 / 抽屉 / 提示
   ============================================================ */
.modal-mask {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(15, 23, 42, .5);
    backdrop-filter: blur(4px);
    display: grid; place-items: center; padding: 20px;
    animation: maskIn .2s var(--ease);
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
    width: 100%; max-width: 520px; max-height: 90vh; overflow: auto;
    background: var(--surface); border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    animation: modalIn .3s var(--ease);
}
.modal.wide { max-width: 760px; }
.modal.narrow { max-width: 420px; }
@keyframes modalIn {
    from { opacity: 0; transform: translateY(16px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
.modal-head {
    padding: 20px 24px 16px; display: flex; align-items: center; gap: 12px;
}
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 720; flex: 1; }
.modal-body { padding: 0 24px 8px; }
.modal-foot {
    padding: 18px 24px 22px; display: flex; gap: 10px; justify-content: flex-end;
}
.form-grid { display: grid; gap: 15px; }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.form-span-2 { grid-column: 1 / -1; }

.drawer-mask {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(15, 23, 42, .42); backdrop-filter: blur(2px);
    animation: maskIn .2s var(--ease);
    display: flex; justify-content: flex-end;
}
.drawer {
    width: 100%; max-width: 560px; height: 100%;
    background: var(--surface); box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column;
    animation: drawerIn .3s var(--ease);
}
@keyframes drawerIn { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-head {
    padding: 18px 22px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px; flex: none;
}
.drawer-head h3 { margin: 0; font-size: 16px; font-weight: 700; flex: 1; }
.drawer-body { padding: 22px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 16px 22px; border-top: 1px solid var(--border); flex: none; display: flex; gap: 10px; }

.toast-root {
    position: fixed; top: 20px; right: 20px; z-index: 200;
    display: flex; flex-direction: column; gap: 10px;
}
.toast {
    min-width: 260px; max-width: 380px;
    display: flex; align-items: flex-start; gap: 11px;
    padding: 13px 16px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    animation: toastIn .32s var(--ease);
}
.toast.out { animation: toastOut .28s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(28px); } }
.toast .ti { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.toast .tb { flex: 1; font-size: 13px; }
.toast .tb b { display: block; font-weight: 660; }
.toast .tb span { color: var(--text-3); font-size: 12px; }
.toast.ok    { border-left: 3px solid var(--ok-500); }    .toast.ok .ti    { color: var(--ok-500); }
.toast.error { border-left: 3px solid var(--danger-500); }.toast.error .ti { color: var(--danger-500); }
.toast.info  { border-left: 3px solid var(--info-500); }  .toast.info .ti  { color: var(--info-500); }

/* ============================================================
   业务专用
   ============================================================ */
.page-head {
    display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.page-head .ph-title h2 { margin: 0; font-size: 22px; font-weight: 760; letter-spacing: -.4px; }
.page-head .ph-title p { margin: 4px 0 0; color: var(--text-3); font-size: 13px; }
.page-head .spacer { flex: 1; }

.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.room-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
    display: flex; flex-direction: column;
}
.room-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.room-cover {
    height: 132px; position: relative;
    background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
    display: grid; place-items: center; color: rgba(255,255,255,.9);
}
.room-cover .cover-badge {
    position: absolute; top: 12px; left: 12px;
    background: rgba(255,255,255,.92); color: var(--brand-700);
    font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
}
.room-cover .cover-badge.off { background: rgba(15,23,42,.7); color: #fff; }
.room-cover .price {
    position: absolute; right: 12px; bottom: 12px;
    background: rgba(15, 23, 42, .55); color: #fff; backdrop-filter: blur(4px);
    padding: 5px 11px; border-radius: 10px; font-weight: 750; font-size: 15px;
}
.room-cover .price small { font-weight: 500; font-size: 11px; opacity: .85; }
.room-body { padding: 15px 17px; flex: 1; display: flex; flex-direction: column; }
.room-body h4 { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.room-body .desc {
    color: var(--text-3); font-size: 12.5px; line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; margin-bottom: 12px; min-height: 40px;
}
.room-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.room-foot { margin-top: auto; display: flex; gap: 8px; }

.kb-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
.kb-lib-item {
    padding: 12px 14px; border-radius: var(--radius); cursor: pointer;
    border: 1px solid transparent; transition: all var(--dur) var(--ease);
}
.kb-lib-item:hover { background: var(--surface-2); }
.kb-lib-item.active { background: var(--brand-50); border-color: var(--brand-200); }
.kb-lib-item .nm { font-weight: 650; font-size: 13.5px; }
.kb-lib-item .in { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.recall-box {
    background: var(--surface-2); border: 1px dashed var(--border-strong);
    border-radius: var(--radius); padding: 16px;
}
.recall-hit {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px;
}
.recall-hit .rh-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.recall-hit .rh-score {
    margin-left: auto; font-family: var(--mono); font-size: 11.5px;
    color: var(--brand-600); font-weight: 650;
}
.recall-hit .rh-text { font-size: 13px; color: var(--text-2); line-height: 1.65; }

.chat-stream { display: flex; flex-direction: column; gap: 14px; padding: 4px; }
.chat-msg { display: flex; gap: 10px; max-width: 82%; }
.chat-msg.me { margin-left: auto; flex-direction: row-reverse; }
.chat-msg .bubble {
    padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.65;
    background: var(--surface-2); border: 1px solid var(--border);
    white-space: pre-wrap; word-break: break-word;
}
.chat-msg.me .bubble {
    background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
    color: #fff; border-color: transparent;
}
.chat-msg.staff .bubble { background: var(--warn-50); border-color: var(--brand-200); }
.chat-msg .who { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.chat-msg.me .who { text-align: right; }

.reply-box { display: flex; gap: 10px; align-items: flex-end; }
.reply-box .textarea { flex: 1; min-height: 46px; max-height: 140px; }

.kv-list { display: grid; gap: 0; }
.kv-row {
    display: grid; grid-template-columns: 128px 1fr; gap: 14px;
    padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.kv-row:last-child { border-bottom: none; }
.kv-row .k { color: var(--text-3); font-weight: 600; font-size: 12.5px; }
.kv-row .v { word-break: break-word; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab {
    padding: 10px 16px; cursor: pointer; font-size: 13.5px; font-weight: 600;
    color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: all var(--dur) var(--ease);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand-600); border-bottom-color: var(--brand-500); }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { display: none; }
.switch .track {
    position: absolute; inset: 0; background: var(--border-strong);
    border-radius: 20px; cursor: pointer; transition: background var(--dur) var(--ease);
}
.switch .track::before {
    content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: transform var(--dur) var(--ease);
    box-shadow: var(--shadow-sm);
}
.switch input:checked + .track { background: var(--brand-500); }
.switch input:checked + .track::before { transform: translateX(18px); }

.section-title {
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
    color: var(--text-3); margin: 4px 0 12px;
}

.divider { height: 1px; background: var(--border); margin: 18px 0; }

.hint { font-size: 12px; color: var(--text-3); line-height: 1.55; }
.hint.warn { color: var(--warn-500); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.text-2 { color: var(--text-2); } .text-3 { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
/* 关键：.login-view/.drawer 等类设置了 display，会覆盖 UA 的 [hidden] 规则，
   导致隐藏元素仍占据布局（登录态下把应用壳顶下一屏）。 */
[hidden] { display: none !important; }

/* ============================================================
   对象存储：图片上传器 / 封面 / 附件 / 自检
   ============================================================ */

/* ---------- 房型封面 ---------- */
.room-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.room-cover .cover-ph { opacity: .35; }
.room-cover::after {                 /* 图片上压一层自下而上的暗渐变，保证价格/徽标可读 */
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(to top, rgba(15,23,42,.58), rgba(15,23,42,0) 58%);
}
.room-cover .cover-badge, .room-cover .price, .room-cover .cover-count { z-index: 2; }
.room-cover .cover-count {
    position: absolute; right: 12px; top: 12px;
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(15,23,42,.55); color: #fff; backdrop-filter: blur(4px);
    font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 20px;
}
.room-cover .cover-count svg { width: 12px; height: 12px; }

/* ---------- 上传器 ---------- */
.uploader {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 10px;
    padding: 12px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg);
    background: var(--surface-2); transition: border-color .18s, background .18s;
}
.uploader.is-drag { border-color: var(--brand-500); background: var(--brand-50); }
html[data-theme="dark"] .uploader.is-drag { background: rgba(20,184,166,.12); }
/* display:contents 让缩略图与「添加」块共用外层 grid，无需额外容器 */
.up-grid { display: contents; }

.up-tile {
    position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden;
    border: 1px solid var(--border); background: var(--surface);
}
.up-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-tile.is-cover { border-color: var(--brand-500); box-shadow: 0 0 0 2px var(--brand-100); }
html[data-theme="dark"] .up-tile.is-cover { box-shadow: 0 0 0 2px rgba(20,184,166,.3); }
.up-flag {
    position: absolute; left: 6px; top: 6px; z-index: 2;
    background: var(--brand-500); color: #fff;
    font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px;
}
.up-tools {
    position: absolute; right: 6px; top: 6px; z-index: 2; display: flex; gap: 4px;
    opacity: 0; transition: opacity .18s var(--ease);
}
.up-tile:hover .up-tools { opacity: 1; }
.up-tool {
    width: 22px; height: 22px; display: grid; place-items: center; cursor: pointer;
    border: 0; border-radius: 7px; background: rgba(15,23,42,.66); color: #fff;
}
.up-tool svg { width: 13px; height: 13px; }
.up-tool:hover { background: var(--brand-600); }
.up-tool.danger:hover { background: var(--danger-500); }

.up-tile.is-loading {
    display: flex; flex-direction: column; justify-content: center; gap: 7px;
    padding: 10px; background: var(--surface);
}
.up-progress { height: 5px; border-radius: 99px; background: var(--border); overflow: hidden; }
.up-progress i { display: block; height: 100%; background: var(--brand-500); transition: width .2s linear; }
.up-name {
    font-size: 10px; color: var(--text-3); text-align: center;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.up-add {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; aspect-ratio: 4 / 3; padding: 6px; cursor: pointer; text-align: center;
    border: 1.5px dashed var(--border-strong); border-radius: 12px;
    background: var(--surface); color: var(--text-2);
    transition: border-color .18s, color .18s;
}
.up-add svg { width: 20px; height: 20px; color: var(--brand-500); }
.up-add b { font-size: 12px; font-weight: 650; }
.up-add small { font-size: 10px; color: var(--text-3); line-height: 1.4; }
.up-add:hover { border-color: var(--brand-500); color: var(--brand-700); }
.up-hint { font-size: 12px; color: var(--text-3); margin-top: 8px; line-height: 1.55; }

/* ---------- 附件条 ---------- */
.file-chip {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
}
.file-chip .fc-ico {
    width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center;
    background: var(--brand-50); color: var(--brand-700);
}
html[data-theme="dark"] .file-chip .fc-ico { background: rgba(20,184,166,.14); color: var(--brand-300); }
.file-chip .fc-ico svg { width: 16px; height: 16px; }
.file-chip .fc-meta { flex: 1; min-width: 0; }
.file-chip .fc-meta b {
    display: block; font-size: 12.5px; font-weight: 650;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-chip .fc-meta span { font-size: 11px; color: var(--text-3); }

/* ---------- 自检结果 ---------- */
.check-list { display: grid; gap: 8px; }
.check-row {
    display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2);
}
.check-row .cr-ico {
    width: 20px; height: 20px; flex: none; border-radius: 50%;
    display: grid; place-items: center; color: #fff; margin-top: 1px;
}
.check-row .cr-ico svg { width: 12px; height: 12px; }
.check-row.ok .cr-ico { background: var(--ok-500); }
.check-row.fail .cr-ico { background: var(--danger-500); }
.check-row .cr-txt { flex: 1; min-width: 0; }
.check-row .cr-txt b { font-size: 12.5px; font-weight: 650; }
.check-row .cr-txt span { display: block; font-size: 11.5px; color: var(--text-3); word-break: break-all; }

.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.kv-cell { padding: 11px 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.kv-cell .k { font-size: 11.5px; color: var(--text-3); margin-bottom: 5px; }
.kv-cell .v { font-size: 13px; font-weight: 650; word-break: break-all; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .kb-layout { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .login-view { grid-template-columns: 1fr; }
    .login-hero { display: none; }
    .sidebar {
        position: fixed; left: 0; top: 0; height: 100vh;
        transform: translateX(-102%); transition: transform .28s var(--ease);
    }
    .sidebar.open { transform: none; }
    .sidebar-backdrop.show { display: block; }
    .hamburger { display: grid; }
    .grid-2-1, .grid-1-2, .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .content { padding: 16px; }
    .topbar { padding: 0 14px; }
}
@media (max-width: 560px) {
    .grid-4 { grid-template-columns: 1fr; }
    .form-grid.cols-2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* ============================================================
   美食管理 / 内容管理：卡片网格（两个页面共用一套卡片语言）
   ============================================================ */

.d-stats { display: flex; gap: 8px; flex-wrap: wrap; }

.d-card, .ct-card { overflow: hidden; display: flex; flex-direction: column; }
.d-card.is-off, .ct-card.is-off { opacity: .6; }

.d-cover, .ct-cover {
    position: relative; aspect-ratio: 16 / 10;
    background: var(--surface-2); overflow: hidden;
}
.d-cover img, .ct-cover img { width: 100%; height: 100%; object-fit: cover; }
.d-cover-ph, .ct-cover-ph {
    width: 100%; height: 100%; display: grid; place-items: center; color: var(--text-3);
}
.d-cover-ph svg, .ct-cover-ph svg { width: 30px; height: 30px; }

.d-flag {
    position: absolute; left: 10px; top: 10px;
    font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px;
    background: var(--warn-500); color: #fff;
}
.d-flag.off { left: auto; right: 10px; background: var(--text-3); }

.ct-type {
    position: absolute; left: 10px; top: 10px;
    font-size: 11px; padding: 3px 8px; border-radius: 6px;
    background: rgba(15, 23, 42, .55); color: #fff; backdrop-filter: blur(4px);
}
.ct-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.ct-play svg { width: 44px; height: 44px; filter: drop-shadow(0 3px 10px rgba(0, 0, 0, .5)); }

.d-name { font-size: 14.5px; line-height: 1.4; }

.d-price { font-size: 15px; font-weight: 600; color: var(--brand-500); white-space: nowrap; }
.d-price.tbd { font-size: 12px; font-weight: 500; color: var(--text-3); }

.d-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.chip-mini {
    font-size: 11px; padding: 2px 7px; border-radius: 5px;
    background: var(--surface-2); color: var(--text-2);
}

.d-desc {
    margin: 10px 0 0; font-size: 12.5px; color: var(--text-2); line-height: 1.65;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* 视频选择器 */
.v-up { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.v-preview { width: 100%; max-height: 240px; border-radius: 10px; background: #000; }
.up-progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.up-progress i { display: block; height: 100%; background: var(--brand-500); transition: width .2s; }

@media (max-width: 960px) {
    .grid-3 { grid-template-columns: 1fr; }
}
