/* ============================================================
   工单系统 · 视觉规范
   主色 #1d4ed8 / 背景 #f4f7fb / 文字 #0f172a
   状态色：待处理=琥珀 · 处理中=蓝 · 已解决=绿 · 已关闭=灰 · 紧急=红
   间距基于 8px，圆角 12px，卡片浅阴影
   ============================================================ */
:root {
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-soft: #eff6ff;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --border: #e6ecf3;
  --border-strong: #d5dfea;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;
  --faint: #94a3b8;
  --amber: #f59e0b; --amber-bg: #fffbeb;
  --blue: #3b82f6;  --blue-bg: #eff6ff;
  --green: #10b981; --green-bg: #ecfdf5;
  --gray: #64748b;  --gray-bg: #f1f5f9;
  --red: #ef4444;   --red-bg: #fef2f2;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.045);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; color: var(--primary-hover); }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 26px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
p { margin: 0 0 12px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
code { background: var(--gray-bg); padding: 1px 5px; border-radius: 4px; color: #334155; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
em { color: var(--red); font-style: normal; }

/* ---------------- 通用组件 ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.card-body { padding: 22px; }
.card-head-hint { font-size: 12.5px; color: var(--faint); }
.count-pill {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  background: var(--primary-soft); color: var(--primary);
  border-radius: 20px; font-size: 12px; font-weight: 600;
}
.section-title { margin: 4px 0 16px; font-size: 15px; color: var(--text); }
.divider { height: 1px; background: var(--border); margin: 22px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
  font-family: inherit; font-size: 13.5px; font-weight: 550; line-height: 1.4;
  cursor: pointer; transition: all .16s ease; white-space: nowrap;
  background: var(--gray-bg); color: var(--text-2);
}
.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(29,78,216,.2); }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-outline { background: #fff; color: var(--text-2); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--primary); background: var(--primary-soft); }
.btn-lg { padding: 12px 24px; font-size: 14.5px; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-mini { padding: 3px 9px; font-size: 11.5px; border-radius: 6px; border-color: var(--border-strong); background: #fff; color: var(--muted); }
.btn-block { width: 100%; }
.form-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 24px; }

.badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 20px; font-size: 12px; font-weight: 600; line-height: 1.5;
  white-space: nowrap;
}
.badge-amber  { background: var(--amber-bg); color: #b45309; }
.badge-blue   { background: var(--blue-bg);  color: #1d4ed8; }
.badge-green  { background: var(--green-bg); color: #047857; }
.badge-gray   { background: var(--gray-bg);  color: #475569; }
.badge-red    { background: var(--red-bg);   color: #b91c1c; }

.alert { padding: 12px 16px; border-radius: 9px; margin-bottom: 16px; font-size: 13.5px; border: 1px solid transparent; }
.alert a { text-decoration: underline; }
.alert-error   { background: var(--red-bg);   color: #991b1b; border-color: #fecaca; }
.alert-success { background: var(--green-bg); color: #065f46; border-color: #a7f3d0; }
.alert-warning { background: var(--amber-bg); color: #92400e; border-color: #fde68a; }
.alert-info    { background: var(--blue-bg);  color: #1e40af; border-color: #bfdbfe; }

/* ---------------- 表单 ---------------- */
.form-row { margin-bottom: 18px; }
.form-row label {
  display: block; margin-bottom: 7px; font-size: 13.5px; font-weight: 600; color: var(--text-2);
}
.label-hint { font-weight: 400; color: var(--faint); font-size: 12px; margin-left: 4px; }
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=file], input:not([type]), select, textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--border-strong);
  border-radius: 8px; background: #fff; color: var(--text);
  font-family: inherit; font-size: 14px; line-height: 1.5;
  transition: border-color .16s, box-shadow .16s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}
