/* ==========================================================================
   采购工作台 · 样式表
   设计语言参照 caizhi-workbench：暖米色纸面 + 青绿主色 + 细边框卡片
   ========================================================================== */

:root {
    /* 主色（青绿） */
    --c-primary: #41897D;
    --c-primary-hover: #377869;
    --c-primary-soft: #E6EDE8;
    --c-primary-dark: #2A6E63;

    /* 语义色 */
    --c-red-bg: #FBEDEB;      --c-red-text: #C14B3F;     --c-red-border: #F0D2CD;
    --c-orange-bg: #FBF0E3;   --c-orange-text: #C2763E;  --c-orange-border: #F1D6BE;
    --c-green-bg: #EAF4EC;    --c-green-text: #3D8155;   --c-green-border: #C2DEC8;
    --c-blue-bg: #E6EDE8;     --c-blue-text: #35786C;    --c-blue-border: #CFE0D8;
    --c-gray-bg: #F1F2EF;     --c-gray-text: #5B5E58;    --c-gray-border: #E3E4DF;

    /* 中性色 */
    --c-page: #F8F7F2;
    --c-border: #E3DED0;
    --c-gray-50: #F6F4EE;
    --c-gray-100: #EFECE3;
    --c-gray-200: #E3DFD2;
    --c-gray-300: #D5D1C3;
    --c-gray-400: #A2A29B;
    --c-gray-500: #514F48;
    --c-gray-600: #3E3D37;
    --c-ink: #1b1a16;
    --c-muted: #6f7873;

    /* 侧边栏 */
    --sl-bg: #F7F8F3;
    --sl-border: #E0DECF;
    --sl-active-bg: #E8EFE9;
    --sl-hover: #EFF2EA;
    --sl-line: #43978A;
    --sl-active-text: #2A6E63;
    --sl-icon-idle: #6F7873;

    /* 阴影与焦点 */
    --sh-card: 0 1px 2px rgba(31, 29, 24, .03), 0 4px 14px rgba(31, 29, 24, .04);
    --sh-pop: 0 8px 32px rgba(31, 29, 24, .14);
    --c-focus: #41897D;
    --c-focus-ring: rgba(65, 137, 125, .14);

    --radius: 14px;
    --radius-sm: 9px;
    --sidebar-w: 232px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--c-ink);
    background: var(--c-page);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
