/* ==========================================================================
   综合数据中控台 - 设计系统
   深色导航 + 浅色内容区 / 零外部依赖
   ========================================================================== */

:root {
    /* ---------- 品牌色 ---------- */
    --brand-50:  #eef4ff;
    --brand-100: #dde8ff;
    --brand-200: #c2d5ff;
    --brand-500: #3b6ef5;
    --brand-600: #2b5ce0;
    --brand-700: #1e47bd;
    --brand-soft: #eef4ff;

    /* ---------- 深色面（导航） ---------- */
    --ink-950: #0a0f1c;
    --ink-900: #0f1626;
    --ink-800: #151d31;
    --ink-700: #1d273d;
    --ink-line: #222d45;
    --ink-text: #e8ecf4;
    --ink-text-2: #a2adc2;
    --ink-text-3: #6b7893;

    /* ---------- 语义色 ---------- */
    --ok:      #0f9b6c;
    --ok-soft: #e8f7f1;
    --ok-line: #b7e6d3;
    --warn:      #c97a06;
    --warn-soft: #fdf5e6;
    --warn-line: #f2ddb0;
    --danger:      #d92d20;
    --danger-soft: #fdf0ef;
    --danger-line: #f7cdc9;
    --info:      #0a7ea4;
    --info-soft: #e9f6fa;
    --info-line: #bde2ee;
    --violet:      #7a5af8;
    --violet-soft: #f1edff;
    --violet-line: #d9cffd;

    /* ---------- 中性色 ---------- */
    --text:    #101828;
    --text-2:  #4a5468;
    --text-3:  #667085;
    --muted:   #98a2b3;
    --line:    #e7e9ee;
    --line-2:  #d5d9e2;
    --bg:      #f5f6f8;
    --surface: #ffffff;
    --surface-2: #fafbfc;
    --surface-3: #f2f4f7;

    /* ---------- 圆角 ---------- */
    --r-xs: 6px;
    --r-sm: 8px;
    --r: 10px;
    --r-lg: 14px;
    --r-xl: 20px;

    /* ---------- 阴影 ---------- */
    --sh-xs: 0 1px 2px rgba(16, 24, 40, .05);
    --sh-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px -1px rgba(16, 24, 40, .07);
    --sh:    0 2px 4px -1px rgba(16, 24, 40, .05), 0 4px 12px -2px rgba(16, 24, 40, .07);
    --sh-md: 0 8px 20px -6px rgba(16, 24, 40, .12), 0 2px 6px -2px rgba(16, 24, 40, .06);
    --sh-lg: 0 24px 48px -12px rgba(10, 15, 28, .28);

    /* ---------- 尺寸 ---------- */
    --sidebar-w: 244px;
    --topbar-h: 60px;

    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    /* ---------- 兼容别名（旧变量名 → 新令牌，供历史内联样式使用） ---------- */
    --c-primary: var(--brand-600);
    --c-primary-dark: var(--brand-700);
    --c-primary-soft: var(--brand-soft);
    --c-success: var(--ok);
    --c-success-soft: var(--ok-soft);
    --c-warn: var(--warn);
    --c-warn-soft: var(--warn-soft);
    --c-danger: var(--danger);
    --c-danger-soft: var(--danger-soft);
    --c-info: var(--info);
    --c-info-soft: var(--info-soft);
    --c-violet: var(--violet);
    --c-text: var(--text);
    --c-text-2: var(--text-2);
    --c-muted: var(--muted);
    --c-border: var(--line);
    --c-border-2: var(--line-2);
    --c-bg: var(--bg);
    --c-surface: var(--surface);
    --c-surface-2: var(--surface-2);
    --shadow-sm: var(--sh-sm);
    --shadow: var(--sh);
    --shadow-md: var(--sh-md);
    --shadow-lg: var(--sh-lg);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv02", "cv03", "cv04";
}

a { color: var(--brand-600); text-decoration: none; transition: color .14s; }
a:hover { color: var(--brand-700); }
button { font-family: inherit; }
code, pre, .mono { font-family: var(--font-mono); }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #ccd2dd; border-radius: 8px;
    border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #aab3c2; background-clip: content-box; }

/* ==========================================================================
   布局
   ========================================================================== */
.ac-layout { display: flex; min-height: 100vh; }

