/* ============================================================
   Chiptuning Service System 车主门户 · 样式
   与管理后台同一套设计语言，品牌色对齐桌面客户端 #185FA5
   ============================================================ */

:root {
  --bg: #f2f5f9;
  --card: #ffffff;
  --ink: #1b2433;
  --ink-2: #3d4a5c;
  --muted: #77828f;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --brand: #185fa5;
  --brand-dark: #124a84;
  --brand-soft: #eaf3fc;
  --ok: #15803d;
  --ok-bg: #e7f7ee;
  --warn: #b45309;
  --warn-bg: #fdf3e3;
  --danger: #b91c1c;
  --danger-bg: #fdecec;
  --info: #1d4ed8;
  --info-bg: #e8f0ff;
  --purple: #6d28d9;
  --purple-bg: #f1eafe;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .18);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.55 -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- 登录（复刻桌面客户端布局） ---------------- */
.login {
  min-height: 100%;
  display: flex; flex-direction: column;
  background: #fff;
}
/* ① 顶部通知栏 */
.top-notice {
  flex: none;
  background: #eaf3fb; border-bottom: 1px solid #c3d9ec;
  padding: 10px 18px;
  display: flex; justify-content: center;
}
.top-notice-inner {
  display: flex; align-items: flex-start; gap: 12px;
  max-width: 820px; width: 100%;
}
.notice-ico {
  flex: none; width: 26px; height: 26px; margin-top: 1px;
  border: 2px solid #b45309; border-radius: 50%;
  color: #b45309; font-weight: 700; font-size: 17px; line-height: 20px;
  display: flex; align-items: center; justify-content: center;
}
.notice-txt {
  color: #1f2937; font-size: 14px; line-height: 1.55;
  max-width: 700px; white-space: pre-wrap;
}
/* ② 主体：左开放时间 + 右登录卡片 */
.login-main {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  gap: 110px; flex-wrap: wrap;
  padding: 40px 24px;
}
/* 左：开放时间表 */
.hours-panel { width: 320px; }
.hours-title { font-size: 18px; font-weight: 700; color: #111827; }
.hours { margin-top: 12px; }
.hrow {
  display: flex; justify-content: space-between;
  font-size: 13px; padding: 5px 0; color: #9aa3ad;
}
.hrow.today { color: #111827; font-weight: 700; }
.hrow .closed-txt { font-style: italic; }
.nl-label { font-size: 12.5px; color: #374151; margin: 20px 0 8px; }
.nl-clock { display: flex; align-items: center; }
.clk-cell {
  width: 34px; height: 38px;
  background: #fff; border: 1px solid #d1d5db; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 600; color: #111827;
}
.clk-sep { font-size: 17px; font-weight: 700; margin: 0 4px; color: #111827; }
.open-badge {
  display: inline-block; margin-top: 14px;
  font-size: 12.5px; padding: 5px 12px; border-radius: 4px;
  border: 1px solid transparent; color: #1f2937;
}
.open-badge.open   { background: #e7f5e9; border-color: #a8d5b5; }
.open-badge.closed { background: #fbe9e7; border-color: #e7b2aa; }
/* 右：登录卡片 */
.login-card {
  width: 360px; max-width: 100%;
  background: #fff; border: 1px solid #e3e6ea;
  border-radius: 10px; padding: 26px 26px 18px;
}
.card-title { font-size: 22px; font-weight: 700; text-align: center; color: #1b1f24; }
.card-sub { font-size: 11px; color: #8b949e; text-align: center; margin: 4px 0 20px; }
.a-fld { display: block; font-size: 11px; color: #666; margin-bottom: 10px; }
.a-fld input {
  display: block; width: 100%; margin-top: 3px; height: 32px;
  border: 1px solid #d0d7de; border-radius: 4px;
  padding: 0 9px; background: #fff; outline: none;
}
.a-fld input:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(24, 95, 165, .12); }
.remember-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px;
}
.remember {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #555; cursor: pointer;
}
.remember input { accent-color: var(--brand); }
.mini-link {
  background: none; border: 0; padding: 0;
  font-size: 11px; color: #7a828b; cursor: pointer;
}
.mini-link:hover { color: var(--brand); text-decoration: underline; }
.a-submit { width: 100%; height: 34px; margin-top: 14px; font-weight: 700; border-radius: 4px; }
.a-divider { height: 1px; background: #eee; margin: 16px 0 12px; }
.a-hint { font-size: 11px; color: #8b949e; text-align: center; }
.a-secondary { width: 100%; height: 32px; margin-top: 8px; border-radius: 4px; }
.a-server { display: block; margin: 8px 0 0 auto; }
.auth-err {
  background: var(--danger-bg); color: var(--danger);
  border-radius: 8px; padding: 8px 10px; font-size: 12px; margin-bottom: 10px;
  white-space: pre-wrap;
}
@media (max-width: 900px) {
  .login-main { gap: 40px; }
}
.logo {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, var(--brand), #2f7fc4);
  color: #fff; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.logo.sm { width: 26px; height: 26px; font-size: 11px; border-radius: 7px; }

.fld { display: block; margin-bottom: 12px; font-size: 12px; color: var(--ink-2); }
.fld input, .fld select {
  display: block; width: 100%; margin-top: 4px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 8px 10px; background: #fff; outline: none;
}
.fld input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(24, 95, 165, .12); }

/* ---------------- 布局 ---------------- */
.shell { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  height: 52px; flex: none;
  background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; gap: 12px;
}
.brand { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.muted-sep { color: var(--line-strong); }
.muted { color: var(--muted); font-weight: 400; font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.who { color: var(--muted); font-size: 12px; }
.credit-chip {
  background: var(--brand-soft); color: var(--brand);
  font-weight: 700; border-radius: 999px; padding: 4px 12px; font-size: 12px;
}

.notice-line {
  background: var(--warn-bg); color: var(--warn);
  border-bottom: 1px solid #f3e3bd;
  padding: 7px 18px; font-size: 12px; white-space: pre-wrap;
  max-height: 110px; overflow: auto;
}

.tabs {
  display: flex; gap: 4px; padding: 10px 18px 0;
  border-bottom: 1px solid var(--line); background: var(--card);
}
.tab {
  border: 1px solid transparent; border-bottom: 0;
  background: transparent; color: var(--muted);
  padding: 8px 18px; border-radius: 9px 9px 0 0; cursor: pointer;
  font-size: 13px;
}
.tab:hover { color: var(--ink); }
.tab.active {
  background: var(--bg); color: var(--brand); font-weight: 600;
  border-color: var(--line);
  margin-bottom: -1px;
}

.pane { flex: 1; padding: 16px 18px 24px; }

/* ---------------- 卡片 / 表格 ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.table-card { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th {
  font-size: 12px; color: var(--muted); font-weight: 600;
  background: #f8fafc; position: sticky; top: 0; white-space: nowrap;
}
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f6f9fd; }
tbody tr:last-child td { border-bottom: 0; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; }
.sub-line { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 12px; }
.count { color: var(--muted); font-size: 12px; }
.empty { padding: 40px 12px; text-align: center; color: var(--muted); font-size: 12px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.filters { display: flex; align-items: center; gap: 10px; }
select {
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fff; padding: 7px 9px; outline: none;
}
select:focus { border-color: var(--brand); }

/* ---------------- 按钮 ---------------- */
.btn {
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  border-radius: 8px; padding: 7px 14px; cursor: pointer; font-size: 13px;
}
.btn:hover { background: #f6f8fb; border-color: #b6c2d2; }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.danger { color: var(--danger); border-color: #e9c2c2; }
.btn.danger:hover { background: var(--danger-bg); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.block { width: 100%; height: 38px; }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0; font-size: 12px; }
.link:hover { text-decoration: underline; }

/* ---------------- 徽标 ---------------- */
.badge {
  display: inline-block; border-radius: 999px;
  padding: 2px 10px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge.gray  { background: #eef2f7; color: #55637a; }
.badge.blue  { background: var(--info-bg); color: var(--info); }
.badge.amber { background: var(--warn-bg); color: var(--warn); }
.badge.green { background: var(--ok-bg); color: var(--ok); }
.badge.red   { background: var(--danger-bg); color: var(--danger); }
.badge.purple{ background: var(--purple-bg); color: var(--purple); }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(15, 27, 45, .45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 16px 16px; overflow: auto;
}
.modal {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  width: 620px; max-width: 100%;
  padding: 20px 22px;
}
.modal.wide { width: 900px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.modal-head h2 { font-size: 15px; }
.modal-x { border: 0; background: none; font-size: 18px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line);
}
.modal-foot .spacer { flex: 1; }

/* 详情键值表 */
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
.file-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px dashed var(--line-strong); border-radius: 8px;
  padding: 8px 10px; margin-top: 8px; font-size: 12px;
}
.file-row .fname { flex: 1; word-break: break-all; }

/* ---------------- 向导 ---------------- */
.steps { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.step {
  display: flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 12px;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
}
.step .dot {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  background: #eef2f7; color: var(--muted);
  display: flex; align-items: center; justify-content: center; font-size: 11px;
}
.step.active { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.step.active .dot { background: var(--brand); color: #fff; }
.step.done { color: var(--ok); border-color: #cdeeda; }
.step.done .dot { background: var(--ok); color: #fff; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid2 .span2 { grid-column: span 2; }
textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 8px 10px; outline: none; resize: vertical; background: #fff;
}
textarea:focus { border-color: var(--brand); }

.opt-list { display: flex; flex-direction: column; gap: 8px; max-height: 330px; overflow: auto; }
.opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; cursor: pointer;
}
.opt:hover { border-color: var(--brand); background: var(--brand-soft); }
.opt input { accent-color: var(--brand); }
.opt .price { color: var(--brand); font-weight: 600; white-space: nowrap; }
.opt .desc { color: var(--muted); font-size: 11px; }
.opt.checked { border-color: var(--brand); background: var(--brand-soft); }

.credit-summary {
  margin-top: 12px; border: 1px solid #cfe2f5; background: var(--brand-soft);
  border-radius: 8px; padding: 9px 12px; font-size: 12px;
}
.credit-summary .row { display: flex; justify-content: space-between; padding: 2px 0; }
.credit-summary .total { font-weight: 700; color: var(--brand); border-top: 1px dashed #b7d4ee; margin-top: 4px; padding-top: 6px; }

.upload-row { display: flex; align-items: center; gap: 10px; }
.bar { flex: 1; height: 8px; background: #edf1f6; border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }
.upload-state { font-size: 11px; color: var(--muted); min-width: 60px; text-align: right; }

/* ---------------- 支持会话 ---------------- */
.support-grid {
  display: grid; grid-template-columns: 300px 1fr; gap: 14px;
  height: calc(100vh - 190px); min-height: 380px;
}
.conv-list-card { display: flex; flex-direction: column; overflow: hidden; }
.conv-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.conv-list { flex: 1; overflow: auto; }
.conv {
  padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.conv:hover { background: #f6f9fd; }
.conv.active { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.conv .t { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.conv .p { color: var(--muted); font-size: 11.5px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .time { color: var(--muted); font-size: 11px; font-weight: 400; }

.chat-card { display: flex; flex-direction: column; overflow: hidden; }
.chat-head {
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  font-weight: 600; font-size: 13px;
}
.chat-msgs { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #f8fafc; }
.msg { max-width: 76%; }
.msg .meta { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.msg .bubble {
  border-radius: 10px; padding: 8px 11px; font-size: 12.5px;
  border: 1px solid var(--line); background: #fff; white-space: pre-wrap; word-break: break-word;
}
.msg.mine { align-self: flex-end; }
.msg.mine .bubble { background: var(--brand-soft); border-color: #cfe2f5; }
.msg .att { margin-top: 5px; font-size: 12px; }
.chat-input {
  border-top: 1px solid var(--line); padding: 10px;
  display: flex; gap: 8px; align-items: flex-end;
}
.chat-input textarea { flex: 1; }
.chat-attach-name { padding: 0 12px 10px; font-size: 11px; color: var(--muted); }

/* ---------------- 用户中心 ---------------- */
.uc-grid { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
.uc-left .card + .card { margin-top: 12px; }
.uc-box { padding: 14px; }
.uc-box h3 { font-size: 13px; margin-bottom: 8px; }
.uc-box .sub { color: var(--muted); font-size: 11px; margin-bottom: 8px; }
.balance { font-size: 30px; font-weight: 700; color: var(--brand); }
.balance small { font-size: 12px; font-weight: 400; margin-left: 4px; }
.contact-row { display: flex; gap: 8px; font-size: 12px; padding: 3px 0; }
.contact-row .k { width: 66px; color: var(--muted); flex: none; }
.contact-row .v { word-break: break-all; }
/* 注册待审批 / 登录被拦时展示的客户经理联系方式卡片 */
.contact-block {
  margin-top: 12px; border: 1px solid #cfe2f5; background: var(--brand-soft);
  border-radius: 8px; padding: 10px 12px;
}
.contact-block .contact-title { font-size: 12px; font-weight: 600; color: var(--brand-dark); margin-bottom: 6px; }
.contact-block .contact-row { font-size: 12px; padding: 4px 0; }
.contact-block .contact-row .k { width: 72px; color: var(--brand-dark); opacity: .75; }
.pack-summary {
  margin: -2px 0 10px; font-size: 12px; color: var(--brand);
  background: var(--brand-soft); border: 1px solid #cfe2f5;
  border-radius: 8px; padding: 6px 10px;
}
.uc-right .card { margin-bottom: 12px; }
.tx-list { max-height: 180px; overflow: auto; }
.tx { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.tx:last-child { border-bottom: 0; }
.tx .amount.plus { color: var(--ok); font-weight: 600; }
.tx .amount.minus { color: var(--danger); font-weight: 600; }
.rc-list { max-height: 150px; overflow: auto; }
.rc { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.rc:last-child { border-bottom: 0; }

/* ---------------- 轻提示 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: #21324a; color: #fff; border-radius: 9px;
  padding: 9px 16px; font-size: 12.5px; z-index: 90;
  box-shadow: var(--shadow); max-width: 70vw; white-space: pre-wrap;
}
.toast.err { background: #7f1d1d; }

@media (max-width: 860px) {
  .support-grid { grid-template-columns: 1fr; height: auto; }
  .conv-list { max-height: 200px; }
  .chat-card { min-height: 380px; }
  .uc-grid { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .grid2 .span2 { grid-column: span 1; }
}

/* 无增项提示（对齐原站蓝色信息条） */
.notice-box {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--brand-soft, #e8f2fb);
  border: 1px solid rgba(24, 95, 165, .18);
  color: var(--brand-dark, #185fa5);
  font-size: 13px;
}
.notice-box b { display: block; font-size: 13px; margin-bottom: 4px; }
.notice-box p { margin: 0; font-size: 12px; color: var(--muted, #5b7386); }