table { border-collapse: collapse; width: 100%; }
ul { margin: 0; padding: 0; list-style: none; }
pre { margin: 0; }
code { font-family: Consolas, Monaco, "Courier New", monospace; font-size: 12.5px;
       background: var(--c-gray-100); padding: 1px 5px; border-radius: 4px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d6d6cf; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #a2a29b; }
::-webkit-scrollbar-track { background: transparent; }

input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--c-focus) !important;
    box-shadow: 0 0 0 3px var(--c-focus-ring);
}
::placeholder { color: #97968e; opacity: 1; }

/* ===================== 图标 ===================== */
.ico { width: 18px; height: 18px; flex: 0 0 auto; display: block; }
.ico-lg { width: 22px; height: 22px; flex: 0 0 auto; display: block; }
.ico-xl { width: 34px; height: 34px; flex: 0 0 auto; display: block; }

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

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

.brand {
    display: flex; align-items: center; gap: 11px;
    padding: 20px 18px 16px;
}
.brand-logo {
    width: 38px; height: 38px; border-radius: 11px;
    background: linear-gradient(135deg, #E8EFE9, #F4EFE3);
    border: 1px solid var(--c-border);
    display: flex; align-items: center; justify-content: center;
    color: var(--c-primary-dark);
    flex: 0 0 auto;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: .3px; }
.brand-sub { font-size: 11px; color: var(--c-muted); white-space: nowrap; }

.nav { flex: 1; padding: 6px 0 14px; }
.nav-group-title {
    font-size: 11px; color: var(--c-gray-400); letter-spacing: .8px;
    padding: 14px 20px 6px; font-weight: 600;
}
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 8px 16px 8px 0;
    margin: 1px 8px;
    border-radius: 11px;
    color: var(--c-gray-600);
    transition: background-color .15s, color .15s;
    position: relative;
}
.nav-item:hover { background: var(--sl-hover); }
.nav-item.is-active { background: var(--sl-active-bg); color: var(--sl-active-text); font-weight: 600; }
.nav-line {
    width: 3px; height: 18px; border-radius: 3px; flex: 0 0 auto;
    background: transparent; transition: background-color .15s;
}
.nav-item.is-active .nav-line { background: var(--sl-line); }
.nav-icon { width: 26px; display: flex; align-items: center; justify-content: center;
            color: var(--sl-icon-idle); }
.nav-item.is-active .nav-icon { color: var(--sl-active-text); }
.nav-label { font-size: 13.5px; }

.sidebar-foot { padding: 14px 18px 18px; border-top: 1px solid var(--sl-border); }
.sidebar-date { font-size: 11.5px; color: var(--c-muted); margin-bottom: 10px; }
.sidebar-user { display: flex; align-items: center; gap: 7px; font-size: 13px; margin-bottom: 8px; }
.sidebar-user-icon { color: var(--c-muted); display: flex; }
.sidebar-user-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-chip {
    font-size: 10.5px; padding: 1px 6px; border-radius: 5px;
    background: var(--c-primary-soft); color: var(--c-primary-dark); flex: 0 0 auto;
}
.sidebar-logout {
    display: flex; align-items: center; gap: 6px;
    font-size: 12.5px; color: var(--c-muted); padding: 5px 0;
}
.sidebar-logout:hover { color: var(--c-red-text); }
.sidebar-ver { font-size: 11px; color: var(--c-gray-400); margin-top: 8px; }

.main { flex: 1; min-width: 0; padding: 24px 28px 60px; }

.menu-toggle { display: none; }
.overlay { display: none; }

/* ===================== 页头 ===================== */
.page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 18px; margin-bottom: 20px; flex-wrap: wrap;
}
.page-title { font-size: 20px; letter-spacing: .2px; display: flex; align-items: center;
              gap: 9px; flex-wrap: wrap; }
.page-sub { font-size: 13px; color: var(--c-muted); margin: 5px 0 0; }
.page-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.back-link { font-size: 12.5px; color: var(--c-muted); display: inline-block; margin-bottom: 6px; }
.back-link:hover { color: var(--c-primary); }

/* ===================== 按钮 ===================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius-sm);
    border: 1px solid transparent; background: transparent;
    font-size: 13.5px; font-weight: 600; font-family: inherit;
    cursor: pointer; white-space: nowrap; transition: background-color .15s, border-color .15s, color .15s;
    line-height: 1.4;
}
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-hover); }
.btn-ghost { background: #fff; border-color: var(--c-gray-300); color: var(--c-gray-600); }
.btn-ghost:hover { background: var(--c-gray-50); border-color: var(--c-gray-400); }
.btn-danger { background: var(--c-red-text); color: #fff; }
.btn-danger:hover { background: #a83e33; }
.btn-danger-ghost { background: #fff; border-color: var(--c-red-border); color: var(--c-red-text); }
.btn-danger-ghost:hover { background: var(--c-red-bg); }
.btn-sm { padding: 6px 13px; font-size: 13px; }
.btn-mini { padding: 3px 9px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; margin-top: 20px; padding: 10px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-done { background: var(--c-green-bg); color: var(--c-green-text); border-color: var(--c-green-border); }
.btn-done:hover { background: #dcefdf; }

.btn-icon {
    width: 28px; height: 28px; border-radius: 8px; border: 1px solid transparent;
    background: transparent; color: var(--c-muted); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background-color .15s, color .15s;
}
.btn-icon:hover { background: var(--c-gray-100); color: var(--c-primary); }
.btn-icon-danger:hover { background: var(--c-red-bg); color: var(--c-red-text); }
.btn-icon .ico { width: 16px; height: 16px; }

.inline-form { display: inline; }
.row-actions { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }

/* ===================== 表单 ===================== */
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--c-gray-600);
               margin-bottom: 5px; }
