:root {
  --bg: #0b0b0e;
  --bg-2: #101014;
  --surface: rgba(20, 20, 25, 0.6);
  --surface-2: #14141a;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #f2efe8;
  --muted: #918b80;
  --accent: #38bdf8;
  --accent-2: #34d399;
  --green: #4ade80;
  --red: #f87171;
  --serif: "Segoe UI", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --display: "Segoe UI", "Noto Sans SC", system-ui, sans-serif;
  --sans: "Segoe UI", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --num: "Bahnschrift", "Segoe UI", "Microsoft YaHei", sans-serif;
}

@font-face {
  font-family: 'Noto Sans SC';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/NotoSansSC.ttf') format('truetype');
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  background: linear-gradient(180deg, #060608 0%, var(--bg) 30%, var(--bg-2) 100%);
  color: var(--text);
  font-family: var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* 后台各分页背景（mainpage / balance / transport，均为无 class 的 body） */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6,6,8,0.92) 0%, rgba(6,6,8,0.66) 34%, rgba(6,6,8,0.66) 64%, rgba(6,6,8,0.96) 100%),
    url('/bg.jpg') center / cover no-repeat;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.noise {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.5;
  background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 3px 3px; mix-blend-mode: overlay;
}
.vignette {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% -10%, transparent 40%, rgba(0,0,0,0.45) 100%);
}

/* 首屏加载 */
.intro {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 22px; background: #060608;
  transition: opacity 0.7s ease, visibility 0.7s;
}
.intro.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-mark {
  width: 60px; height: 60px; border: 1px solid var(--line-2); border-radius: 50%;
  object-fit: cover; display: block; animation: spinGlow 2.4s ease-in-out infinite;
}
@keyframes spinGlow { 0%,100% { box-shadow: 0 0 0 rgba(56,189,248,0); } 50% { box-shadow: 0 0 26px rgba(56,189,248,0.5); } }
.intro-line { width: 180px; height: 1px; background: var(--line); overflow: hidden; position: relative; }
.intro-line span {
  position: absolute; inset: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: translateX(-100%); animation: loadline 1.2s ease forwards;
}
@keyframes loadline { to { transform: translateX(0); } }
.intro-word { font-family: var(--display); letter-spacing: 0.38em; text-indent: 0.38em; font-size: 12px; color: var(--muted); text-transform: uppercase; }

/* 导航 */
.navbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px;
  padding: 14px clamp(20px, 4vw, 40px); backdrop-filter: blur(14px);
  background: rgba(6,6,8,0.65); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: 0.5px; white-space: nowrap; }
.brand-sub { font-family: var(--display); font-size: 9px; letter-spacing: 0.16em; color: var(--muted); text-transform: uppercase; white-space: pre-line; line-height: 1.4; }
.nav-links { display: flex; gap: 10px; flex: 1; }
.nav-links a {
  position: relative; color: var(--muted); font-size: 14px; padding: 8px 14px;
  border-radius: 10px; transition: color 0.25s, background 0.25s, transform 0.25s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0); transform-origin: left; transition: transform 0.28s ease;
}
.nav-links a:hover { color: var(--text); transform: translateY(-1px); background: rgba(255,255,255,0.03); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a:active { transform: translateY(0) scale(0.96); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after { transform: scaleX(1); }

.nav-right { display: flex; align-items: center; gap: 10px; }
.lang-wrap { position: relative; }
.lang-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2);
  background: transparent; color: var(--muted); display: grid; place-items: center;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.lang-btn:hover { color: var(--accent); border-color: rgba(56,189,248,0.5); transform: rotate(12deg); }
.logout-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--muted); display: grid; place-items: center; transition: color 0.2s, border-color 0.2s, transform 0.2s; }
.logout-btn:hover { color: var(--red); border-color: rgba(248,113,113,0.5); transform: scale(1.06); }
.passkey-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--muted); display: grid; place-items: center; transition: color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s; }
.passkey-btn:hover { color: var(--accent); border-color: rgba(56,189,248,0.5); transform: scale(1.06); box-shadow: 0 0 16px rgba(56,189,248,0.28); }
.passkey-btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.acct-wrap { position: relative; }
.acct-pop {
  position: absolute; top: 100%; right: 0; padding-top: 8px; z-index: 45;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}
