:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --border: #e2e6ec;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --radius: 10px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 0 28px; height: 58px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { font-size: 16px; font-weight: 600; color: var(--text); }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 18px; flex: 1; }
.nav a { color: var(--muted); }
.nav a:hover, .nav a.active { color: var(--primary); }
.user-bar { display: flex; align-items: center; gap: 12px; font-size: 13px; }

.container { max-width: 1320px; margin: 28px auto; padding: 0 24px; }
.narrow { max-width: 440px; }
h1 { font-size: 22px; font-weight: 600; margin: 0 0 6px; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 14px; }
.subtitle { color: var(--muted); margin: 0 0 22px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 18px;
}
.grid-2 { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%; padding: 9px 11px; margin-bottom: 14px;
  border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--text); font: inherit; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.10); }
textarea { min-height: 190px; resize: vertical; line-height: 1.7; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border: 1px solid transparent; border-radius: 8px;
  background: var(--primary); color: #fff; font: inherit; cursor: pointer;
}
button:hover, .btn:hover { background: var(--primary-dark); text-decoration: none; }
button:disabled { opacity: .55; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: #f3f4f6; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { margin: 0; width: auto; flex: 1; min-width: 140px; }
.toolbar select { flex: 0 0 auto; width: 150px; }
.toolbar .count { color: var(--muted); font-size: 13px; white-space: nowrap; }

.note-item {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 16px; margin-bottom: 10px; background: #fff;
}
.note-item h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.note-item p { margin: 0 0 10px; color: var(--muted); white-space: pre-wrap; word-break: break-word; max-height: 90px; overflow: hidden; }
.meta { font-size: 12px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; background: #fafbfc; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.tag-admin { background: #e0e7ff; color: #3730a3; }
.tag-user { background: #f1f5f9; color: #475569; }
.tag-active { background: #dcfce7; color: #15803d; }
.tag-disabled { background: #fee2e2; color: #b91c1c; }

.msg { margin: 0 0 14px; padding: 9px 12px; border-radius: 8px; display: none; font-size: 13px; }
.msg.show { display: block; }
.msg.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.msg.success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.msg.info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

.pagination { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 14px; color: var(--muted); font-size: 13px; }
.empty { text-align: center; padding: 28px; color: var(--muted); }
.hero { padding: 36px 0 8px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
@media (max-width: 760px) { .feature-grid { grid-template-columns: 1fr; } }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.feature h3 { margin: 0 0 6px; font-size: 14px; }
.feature p { margin: 0; color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); margin-top: 10px; }
code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ---- v2 工单系统 / 公告 ---- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 760px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat .label { color: var(--muted); font-size: 12px; }
.stat .value { font-size: 24px; font-weight: 600; margin-top: 4px; }
.stat .value.danger { color: var(--danger); }
.distribution { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 760px) { .distribution { grid-template-columns: 1fr; } }
.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 12px; }
.bar-row .name { width: 74px; color: var(--muted); flex: 0 0 auto; }
.bar-row .track { flex: 1; height: 8px; background: #eef1f5; border-radius: 999px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--primary); border-radius: 999px; }
.bar-row .num { width: 26px; text-align: right; color: var(--muted); flex: 0 0 auto; }

.tag-st-open { background: #dbeafe; color: #1d4ed8; }
.tag-st-processing { background: #fef3c7; color: #92400e; }
.tag-st-waiting { background: #f3e8ff; color: #6b21a8; }
.tag-st-resolved { background: #dcfce7; color: #15803d; }
.tag-st-closed { background: #f1f5f9; color: #475569; }
.tag-pr-low { background: #f1f5f9; color: #475569; }
.tag-pr-medium { background: #e0f2fe; color: #0369a1; }
.tag-pr-high { background: #ffedd5; color: #c2410c; }
.tag-pr-urgent { background: #fee2e2; color: #b91c1c; }
.tag-cat { background: #eef2ff; color: #4338ca; }

.announcement { border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 8px; padding: 14px 16px; margin-bottom: 10px; background: #fff; }
.announcement.pinned { border-left-color: var(--warning); background: #fffbeb; }
.announcement h3 { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.announcement .body { color: var(--muted); white-space: pre-wrap; word-break: break-word; }
.announcement .foot { margin-top: 8px; font-size: 12px; color: var(--muted); }
.notice-strip { border: 1px solid #bfdbfe; background: #eff6ff; color: #1e40af; border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 26vw, 360px); gap: 18px; align-items: start; }
.detail-grid > div { min-width: 0; }
@media (max-width: 980px) { .detail-grid { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 6px 10px; font-size: 13px; margin-bottom: 16px; }
.kv .k { color: var(--muted); }
.ticket-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.ticket-head h1 { margin: 0; }
.description { white-space: pre-wrap; word-break: break-word; background: #fafbfc; border: 1px solid var(--border); border-radius: 8px; padding: 14px; min-height: 90px; }
.reply { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.reply.internal { background: #fffbeb; border-color: #fde68a; }
.reply .head { font-size: 12px; color: var(--muted); display: flex; gap: 10px; margin-bottom: 6px; }
.reply .body { white-space: pre-wrap; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 14px 14px; font-size: 12px; color: var(--muted); }
.timeline li::before { content: ''; position: absolute; left: -20px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.timeline li .t { color: var(--text); }
.section-title { font-size: 14px; font-weight: 600; margin: 20px 0 10px; }
select.compact, input.compact { margin: 0; padding: 6px 9px; width: auto; }
.link-btn { background: none; border: none; color: var(--primary); padding: 0; font: inherit; cursor: pointer; }
.link-btn:hover { background: none; text-decoration: underline; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---- 排版优化：表单横向紧凑 + 表格列不折行 ---- */
button, .btn { white-space: nowrap; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { margin: 0; }
.form-row { display: grid; grid-template-columns: minmax(240px, 1fr) 150px 130px auto; gap: 12px; align-items: end; }
.form-row input, .form-row select { margin-bottom: 0; }
.form-row label { margin-bottom: 6px; }
.form-row-action button { height: 42px; width: 100%; }
.ticket-table { min-width: 720px; }
.ticket-table th, .ticket-table td { padding: 11px 12px; }
.ticket-table td a { display: inline-block; max-width: 300px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
@media (max-width: 900px) { .form-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } .form-row-action button { width: 100%; } }
.toolbar { gap: 8px; }
.toolbar select { width: 132px; }
.toolbar input[type=text] { min-width: 180px; }

/* 三步流程：卡片 + 连接箭头 */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; }
.step { position: relative; display: flex; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.step:not(:last-child)::after { content: '→'; position: absolute; right: -14px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 15px; }
.step-no { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; background: #e6f1fb; color: #185fa5; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; }
.step b { display: block; font-size: 14px; font-weight: 500; }
.step p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .step:not(:last-child)::after { content: '↓'; right: 50%; top: auto; bottom: -17px; transform: translateX(50%); }
}

/* 服务保障：向左无缝滚动，悬停暂停 */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 28px 0 12px; }
.section-head h2 { margin: 0; }
.marquee { overflow: hidden; padding: 2px 0 6px; }
.marquee-track { display: flex; width: max-content; }
.marquee-track.is-ready { animation: marquee-left 24s linear infinite; }
.marquee:hover .marquee-track, .marquee:focus-within .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; gap: 14px; padding-right: 14px; }
.marquee .feature { flex: 0 0 258px; width: 258px; }
@keyframes marquee-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .marquee-track.is-ready { animation: none; }
  .marquee { overflow-x: auto; }
  .marquee-group[aria-hidden="true"] { display: none; }
}

/* 首屏通栏：撑满容器宽度，减少局促感 */
.hero-banner { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: var(--radius); padding: 30px 36px; margin-bottom: 22px; }
.hero-banner h1 { font-size: 26px; }
.hero-banner .subtitle { font-size: 14px; margin-bottom: 20px; }
@media (max-width: 560px) { .hero-banner { padding: 22px 20px; } .hero-banner h1 { font-size: 22px; } }

/* 醒目但字号不变：胶囊徽章 + 通栏提示条，沿用站点的卡片语言 */
.time-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 15px; border-radius: 999px; background: #e6f1fb; border: 1px solid #b5d4f4; color: #0c447c; font-size: 13px; font-weight: 500; white-space: nowrap; }
.time-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #1d9e75; flex: 0 0 7px; }
.privacy-note { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: var(--radius); color: var(--text); font-size: 12px; font-weight: 500; }
.privacy-mark { flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%; background: #e6f1fb; color: #185fa5; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; font-family: Georgia, serif; }

/* 点击「查看服务保障」后的定位与高亮反馈 */
.sla-block { scroll-margin-top: 24px; border-radius: var(--radius); transition: box-shadow .35s ease, background-color .35s ease; }
.sla-block.highlight { background: rgba(230, 241, 251, .55); box-shadow: 0 0 0 4px #b5d4f4; }
@media (prefers-reduced-motion: reduce) { .sla-block { transition: none; } }

/* 操作结果浮层反馈（全站通用） */
.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; min-width: 230px; max-width: 380px; padding: 12px 15px; border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 10px; background: #fff; box-shadow: 0 8px 24px rgba(15, 23, 42, .14); color: var(--text); font-size: 13px; animation: toast-in .2s ease-out; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast-mark { flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; font-size: 12px; font-weight: 500; }
.toast.success .toast-mark { background: var(--success); }
.toast.error .toast-mark { background: var(--danger); }
.toast.leaving { opacity: 0; transform: translateY(-8px); transition: opacity .25s ease, transform .25s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }
@media (max-width: 560px) { .toast-stack { left: 12px; right: 12px; } .toast { max-width: none; } }

/* 工单详情：横向时间线，全宽放置以平衡两列高度 */
/* 时间线：单行向左无缝滚动，悬停暂停，放得下时保持静态 */
.timeline-marquee { overflow: hidden; }
.timeline-track { display: flex; width: max-content; }
.timeline-track.is-ready { animation: timeline-scroll 30s linear infinite; }
.timeline-marquee:hover .timeline-track,
.timeline-marquee:focus-within .timeline-track { animation-play-state: paused; }
.timeline-group { display: flex; gap: 12px; padding-right: 12px; flex: 0 0 auto; }
.timeline-group .tl-item { flex: 0 0 230px; width: 230px; }
@keyframes timeline-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .timeline-track.is-ready { animation: none; }
  .timeline-marquee { overflow-x: auto; }
  .timeline-group[data-clone="1"] { display: none; }
}
.tl-item { position: relative; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px 12px 17px; background: #fafbfc; font-size: 12px; }
.tl-item::before { content: ''; position: absolute; left: 0; top: 13px; width: 3px; height: 16px; border-radius: 0 2px 2px 0; background: var(--primary); }
.tl-item .t { display: block; color: var(--text); font-size: 13px; font-weight: 500; margin-bottom: 5px; }
.tl-item .d { display: block; color: var(--muted); line-height: 1.7; word-break: break-word; }
.tl-change, .tl-note { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-note { cursor: help; }