.field-hint { display: block; font-size: 11.5px; color: var(--c-gray-400); margin-top: 4px; }
.req { color: var(--c-red-text); }

.input {
    width: 100%; padding: 8px 12px;
    border: 1px solid var(--c-gray-300); border-radius: var(--radius-sm);
    font-size: 13.5px; font-family: inherit; color: var(--c-ink);
    background: #fff; transition: border-color .15s, box-shadow .15s;
}
textarea.input { resize: vertical; line-height: 1.55; }
.input-sm { padding: 6px 9px; font-size: 13px; }
.num-input { text-align: right; }
select.input { appearance: none; padding-right: 30px; cursor: pointer;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f7873' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 9px center; background-size: 15px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
             gap: 16px; margin-bottom: 16px; }
.form-item { margin-bottom: 14px; min-width: 0; }
.form-item-wide { grid-column: 1 / -1; }
.form-item .input { margin-bottom: 0; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
                margin-top: 18px; padding-top: 4px; }
.form-actions-spacer { flex: 1; }
.form-actions-note { font-size: 12.5px; color: var(--c-muted); }

/* ===================== 卡片 ===================== */
.card {
    background: #fff; border: 1px solid var(--c-border);
    border-radius: var(--radius); box-shadow: var(--sh-card);
    padding: 20px; margin-bottom: 18px;
}
.card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 15px; flex-wrap: wrap;
}
.card-title { font-size: 15.5px; font-weight: 600; }
.card-sub { font-size: 12.5px; color: var(--c-muted); }
.card-link { font-size: 13px; color: var(--c-primary); font-weight: 600; }
.card-link:hover { color: var(--c-primary-hover); }
.card-link .ico { width: 15px; height: 15px; display: inline-block; vertical-align: -2px; }
.card-note { font-size: 12.5px; color: var(--c-muted); margin: -6px 0 15px; line-height: 1.7; }
.card-table { padding: 0; overflow: hidden; }
.card-table .card-head { padding: 20px 20px 0; }

/* 备注卡片（订单/合同详情页顶部） */
.card-note-box { display: flex; gap: 12px; align-items: flex-start; padding: 13px 18px; }
.note-label {
    flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--c-primary-dark);
    background: var(--c-primary-soft); padding: 2px 9px; border-radius: 6px; line-height: 1.7;
}
.note-text { flex: 1; min-width: 0; font-size: 13.5px; color: var(--c-gray-500); line-height: 1.7; }

/* 明细行内的辅助列 */
.line-row .line-no { color: var(--c-gray-400); font-size: 12.5px; text-align: center;
                     font-variant-numeric: tabular-nums; }
.line-row .line-amount { color: var(--c-gray-600); font-variant-numeric: tabular-nums; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-sidebar { grid-template-columns: 1fr 340px; }

/* ===================== 表格 ===================== */
.table { width: 100%; font-size: 13.5px; }
.table th {
    text-align: left; font-weight: 600; font-size: 12.5px; color: var(--c-gray-500);
    padding: 10px 12px; border-bottom: 1px solid var(--c-gray-200);
    background: var(--c-gray-50); white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--c-gray-100); vertical-align: middle; }
.table tbody tr:hover { background: #FCFBF7; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { padding: 11px 12px; background: var(--c-gray-50); font-weight: 600;
                  border-top: 1px solid var(--c-gray-200); }
.table-compact th, .table-compact td { padding: 8px 10px; font-size: 13px; }
.table .num, .num { text-align: right; white-space: nowrap; }
.table .strong, .strong { font-weight: 600; }
.table-scroll { overflow-x: auto; }
.table-scroll-tall { max-height: 460px; overflow-y: auto; }
.table-preview td { white-space: nowrap; font-size: 12.5px; }
.table-lines td { padding: 6px 6px; vertical-align: middle; }
.table-lines th { padding: 8px 6px; }
.table-kv th { width: 170px; background: var(--c-gray-50); font-weight: 600;
               color: var(--c-gray-500); font-size: 13px; }