/* ---------- 侧边栏（深色） ---------- */
.ac-sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--ink-900);
    background-image: linear-gradient(180deg, #131b2e 0%, #0d1424 60%, #0b1120 100%);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 30;
    transition: transform .24s cubic-bezier(.4, 0, .2, 1);
}
.ac-sidebar::after {
    content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 1px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
}

.ac-brand {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 18px;
    flex: 0 0 var(--topbar-h);
    border-bottom: 1px solid var(--ink-line);
}
.ac-brand-logo {
    width: 32px; height: 32px; border-radius: 9px;
    background: linear-gradient(140deg, var(--brand-500), #6d4df0);
    color: #fff; font-weight: 700; font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    letter-spacing: -.4px; flex: 0 0 32px;
    box-shadow: 0 4px 12px -3px rgba(59, 110, 245, .55), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.ac-brand-txt { font-weight: 600; font-size: 14.5px; letter-spacing: -.1px; color: #fff; }
.ac-brand-txt small {
    display: block; font-weight: 400; font-size: 11px;
    color: var(--ink-text-3); line-height: 1.35; letter-spacing: 0;
}

.ac-nav { flex: 1; overflow-y: auto; padding: 14px 12px 22px; }
.ac-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); background-clip: content-box; }
.ac-nav-group { margin-bottom: 8px; }
.ac-nav-group + .ac-nav-group { margin-top: 16px; }
.ac-nav-group-title {
    font-size: 10.5px; font-weight: 600; color: var(--ink-text-3);
    letter-spacing: .1em; padding: 6px 10px 8px; text-transform: uppercase;
}
.ac-nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 8.5px 11px; border-radius: 8px;
    color: var(--ink-text-2); font-size: 13.5px; font-weight: 500;
    margin-bottom: 1px; transition: background .14s, color .14s;
    position: relative;
}
.ac-nav-item:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.ac-nav-item.active {
    background: linear-gradient(90deg, rgba(59, 110, 245, .20), rgba(59, 110, 245, .07));
    color: #fff; font-weight: 600;
}
.ac-nav-item.active::before {
    content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 17px; border-radius: 0 3px 3px 0;
    background: var(--brand-500);
    box-shadow: 0 0 10px 1px rgba(59, 110, 245, .7);
}
.ac-nav-item .ac-ico { flex: 0 0 16px; color: var(--ink-text-3); transition: color .14s; }
.ac-nav-item:hover .ac-ico { color: var(--ink-text-2); }
.ac-nav-item.active .ac-ico { color: #7ba0ff; }

.ac-nav-badge {
    margin-left: auto; background: var(--danger); color: #fff;
    font-size: 11px; padding: 0 6px; border-radius: 9px; line-height: 17px;
    min-width: 18px; text-align: center; font-weight: 600;
    box-shadow: 0 2px 6px -1px rgba(217, 45, 32, .5);
}
.ac-nav-badge.soft { background: rgba(59, 110, 245, .22); color: #9dbaff; box-shadow: none; }

.ac-sidebar-foot {
    padding: 12px 16px; border-top: 1px solid var(--ink-line);
    font-size: 11.5px; color: var(--ink-text-3); display: flex;
    justify-content: space-between; align-items: center; gap: 6px;
}
.ac-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.ac-dot.on { background: #2fcf8f; box-shadow: 0 0 0 3px rgba(47, 207, 143, .16); }
.ac-dot.off { background: #f0654f; box-shadow: 0 0 0 3px rgba(240, 101, 79, .16); }
.ac-sidebar-foot > span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- 主区域 ---------- */
.ac-main {
    flex: 1; min-width: 0;
    margin-left: var(--sidebar-w);
    display: flex; flex-direction: column;
}

.ac-topbar {
    height: var(--topbar-h);
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 14px;
    padding: 0 24px;
    position: sticky; top: 0; z-index: 20;
}
.ac-topbar h1 { font-size: 15.5px; font-weight: 600; letter-spacing: -.2px; line-height: 1.3; }
.ac-topbar .ac-crumb { color: var(--muted); font-size: 12px; line-height: 1.3; }
.ac-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ac-topbar .ac-brand-logo {
    width: 28px; height: 28px; flex: 0 0 28px; font-size: 12px;
    border-radius: 8px; box-shadow: none;
}

.ac-content { padding: 24px; flex: 1; }

.ac-menu-toggle {
    display: none; background: none; border: none; cursor: pointer;
    color: var(--text-2); padding: 6px; border-radius: 7px;
}
.ac-menu-toggle:hover { background: var(--surface-3); }

/* ==========================================================================
   卡片
   ========================================================================== */
.ac-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    margin-bottom: 18px;
    overflow: hidden;
}
.ac-card-head {
    padding: 15px 20px;
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 10px;
    background: var(--surface);
}
.ac-card-head h2, .ac-card-head h3 {
    font-size: 14px; font-weight: 600; letter-spacing: -.1px; color: var(--text);
}
.ac-card-head .ac-sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.ac-card-head .ac-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.ac-card-body { padding: 20px; }
.ac-card-body.tight { padding: 0; }

/* ---------- 指标卡 ---------- */
.ac-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
    gap: 14px; margin-bottom: 18px;
}
.ac-stat {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-lg); padding: 17px 18px 16px; position: relative;
    box-shadow: var(--sh-sm); overflow: hidden;
    transition: box-shadow .18s, transform .18s, border-color .18s;
}
.ac-stat:hover { box-shadow: var(--sh); transform: translateY(-1px); border-color: var(--line-2); }
.ac-stat::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: var(--brand-500); opacity: .9;
}
.ac-stat.ok::before { background: var(--ok); }
.ac-stat.warn::before { background: var(--warn); }
.ac-stat.danger::before { background: var(--danger); }
.ac-stat.info::before { background: var(--info); }
.ac-stat.violet::before { background: var(--violet); }
.ac-stat-label {
    font-size: 12.5px; color: var(--text-3); display: flex;
    align-items: center; gap: 6px; font-weight: 500;
}
.ac-stat-label .ac-ico { color: var(--muted); }
.ac-stat-value {
    font-size: 27px; font-weight: 700; letter-spacing: -.9px; margin-top: 7px;
    line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--text);
}
.ac-stat-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.ac-stat-foot { font-size: 12px; color: var(--muted); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.ac-stat-foot .up { color: var(--danger); font-weight: 600; }
.ac-stat-foot .down { color: var(--ok); font-weight: 600; }

/* ==========================================================================
   按钮
   ========================================================================== */
.ac-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 34px; padding: 0 14px; border-radius: var(--r-sm);
    border: 1px solid var(--line-2); background: var(--surface);
    color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer;
    transition: background .14s, border-color .14s, box-shadow .14s, transform .08s;
    white-space: nowrap; line-height: 1;
}
.ac-btn:hover { background: var(--surface-2); border-color: #b8c0cd; color: var(--text); }
.ac-btn:active { transform: translateY(1px); }
.ac-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(59, 110, 245, .22); }
.ac-btn[disabled], .ac-btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.ac-btn.primary {
    background: linear-gradient(180deg, var(--brand-500), var(--brand-600));
    border-color: var(--brand-600); color: #fff;
    box-shadow: 0 1px 2px rgba(43, 92, 224, .32), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.ac-btn.primary:hover {
    background: linear-gradient(180deg, #4a7bf7, #2f5fdf);
    border-color: var(--brand-700); color: #fff;
    box-shadow: 0 3px 8px -2px rgba(43, 92, 224, .44), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.ac-btn.success {
    background: linear-gradient(180deg, #12a877, var(--ok));
    border-color: var(--ok); color: #fff;
    box-shadow: 0 1px 2px rgba(15, 155, 108, .3), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.ac-btn.success:hover { filter: brightness(1.05); color: #fff; }
.ac-btn.danger {
    background: linear-gradient(180deg, #e2473b, var(--danger));
    border-color: var(--danger); color: #fff;
    box-shadow: 0 1px 2px rgba(217, 45, 32, .3), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.ac-btn.danger:hover { filter: brightness(1.05); color: #fff; }
.ac-btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.ac-btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.ac-btn.sm { height: 29px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.ac-btn.xs { height: 25px; padding: 0 9px; font-size: 12px; border-radius: 6px; }
.ac-btn.block { width: 100%; }
.ac-btn.lg { height: 44px; font-size: 14px; border-radius: var(--r); }

.ac-btn-group { display: inline-flex; }
.ac-btn-group .ac-btn { border-radius: 0; margin-left: -1px; }
.ac-btn-group .ac-btn:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); margin-left: 0; }
.ac-btn-group .ac-btn:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }

/* ==========================================================================
   表单
   ========================================================================== */
.ac-field { margin-bottom: 15px; }
.ac-field > label {
    display: block; font-size: 12.5px; font-weight: 500;
    color: var(--text-2); margin-bottom: 6px;
}
.ac-field > label .req { color: var(--danger); margin-left: 2px; }
.ac-field .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.55; }

.ac-input, .ac-select, .ac-textarea {
    width: 100%; height: 36px; padding: 0 12px;
    border: 1px solid var(--line-2); border-radius: var(--r-sm);
    background: var(--surface); color: var(--text); font-size: 13px;
    font-family: inherit; transition: border-color .14s, box-shadow .14s; outline: none;
}
.ac-input:hover, .ac-select:hover, .ac-textarea:hover { border-color: #b8c0cd; }
.ac-textarea { height: auto; padding: 9px 12px; line-height: 1.6; resize: vertical; min-height: 80px; }
.ac-input:focus, .ac-select:focus, .ac-textarea:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3.5px rgba(59, 110, 245, .13);
}
.ac-input::placeholder, .ac-textarea::placeholder { color: var(--muted); }
.ac-select {
    appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px;
}
.ac-input.sm, .ac-select.sm { height: 32px; font-size: 12.5px; }

.ac-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; user-select: none; }
.ac-check input { width: 15px; height: 15px; accent-color: var(--brand-600); cursor: pointer; }

.ac-row { display: flex; gap: 12px; }
.ac-row > * { flex: 1; min-width: 0; }
.ac-row.wrap { flex-wrap: wrap; }
.ac-col-2 { flex: 2; }

.ac-toolbar {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    padding: 13px 20px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.ac-toolbar .grow { flex: 1; }

/* ==========================================================================
   标签 / 徽章
   ========================================================================== */
.ac-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 7px; font-size: 11.5px; font-weight: 600;
    line-height: 17px; white-space: nowrap; border: 1px solid transparent;
}
.ac-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: 0 0 5px; }
.ac-badge.plain::before { display: none; }
.ac-badge.ok      { background: var(--ok-soft);     color: #0a7a55; border-color: var(--ok-line); }
.ac-badge.doing   { background: var(--brand-soft);  color: var(--brand-700); border-color: var(--brand-200); }
.ac-badge.pending { background: var(--surface-3);   color: var(--text-3); border-color: var(--line); }
.ac-badge.danger  { background: var(--danger-soft); color: #b42318; border-color: var(--danger-line); }
.ac-badge.warn    { background: var(--warn-soft);   color: #a35f05; border-color: var(--warn-line); }
.ac-badge.info    { background: var(--info-soft);   color: #086d8f; border-color: var(--info-line); }
.ac-badge.violet  { background: var(--violet-soft); color: #5b3fd8; border-color: var(--violet-line); }

.ac-chip {
    display: inline-block; padding: 2px 8px; border-radius: 6px;
    background: var(--surface-3); border: 1px solid var(--line);
    font-size: 11.5px; color: var(--text-3);
}

/* ==========================================================================
   表格
   ========================================================================== */
.ac-table-wrap { overflow-x: auto; }
.ac-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ac-table th {
    text-align: left; font-weight: 600; color: var(--text-3); font-size: 11.5px;
    padding: 10px 16px; background: var(--surface-2);
    border-bottom: 1px solid var(--line); white-space: nowrap;
    letter-spacing: .02em;
}
.ac-table td { padding: 12px 16px; border-bottom: 1px solid #f1f3f7; vertical-align: middle; color: var(--text-2); }
.ac-table tbody tr { transition: background .12s; }
.ac-table tbody tr:hover { background: #f8fafd; }
.ac-table tbody tr:last-child td { border-bottom: none; }
.ac-table .num { font-variant-numeric: tabular-nums; }
.ac-table .actions { display: flex; gap: 6px; }
.ac-table .title-cell { font-weight: 500; color: var(--text); }
.ac-table tr.row-overdue { background: #fffbfa; }
.ac-table tr.row-overdue:hover { background: #fff5f3; }
.ac-table tr.row-overdue td.title-cell { color: #b42318; }
.ac-table tr.row-done td.title-cell { color: var(--text-3); }

/* 表格内的行内操作按钮：默认浅底描边，hover 才实心，避免整列色块过重 */
.ac-table .ac-btn.success {
    background: var(--surface); border-color: var(--ok-line); color: #0a7a55;
    box-shadow: none; font-weight: 600;
}
.ac-table .ac-btn.success:hover { background: var(--ok); border-color: var(--ok); color: #fff; }
.ac-table .ac-btn.danger {
    background: var(--surface); border-color: var(--danger-line); color: #b42318;
    box-shadow: none; font-weight: 600;
}
.ac-table .ac-btn.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.ac-table .ac-btn.ghost.xs { color: var(--text-3); }
.ac-table .ac-btn.ghost.xs:hover { color: var(--text); }

/* 空状态 */
.ac-empty { text-align: center; padding: 52px 20px; color: var(--muted); }
.ac-empty svg { margin-bottom: 14px; opacity: .45; }
.ac-empty p { font-size: 13px; }
.ac-empty .ac-btn { margin-top: 16px; }

/* ==========================================================================
   标签页
   ========================================================================== */
.ac-tabs {
    display: flex; gap: 4px; border-bottom: 1px solid var(--line);
    padding: 0 20px; background: var(--surface);
}
.ac-tab {
    padding: 12px 14px; font-size: 13px; font-weight: 500; color: var(--text-3);
    border-bottom: 2px solid transparent; cursor: pointer; transition: color .14s, border-color .14s;
    display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
    margin-bottom: -1px;
}
.ac-tab:hover { color: var(--text); }
.ac-tab.active { color: var(--brand-600); border-bottom-color: var(--brand-500); font-weight: 600; }
.ac-tab .cnt {
    background: var(--surface-3); color: var(--text-3); border-radius: 9px;
    font-size: 11px; padding: 0 6px; line-height: 17px; font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.ac-tab.active .cnt { background: var(--brand-soft); color: var(--brand-600); }
.ac-tab .cnt.alert { background: var(--danger-soft); color: #b42318; }

/* ==========================================================================
   弹窗
   ========================================================================== */
.ac-modal-mask {
    position: fixed; inset: 0; background: rgba(16, 24, 40, .48);
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    z-index: 100; display: none;
    align-items: flex-start; justify-content: center; padding: 64px 20px;
    overflow-y: auto;
}
.ac-modal-mask.open { display: flex; }
.ac-modal {
    background: var(--surface); border-radius: var(--r-lg); width: 100%;
    max-width: 620px; box-shadow: var(--sh-lg); animation: ac-pop .2s cubic-bezier(.16, 1, .3, 1);
}
.ac-modal.wide { max-width: 880px; }
.ac-modal.narrow { max-width: 440px; }
@keyframes ac-pop { from { opacity: 0; transform: translateY(-10px) scale(.985); } to { opacity: 1; transform: none; } }
.ac-modal-head {
    padding: 18px 22px; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 10px;
}
.ac-modal-head h3 { font-size: 15px; font-weight: 600; letter-spacing: -.1px; }
.ac-modal-head .ac-close {
    margin-left: auto; background: none; border: none; cursor: pointer;
    color: var(--muted); padding: 5px; border-radius: 7px; line-height: 0;
    transition: background .14s, color .14s;
}
.ac-modal-head .ac-close:hover { background: var(--surface-3); color: var(--text); }
.ac-modal-body { padding: 22px; max-height: 66vh; overflow-y: auto; }
.ac-modal-foot {
    padding: 16px 22px; border-top: 1px solid var(--line);
    display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2);
}

/* ==========================================================================
   提示条
   ========================================================================== */
.ac-alert {
    display: flex; gap: 10px; padding: 12px 15px; border-radius: var(--r);
    font-size: 13px; margin-bottom: 18px; line-height: 1.6; border: 1px solid transparent;
}
.ac-alert.ok   { background: var(--ok-soft);     border-color: var(--ok-line);     color: #0a7a55; }
.ac-alert.err  { background: var(--danger-soft); border-color: var(--danger-line); color: #b42318; }
.ac-alert.warn { background: var(--warn-soft);   border-color: var(--warn-line);   color: #a35f05; }
.ac-alert.info { background: var(--brand-soft);  border-color: var(--brand-200);  color: var(--brand-700); }
.ac-alert svg { flex: 0 0 16px; margin-top: 2px; }

/* Toast */
#ac-toast-area { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 9px; }
.ac-toast {
    background: var(--surface); border: 1px solid var(--line);
    border-left: 3px solid var(--brand-500); border-radius: var(--r);
    box-shadow: var(--sh-md); padding: 12px 16px; font-size: 13px;
    min-width: 230px; max-width: 380px; animation: ac-slide .22s cubic-bezier(.16, 1, .3, 1);
    color: var(--text);
}
.ac-toast.ok { border-left-color: var(--ok); }
.ac-toast.err { border-left-color: var(--danger); }
@keyframes ac-slide { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   图表（自研轻量 SVG）
   ========================================================================== */
.ac-chart { width: 100%; display: block; overflow: visible; }
.ac-chart-legend {
    display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px;
    color: var(--text-3); margin-top: 12px;
}
.ac-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ac-chart-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

.ac-bars { display: flex; flex-direction: column; gap: 12px; }
.ac-bar-row { display: flex; align-items: center; gap: 11px; font-size: 12.5px; }
.ac-bar-row .lb { flex: 0 0 94px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-bar-row .track { flex: 1; height: 8px; background: var(--surface-3); border-radius: 5px; overflow: hidden; }
.ac-bar-row .fill { height: 100%; border-radius: 5px; background: var(--brand-500); transition: width .5s cubic-bezier(.4, 0, .2, 1); }
.ac-bar-row .vl {
    flex: 0 0 60px; text-align: right; font-variant-numeric: tabular-nums;
    color: var(--text); font-weight: 600;
}

.ac-progress { height: 6px; background: var(--surface-3); border-radius: 4px; overflow: hidden; width: 100%; }
.ac-progress > i { display: block; height: 100%; background: var(--brand-500); border-radius: 4px; }

/* ==========================================================================
   看板网格
   ========================================================================== */
.ac-grid { display: grid; gap: 18px; }
/* min-width:0 是关键：否则内部的代码块 / 长 URL 会把栅格列撑破 */
.ac-grid > * { min-width: 0; }
.ac-grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ac-grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ac-grid.c2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* ==========================================================================
   登录页
   ========================================================================== */
.ac-login {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 24px; position: relative; overflow: hidden;
    background: linear-gradient(150deg, #101828 0%, #0d1424 45%, #131c31 100%);
}
.ac-login::before {
    content: ''; position: absolute; width: 900px; height: 900px; border-radius: 50%;
    top: -420px; left: 50%; transform: translateX(-50%);
    background: radial-gradient(circle, rgba(59, 110, 245, .30) 0%, transparent 62%);
    pointer-events: none;
}
.ac-login::after {
    content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 78%);
    -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 78%);
}
.ac-login-box { width: 100%; max-width: 404px; position: relative; z-index: 1; }
.ac-login-card {
    background: rgba(255, 255, 255, .985);
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: var(--r-xl); box-shadow: 0 32px 64px -16px rgba(0, 0, 0, .5);
    padding: 34px 30px;
}
.ac-login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.ac-login-brand .ac-brand-logo { width: 42px; height: 42px; flex: 0 0 42px; font-size: 18px; border-radius: 12px; }
.ac-login-brand h1 { font-size: 19px; font-weight: 700; letter-spacing: -.4px; }
.ac-login-brand p { font-size: 12px; color: var(--text-3); }
.ac-login-foot { text-align: center; font-size: 12px; color: rgba(255, 255, 255, .42); margin-top: 18px; }

/* ==========================================================================
   代码块 / 接口文档
   ========================================================================== */
.ac-code {
    background: #0d1424; color: #d7dee9; border-radius: var(--r);
    padding: 14px 16px; font-size: 12.5px; line-height: 1.75;
    overflow-x: auto; position: relative; white-space: pre;
    border: 1px solid #1d273d;
}
.ac-code .k { color: #7cb2ff; }
.ac-code .s { color: #7ee0b0; }
.ac-code .c { color: #5a6784; }
.ac-code-lang {
    position: absolute; top: 9px; right: 13px; font-size: 10.5px;
    color: #5a6784; text-transform: uppercase; letter-spacing: .08em;
}

.ac-ep {
    border: 1px solid var(--line); border-radius: var(--r);
    padding: 13px 15px; margin-bottom: 10px; background: var(--surface);
    transition: border-color .14s, box-shadow .14s;
}
.ac-ep:hover { border-color: var(--line-2); box-shadow: var(--sh-xs); }
.ac-ep-head { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; flex-wrap: wrap; }
.ac-method {
    font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px;
    letter-spacing: .04em; font-family: var(--font-mono);
}
.ac-method.get  { background: var(--brand-soft);  color: var(--brand-700); }
.ac-method.post { background: var(--ok-soft);     color: #0a7a55; }
.ac-method.put  { background: var(--warn-soft);   color: #a35f05; }
.ac-method.del  { background: var(--danger-soft); color: #b42318; }
.ac-ep-path { font-family: var(--font-mono); font-size: 12.5px; color: var(--text); font-weight: 500; }
.ac-ep-desc { font-size: 12.5px; color: var(--text-3); }

/* ==========================================================================
   信息上报（事件流）
   ========================================================================== */
.ac-card-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 11px 18px; border-top: 1px solid var(--line); flex-wrap: wrap;
}

/* 分页导航 */
.ac-pager { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ac-pager-btn {
    min-width: 30px; height: 30px; padding: 0 9px; border-radius: var(--r-xs);
    border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
    font-size: 12.5px; display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none; transition: .12s; font-variant-numeric: tabular-nums;
}
.ac-pager-btn:hover { border-color: var(--brand-200); color: var(--brand-700); background: var(--brand-50); }
.ac-pager-btn.active { background: var(--brand-600); border-color: var(--brand-600); color: #fff; font-weight: 600; }
.ac-pager-btn.disabled { color: var(--muted); background: var(--surface-3); cursor: not-allowed; }
.ac-pager-gap { color: var(--muted); padding: 0 2px; }

/* 上报表格：首列按级别着色 */
.ac-table tr.ev-row td:first-child { position: relative; }
.ac-table tr.ev-row td:first-child::before {
    content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--line-2);
}
.ac-table tr.ev-row.lv-success td:first-child::before { background: var(--ok); }
.ac-table tr.ev-row.lv-info    td:first-child::before { background: var(--brand-500); }
.ac-table tr.ev-row.lv-warn    td:first-child::before { background: var(--warn); }
.ac-table tr.ev-row.lv-error   td:first-child::before { background: var(--danger); }

/* 动态列表（看板组件） */
.ac-ev-list { display: flex; flex-direction: column; }
.ac-ev-item {
    display: flex; align-items: flex-start; gap: 10px; padding: 11px 18px;
    border-bottom: 1px solid #f1f3f7; transition: background .12s;
}
.ac-ev-item:last-child { border-bottom: none; }
.ac-ev-item:hover { background: #f8fafd; }
.ac-ev-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: 0 0 8px; background: var(--muted); }
.ac-ev-dot.ok      { background: var(--ok); }
.ac-ev-dot.info    { background: var(--brand-500); }
.ac-ev-dot.warn    { background: var(--warn); }
.ac-ev-dot.danger  { background: var(--danger); }
.ac-ev-dot.pending { background: var(--muted); }
.ac-ev-main { flex: 1; min-width: 0; }
.ac-ev-title { font-size: 13px; color: var(--text); font-weight: 500; margin-bottom: 4px; }
.ac-ev-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; }

/* 占比迷你条（统计表内） */
.ac-mini-bar {
    height: 4px; border-radius: 2px; background: var(--surface-3);
    overflow: hidden; margin-bottom: 4px; min-width: 60px;
}
.ac-mini-bar i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--brand-500), #6f9bff); }

/* 排行榜 */
.ac-rank-list { padding: 4px 0; }
.ac-rank { display: flex; align-items: center; gap: 10px; padding: 8px 18px; }
.ac-rank-no {
    width: 20px; height: 20px; flex: 0 0 20px; border-radius: 6px; background: var(--surface-3);
    color: var(--text-3); font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.ac-rank-no.top { background: var(--brand-soft); color: var(--brand-700); }
.ac-rank-main { flex: 1; min-width: 0; }
.ac-rank-bar { height: 4px; border-radius: 2px; background: var(--surface-3); margin-top: 5px; overflow: hidden; }
.ac-rank-bar i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--brand-500), #6f9bff); }

/* ==========================================================================
   工具类
   ========================================================================== */
.mt0 { margin-top: 0 !important; } .mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb0 { margin-bottom: 0 !important; } .mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.mb16 { margin-bottom: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.flex-center { display: flex; align-items: center; gap: 8px; }
.gap6 { gap: 6px; } .gap10 { gap: 10px; } .gap16 { gap: 16px; }
.hide { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-danger { color: var(--danger); }
.text-success { color: var(--ok); }
.text-primary { color: var(--brand-600); }

/* ==========================================================================
   小程序用户统计
   ========================================================================== */
.ac-app-grid {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(318px, 1fr));
}
.ac-app {
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
    padding: 15px 16px 13px; display: flex; flex-direction: column; gap: 9px;
    position: relative; overflow: hidden;
    transition: box-shadow .18s, transform .18s, border-color .18s;
}
.ac-app::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--brand-500); opacity: .85;
}
.ac-app:hover { box-shadow: var(--sh); transform: translateY(-1px); border-color: var(--line-2); }
.ac-app.off { opacity: .62; }
.ac-app.off::before { background: var(--muted); }
.ac-app.err::before { background: var(--danger); }

.ac-app-head { display: flex; align-items: flex-start; gap: 8px; }
.ac-app-name { font-size: 14.5px; font-weight: 650; color: var(--text); line-height: 1.35; }
.ac-app-sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.ac-app-num { display: flex; align-items: baseline; gap: 7px; }
.ac-app-num b {
    font-size: 28px; font-weight: 700; letter-spacing: -.6px;
    font-variant-numeric: tabular-nums; color: var(--text); line-height: 1.1;
}
.ac-app-num span { font-size: 12px; color: var(--muted); }

.ac-app-spark { height: 30px; margin: -3px 0 1px; }

.ac-app-kv { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); gap: 8px; }
.ac-app-kv span:last-child { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.ac-app-api {
    font-family: var(--font-mono, ui-monospace, Menlo, Consolas, monospace);
    font-size: 11.5px; color: var(--text-3);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ac-app-foot {
    display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
    border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 1px;
}
.ac-app-foot .spacer { flex: 1; }

/* 接口地址配置行 */
.ac-app-url { font-family: var(--font-mono, ui-monospace, Menlo, Consolas, monospace); font-size: 12px; }
.ac-app-live { font-size: 12px; }

/* 规范文档页 */
.ac-spec-step {
    display: flex; gap: 12px; padding: 14px 0;
    border-bottom: 1px dashed var(--line);
}
.ac-spec-step:last-child { border-bottom: 0; }
.ac-spec-no {
    flex: 0 0 24px; height: 24px; border-radius: 50%; background: var(--brand-soft);
    color: var(--brand-700); font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.ac-spec-body { flex: 1; min-width: 0; }
.ac-spec-body h4 { font-size: 13.5px; font-weight: 650; margin: 2px 0 6px; }

/* 折叠面板 */
.ac-collapse > summary {
    cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2);
    padding: 10px 0; list-style: none; display: flex; align-items: center; gap: 8px;
}
.ac-collapse > summary::-webkit-details-marker { display: none; }
.ac-collapse > summary::before {
    content: ''; width: 0; height: 0; border-left: 5px solid var(--muted);
    border-top: 4px solid transparent; border-bottom: 4px solid transparent;
    transition: transform .15s;
}
.ac-collapse[open] > summary::before { transform: rotate(90deg); }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1180px) {
    .ac-grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ac-grid.c2-1 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .ac-sidebar { transform: translateX(-100%); box-shadow: var(--sh-lg); }
    .ac-sidebar.open { transform: none; }
    .ac-main { margin-left: 0; }
    .ac-menu-toggle { display: block; }
    .ac-grid.c2, .ac-grid.c3 { grid-template-columns: 1fr; }
    .ac-content { padding: 16px; }
    .ac-topbar { padding: 0 16px; gap: 10px; }
    .ac-modal-mask { padding: 24px 14px; }
    .ac-stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}
@media print {
    .ac-sidebar, .ac-topbar, .ac-toolbar, .ac-btn { display: none !important; }
    .ac-main { margin-left: 0; }
    .ac-card { box-shadow: none; }
    body { background: #fff; }
}
