/* 巨实而研 · 共享样式(暖色浅底) */

:root {
  color-scheme: light;
  --bg: var(--bg);
  --panel: var(--panel);
  --panel-2: var(--panel-2);
  --line: var(--line);
  --line-soft: var(--line-soft);
  --text: var(--text);
  --muted: var(--muted);
  --accent: var(--accent);
  --accent-hi: #e08b3c;
  --accent-dim: var(--accent-dim);
  --accent-line: var(--accent-line);
  --amber-text: var(--amber-text);
  --ok: #5c7a2e;
  --warn: #b07d18;
  --err: #c0452f;
  --err-bg: #fdf0ec;
  --err-line: #e8b7a9;
  --code-bg: var(--code-bg);
  --code-line: #eadcc8;
  --hover: #f1e4d0;
  --radius: 12px;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  --shadow: 0 2px 10px rgba(120, 80, 40, .08);
  --shadow-lg: 0 18px 44px rgba(120, 80, 40, .18);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background:
    radial-gradient(900px 420px at 50% -14%, rgba(224, 139, 60, .12), transparent 62%),
    radial-gradient(700px 320px at 88% 6%, rgba(214, 108, 62, .07), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 14px/1.65 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(200, 106, 43, .22); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ddc9ad; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #c9ad8a; }

button {
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
button:hover:not(:disabled) { background: var(--hover); border-color: var(--accent-line); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary {
  background: linear-gradient(180deg, #f0a95f, #e08b3c);
  border-color: #c9762c;
  color: #2b1206;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(200, 106, 43, .28);
}
button.primary:hover:not(:disabled) { background: linear-gradient(180deg, #f5b673, #e8944a); }
button.danger { color: var(--err); border-color: var(--err-line); background: var(--err-bg); }
button.danger:hover:not(:disabled) { background: #fbe3dc; }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover:not(:disabled) { background: var(--hover); color: var(--text); }
button.sm { padding: 3px 8px; font-size: 12px; border-radius: 6px; }

input, textarea, select {
  font: inherit;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { border-color: #c9854a; box-shadow: 0 0 0 3px rgba(200, 106, 43, .14); }
input::placeholder, textarea::placeholder { color: #a8917a; }

.brand {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .9);
}
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.small { font-size: 12px; }
.tiny { font-size: 11.5px; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1 1 auto; }
.wrap-anywhere { word-break: break-all; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tag {
  display: inline-block;
  font: 11.5px/1 var(--mono);
  padding: 4px 7px;
  border-radius: 6px;
  border: 1px solid var(--accent-line);
  background: var(--accent-dim);
  color: var(--amber-text);
  white-space: nowrap;
}
.tag.ok { border-color: #cfdcae; background: #f6f9ec; color: var(--ok); }
.tag.warn { border-color: #e8d3a0; background: #fdf6e3; color: var(--warn); }
.tag.err { border-color: var(--err-line); background: var(--err-bg); color: var(--err); }
.tag.plain { border-color: var(--line); background: var(--panel-2); color: var(--muted); }

.alert {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
}
.alert.err { border-color: var(--err-line); background: var(--err-bg); color: #8f2f1e; }
.alert.ok { border-color: #cfdcae; background: #f6f9ec; color: #3f5a1c; }
.alert.hidden { display: none; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; }
tbody tr:hover { background: #fdf8f1; }

.modal-mask {
  position: fixed; inset: 0;
  background: rgba(60, 40, 25, .28);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; z-index: 50;
}
.modal-mask.hidden { display: none; }
.modal {
  width: min(760px, 100%);
  max-height: 82vh;
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal-body { padding: 14px 16px; overflow: auto; }
.modal-foot { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

/* 联系我们 */
.ct-row { display: flex; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.ct-row:last-child { border-bottom: none; }
.ct-row .k { flex: 0 0 62px; color: var(--muted); font-size: 12px; }
.ct-row .v { flex: 1 1 auto; word-break: break-all; }
.ct-row .v a { color: var(--accent); text-decoration: none; }
.ct-row .v a:hover { text-decoration: underline; }
.ct-qr { text-align: center; padding: 14px 0 2px; }
.ct-qr img { height: 170px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.ct-qr .tip { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

/* —— 移动端基线(所有页面共用) —— */
@media (max-width: 860px) {
  /* iOS 下输入框 <16px 会在聚焦时强制放大页面 */
  input, textarea, select { font-size: 16px; }
  button { min-height: 36px; }
  button.sm { min-height: 30px; padding: 5px 9px; }
  .modal-mask { padding: 10px; }
  .modal { width: 100% !important; max-height: 88dvh; }
  .modal-head { flex-wrap: wrap; row-gap: 6px; }
  .modal-body { padding: 12px; }
  .ct-row { gap: 8px; }
  .ct-row .k { flex: 0 0 52px; }
  .ct-qr img { height: 46vw; max-height: 220px; }
}


/* —— 主题 ——
   warm  暖阳(默认,上面 :root 即为此套)
   paper 冷白
   green 护眼绿
   navy  墨蓝(深)
   night 夜间(深)
   dusk  暖夜(深)
*/

[data-theme='paper'] {
  color-scheme: light;
  --bg: #f4f6f9; --panel: #ffffff; --panel-2: #eef2f7; --line: #d6dfe9; --line-soft: #e6edf4;
  --text: #1d2530; --muted: #5d6b7c; --accent: #2563a8; --accent-hi: #4a8fd4;
  --accent-dim: #e6f0fb; --accent-line: #b9d4ee; --amber-text: #1f5c9e;
  --ok: #2f7a4f; --warn: #a0721a; --err: #c0392b; --err-bg: #fdeeec; --err-line: #efb8b1;
  --code-bg: #f7f9fc; --code-line: #dde6f0; --hover: #e9eff6;
  --shadow: 0 2px 10px rgba(30, 60, 100, .08); --shadow-lg: 0 18px 44px rgba(30, 60, 100, .16);
}

[data-theme='green'] {
  color-scheme: light;
  --bg: #f1f6ee; --panel: #fbfdf9; --panel-2: #e8f1e2; --line: #cddcc4; --line-soft: #dfeada;
  --text: #1f2b1c; --muted: #5c6d55; --accent: #3f7a35; --accent-hi: #63a052;
  --accent-dim: #e4f1dc; --accent-line: #bad5ac; --amber-text: #356b2c;
  --ok: #3f7a35; --warn: #9a7418; --err: #b5432c; --err-bg: #fbece8; --err-line: #e5b3a7;
  --code-bg: #f3f8f0; --code-line: #d5e3cd; --hover: #e4eedd;
  --shadow: 0 2px 10px rgba(50, 80, 40, .08); --shadow-lg: 0 18px 44px rgba(50, 80, 40, .16);
}

[data-theme='navy'] {
  color-scheme: dark;
  --bg: #101826; --panel: #17212f; --panel-2: #1e2a3a; --line: #2c3a4d; --line-soft: #253244;
  --text: #e8eef7; --muted: #9fb0c6; --accent: #58a6ff; --accent-hi: #7cbcff;
  --accent-dim: #1b2a3d; --accent-line: #33506f; --amber-text: #7cc0ff;
  --ok: #5fc98a; --warn: #e0b04a; --err: #ff7b6b; --err-bg: #2a1a1c; --err-line: #5d3336;
  --code-bg: #131d2a; --code-line: #27374a; --hover: #1c2836;
  --shadow: 0 2px 12px rgba(0, 0, 0, .35); --shadow-lg: 0 20px 48px rgba(0, 0, 0, .55);
}

[data-theme='night'] {
  color-scheme: dark;
  --bg: #15161a; --panel: #1d1f24; --panel-2: #24272d; --line: #33373f; --line-soft: #2a2e35;
  --text: #e9eaee; --muted: #a0a4ad; --accent: #e08b3c; --accent-hi: #f0a861;
  --accent-dim: #2a2118; --accent-line: #4a3a28; --amber-text: #f0a861;
  --ok: #6fbf73; --warn: #e0b04a; --err: #ef6f5b; --err-bg: #2b1c1a; --err-line: #573330;
  --code-bg: #17191d; --code-line: #2c3037; --hover: #23262c;
  --shadow: 0 2px 12px rgba(0, 0, 0, .4); --shadow-lg: 0 20px 48px rgba(0, 0, 0, .6);
}

[data-theme='dusk'] {
  color-scheme: dark;
  --bg: #1c1714; --panel: #262020; --panel-2: #2f2725; --line: #43392f; --line-soft: #362e28;
  --text: #f2e9de; --muted: #b9a795; --accent: #d98a4e; --accent-hi: #f0a869;
  --accent-dim: #33271f; --accent-line: #55402f; --amber-text: #f0a869;
  --ok: #8fbf6f; --warn: #d9a94a; --err: #e87358; --err-bg: #2f1f1a; --err-line: #5a3a30;
  --code-bg: #201a17; --code-line: #3a3029; --hover: #2e2620;
  --shadow: 0 2px 12px rgba(0, 0, 0, .45); --shadow-lg: 0 20px 48px rgba(0, 0, 0, .65);
}

/* 深色主题下,把写死的浅色底改成变量,保证对比度 */
[data-theme='navy'] .quick-card:hover,
[data-theme='night'] .quick-card:hover,
[data-theme='dusk'] .quick-card:hover,
[data-theme='navy'] .try-chip,
[data-theme='night'] .try-chip,
[data-theme='dusk'] .try-chip,
[data-theme='navy'] .support-info,
[data-theme='night'] .support-info,
[data-theme='dusk'] .support-info,
[data-theme='navy'] .recharge-balance,
[data-theme='night'] .recharge-balance,
[data-theme='dusk'] .recharge-balance,
[data-theme='navy'] .cl-item.on,
[data-theme='night'] .cl-item.on,
[data-theme='dusk'] .cl-item.on,
[data-theme='navy'] .notif-item.unread,
[data-theme='night'] .notif-item.unread,
[data-theme='dusk'] .notif-item.unread,
[data-theme='navy'] .msg-actions button:hover,
[data-theme='night'] .msg-actions button:hover,
[data-theme='dusk'] .msg-actions button:hover {
  background: var(--hover);
  color: var(--text);
}

[data-theme='navy'] .empty h2,
[data-theme='night'] .empty h2,
[data-theme='dusk'] .empty h2 { color: var(--accent); text-shadow: none; }

[data-theme='navy'] .sup-msg.me .sup-bubble,
[data-theme='night'] .sup-msg.me .sup-bubble,
[data-theme='dusk'] .sup-msg.me .sup-bubble { border-color: var(--accent-line); }