input::placeholder, textarea::placeholder { color: #aab6c5; }
textarea { resize: vertical; min-height: 90px; }
select { appearance: none; 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='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
input[type=file] { padding: 8px; font-size: 12.5px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.inline-inputs { display: flex; gap: 10px; align-items: center; }
.inline-inputs select { flex: 1; }
.inline-form { display: flex; gap: 10px; }
.inline-form input { flex: 1; }
.char-counter { text-align: right; font-size: 11.5px; color: var(--faint); margin-top: 5px; }
.file-drop { border: 1.5px dashed var(--border-strong); border-radius: 9px; padding: 20px; text-align: center; background: #fbfdff; transition: border-color .16s, background .16s; }
.file-drop.dragover { border-color: var(--primary); background: var(--primary-soft); }
.file-drop input[type=file] { display: none; }
.file-drop-text { color: var(--muted); font-size: 13px; cursor: pointer; }
.file-drop-text:hover { color: var(--primary); }
.file-list, .file-list-inline { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.file-list:empty, .file-list-inline:empty { display: none; }
.file-chip { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; font-size: 12px; color: var(--text-2); }
.file-list-inline .file-chip { margin: 0; }

/* ---------------- 前台 ---------------- */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.site-header-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 680; font-size: 16px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 750; font-size: 16px; flex: none; }
.brand-block { justify-content: center; margin-bottom: 22px; font-size: 18px; }
.site-nav { display: flex; gap: 4px; }
.site-nav a { padding: 7px 14px; border-radius: 7px; color: var(--muted); font-size: 13.5px; font-weight: 550; }
.site-nav a:hover { background: var(--primary-soft); color: var(--primary); }
.site-nav a.active { background: var(--primary-soft); color: var(--primary); }
.front-wrap { max-width: 1100px; margin: 0 auto; padding: 32px 24px 56px; }
.front .card { max-width: 900px; margin-left: auto; margin-right: auto; }
.front .card-narrow { max-width: 560px; }
.site-footer { border-top: 1px solid var(--border); background: #fff; padding: 20px 0; color: var(--faint); font-size: 12.5px; }
.site-footer .front-wrap { padding: 0 24px; display: flex; gap: 8px; }
.site-footer .dot { color: var(--border-strong); }

.hero { max-width: 900px; margin: 0 auto 26px; }
.hero-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 600; margin-bottom: 14px; }
.hero h1 { font-size: 30px; margin-bottom: 10px; }
.hero p { color: var(--muted); font-size: 14.5px; max-width: 720px; }
.hero strong { color: var(--text); }
.steps { max-width: 900px; margin: 26px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.step { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.step span { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); align-items: center; justify-content: center; font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.step b { display: block; font-size: 13.5px; }
.step p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.page-head { max-width: 900px; margin: 0 auto 24px; }
.page-head h1 { margin-bottom: 8px; }
.page-head p { color: var(--muted); }
.page-head strong { color: var(--text); }
.tips-card { max-width: 560px; margin: 0 auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; }
.tips-card h3 { margin-bottom: 10px; }
.tips-card ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.tips-card li { margin-bottom: 7px; }

.success-banner { display: flex; gap: 16px; max-width: 1100px; margin: 0 0 20px; padding: 20px 24px; background: var(--green-bg); border: 1px solid #a7f3d0; border-radius: var(--radius); }
.success-icon { width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.success-banner h2 { color: #065f46; font-size: 18px; margin-bottom: 4px; }
.success-banner p { color: #047857; font-size: 13px; margin-bottom: 12px; }
.success-kv { display: flex; gap: 26px; flex-wrap: wrap; }
.success-kv > div { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.success-kv span { color: #047857; }
.success-kv b { font-size: 15px; color: #065f46; font-family: ui-monospace, monospace; }

/* ---------------- 工单详情 ---------------- */
.ticket-layout { display: grid; grid-template-columns: minmax(0,1fr) 290px; gap: 20px; align-items: start; }
.ticket-main > .card:last-child, .ticket-side > .card:last-child { margin-bottom: 0; }
.ticket-head { align-items: flex-start; }
.ticket-no-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.ticket-no-line .mono { font-size: 12.5px; color: var(--muted); background: var(--gray-bg); padding: 2px 8px; border-radius: 5px; }
.ticket-head h2 { font-size: 19px; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 12.5px; color: var(--muted); }
.ticket-meta b { color: var(--text-2); font-weight: 600; }
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; left: 17px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.msg { position: relative; display: flex; gap: 14px; margin-bottom: 22px; }
.msg-avatar { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; background: #e2e8f0; color: #475569; display: flex; align-items: center; justify-content: center; font-weight: 650; font-size: 14px; flex: none; }
.msg-admin .msg-avatar { background: var(--primary); color: #fff; }
.msg-box { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 13px 16px; }
.msg-admin .msg-box { background: #f8fbff; border-color: #dbeafe; }
.msg-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; flex-wrap: wrap; }
.msg-head b { font-size: 13.5px; }
.role-tag { font-size: 11px; padding: 1px 7px; border-radius: 4px; background: var(--gray-bg); color: var(--muted); }
.msg-admin .role-tag { background: var(--primary-soft); color: var(--primary); }
.msg-head time { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.msg-body { font-size: 14px; color: var(--text-2); line-height: 1.75; word-break: break-word; }
.attach-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.attach-item { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border: 1px solid var(--border); border-radius: 7px; background: #fff; font-size: 12px; color: var(--text-2); max-width: 100%; }
.attach-item:hover { border-color: var(--primary); color: var(--primary); }
.attach-icon { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 18px; padding: 0 4px; background: var(--primary-soft); color: var(--primary); border-radius: 4px; font-size: 9px; font-weight: 700; letter-spacing: .3px; }
.attach-name { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-size { color: var(--faint); font-size: 11px; }
.reply-box { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border); }
.reply-box h3 { margin-bottom: 4px; }
.reply-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.reply-file { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.reply-file input[type=file] { display: none; }
.closed-note { margin-top: 22px; padding: 14px 16px; background: var(--gray-bg); border-radius: 8px; color: var(--muted); font-size: 13px; text-align: center; }
.quick-replies { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.quick-reply { padding: 4px 10px; border: 1px solid var(--border-strong); background: #fff; color: var(--text-2); border-radius: 20px; font-family: inherit; font-size: 12px; cursor: pointer; }
.quick-reply:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.progress-list { list-style: none; margin: 0; padding: 0; }
.progress-list li { display: flex; gap: 12px; padding-bottom: 18px; position: relative; }
.progress-list li:last-child { padding-bottom: 0; }
.progress-list li:not(:last-child)::after { content: ""; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--border); }
.progress-list li.done:not(:last-child)::after { background: #a7f3d0; }
.progress-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border-strong); background: #fff; margin-top: 4px; flex: none; position: relative; z-index: 1; }
.progress-list li.done .progress-dot { border-color: var(--green); background: var(--green); }
.progress-list b { display: block; font-size: 13px; font-weight: 600; }
.progress-list small { color: var(--faint); font-size: 11.5px; }
.kv-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.kv-list > div:last-child { border-bottom: none; }
.kv-list span { color: var(--muted); flex: none; }
.kv-list b { font-weight: 600; text-align: right; word-break: break-all; }
.kv-list.compact > div { padding: 6px 0; }
.side-info .btn { margin-top: 16px; }
.detail-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.detail-top-right { display: flex; align-items: center; gap: 10px; }
.detail-top-right .mono { color: var(--muted); font-size: 13px; }
.detail-subject { font-size: 19px; margin-bottom: 12px; }
.quick-status { display: flex; gap: 8px; margin-top: 12px; }
.quick-status .btn { flex: 1; }

/* ---------------- 后台框架 ---------------- */
body.admin { background: var(--bg); }
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 228px; background: #101a30; color: #cbd5e1; display: flex; flex-direction: column; z-index: 40; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand b { display: block; color: #fff; font-size: 14.5px; line-height: 1.3; }
.sidebar-brand small { color: #7c8db0; font-size: 11.5px; }
.sidebar-nav { flex: 1; padding: 16px 10px; overflow-y: auto; }
.nav-group-label { padding: 12px 12px 6px; font-size: 10.5px; letter-spacing: .08em; color: #6b7fa5; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 8px; color: #b6c3d9; font-size: 13.5px; font-weight: 500; margin-bottom: 2px; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-icon { width: 18px; text-align: center; font-size: 15px; opacity: .9; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #334155; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 650; font-size: 13px; flex: none; }
.avatar-lg { width: 42px; height: 42px; font-size: 16px; background: var(--primary-soft); color: var(--primary); }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info b { display: block; color: #fff; font-size: 12.5px; }
.sidebar-user-info small { color: #7c8db0; font-size: 11px; }
.logout-btn { color: #8fa2c4; font-size: 18px; padding: 4px; }
.logout-btn:hover { color: #fff; }
.admin-body { margin-left: 228px; min-height: 100vh; display: flex; flex-direction: column; }
.admin-topbar { position: sticky; top: 0; z-index: 20; height: 62px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; padding: 0 26px; }
.admin-topbar h1 { font-size: 17px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-date { font-size: 12.5px; color: var(--faint); }
.menu-toggle { display: none; background: none; border: none; font-size: 20px; color: var(--text-2); cursor: pointer; padding: 4px; }
.admin-main { flex: 1; padding: 24px 26px 40px; }
.admin-footer { display: flex; justify-content: space-between; padding: 14px 26px; border-top: 1px solid var(--border); color: var(--faint); font-size: 12px; background: #fff; }

/* ---------------- 看板 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 11px; padding: 16px 18px; box-shadow: var(--shadow); border-top: 3px solid var(--border-strong); }
.stat-card.stat-amber { border-top-color: var(--amber); }
.stat-card.stat-blue  { border-top-color: var(--blue); }
.stat-card.stat-green { border-top-color: var(--green); }
.stat-card.stat-red   { border-top-color: var(--red); }
.stat-label { display: block; font-size: 12.5px; color: var(--muted); }
.stat-num { display: block; font-size: 27px; font-weight: 700; line-height: 1.35; letter-spacing: -.02em; }
.stat-num-sm { font-size: 20px; }
.stat-foot { font-size: 11.5px; color: var(--faint); }
.stat-foot em { color: var(--primary); font-style: normal; font-weight: 650; }
.panel-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.panel-grid > .card { margin-bottom: 20px; }
.legend { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.lg { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-left: 8px; }
.lg-blue { background: var(--primary); } .lg-green { background: var(--green); }
.chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 190px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; border-bottom: 1px solid var(--border); }
.bar { width: 16px; border-radius: 4px 4px 0 0; position: relative; min-height: 2px; transition: height .3s; }
.bar-new { background: var(--primary); }
.bar-resolved { background: var(--green); }
.bar span { position: absolute; top: -19px; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); }
.bar-col small { display: block; margin-top: 8px; font-size: 11px; color: var(--faint); white-space: nowrap; }
.dist-list { display: flex; flex-direction: column; gap: 13px; }
.dist-row { display: flex; align-items: center; gap: 12px; font-size: 12.5px; }
.dist-name { width: 72px; flex: none; color: var(--text-2); }
.dist-track { flex: 1; height: 9px; background: var(--gray-bg); border-radius: 10px; overflow: hidden; }
.dist-track i { display: block; height: 100%; background: var(--primary); border-radius: 10px; }
.dist-row b { width: 24px; text-align: right; }
.todo-list { display: flex; flex-direction: column; }
.todo-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px dashed var(--border); color: var(--text); }
.todo-item:last-child { border-bottom: none; }
.todo-item:hover { background: #fbfdff; }
.todo-prio { width: 3px; height: 30px; border-radius: 3px; background: var(--border-strong); flex: none; }
.prio-urgent { background: var(--red); } .prio-high { background: var(--amber); } .prio-normal { background: var(--blue); }
.todo-main { flex: 1; min-width: 0; }
.todo-main b { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-main small { color: var(--faint); font-size: 11.5px; }
.todo-time { font-size: 11.5px; color: var(--faint); flex: none; }
.status-ring-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.status-chip { display: flex; flex-direction: column; align-items: center; padding: 14px 8px; border-radius: 9px; border: 1px solid var(--border); color: var(--text); }
.status-chip:hover { border-color: var(--primary); }
.status-chip b { font-size: 22px; line-height: 1.3; }
.status-chip span { font-size: 12px; color: var(--muted); }
.chip-amber { background: var(--amber-bg); } .chip-blue { background: var(--blue-bg); }
.chip-green { background: var(--green-bg); } .chip-gray { background: var(--gray-bg); }
.quick-links { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
.empty-state { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty-icon { font-size: 26px; color: var(--faint); margin-bottom: 6px; }
.empty-state p { margin: 0 0 12px; font-size: 13px; }

/* ---------------- 列表 / 表格 ---------------- */
.filter-card { padding: 14px 18px; }
.filter-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-field { flex: 0 1 160px; }
.filter-field.filter-search { flex: 1 1 220px; }
.filter-field input, .filter-field select { padding: 8px 11px; font-size: 13px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 11px 16px; background: #f8fafc; color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; border-bottom: 1px solid var(--border); }
.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fbfdff; }
.link { font-weight: 600; }
.cell-title { font-weight: 550; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { color: var(--faint); font-size: 11.5px; margin-top: 2px; }
.pagination { display: flex; gap: 6px; padding: 14px 18px; border-top: 1px solid var(--border); justify-content: flex-end; flex-wrap: wrap; }
.page-btn { padding: 6px 11px; border: 1px solid var(--border); border-radius: 7px; color: var(--text-2); font-size: 12.5px; background: #fff; }
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.current { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn.disabled { color: var(--faint); pointer-events: none; background: var(--gray-bg); }

/* ---------------- 设置页 ---------------- */
.settings-grid { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 20px; align-items: start; }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #f8fafc; border: 1px solid var(--border); border-radius: 9px; margin-bottom: 20px; cursor: pointer; }
.switch-row input { display: none; }
.switch { width: 38px; height: 21px; border-radius: 20px; background: #cbd5e1; position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.switch-row input:checked + .switch { background: var(--primary); }
.switch-row input:checked + .switch::after { transform: translateX(17px); }
.switch-row b { display: block; font-size: 13.5px; }
.switch-row small { color: var(--muted); font-size: 12px; }
.smtp-ref > div { padding: 11px 0; border-bottom: 1px dashed var(--border); }
.smtp-ref > div:last-child { border-bottom: none; }
.smtp-ref b { display: block; font-size: 13px; }
.smtp-ref span { display: block; font-size: 12px; color: var(--primary); font-family: ui-monospace, monospace; }
.smtp-ref small { display: block; font-size: 11.5px; color: var(--faint); }
.customer-card { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.customer-card b { display: block; font-size: 14px; }
.customer-card small { color: var(--faint); font-size: 11.5px; }

/* ---------------- 登录 / 安装 ---------------- */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #eef4ff 0%, #f4f7fb 55%, #eefaf5 100%); }
.login-wrap { width: 100%; max-width: 420px; padding: 24px; }
.login-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 32px; box-shadow: 0 16px 48px rgba(15,23,42,.08); }
.login-card h1 { font-size: 21px; margin-bottom: 6px; }
.login-card .muted { margin-bottom: 22px; }
.login-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; gap: 10px; flex-wrap: wrap; }
.install-wrap { max-width: 720px; }
.install-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 32px; box-shadow: var(--shadow); }
.install-card h1 { font-size: 22px; margin-bottom: 8px; }
.install-card h3 { margin-top: 24px; margin-bottom: 12px; }
.install-card .btn { margin-right: 8px; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.check-list li { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.check-list li span { width: 17px; height: 17px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; flex: none; }
.check-list li.ok span { background: var(--green-bg); color: #047857; }
.check-list li.bad span { background: var(--red-bg); color: #b91c1c; }
.check-list li.bad { color: #b91c1c; }
.error-card { max-width: 520px; margin: 80px auto; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 36px; text-align: center; box-shadow: var(--shadow); }
.error-icon { width: 46px; height: 46px; border-radius: 50%; background: var(--red-bg); color: var(--red); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; margin: 0 auto 16px; }
.error-card h1 { font-size: 20px; margin-bottom: 10px; }
.error-msg { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .admin-body { margin-left: 0; }
  .menu-toggle { display: block; }
  .panel-grid, .settings-grid, .ticket-layout { grid-template-columns: 1fr; }
  .ticket-side { order: -1; }
  .admin-ticket-layout .ticket-side { order: 0; }
}
@media (max-width: 700px) {
  .front-wrap { padding: 22px 16px 40px; }
  .site-header-inner { padding: 0 16px; }
  .site-nav a { padding: 6px 9px; font-size: 12.5px; }
  .hero h1 { font-size: 24px; }
  .card-body { padding: 18px 16px; }
  .card-head { padding: 14px 16px; }
  .form-grid-2, .form-grid-3, .steps { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-main { padding: 18px 14px 32px; }
  .admin-topbar { padding: 0 14px; }
  .topbar-date { display: none; }
  .check-list { grid-template-columns: 1fr; }
  .filter-field, .filter-field.filter-search { flex: 1 1 100%; }
  .msg-head time { margin-left: 0; width: 100%; }
  .success-kv { flex-direction: column; gap: 6px; }
  .inline-form { flex-direction: column; }
}
