/* ==========================================================================
   采购管理工作台 - 全局样式
   ========================================================================== */
:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff6ff;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --line: #e6ebf2;
  --line-2: #eef2f7;
  --red: #dc2626;
  --green: #16a34a;
  --amber: #d97706;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }

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

body {
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; opacity: .85; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.muted { color: var(--text-3); }
td.cell-na { color: #cbd5e1; }
.up { color: var(--red); }
.down { color: var(--green); }
.req { color: var(--red); }

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

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: #0f172a;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand-logo {
  width: 38px; height: 38px; border-radius: 10px; object-fit: cover;
  background: var(--brand); flex: 0 0 38px;
}
.brand-logo-text {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 18px;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
}
.brand-text { min-width: 0; }
.brand-name {
  color: #fff; font-weight: 700; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-sub {
  font-size: 11px; color: #64748b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nav { padding: 12px 10px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 9px;
  color: #cbd5e1; font-size: 13.5px; font-weight: 500;
  margin-bottom: 2px; transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; opacity: 1; }
.nav-item.active { background: var(--brand); color: #fff; font-weight: 600; }
.nav-sep {
  font-size: 11px; color: #64748b; padding: 14px 12px 6px;
  letter-spacing: .08em; text-transform: uppercase;
}

.sidebar-foot {
  padding: 12px 16px 18px; border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: 12px; color: #94a3b8;
}
.reg-state { display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-green { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.dot-red { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .18); }
.ver { margin-top: 6px; color: #475569; }

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

.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  position: sticky; top: 0; z-index: 30;
}
.menu-btn {
  display: none; background: none; border: 0; color: var(--text-2);
  cursor: pointer; padding: 6px; border-radius: 8px;
}
.topbar-title { font-size: 16px; font-weight: 700; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.clock { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.userbox { display: flex; align-items: center; gap: 9px; position: relative; cursor: pointer; padding: 6px 8px; border-radius: 10px; }
.userbox:hover { background: #f8fafc; }
.userbox:hover .dropdown { display: block; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.userinfo { line-height: 1.25; }
.uname { font-size: 13px; font-weight: 600; }
.urole { font-size: 11px; color: var(--text-3); }
.dropdown {
  display: none; position: absolute; right: 0; top: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); min-width: 140px; padding: 6px; z-index: 50;
}
.dropdown a { display: block; padding: 8px 12px; border-radius: 7px; color: var(--text-2); font-size: 13px; }
.dropdown a:hover { background: #f1f5f9; color: var(--text); opacity: 1; }
.dropdown a.danger { color: var(--red); }

.content { padding: 22px; flex: 1; }
.footer {
  text-align: center; padding: 16px; color: var(--text-3);
  font-size: 12px; border-top: 1px solid var(--line);
}

/* ---------- 页头 ---------- */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.page-h2 { font-size: 20px; margin-bottom: 4px; }
.page-desc { margin: 0; color: var(--text-3); font-size: 13px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.dash-actions { display: flex; align-items: center; gap: 14px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 9px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; cursor: pointer; font-family: inherit;
  background: #eef2f7; color: var(--text-2); transition: .15s; white-space: nowrap;
}
.btn:hover { opacity: .92; text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover { border-color: #cbd5e1; background: #f8fafc; }
.btn-danger { background: #fef2f2; color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }
.link { background: none; border: 0; color: var(--brand); cursor: pointer; font-size: 13px; padding: 0; font-family: inherit; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--red); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  padding: 18px; margin-bottom: 18px;
}
.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.card-head h3 { font-size: 15px; }
.card-sub { font-size: 12px; color: var(--text-3); }
.form-card { padding: 22px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; align-items: center; flex-wrap: wrap; }
.form-actions .btn { min-width: 96px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-2 .card { margin-bottom: 0; }

/* ---------- 表单 ---------- */
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="email"], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #d7dee8; border-radius: 9px;
  font-size: 13.5px; font-family: inherit; color: var(--text); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
input:disabled { background: #f8fafc; color: var(--text-3); }
input[type="color"] { padding: 3px; height: 40px; cursor: pointer; }
textarea { resize: vertical; }
.hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.hint-inline { font-weight: 400; color: var(--text-3); font-size: 11.5px; }

.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  background: #fff; padding: 12px; border-radius: var(--radius);
  border: 1px solid var(--line); margin-bottom: 16px;
}
.filter-bar input, .filter-bar select { width: auto; min-width: 130px; padding: 8px 10px; }
.filter-bar .filter-kw { min-width: 240px; flex: 1; max-width: 380px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.card > .table-wrap { border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  background: #f8fafc; color: var(--text-2); font-weight: 600; font-size: 12.5px;
  text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover { background: #fafbfe; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-compact th, .table-compact td { padding: 8px 10px; font-size: 12.5px; }
.table .col-check { width: 38px; text-align: center; }
.table .col-op { white-space: nowrap; width: 1%; }
.table .col-op .link { margin-right: 8px; }
.table .empty, .empty { text-align: center; color: var(--text-3); padding: 34px 12px; font-size: 13px; }
.ellipsis { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-overdue { background: #fff5f5 !important; }
.row-overdue:hover { background: #ffecec !important; }

.table-inline td.editable { cursor: pointer; position: relative; }
.table-inline td.editable:hover { background: var(--brand-soft); box-shadow: inset 0 0 0 1px #bfdbfe; }
td.editing { padding: 4px 6px !important; background: #fff; }
td.editing input, td.editing select { padding: 6px 8px; font-size: 13px; }

.delivery-cell { white-space: nowrap; }
.delivery-cell .cell-text { margin-right: 6px; }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.7;
}
.badge-gray { background: #f1f5f9; color: #64748b; }

.legend {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 16px; font-size: 12px;
}
.legend-title { color: var(--text-3); font-weight: 600; }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-grid-5 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi-grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi-grid-3 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px; position: relative; overflow: hidden; box-shadow: var(--shadow-sm);
}
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
.kpi-blue::before { background: #2563eb; }
.kpi-red::before { background: #dc2626; }
.kpi-amber::before { background: #d97706; }
.kpi-green::before { background: #16a34a; }
.kpi-purple::before { background: #7c3aed; }
.kpi-cyan::before { background: #0891b2; }
.kpi-indigo::before { background: #4f46e5; }
.kpi-label { font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; }
.kpi-value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-unit { font-size: 13px; color: var(--text-3); font-weight: 600; margin-left: 3px; }
.kpi-foot { font-size: 11.5px; color: var(--text-3); margin-top: 6px; }
.kpi-foot b { color: var(--text-2); }

.stat-strip {
  display: flex; gap: 28px; flex-wrap: wrap; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 18px; margin-bottom: 16px; font-size: 13px;
}
.ss-label { color: var(--text-3); margin-right: 6px; font-size: 12.5px; }
.ss-value { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.ss-unit { color: var(--text-3); margin-left: 2px; }

/* ---------- 图表 ---------- */
.chart { width: 100%; height: 300px; }

/* ---------- 提示 ---------- */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 13px; border: 1px solid transparent; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-warn { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-info { background: var(--brand-soft); color: #1e40af; border-color: #bfdbfe; }

.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #0f172a; color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 13px; box-shadow: 0 10px 30px rgba(15, 23, 42, .25);
  animation: toastIn .22s ease; max-width: 360px;
}
.toast.ok { background: #14532d; }
.toast.err { background: #7f1d1d; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab {
  padding: 10px 18px; font-size: 13.5px; font-weight: 600; color: var(--text-2);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--brand); opacity: 1; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 16px 0 4px; flex-wrap: wrap; }
.pager a {
  min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 10px; border-radius: 8px; background: #fff; border: 1px solid var(--line);
  color: var(--text-2); font-size: 13px;
}
.pager a:hover { border-color: var(--brand); color: var(--brand); opacity: 1; }
.pager a.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager-info { margin-right: auto; color: var(--text-3); font-size: 12.5px; }

/* ---------- 批量操作 ---------- */
.bulk-bar { display: flex; align-items: center; gap: 14px; padding: 12px 4px; flex-wrap: wrap; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  z-index: 100; align-items: flex-start; justify-content: center; padding: 60px 16px 30px;
  overflow-y: auto; backdrop-filter: blur(2px);
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 760px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .3); animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 16px; }
.modal-close { background: none; border: 0; font-size: 26px; line-height: 1; color: var(--text-3); cursor: pointer; padding: 0 4px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 22px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.modal-form .form-grid { grid-template-columns: repeat(2, 1fr); }

/* ---------- 开关 ---------- */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0; background: #cbd5e1;
  border-radius: 24px; transition: .2s;
}
.slider::before {
  content: ''; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:disabled + .slider { opacity: .5; cursor: not-allowed; }
.switch.big { width: 56px; height: 30px; }
.switch.big .slider::before { height: 24px; width: 24px; }
.switch.big input:checked + .slider::before { transform: translateX(26px); }
.switch-row { display: flex; align-items: flex-start; gap: 16px; padding: 14px; background: #f8fafc; border-radius: 10px; border: 1px solid var(--line); }
.switch-title { font-weight: 700; font-size: 14px; }
.switch-desc { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.switch-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; margin: 0; }
.switch-inline input { width: auto; }
.admin-only-tag { background: #eef2ff; color: #4f46e5; padding: 2px 8px; border-radius: 20px; font-weight: 600; }

/* ---------- 导入 ---------- */
.dropzone {
  border: 2px dashed #cbd5e1; border-radius: 14px; padding: 36px 20px;
  text-align: center; cursor: pointer; color: var(--text-3); transition: .18s;
  background: #fbfcfe; position: relative;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; left: -9999px; }
.dz-title { font-size: 14.5px; font-weight: 600; margin-top: 10px; color: var(--text-2); }
.dz-sub { font-size: 12px; margin-top: 4px; }
.dz-file { display: none; margin-top: 12px; font-size: 13px; color: var(--brand); font-weight: 600; }
.import-tips { margin-top: 18px; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; }
.tip-title { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.import-tips ul { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--text-2); line-height: 1.9; }

.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.map-item { display: flex; align-items: center; gap: 8px; background: #f8fafc; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; }
.map-col { flex: 1; min-width: 0; }
.map-col-name { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-col-idx { font-size: 11px; color: var(--text-3); }
.map-arrow { color: var(--text-3); flex: 0 0 14px; }
.map-item select { width: 150px; flex: 0 0 150px; padding: 6px 8px; font-size: 12.5px; }

.merge-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 20px; }
.merge-mode {
  display: flex; gap: 10px; align-items: flex-start; padding: 14px;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff;
  font-weight: 400; margin: 0;
}
.merge-mode:hover { border-color: #bfdbfe; background: var(--brand-soft); }
.merge-mode input { width: auto; margin-top: 3px; }
.mm-label { font-weight: 700; font-size: 13px; color: var(--text); }
.mm-desc { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* ---------- 重点工作 ---------- */
.task-list { display: flex; flex-direction: column; gap: 12px; }
.task-card { display: flex; gap: 18px; align-items: flex-start; padding: 16px 18px; margin-bottom: 0; }
.task-card.overdue { border-left: 3px solid var(--red); }
.task-main { flex: 1; min-width: 0; }
.task-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.task-title { font-weight: 700; font-size: 15px; }
.task-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); }
.task-meta b { color: var(--text-2); }
.task-desc { margin-top: 8px; font-size: 12.5px; color: var(--text-2); background: #f8fafc; padding: 9px 12px; border-radius: 8px; }
.progress-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.progress { flex: 1; height: 8px; background: #eef2f7; border-radius: 20px; overflow: hidden; max-width: 320px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--brand), #7c3aed); border-radius: 20px; transition: width .3s; }
.progress-num { font-size: 12.5px; font-weight: 700; color: var(--text-2); min-width: 38px; }
.progress-range { width: 130px; flex: 0 0 130px; accent-color: var(--brand); }
.task-logs { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.task-log { display: flex; gap: 10px; font-size: 12px; color: var(--text-2); padding: 3px 0; flex-wrap: wrap; }
.tl-time { color: var(--text-3); font-variant-numeric: tabular-nums; }
.tl-user { font-weight: 600; }
.tl-prog { color: var(--brand); font-weight: 600; }
.task-side { display: flex; flex-direction: column; gap: 6px; flex: 0 0 88px; }

.task-mini { display: flex; flex-direction: column; gap: 12px; }
.task-mini-item { border-bottom: 1px dashed var(--line); padding-bottom: 10px; }
.task-mini-item:last-child { border-bottom: 0; }
.tmi-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tmi-title { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmi-meta { font-size: 11.5px; color: var(--text-3); margin-top: 3px; display: flex; gap: 12px; }

/* ---------- LOGO 设置 ---------- */
.logo-preview { padding: 18px 0 22px; }
.logo-img { max-width: 180px; max-height: 100px; border-radius: 10px; border: 1px solid var(--line); padding: 8px; background: #fff; }
.logo-empty { color: var(--text-3); font-size: 13px; }

/* ---------- 登录 / 注册 ---------- */
.auth-body {
  background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 45%, #e0f2fe 100%);
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px;
}
.auth-wrap { width: 100%; max-width: 440px; }
.auth-card {
  background: #fff; border-radius: 18px; padding: 34px 32px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .12); border: 1px solid rgba(255, 255, 255, .6);
}
.auth-card-wide { max-width: 560px; }
.auth-wrap:has(.auth-card-wide) { max-width: 560px; }
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-logo { width: 60px; height: 60px; border-radius: 16px; object-fit: cover; margin-bottom: 12px; }
.auth-logo-text {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand), #7c3aed); color: #fff;
  font-size: 26px; font-weight: 800;
}
.auth-head h1 { font-size: 21px; margin-bottom: 4px; }
.auth-head p { margin: 0; color: var(--text-3); font-size: 12.5px; }
.auth-form label { margin-top: 14px; }
.auth-form label:first-of-type { margin-top: 0; }
.auth-form .btn { margin-top: 22px; }
.auth-form .form-row { margin-top: 14px; }
.auth-form .form-row label { margin-top: 0; }
.auth-foot { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-3); }
.auth-foot a { font-weight: 600; margin-left: 4px; }
.auth-copy { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 18px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .form-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .3);
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .content { padding: 16px; }
  .clock { display: none; }
}
@media (max-width: 640px) {
  .form-grid, .form-row { grid-template-columns: 1fr; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .userinfo { display: none; }
  .filter-bar .filter-kw { min-width: 100%; }
  .filter-bar input, .filter-bar select { flex: 1; min-width: 120px; }
  .task-card { flex-direction: column; }
  .task-side { flex-direction: row; flex: none; width: 100%; }
  .task-side .btn { flex: 1; }
  .modal-form .form-grid { grid-template-columns: 1fr; }
  .chart { height: 240px; }
}