.table-kv td { font-size: 13.5px; }
.row-total td { background: var(--c-gray-50); font-weight: 600; }

.card-table .table th:first-child, .card-table .table td:first-child { padding-left: 20px; }
.card-table .table th:last-child, .card-table .table td:last-child { padding-right: 20px; }

.link { color: var(--c-primary); }
.link:hover { text-decoration: underline; }
.link-strong { font-weight: 600; color: var(--c-ink); }
.link-strong:hover { color: var(--c-primary); }

/* ===================== 徽标 ===================== */
.badge {
    display: inline-flex; align-items: center;
    padding: 2px 9px; border-radius: 20px;
    font-size: 12px; font-weight: 600; white-space: nowrap;
    border: 1px solid transparent;
}
.badge-green  { background: var(--c-green-bg);  color: var(--c-green-text);  border-color: var(--c-green-border); }
.badge-orange { background: var(--c-orange-bg); color: var(--c-orange-text); border-color: var(--c-orange-border); }
.badge-red    { background: var(--c-red-bg);    color: var(--c-red-text);    border-color: var(--c-red-border); }
.badge-blue   { background: var(--c-blue-bg);   color: var(--c-blue-text);   border-color: var(--c-blue-border); }
.badge-gray   { background: var(--c-gray-bg);   color: var(--c-gray-text);   border-color: var(--c-gray-border); }

.pill {
    display: inline-block; min-width: 26px; text-align: center;
    padding: 1px 8px; border-radius: 7px; font-size: 12.5px; font-weight: 600;
}
.pill-done { background: var(--c-green-bg); color: var(--c-green-text); }
.pill-open { background: var(--c-orange-bg); color: var(--c-orange-text); }

.tag {
    display: inline-block; padding: 0 6px; border-radius: 5px;
    font-size: 11px; background: var(--c-gray-100); color: var(--c-gray-500);
    margin-left: 5px; vertical-align: 1px;
}
.tag-import { background: var(--c-blue-bg); color: var(--c-blue-text); }
.tag-risk { background: var(--c-red-bg); color: var(--c-red-text); font-weight: 600; }

.text-done { color: var(--c-green-text); }
.text-open { color: var(--c-orange-text); }
.text-risk { color: var(--c-red-text); }
.muted { color: var(--c-muted); }
.muted-sm { color: var(--c-gray-400); font-size: 12px; }
.hist-no {
    display: inline-block; font-weight: 600; color: var(--c-primary-dark);
    background: var(--c-primary-soft); padding: 0 6px; border-radius: 5px;
    font-size: 12px; margin-right: 5px;
}

/* ===================== 进度 ===================== */
.progress-wrap { display: inline-flex; align-items: center; gap: 8px; min-width: 120px; }
.progress {
    flex: 1; height: 6px; min-width: 60px; border-radius: 6px;
    background: var(--c-gray-100); overflow: hidden; display: block;
}
.progress-bar { display: block; height: 100%; border-radius: 6px; transition: width .3s; }
.progress-done { background: var(--c-primary); }
.progress-doing { background: #D9A05B; }
.progress-idle { background: var(--c-gray-300); }
.progress-text { font-size: 12px; color: var(--c-muted); font-variant-numeric: tabular-nums;
                 min-width: 34px; text-align: right; }

/* ===================== 标签页 ===================== */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 20px;
    border: 1px solid var(--c-border); background: #fff;
    font-size: 13px; color: var(--c-gray-500); transition: all .15s;
}
.tab:hover { border-color: var(--c-primary); color: var(--c-primary); }
.tab.is-active { background: var(--c-primary-soft); border-color: var(--c-blue-border);
                 color: var(--c-primary-dark); font-weight: 600; }