.acct-wrap:hover .acct-pop, .acct-pop:hover { opacity: 1; visibility: visible; transform: translateY(0); }
.acct-pop-card {
  min-width: 268px; max-width: calc(100vw - 24px); background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: 14px; padding: 10px; box-shadow: 0 18px 40px rgba(0,0,0,0.5); backdrop-filter: blur(14px);
}
.acct-pop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.acct-opt {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 8px; border: 1px solid var(--line); border-radius: 10px; min-height: 76px;
  background: var(--surface); color: var(--text); font-size: 13px; text-align: center;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.acct-opt:hover { border-color: rgba(56,189,248,0.5); background: rgba(56,189,248,0.1); color: var(--text); }
.acct-opt-icon { color: var(--accent); display: block; }
.acct-opt-label { font-size: 12px; line-height: 1.3; }
.acct-opt-sub { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.perm-light { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.perm-light.admin { background: var(--green); box-shadow: 0 0 6px rgba(74,222,128,0.7); }
.perm-light.user { background: #3b82f6; box-shadow: 0 0 6px rgba(59,130,246,0.7); }
.perm-role { font-weight: 600; }
.perm-role.admin { background: linear-gradient(92deg, #ffd166, #ff6a3d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.perm-role.user { background: linear-gradient(92deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lang-menu {
  position: absolute; right: 0; top: 42px; min-width: 132px; padding: 6px;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px;
  backdrop-filter: blur(12px); box-shadow: 0 18px 40px rgba(0,0,0,0.5); z-index: 30;
}
.lang-menu button {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none;
  color: var(--muted); font-size: 13px; border-radius: 8px; transition: color 0.16s, background 0.16s;
}
.lang-menu button:hover, .lang-menu button.active { color: var(--text); background: rgba(56,189,248,0.12); }

/* 信息胶囊（30s 轮换） */
.info-pill {
  display: flex; flex-direction: row; align-items: center; gap: 10px;
  padding: 7px 16px; border: 1px solid var(--line-2); border-radius: 999px;
  background: rgba(20,20,25,0.55); min-width: 180px; max-width: 240px; overflow: hidden;
}
.pill-label { font-size: 11px; color: var(--muted); white-space: nowrap; flex-shrink: 0; letter-spacing: 0.02em; }
.pill-value {
  font-family: var(--num); font-size: 14px; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.info-pill.swap .pill-label, .info-pill.swap .pill-value { animation: pillIn 0.45s ease; }
@keyframes pillIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 信息胶囊：悬停小窗（四宫格） */
.pill-wrap { position: relative; }
.info-pop {
  position: absolute; top: 100%; right: 0; padding-top: 8px; z-index: 40;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}
.pill-wrap:hover .info-pop { opacity: 1; visibility: visible; transform: translateY(0); }
.info-pop-card {
  min-width: 320px; max-width: calc(100vw - 32px); background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: 14px; padding: 12px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.5); backdrop-filter: blur(14px);
}
.info-pop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.info-pop-cell {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; min-width: 0;
}
.info-pop-label { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; margin-bottom: 6px; }
.info-pop-value { font-family: var(--num); font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.35; font-variant-numeric: tabular-nums; }
.info-pop-value .cur { font-size: 0.72em; color: var(--muted); font-weight: 500; }
.info-pop-sub { font-size: 11px; color: var(--muted); line-height: 1.5; margin-top: 4px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* 主体 */
main { position: relative; z-index: 1; max-width: 1040px; margin: 0 auto; padding: clamp(40px, 8vw, 88px) clamp(20px,4vw,40px) 96px; }

.hero { margin-bottom: clamp(44px, 7vw, 72px); }
.eyebrow {
  font-family: var(--display); font-size: 13px; letter-spacing: 0.28em; text-indent: 0.28em;
  color: var(--accent); text-transform: uppercase; margin-bottom: 28px; text-shadow: 0 1px 12px rgba(0,0,0,0.6);
}
.eyebrow.zhtext { font-family: var(--serif); text-transform: none; letter-spacing: 0.12em; margin-bottom: 18px; }
h1 {
  font-family: var(--serif); font-weight: 700; font-size: clamp(38px, 6.5vw, 60px);
  line-height: 1.2; letter-spacing: 0.01em; margin-bottom: 22px;
}
.greet-line { display: block; }
.greet-line { text-shadow: 0 2px 18px rgba(0,0,0,0.55); }
.bless-line {
  display: block; font-weight: 500; font-size: clamp(22px, 3.6vw, 32px);
  background: linear-gradient(92deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; margin-top: 8px;
}

.section-title {
  font-family: var(--display); letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
  font-size: 12px; margin-bottom: 18px;
}

/* 卡片（天气 / 假期） */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 48px; }
.card {
  padding: 26px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
  backdrop-filter: blur(10px); transition: transform 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--line-2); }
.card-label { font-size: 12px; color: var(--muted); letter-spacing: 0.05em; }
.card-value {
  font-family: var(--num); font-size: clamp(36px, 5vw, 50px); font-weight: 700; margin: 16px 0 10px;
  font-variant-numeric: tabular-nums;
}
.card-value.accent { color: var(--accent); }
.card-value .unit { font-size: 0.5em; color: var(--muted); font-weight: 500; }
.card-meta { font-size: 14px; color: var(--text); opacity: 0.88; margin-bottom: 10px; line-height: 1.5; }
.card-note { font-size: 12px; color: var(--muted); line-height: 1.7; }

/* 左右分栏监测 */
.monitors { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.monitor {
  padding: 26px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.monitor-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.monitor-title { font-family: var(--serif); font-size: 18px; }
#kmb-title { display: flex; flex-direction: column; gap: 3px; }
#kmb-title .kmb-stop { font-family: var(--serif); font-size: 22px; font-weight: 700; }
#kmb-title .kmb-route { font-family: var(--sans); font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: 0.04em; }
.monitor-badge { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.balance-stack { display: grid; gap: 10px; }
.bal-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); }
.bal-row strong { font-family: var(--num); color: var(--text); font-size: 16px; font-weight: 600; }
.big-balance { font-family: var(--num); font-size: 44px; font-weight: 700; color: var(--text); margin-bottom: 12px; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 4px; }
.big-balance .cur { font-size: 0.5em; color: var(--muted); font-weight: 500; }
.big-balance .amount { color: var(--text); }
.muted-line { font-size: 12px; color: var(--muted); margin-top: 12px; }

.kmb-etas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kmb-col { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.kmb-col .dir { font-size: 13px; margin-bottom: 10px; }
.eta-list { display: flex; flex-direction: column; gap: 6px; }
.kmb-note { font-size: 12px; color: var(--muted); margin-top: 12px; }

/* 交通/余额 子页 hero */
.sub-hero { margin-bottom: 40px; }
.sub-hero .eyebrow { margin-bottom: 14px; }
.sub-hero h2 { font-family: var(--serif); font-size: clamp(30px,5vw,46px); font-weight: 700; line-height: 1.2; }
.sub-hero p { color: var(--muted); font-size: 15px; line-height: 1.8; margin-top: 16px; max-width: 600px; }

.locate-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px;
  border: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #160a04;
  font-size: 14px; font-weight: 600; margin-bottom: 26px; transition: transform 0.15s, box-shadow 0.2s;
}
.locate-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(56,189,248,0.3); }
.locate-note { font-size: 12px; color: var(--muted); margin-bottom: 22px; }
.transit-search { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 8px 8px 18px; margin-bottom: 10px; }
.transit-search input { flex: 1; background: transparent; border: 0; color: var(--text); padding: 8px 0; font-size: 14px; outline: none; }
.transit-search:focus-within { border-color: rgba(56,189,248,0.5); }
.search-btn { width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; border: 0; background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #160a04; display: grid; place-items: center; transition: transform 0.15s, box-shadow 0.2s; }
.search-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(56,189,248,0.45); }
.search-btn:active { transform: translateY(0) scale(0.94); }
.result-section { font-family: var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-size: 12px; margin: 20px 0 10px; }

.stop-list { display: grid; gap: 14px; }
.stop-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.stop-name { font-family: var(--serif); font-size: 18px; margin-bottom: 4px; }
.stop-code { font-family: var(--num); font-size: 11px; color: var(--muted); letter-spacing: 0.04em; margin-bottom: 10px; }
.stop-meta { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.arrive-list { display: grid; gap: 8px; }
.arrive-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.route-badge { font-family: var(--num); font-size: 12px; font-weight: 700; color: #160a04; background: linear-gradient(90deg, var(--accent), var(--accent-2)); padding: 3px 9px; border-radius: 999px; min-width: 40px; text-align: center; }
.arrive-dest { flex: 1; font-size: 13px; color: var(--text); }
.arrive-min { font-family: var(--num); font-weight: 600; white-space: nowrap; display: flex; align-items: baseline; gap: 2px; }
.arrive-min .min-num { font-size: 15px; color: var(--accent); }
.arrive-min .min-unit { font-size: 10px; color: var(--muted); font-weight: 400; }
.eta-chip { font-family: var(--num); font-size: 14px; color: var(--accent); padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 999px; display: flex; align-items: baseline; gap: 2px; }
.eta-chip .min-num { font-size: 15px; }
.eta-chip .min-unit { font-size: 10px; color: var(--muted); font-weight: 400; }

.empty-note { color: var(--muted); font-size: 14px; padding: 24px 0; }

footer {
  position: relative; z-index: 1; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 22px clamp(20px,4vw,40px); border-top: 1px solid var(--line); color: var(--muted); font-size: 13px;
}
.footer-status { display: inline-flex; align-items: center; gap: 8px; }
.conn-light { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: transparent; transition: background 0.2s, box-shadow 0.2s; }
.conn-light.green { background: var(--green); box-shadow: 0 0 8px rgba(74,222,128,0.7); }
.conn-light.yellow { background: #facc15; box-shadow: 0 0 8px rgba(250,204,21,0.7); }
.conn-light.red { background: var(--red); box-shadow: 0 0 8px rgba(248,113,113,0.7); }
.conn-light.maintenance { background: #000; border: 1px solid rgba(255,255,255,0.25); box-shadow: 0 0 8px rgba(0,0,0,0.6); }
.conn-retry {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.conn-retry:hover { color: var(--accent); border-color: rgba(56,189,248,0.5); transform: rotate(180deg); }
.conn-toggle {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer;
  transition: color 0.2s, border-color 0.2s, transform 0.2s, background 0.2s;
}
.conn-toggle:hover { color: var(--accent); border-color: rgba(56,189,248,0.5); transform: scale(1.06); }
.conn-toggle.on { color: var(--red); border-color: rgba(248,113,113,0.5); background: rgba(248,113,113,0.1); }
.conn-toggle.on:hover { color: var(--text); }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s cubic-bezier(0.2,0.7,0.2,1), transform 0.7s cubic-bezier(0.2,0.7,0.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* DeepSeek 圆形按钮 */
.ds-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2);
  background: transparent; color: var(--muted); display: grid; place-items: center;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.ds-btn:hover { color: var(--accent); border-color: rgba(56,189,248,0.5); transform: scale(1.08) rotate(-6deg); }

/* 可点击监测卡 */
.monitor { position: relative; }
.monitor.clickable { cursor: pointer; }
.monitor.clickable:hover { border-color: var(--line-2); transform: translateY(-3px); }

/* 天气卡片动画 */
.card { position: relative; }
.weather-visual { position: absolute; top: 18px; right: 20px; width: 44px; height: 44px; font-size: 34px; line-height: 1; text-align: center; opacity: 0.92; }
.weather-visual::after { display: inline-block; }
.wv-sun::after { content: "☀️"; animation: sunspin 6s linear infinite; }
.wv-rain::after { content: "🌧️"; animation: rainbob 1.4s ease-in-out infinite; }
.wv-cloud::after { content: "☁️"; animation: clouddrift 5s ease-in-out infinite; }
.wv-storm::after { content: "⛈️"; animation: stormflash 1.2s ease-in-out infinite; }
.wv-calm::after { content: "🌤️"; animation: calmfloat 4s ease-in-out infinite; }
@keyframes sunspin { to { transform: rotate(360deg); } }
@keyframes rainbob { 50% { transform: translateY(4px); } }
@keyframes clouddrift { 50% { transform: translateX(4px); } }
@keyframes stormflash { 0%,100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes calmfloat { 50% { transform: translateY(-3px); } }

/* 聊天页 */
.chat-main { display: block; max-width: 900px; margin: 0 auto; }
.chat-panel { display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 480px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; backdrop-filter: blur(10px); overflow: hidden; }
.chat-head { display: flex; align-items: center; justify-content: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.chat-title { font-family: var(--serif); font-size: 22px; letter-spacing: 0.02em; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 82%; padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.msg-user { align-self: flex-end; background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #160a04; border-bottom-right-radius: 4px; }
.msg-assistant { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--text); }
.msg.thinking { color: var(--muted); font-style: italic; }
.chat-input { display: flex; align-items: flex-end; gap: 10px; padding: 12px 14px; margin: 14px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 24px; box-shadow: 0 10px 30px rgba(0,0,0,0.35); }
.chat-input textarea { flex: 1; resize: none; background: transparent; border: 0; color: var(--text); padding: 8px 6px; font-family: inherit; font-size: 14px; line-height: 1.5; max-height: 130px; outline: none; }
.send-btn { width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; border: 0; background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #160a04; display: grid; place-items: center; transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s; }
.send-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(56,189,248,0.45); }
.send-btn:active { transform: translateY(0) scale(0.94); }
.send-btn:disabled { opacity: 0.5; cursor: default; }
.chat-aside { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; backdrop-filter: blur(10px); padding: 18px; }
.aside-title { font-family: var(--serif); font-size: 16px; margin-bottom: 14px; }
.aside-search { display: flex; gap: 8px; margin-bottom: 16px; }
.aside-search input { flex: 1; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; color: var(--text); padding: 9px 12px; font-size: 13px; outline: none; }
.aside-search input:focus { border-color: rgba(56,189,248,0.4); }
.aside-list { display: grid; gap: 8px; max-height: 60vh; overflow-y: auto; }
.ds-item { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); transition: border-color 0.2s; }
.ds-item:hover { border-color: rgba(56,189,248,0.4); }
.ds-cat { flex-shrink: 0; font-size: 11px; color: var(--accent); border: 1px solid rgba(56,189,248,0.4); padding: 2px 8px; border-radius: 999px; }
.ds-name { font-size: 13px; color: var(--text); line-height: 1.4; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(56,189,248,0.5); }
*::-webkit-scrollbar-track { background: transparent; }

/* 适配：平板 */
@media (max-width: 900px) {
  .navbar { flex-wrap: wrap; gap: 14px; }
  .home-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 适配：手机 */
@media (max-width: 760px) {
  .navbar { gap: 12px; }
  .nav-links { order: 3; width: 100%; flex-wrap: wrap; gap: 4px; }
  .nav-links a { font-size: 13px; padding: 6px 10px; }
  .brand-sub { display: none; }
  .brand-name { font-size: 14px; }
  .nav-right { gap: 8px; }
  .info-pill { min-width: 0; max-width: 46vw; padding: 6px 12px; }
  .cards { grid-template-columns: 1fr; }
  .monitors { grid-template-columns: 1fr; }
  .chat-main { grid-template-columns: 1fr; }
  main { padding: 32px 16px 64px; }
  .acct-pop-card { min-width: 0; width: 236px; }
  .home-hero { padding-top: 24px; }
  .home-hero .home-title { font-size: clamp(34px, 9vw, 48px); }
  .home-sub { font-size: 15px; }
  .home-note { font-size: 12px; }
  .home-cta { padding: 11px 22px; }
  .home-contact { gap: 12px; }
  .contact-buttons { gap: 10px; }
  .contact-btn { width: 34px; height: 34px; }
  .auth-card { padding: 26px 20px; }
  .auth-actions { gap: 8px; }
  .auth-actions .auth-key { width: 40px; height: 40px; }
  .home-login { padding: 8px 14px; }
  .modal-card { width: min(92vw, 360px); padding: 22px 18px; }
}

/* 适配：小手机 */
@media (max-width: 480px) {
  .info-pill { display: none; }
  .nav-right { gap: 6px; }
  .home-nav { gap: 10px; }
  .home-login { padding: 8px; }
  #home-login-label { display: none; }
  .home-grid { grid-template-columns: 1fr; }
  .home-item { padding: 20px 16px; }
  .contact-btn { width: 32px; height: 32px; }
  .kmb-etas { grid-template-columns: 1fr; }
  .home-sub, .home-note { max-width: 100%; }
  main { padding: 26px 12px 56px; }
}

/* 登录 / 介绍页 */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; }
.auth-body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6,6,8,0.92) 0%, rgba(6,6,8,0.7) 42%, rgba(6,6,8,0.82) 66%, rgba(6,6,8,0.97) 100%),
    url('/bg-login.jpg') center / cover no-repeat;
}
.auth-wrap { position: relative; z-index: 1; width: 100%; max-width: 420px; padding: 32px 24px; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.auth-logo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; display: inline-block; box-shadow: 0 0 24px rgba(56,189,248,0.4); }
.auth-card { position: relative; width: 100%; display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; backdrop-filter: blur(14px); padding: 34px 28px; align-items: center; }
.auth-back {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  display: grid; place-items: center;
  transition: color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.auth-back:hover { color: var(--accent); border-color: rgba(56,189,248,0.5); transform: scale(1.06); box-shadow: 0 0 14px rgba(56,189,248,0.25); }
.auth-title { font-family: var(--serif); font-size: 24px; }
.auth-sub { font-family: var(--display); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.auth-input { width: 100%; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; color: var(--text); padding: 12px 14px; font-size: 14px; outline: none; transition: border-color 0.2s; }
.auth-input:focus { border-color: rgba(56,189,248,0.5); }
.auth-remember {
  width: 100%; display: flex; align-items: center; gap: 9px; cursor: pointer;
  font-size: 13px; color: var(--muted); user-select: none;
}
.auth-remember:hover input[type="checkbox"] { border-color: rgba(56,189,248,0.5); }
.auth-remember input[type="checkbox"] {
  appearance: none; width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer;
  display: grid; place-items: center; transition: border-color 0.2s, background 0.2s;
}
.auth-remember input[type="checkbox"]:checked { border-color: var(--accent); background: var(--accent); }
.auth-remember input[type="checkbox"]:checked::after {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: #160a04;
}
.auth-btn { display: inline-block; width: 100%; padding: 12px 18px; border: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #160a04; font-size: 15px; font-weight: 600; cursor: pointer; text-align: center; transition: transform 0.15s, box-shadow 0.2s; }
a.auth-btn { text-decoration: none; }
.auth-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(56,189,248,0.35); }
.auth-btn-warm { background: linear-gradient(90deg, #ff6a3d, #ffb454); }
.auth-btn-warm:hover { box-shadow: 0 10px 26px rgba(255,106,61,0.35); }
.auth-error { min-height: 18px; font-size: 12px; color: var(--red); }
.auth-divider { width: 100%; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.auth-btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); box-shadow: none; }
.auth-btn-ghost:hover { border-color: rgba(56,189,248,0.5); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.25); }
.auth-link { background: none; border: 0; color: var(--muted); font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.auth-link:hover { color: var(--accent); }
.auth-btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.landing-title { font-family: var(--serif); font-size: 34px; }
.landing-en { font-family: var(--display); letter-spacing: 0.22em; text-transform: uppercase; font-size: 12px; color: var(--muted); }
.landing-desc { color: var(--muted); font-size: 14px; line-height: 1.7; }
.landing-features { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.landing-features span { font-size: 12px; color: var(--text); border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 12px; }
.err-code {
  font-family: var(--num); font-size: clamp(60px, 12vw, 120px); font-weight: 800; line-height: 1;
  background: linear-gradient(92deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; margin: 6px 0 2px;
}

/* 登录页：通行密钥圆形按钮 */
.auth-actions { display: flex; align-items: center; gap: 10px; width: 100%; }
.auth-actions .auth-btn { flex: 1; width: auto; }
.auth-lang-wrap { position: relative; flex-shrink: 0; }
.auth-key {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted);
  display: grid; place-items: center;
  transition: color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.auth-key:hover { color: var(--accent); border-color: rgba(56,189,248,0.5); transform: scale(1.06); box-shadow: 0 0 16px rgba(56,189,248,0.28); }

/* 全局 toast 提示 */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(20px);
  max-width: 82vw; padding: 10px 18px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text);
  font-size: 13px; opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  backdrop-filter: blur(12px); box-shadow: 0 18px 40px rgba(0,0,0,0.5); z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { color: var(--red); border-color: rgba(248,113,113,0.5); }

/* 个人主页 */
.home-body { min-height: 100vh; display: flex; flex-direction: column; position: relative; }
.home-body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6,6,8,0.92) 0%, rgba(6,6,8,0.66) 34%, rgba(6,6,8,0.66) 64%, rgba(6,6,8,0.96) 100%),
    url('/bg.jpg') center / cover no-repeat;
}
.home-nav { justify-content: space-between; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover; display: block;
  box-shadow: 0 0 0 1px var(--line-2), 0 0 14px rgba(56,189,248,0.22);
}
.home-login {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line-2);
  color: var(--text); font-size: 14px; font-weight: 500; background: transparent;
  transition: color 0.2s, border-color 0.2s, transform 0.2s, background 0.2s, box-shadow 0.2s;
}
.home-register {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line-2);
  color: var(--muted); font-size: 14px; font-weight: 500; background: transparent;
  transition: color 0.2s, border-color 0.2s, transform 0.2s, background 0.2s, box-shadow 0.2s;
}
.home-register:hover {
  color: var(--text); background: var(--surface-2);
  border-color: rgba(56,189,248,0.5); transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(56,189,248,0.2);
}
.home-login:hover {
  color: #160a04; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-color: transparent; transform: translateY(-1px); box-shadow: 0 8px 22px rgba(56,189,248,0.3);
}
.home-login-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--green); box-shadow: 0 0 8px rgba(74,222,128,0.75);
}
.home-lang-wrap { position: relative; }
.home-lang-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  display: grid; place-items: center;
  transition: color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.home-lang-btn:hover { color: var(--accent); border-color: rgba(56,189,248,0.5); transform: rotate(12deg); box-shadow: 0 0 14px rgba(56,189,248,0.25); }
.home-main { flex: 1; }
.home-hero { max-width: 780px; margin: 0 auto; text-align: center; padding-top: clamp(36px, 8vw, 76px); }
.home-title { font-size: clamp(40px, 7vw, 72px); margin-bottom: 20px; min-height: 1.2em; text-shadow: 0 2px 26px rgba(0,0,0,0.55); }
.home-accent {
  background: linear-gradient(92deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.typing-caret {
  display: inline-block; width: 2px; height: 0.85em; margin-left: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  vertical-align: -0.08em; animation: caretBlink 0.9s steps(2, start) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }
.home-sub { color: var(--muted); font-size: 16px; line-height: 1.8; max-width: 560px; margin: 0 auto 16px; text-shadow: 0 1px 14px rgba(0,0,0,0.7); }
.home-note { color: var(--muted); font-size: 13px; letter-spacing: 0.02em; opacity: 0.9; margin: 0 auto 30px; text-shadow: 0 1px 12px rgba(0,0,0,0.75); }
.home-cta {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 26px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #160a04;
  font-size: 15px; font-weight: 600; transition: transform 0.15s, box-shadow 0.2s;
}
.home-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(56,189,248,0.35); }

.home-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: clamp(48px, 8vw, 72px); }
.home-item {
  padding: 26px 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
  backdrop-filter: blur(10px); text-align: left; transition: transform 0.2s, border-color 0.2s;
}
.home-item:hover { transform: translateY(-4px); border-color: var(--line-2); }
.home-item-icon { font-size: 26px; margin-bottom: 16px; }
.home-item-title { font-family: var(--serif); font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.home-item-sub { font-size: 12px; color: var(--muted); line-height: 1.6; }

.home-footer {
  display: flex; justify-content: center; align-items: center;
  padding: 22px clamp(20px, 4vw, 40px); border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px; flex-wrap: wrap;
}
.home-contact {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 26px clamp(20px, 4vw, 40px) 20px;
}
.contact-title { font-size: 12px; color: var(--muted); letter-spacing: 0.06em; }
.contact-buttons { display: flex; gap: 14px; }
.contact-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--muted);
  display: grid; place-items: center;
  transition: color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.contact-btn:hover {
  color: var(--accent); border-color: rgba(56,189,248,0.5); transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(56,189,248,0.25);
}

@media (max-width: 760px) {
  .home-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .home-grid { grid-template-columns: 1fr; }
}

/* 账号管理弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: rgba(6,6,8,0.7); backdrop-filter: blur(6px);
}
.modal-mask[hidden] { display: none; }
.modal-card {
  position: relative; width: min(90vw, 360px); background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: 16px; padding: 26px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}
.modal-back {
  position: absolute; top: 12px; left: 12px; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  display: grid; place-items: center; transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.modal-back:hover { color: var(--accent); border-color: rgba(56,189,248,0.5); transform: scale(1.06); }
.modal-title { font-family: var(--serif); font-size: 20px; }
.modal-input {
  width: 100%; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--text); padding: 11px 12px; font-size: 14px; outline: none; transition: border-color 0.2s;
}
.modal-input:focus { border-color: rgba(56,189,248,0.5); }
.modal-error { min-height: 16px; font-size: 12px; color: var(--red); }
.modal-submit {
  width: 100%; padding: 12px 18px; border: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #160a04;
  font-size: 15px; font-weight: 600; cursor: pointer; transition: transform 0.15s, box-shadow 0.2s;
}
.modal-submit:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(56,189,248,0.35); }

/* 弹窗小屏适配（改密码 / 改账号名） */
@media (max-width: 760px) {
  .modal-mask { padding: 14px; }
  .modal-card {
    width: min(94vw, 360px); max-height: calc(100vh - 28px); overflow-y: auto;
    padding: 20px 16px; gap: 10px;
  }
  .modal-title { font-size: 18px; }
  .modal-input { padding: 10px 11px; }
}
@media (max-width: 480px) {
  .modal-mask { padding: 10px; }
  .modal-card { width: 96vw; padding: 18px 14px; }
  .modal-back { top: 10px; left: 10px; width: 30px; height: 30px; }
}

/* 账号弹出菜单（四宫格）小屏适配 */
@media (max-width: 760px) {
  .acct-pop { right: 4px; }
  .acct-pop-card { width: min(240px, calc(100vw - 20px)); min-width: 0; }
  .acct-opt { min-height: 62px; padding: 9px 5px; min-width: 0; }
  .acct-opt-label { font-size: 12px; }
  .acct-opt-sub { white-space: normal; font-size: 9.5px; }
}
@media (max-width: 480px) {
  .acct-pop { right: 2px; }
  .acct-pop-card { width: min(220px, calc(100vw - 14px)); }
}

/* ---------- 全站美化：滚动条 / 选区 / 焦点 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.03); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(56, 189, 248, 0.45); background-clip: padding-box; }
::selection { background: rgba(56, 189, 248, 0.35); color: #fff; }
:focus-visible { outline: 2px solid rgba(56, 189, 248, 0.6); outline-offset: 2px; }
input, button, textarea, select { font-family: inherit; }
button { -webkit-tap-highlight-color: transparent; }

/* ---------- 手机版：汉堡目录 + 侧边抽屉（后台导航） ---------- */
.nav-hamburger { display: none; }
@media (max-width: 900px) {
  .navbar { gap: 12px; }
  .nav-right { margin-left: auto; flex-shrink: 0; }
  .info-pill .pill-label { display: none; }
  .info-pill { padding: 6px 10px; }
  .nav-hamburger {
    display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid var(--line-2); background: transparent; color: var(--muted); cursor: pointer;
    flex-shrink: 0; transition: color .2s, border-color .2s, background .2s;
  }
  .nav-hamburger:hover { color: var(--accent); border-color: rgba(56,189,248,0.5); }
  .nav-backdrop {
    position: fixed; inset: 0; z-index: 150; background: rgba(6,6,8,0.62); backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
  }
  .nav-links {
    position: fixed; top: 0; left: 0; height: 100vh; width: min(270px, 82vw);
    flex-direction: column; align-items: stretch; gap: 4px; padding: 22px 14px;
    background: var(--surface-2); border-right: 1px solid var(--line);
    transform: translateX(-100%); transition: transform .28s ease; z-index: 160;
    overflow-y: auto; order: 0; flex: none; box-sizing: border-box;
    box-shadow: 8px 0 30px rgba(0,0,0,0.35);
  }
  body.nav-open .nav-links { transform: translateX(0); }
  body.nav-open .nav-backdrop { opacity: 1; visibility: visible; }
  .nav-links a { display: block; width: 100%; font-size: 14px; padding: 12px 12px; border-radius: 10px; box-sizing: border-box; }
  body.nav-open { overflow: hidden; }
}