.tab-count {
    font-size: 11.5px; background: var(--c-gray-100); color: var(--c-gray-500);
    padding: 0 6px; border-radius: 8px; min-width: 20px; text-align: center;
}
.tab.is-active .tab-count { background: #fff; color: var(--c-primary-dark); }

.type-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.type-tab {
    display: flex; flex-direction: column; gap: 2px;
    padding: 12px 14px; border-radius: 11px;
    border: 1px solid var(--c-gray-300); background: #fff; transition: all .15s;
}
.type-tab:hover { border-color: var(--c-primary); }
.type-tab.is-active { border-color: var(--c-primary); background: var(--c-primary-soft); }
.type-label { font-size: 14px; font-weight: 600; }
.type-count { font-size: 11.5px; color: var(--c-muted); }

/* ===================== 筛选栏 ===================== */
.filter-bar {
    display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
    background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
    padding: 12px 14px; margin-bottom: 18px; box-shadow: var(--sh-card);
}
.filter-bar-block { display: block; }
.filter-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.filter-row + .filter-row { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--c-gray-200); }
.filter-label { font-size: 12.5px; color: var(--c-muted); font-weight: 600; }
.filter-search { flex: 1 1 240px; min-width: 180px; max-width: 380px; }
.filter-search-wide { flex: 1 1 320px; min-width: 220px; }
.filter-select { width: auto; min-width: 130px; flex: 0 1 auto; }
.filter-date { width: auto; min-width: 140px; flex: 0 1 auto; }
.filter-sep { color: var(--c-gray-400); }
.filter-check {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--c-gray-600); white-space: nowrap; cursor: pointer;
}
.filter-check input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--c-primary); margin: 0; }

/* ===================== 分开统计卡片 ===================== */
.split-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px; margin-bottom: 20px;
}
.split-stats-sm { margin-bottom: 18px; }
.split-card {
    background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
    padding: 18px 20px; box-shadow: var(--sh-card);
    border-left: 4px solid var(--c-gray-300);
}
.split-done { border-left-color: var(--c-primary); }
.split-open { border-left-color: #D9A05B; }
.split-rate { border-left-color: #6E8FB5; }
.split-week { border-left-color: #A88FBF; }
.split-head { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.split-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-gray-300); }
.split-done .split-dot { background: var(--c-primary); }
.split-open .split-dot { background: #D9A05B; }
.split-label { font-size: 12.5px; color: var(--c-muted); font-weight: 600; }
.split-value { font-size: 30px; font-weight: 700; line-height: 1.15; letter-spacing: -.5px;
               font-variant-numeric: tabular-nums; }
.split-done .split-value { color: var(--c-primary-dark); }
.split-open .split-value { color: var(--c-orange-text); }
.split-unit { font-size: 13px; font-weight: 500; color: var(--c-muted); margin-left: 5px; }
.split-meta { font-size: 12.5px; color: var(--c-muted); margin-top: 4px; }
.split-bar { height: 4px; border-radius: 4px; background: var(--c-gray-100);
             margin-top: 12px; overflow: hidden; }
.split-bar span { display: block; height: 100%; border-radius: 4px; background: var(--c-gray-300); }
.split-done .split-bar span { background: var(--c-primary); }
.split-open .split-bar span { background: #D9A05B; }
.split-rate .split-bar span { background: #6E8FB5; }
.split-week .split-bar span { background: #A88FBF; }

.dist-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
            font-size: 12.5px; padding: 1px 0; }

/* ===================== 统计条 ===================== */
.stat-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px; margin-bottom: 18px;
}
.stat-box {
    background: #fff; border: 1px solid var(--c-border); border-radius: 12px;
    padding: 13px 16px; box-shadow: var(--sh-card);
}
.stat-box-wide { grid-column: span 2; min-width: 200px; }
.stat-label { font-size: 12px; color: var(--c-muted); margin-bottom: 3px; }
.stat-value { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums;
              letter-spacing: -.3px; }
.stat-value.sm { font-size: 15.5px; font-weight: 600; }
.stat-value .progress-wrap { min-width: 100px; }

.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
              gap: 10px; margin-bottom: 16px; }
.mini-stat {
    display: flex; flex-direction: column; gap: 2px;
    padding: 11px 13px; border-radius: 11px;
    background: var(--c-gray-50); border: 1px solid var(--c-gray-200);
    transition: border-color .15s, background-color .15s;
}
.mini-stat:hover { border-color: var(--c-primary); background: var(--c-primary-soft); }
.mini-num { font-size: 20px; font-weight: 700; color: var(--c-primary-dark);
            font-variant-numeric: tabular-nums; }
.mini-num.is-risk { color: var(--c-red-text); }
.mini-label { font-size: 11.5px; color: var(--c-muted); }

/* ===================== 列表 ===================== */
.list-title { font-size: 12.5px; font-weight: 600; color: var(--c-gray-500);
              margin: 16px 0 7px; padding-bottom: 5px; border-bottom: 1px dashed var(--c-gray-200); }
.list-title:first-child { margin-top: 0; }
.mini-list li {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 7px 0; border-bottom: 1px solid var(--c-gray-100); font-size: 13px;
}
.mini-list li:last-child { border-bottom: 0; }
.mini-list a { display: flex; align-items: center; gap: 7px; min-width: 0; }
.mini-list a:hover .mini-name { color: var(--c-primary); }
.mini-no { font-weight: 600; color: var(--c-primary-dark); font-size: 12.5px; white-space: nowrap; }
.mini-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-extra { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; font-size: 12px; }

/* ===================== 图表 ===================== */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 210px;
         padding: 10px 0 0; overflow-x: auto; }
.chart-lg { height: 240px; }
.chart-col { flex: 1 1 0; min-width: 34px; display: flex; flex-direction: column;
             align-items: center; height: 100%; justify-content: flex-end; }
.chart-bars { display: flex; align-items: flex-end; gap: 3px; height: 180px; }
.chart-bar { width: 11px; border-radius: 3px 3px 0 0; display: block; min-height: 2px;
             transition: opacity .15s; }
.chart-bar:hover { opacity: .78; }
.chart-done { background: var(--c-primary); }
.chart-open { background: #D9A05B; }
.chart-val { font-size: 11px; color: var(--c-gray-400); margin-top: 5px; height: 15px;
             font-variant-numeric: tabular-nums; }
.chart-label { font-size: 11.5px; color: var(--c-muted); white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--c-muted); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend-done { background: var(--c-primary); }
.legend-open { background: #D9A05B; }

/* ===================== 时间线 ===================== */
.timeline { position: relative; padding-left: 4px; }
.timeline-item { display: flex; gap: 12px; padding: 9px 0; position: relative; }
.timeline-item:not(:last-child)::before {
    content: ''; position: absolute; left: 4px; top: 24px; bottom: -6px;
    width: 1px; background: var(--c-gray-200);
}
.timeline-dot {
    width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; margin-top: 7px;
    background: var(--c-gray-300); position: relative; z-index: 1;
    box-shadow: 0 0 0 3px #fff;
}
.tone-done { background: var(--c-primary); }
.tone-open { background: #D9A05B; }
.timeline-body { flex: 1; min-width: 0; }
.timeline-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 3px; }
.timeline-no { font-size: 12px; font-weight: 600; color: var(--c-primary-dark); }
.timeline-time { font-size: 11.5px; color: var(--c-gray-400); margin-left: auto; }
.timeline-status { font-size: 11.5px; color: var(--c-muted); }
.timeline-text { font-size: 13.5px; }
.timeline-meta { font-size: 11.5px; color: var(--c-gray-400); margin-top: 3px;
                 display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.timeline-detail {
    font-size: 12px; color: var(--c-gray-500); background: var(--c-gray-50);
    border: 1px solid var(--c-gray-200); border-radius: 8px;
    padding: 8px 11px; margin-top: 6px; white-space: pre-wrap; word-break: break-all;
    max-height: 160px; overflow: auto; font-family: inherit;
}

/* ===================== 上传 ===================== */
.drop-zone {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; padding: 38px 20px; cursor: pointer;
    border: 2px dashed var(--c-gray-300); border-radius: var(--radius);
    background: var(--c-gray-50); transition: all .18s; text-align: center;
}
.drop-zone:hover, .drop-zone.is-over {
    border-color: var(--c-primary); background: var(--c-primary-soft);
}
.drop-icon { color: var(--c-primary); }
.drop-title { font-size: 14.5px; font-weight: 600; }
.drop-hint { font-size: 12.5px; color: var(--c-muted); }

.map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 9px; }
.map-item {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 12px; border-radius: 10px; font-size: 13px;
    background: var(--c-gray-50); border: 1px solid var(--c-gray-200);
}
.map-item.is-ok { background: var(--c-green-bg); border-color: var(--c-green-border); }
.map-target { font-weight: 600; }
.map-arrow { color: var(--c-gray-400); }
.map-source { color: var(--c-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-item.is-ok .map-source { color: var(--c-green-text); font-weight: 600; }
.col-ok { color: var(--c-green-text); font-weight: 700; margin-left: 3px; }

.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.radio-card {
    display: block; padding: 14px 16px; border-radius: 12px; cursor: pointer;
    border: 1px solid var(--c-gray-300); background: #fff; transition: all .15s;
}
.radio-card:hover { border-color: var(--c-primary); }
.radio-card.is-checked { border-color: var(--c-primary); background: var(--c-primary-soft); }
.radio-card input[type=radio] { accent-color: var(--c-primary); margin-right: 6px; }
.radio-title { display: inline; font-size: 13.5px; font-weight: 600; }
.radio-desc { display: block; font-size: 12px; color: var(--c-muted); margin-top: 5px; line-height: 1.6; }

.howto { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.howto-item { display: flex; gap: 11px; }
.howto-num {
    width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto;
    background: var(--c-primary-soft); color: var(--c-primary-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 12.5px; font-weight: 700;
}
.howto-title { font-size: 13.5px; font-weight: 600; margin-bottom: 2px; }
.howto-text { font-size: 12.5px; color: var(--c-muted); line-height: 1.65; }

/* ===================== 数据统计网格 ===================== */
.count-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.count-item { text-align: center; padding: 13px 8px; border-radius: 11px;
              background: var(--c-gray-50); border: 1px solid var(--c-gray-200); }
.count-num { font-size: 20px; font-weight: 700; color: var(--c-primary-dark);
             font-variant-numeric: tabular-nums; }
.count-name { font-size: 12px; color: var(--c-muted); margin-top: 2px; }

.code-block {
    background: var(--c-gray-50); border: 1px solid var(--c-gray-200);
    border-radius: 10px; padding: 12px 14px; font-size: 12px;
    overflow-x: auto; white-space: pre-wrap; word-break: break-all;
    font-family: Consolas, Monaco, "Courier New", monospace; color: var(--c-gray-500);
}
.detail-pre {
    background: var(--c-gray-50); border: 1px solid var(--c-gray-200);
    border-radius: 8px; padding: 10px 12px; font-size: 12.5px;
    white-space: pre-wrap; word-break: break-all; font-family: inherit;
}

/* ===================== 提示条 ===================== */
.alert {
    padding: 12px 16px; border-radius: 11px; margin-bottom: 16px;
    font-size: 13px; line-height: 1.7; border: 1px solid transparent;
}
.alert-ok    { background: var(--c-green-bg);  color: var(--c-green-text);  border-color: var(--c-green-border); }
.alert-error { background: var(--c-red-bg);    color: var(--c-red-text);    border-color: var(--c-red-border); }
.alert-warn  { background: var(--c-orange-bg); color: var(--c-orange-text); border-color: var(--c-orange-border); }
.alert-info  { background: var(--c-blue-bg);   color: var(--c-blue-text);   border-color: var(--c-blue-border); }
.alert .link { color: inherit; text-decoration: underline; font-weight: 600; }

/* ===================== 空状态 ===================== */
.empty { text-align: center; padding: 42px 20px; }
.empty-title { font-size: 14px; color: var(--c-gray-500); font-weight: 600; }
.empty-hint { font-size: 12.5px; color: var(--c-gray-400); margin-top: 6px; }

/* ===================== 分页 ===================== */
.pager {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; padding: 14px 4px; flex-wrap: wrap;
}
.pager-info { font-size: 12.5px; color: var(--c-muted); }
.pager-links { display: flex; gap: 5px; flex-wrap: wrap; }
.pager-btn {
    min-width: 32px; padding: 5px 10px; text-align: center;
    border: 1px solid var(--c-gray-300); border-radius: 8px; background: #fff;
    font-size: 13px; color: var(--c-gray-600);
}
.pager-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.pager-btn.is-active { background: var(--c-primary); border-color: var(--c-primary);
                       color: #fff; font-weight: 600; }

/* ===================== 弹窗 ===================== */
.modal {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(31, 29, 24, .38);
    display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal[hidden] { display: none; }
.modal-card {
    background: #fff; border-radius: var(--radius); box-shadow: var(--sh-pop);
    padding: 22px; width: 100%; max-width: 460px; max-height: 84vh;
    display: flex; flex-direction: column;
}
.modal-card-wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between;
              gap: 12px; margin-bottom: 14px; }
.modal-title { font-size: 16px; }
.modal-text { font-size: 13.5px; color: var(--c-gray-500); line-height: 1.75; margin: 0 0 6px; }
.modal-body { overflow-y: auto; font-size: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ===================== 登录页 ===================== */
.auth-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 24px;
    background: linear-gradient(160deg, #F8F7F2 0%, #EFF2EA 55%, #E8EFE9 100%);
}
.auth-card {
    width: 100%; max-width: 400px; background: #fff;
    border: 1px solid var(--c-border); border-radius: 18px;
    box-shadow: 0 10px 40px rgba(31, 29, 24, .08); padding: 34px 32px 26px;
}
.auth-brand { text-align: center; margin-bottom: 26px; }
.auth-logo {
    width: 60px; height: 60px; border-radius: 17px; margin: 0 auto 14px;
    background: linear-gradient(135deg, #E8EFE9, #F4EFE3);
    border: 1px solid var(--c-border);
    display: flex; align-items: center; justify-content: center;
    color: var(--c-primary-dark);
}
.auth-title { font-size: 20px; margin-bottom: 6px; letter-spacing: .5px; }
.auth-sub { font-size: 12.5px; color: var(--c-muted); line-height: 1.6; margin: 0; }
.auth-foot {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 20px; font-size: 12px; color: var(--c-gray-400);
}
.auth-foot a { color: var(--c-primary); }
.auth-card .field-label { margin-top: 14px; }
.auth-card .alert { margin-bottom: 14px; }

/* ===================== 响应式 ===================== */
@media (max-width: 1100px) {
    .grid-2 { grid-template-columns: 1fr; }
    .grid-sidebar { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0;
        transform: translateX(-100%); transition: transform .22s ease;
        box-shadow: var(--sh-pop);
    }
    body.nav-open .sidebar { transform: translateX(0); }
    body.nav-open .overlay {
        display: block; position: fixed; inset: 0; z-index: 39;
        background: rgba(31, 29, 24, .35);
    }
    .main { padding: 16px 14px 48px; }
    .menu-toggle {
        display: inline-flex; align-items: center; gap: 6px;
        margin-bottom: 14px; padding: 7px 13px;
        border: 1px solid var(--c-gray-300); border-radius: 9px;
        background: #fff; font-size: 13px; font-family: inherit;
        color: var(--c-gray-600); cursor: pointer;
    }
    .menu-toggle .ico { width: 16px; height: 16px; }
    .page-head { flex-direction: column; align-items: stretch; }
    .page-actions { justify-content: flex-start; }
    .split-value { font-size: 26px; }
    .stat-box-wide { grid-column: span 1; }
    .filter-search, .filter-search-wide, .filter-select, .filter-date { max-width: none; width: 100%; }
    .form-actions { flex-direction: column; align-items: stretch; }
    .form-actions .btn { width: 100%; }
}

@media print {
    .sidebar, .page-actions, .filter-bar, .tabs, .pager, .menu-toggle { display: none !important; }
    .main { padding: 0; }
    .card { box-shadow: none; break-inside: avoid; }
}
