/* WHZ CAMPUS AGENT · 验证版样式（白黄暖光像素风） */
:root {
  --bg: #fbf6e7;
  --panel: #fffdf6;
  --panel-2: #fdf3d6;
  --line: #e6d3a3;
  --text: #3d2f14;
  --sub: #8a7a55;
  --pri: #e0a800;
  --pri-2: #b8860b;
  --gold: #c8860a;
  --dia: #4aa8c8;
  --tick: #d9752f;
  --win: #2f9e5f;
  --lose: #d23b3b;
  --sus: #a855f7;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  font-size: 14px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#app { position: relative; width: 100%; height: 100%; }

.screen {
  position: absolute; inset: 0;
  display: none;
  overflow: auto;
}
.screen.active { display: block; }

/* 制作者署名 */
.watermark {
  position: absolute; right: 10px; bottom: 8px;
  font-size: 11px; letter-spacing: .5px;
  color: rgba(120, 95, 40, .28);
  pointer-events: none; user-select: none; z-index: 5;
}

/* ---------------- 通用控件 ---------------- */
.btn {
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  transition: .15s;
}
.btn:hover:not(:disabled) { border-color: var(--pri); color: #6b4e00; transform: translateY(-1px); }
.btn:disabled, .btn-disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, #ffd75e, var(--pri));
  border-color: #e0a800;
  color: #4a3608; font-weight: 700;
}
.btn-ghost { background: transparent; }
.btn.wide { width: 100%; }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12px; color: var(--sub); margin-bottom: 6px; }
.field input, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fffdf7;
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.field input:focus, select:focus { border-color: var(--pri); box-shadow: 0 0 0 2px rgba(224,168,0,.16); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sub); margin-bottom: 12px; cursor: pointer; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; }
.hint { font-size: 12px; color: var(--sub); margin-top: 8px; line-height: 1.6; }
.sub { font-size: 12px; color: var(--sub); line-height: 1.7; }

/* ---------------- 加载页 ---------------- */
#screen-loading { display: none; }
#screen-loading.active { display: flex; align-items: center; justify-content: center; }
.load-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(700px 420px at 20% 15%, rgba(255,205,84,.35), transparent 70%),
    radial-gradient(600px 400px at 85% 80%, rgba(255,238,180,.45), transparent 70%),
    repeating-linear-gradient(0deg, rgba(160,120,30,.05) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(160,120,30,.05) 0 1px, transparent 1px 34px);
}
.load-inner { position: relative; text-align: center; z-index: 2; }
.logo {
  font-size: 56px; font-weight: 800; letter-spacing: 8px;
  background: linear-gradient(180deg, #f7b733, #c8860a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.logo.sm { font-size: 26px; letter-spacing: 4px; }
.logo-sub { color: var(--sub); letter-spacing: 6px; font-size: 12px; margin: 6px 0 34px; }
.load-bar { width: 320px; height: 6px; border-radius: 4px; background: #efe0b8; margin: 0 auto 10px; overflow: hidden; }
.load-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--pri-2), #ffd75e); transition: width .3s; }
.load-tip { color: var(--sub); font-size: 12px; margin-bottom: 26px; height: 16px; }
.load-foot { color: #a3926a; font-size: 12px; margin-top: 30px; }

/* ---------------- 登录 ---------------- */
#screen-auth { display: none; }
#screen-auth.active { display: flex; align-items: center; justify-content: center; }
.auth-wrap {
  position: relative;
  display: grid; grid-template-columns: 340px 400px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(150, 110, 20, .18);
}
.auth-side {
  position: relative;
  padding: 40px 30px;
  background:
    radial-gradient(420px 260px at 20% 10%, rgba(255,214,102,.55), transparent 70%),
    linear-gradient(160deg, #fff6d8, #f7e7b5 70%);
  border-right: 1px solid var(--line);
}
.auth-slogan { color: #7a6636; font-size: 13px; line-height: 1.8; margin: 12px 0 20px; }
.auth-points { list-style: none; font-size: 12px; color: #8a7645; line-height: 2.1; }
.auth-points li::before { content: "▸ "; color: var(--pri-2); }
.auth-main { padding: 30px 30px 26px; }
.tabs { display: flex; gap: 6px; margin-bottom: 22px; }
.tab {
  flex: 1; padding: 9px 0; background: transparent; color: var(--sub);
  border: none; border-bottom: 2px solid transparent; cursor: pointer; font-size: 14px;
}
.tab.active { color: var(--pri-2); border-bottom-color: var(--pri); font-weight: 600; }
.pane { display: none; }
.pane.active { display: block; }

/* ---------------- 主页 ---------------- */
#screen-home { padding: 0 20px 20px; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; background: rgba(251,246,231,.88); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line); margin-bottom: 16px;
}
.top-left { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 46px; height: 46px; border-radius: 10px; padding: 0;
  background: linear-gradient(150deg, #fff3cc, #ffe08a);
  border: 2px solid #e6c76e;
  image-rendering: pixelated;
}
.who-name { display: flex; align-items: baseline; gap: 8px; font-size: 15px; font-weight: 600; }
.who-name em { font-style: normal; font-size: 12px; color: var(--sub); font-weight: 400; }
.who-lv { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--sub); margin-top: 4px; }
.who-lv b { color: var(--gold); }
.expbar { width: 130px; height: 5px; background: #efe0b8; border-radius: 3px; overflow: hidden; }
.expbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #e0a800, #ffd75e); }
.expnum { font-size: 11px; color: #a3926a; }
.top-right { display: flex; align-items: center; gap: 10px; }
.cur {
  display: flex; align-items: center; gap: 6px;
  background: var(--panel); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 20px; font-size: 13px;
  box-shadow: 0 2px 6px rgba(160,120,30,.08);
}
.cur .ico { width: 18px; height: 18px; display: block; flex: none; object-fit: contain; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); color: var(--sub); font-size: 16px;
}
.icon-btn:hover { color: var(--pri-2); border-color: var(--pri); }

.home-main { display: grid; grid-template-columns: 300px 1fr 260px; gap: 14px; align-items: start; }
.col-left, .col-mid, .col-right { display: flex; flex-direction: column; gap: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px;
  box-shadow: 0 8px 24px rgba(170,130,40,.06);
}
.card-title {
  font-size: 13px; color: #7a6636; font-weight: 600; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.card-title .tip { font-size: 11px; color: #a3926a; font-weight: 400; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat-grid > div { background: #fff8e2; border: 1px solid #f0e2b8; border-radius: 8px; padding: 10px; }
.stat-grid span { display: block; font-size: 11px; color: var(--sub); }
.stat-grid b { font-size: 18px; color: var(--pri-2); }
.rec-list { list-style: none; font-size: 12px; max-height: 210px; overflow: auto; }
.rec-list li {
  display: flex; justify-content: space-between; padding: 7px 0;
  border-bottom: 1px dashed #ecdcb0; color: #7a6636;
}
.rec-list li .r-win { color: var(--win); }
.rec-list li .r-lose { color: var(--lose); }
.rec-list li.empty { color: #b3a173; justify-content: center; }

.mode-card { padding-bottom: 10px; }
.mode-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.mode-head h3 { font-size: 17px; }
.tag { font-size: 11px; color: #9a6b00; background: rgba(255,214,92,.35); border: 1px solid rgba(224,168,0,.45); padding: 2px 8px; border-radius: 10px; }
.mode-desc { font-size: 12px; color: var(--sub); line-height: 1.9; margin-bottom: 14px; }
.mode-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mode-actions .btn { flex: 1; min-width: 110px; }
.bot-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 12px; color: var(--sub); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button {
  padding: 6px 14px; background: transparent; border: none; color: var(--sub);
  cursor: pointer; font-size: 12px; font-family: inherit;
}
.seg button.active { background: var(--pri); color: #4a3608; font-weight: 600; }
.ann-body { font-size: 12px; color: #7a6636; line-height: 1.9; white-space: pre-wrap; max-height: 190px; overflow: auto; }
.keys-help { font-size: 12px; color: var(--sub); line-height: 2; }
.keys-help b { color: var(--pri-2); margin-right: 6px; }

/* ---------------- 对局 ---------------- */
#screen-game { display: none; }
#screen-game.active { display: flex; align-items: center; justify-content: center; }
.game-wrap { position: relative; width: min(96vw, 1120px); }
#cv {
  display: block; width: 100%; height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #ffe9b8;
  box-shadow: 0 24px 70px rgba(150,110,20,.22);
}
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud-top { display: flex; justify-content: space-between; padding: 16px 18px; }
.side-info { width: 300px; }
.side-info.right { text-align: right; }
.si-name {
  font-size: 13px; font-weight: 700; color: #4a3608; margin-bottom: 5px;
  text-shadow: 0 1px 0 rgba(255,255,255,.85);
}
.hpbar {
  position: relative; height: 16px; border-radius: 8px;
  background: rgba(255,252,240,.9); border: 1px solid #c9a95f; overflow: hidden;
  box-shadow: 0 2px 6px rgba(120,80,0,.15);
}
.hpbar i {
  position: absolute; inset: 0; width: 100%;
  background: linear-gradient(90deg, #2f9e5f, #7ed6a2);
  transition: width .12s linear;
}
.side-info.right .hpbar i { background: linear-gradient(90deg, #ff9a76, #e05353); right: 0; left: auto; }
.hpbar span {
  position: relative; z-index: 2; font-size: 11px; line-height: 15px;
  display: block; text-align: center; color: #3d2f14; font-weight: 700;
}
.side-info.right .hpbar span { text-align: center; }
.pips { display: flex; gap: 5px; margin-top: 6px; }
.side-info.right .pips { justify-content: flex-end; }
.pips i {
  width: 22px; height: 5px; border-radius: 3px; background: #d8c690; display: block;
}
.pips i.alive { background: #2f9e5f; }
.pips i.cur { box-shadow: 0 0 0 1px #fff inset; }
.pips i.dead { background: #b08a55; opacity: .5; }
.timer {
  font-size: 30px; font-weight: 800; color: #4a3608; text-shadow: 0 2px 0 rgba(255,255,255,.85);
  min-width: 70px; text-align: center; font-variant-numeric: tabular-nums;
}
.timer.warn { color: #d23b3b; }
.countdown {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center;
  font-size: 110px; font-weight: 900; color: #fff8e0;
  text-shadow: 0 0 50px rgba(224,168,0,.95), 0 4px 0 rgba(120,80,0,.35);
}
.countdown.show { display: flex; }
.countdown.waiting { font-size: 26px; letter-spacing: 3px; color: rgba(74,54,8,.8); text-shadow: 0 1px 0 rgba(255,255,255,.8); }
.hud-tip {
  position: absolute; left: 0; right: 0; bottom: 12px;
  text-align: center; font-size: 12px; color: rgba(90,70,20,.6);
  text-shadow: 0 1px 0 rgba(255,255,255,.7);
}

.hud-exit {
  position: absolute; right: 12px; bottom: 34px; z-index: 3;
  padding: 6px 14px; font-size: 12px; cursor: pointer;
  color: #6b5520; background: rgba(255,250,232,.82);
  border: 1px solid #d8c083; border-radius: 6px;
  transition: .15s;
  pointer-events: auto;
}
.hud-exit:hover { color: #3d2f14; border-color: var(--pri); background: #fff6d8; }

.quit-tip { margin: 6px 2px; font-size: 14px; line-height: 1.7; color: #5c4a1e; }

/* ---------------- 弹窗 ---------------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: none; align-items: center; justify-content: center;
  background: rgba(90, 68, 20, .32); backdrop-filter: blur(3px);
}
.modal.show { display: flex; }
.modal-box {
  width: 420px; max-width: 92vw; max-height: 86vh; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 30px 80px rgba(140, 100, 20, .28);
  animation: pop .16s ease-out;
}
.modal-box.wide { width: 620px; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head {
  position: relative; padding: 15px 18px; font-weight: 600; font-size: 15px;
  border-bottom: 1px solid var(--line);
}
.modal-head .x {
  position: absolute; right: 14px; top: 11px; cursor: pointer;
  color: var(--sub); font-size: 20px; line-height: 1;
}
.modal-head .x:hover { color: var(--pri-2); }
.modal-body { padding: 18px; overflow: auto; font-size: 13px; line-height: 1.8; color: #6b5626; }
.modal-body pre { white-space: pre-wrap; font-family: inherit; line-height: 1.9; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--line); text-align: right; }

.set-sec { margin-bottom: 20px; }
.set-sec h4 { font-size: 13px; color: #7a6636; margin-bottom: 12px; font-weight: 600; }
.keybind-grid { display: flex; flex-direction: column; gap: 10px; }
.kb-row { display: flex; align-items: center; gap: 6px; }
.kb-row b { width: 52px; font-size: 12px; color: var(--sub); font-weight: 500; }
.kb {
  min-width: 40px; padding: 6px 8px; border-radius: 6px; cursor: pointer;
  background: #fffdf7; border: 1px solid var(--line); color: var(--text); font-size: 12px;
  font-family: inherit;
}
.kb.listening { border-color: var(--pri); color: var(--pri-2); }
.kb.sk { border-color: #edd48a; color: #9a6b00; }
.set-sec input[type="range"] { flex: 1; }
.set-sec select { width: 160px; }
hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

.room-code {
  font-size: 34px; letter-spacing: 8px; text-align: center; font-weight: 800;
  color: var(--pri-2); padding: 18px 0 10px; font-variant-numeric: tabular-nums;
}
.room-code + .sub { text-align: center; margin-bottom: 16px; }

.res-line { text-align: center; color: var(--sub); margin-bottom: 14px; }
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.res-grid > div { background: #fff8e2; border: 1px solid #f0e2b8; border-radius: 8px; padding: 12px; }
.res-grid span { display: block; font-size: 11px; color: var(--sub); }
.res-grid b { font-size: 17px; }
.res-up { margin-top: 14px; text-align: center; color: var(--pri-2); font-size: 13px; min-height: 18px; }
#res-title.win { color: var(--win); }
#res-title.lose { color: var(--lose); }

#toast {
  position: fixed; left: 50%; top: 26px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 99; pointer-events: none;
}
#toast div {
  padding: 9px 18px; border-radius: 20px; font-size: 13px;
  background: rgba(255,253,246,.98); border: 1px solid var(--line); color: var(--text);
  box-shadow: 0 8px 20px rgba(140,100,20,.18);
  animation: pop .16s ease-out;
}
#toast div.err { border-color: #e8a3a3; color: #a52222; }
#toast div.ok { border-color: #9fd7b5; color: #1f7a48; }

/* ---------------- 角色 ---------------- */
.char-line { display: flex; align-items: center; gap: 8px; }
.char-line b, .bot-row b { color: var(--pri-2); font-weight: 600; }
.btn.mini { padding: 3px 10px; font-size: 12px; border-radius: 6px; }
.char-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.char-card {
  position: relative; cursor: pointer;
  background: #fffaf0; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; transition: .15s;
}
.char-card:hover { border-color: var(--pri); transform: translateY(-1px); }
.char-card.on { border-color: var(--pri); box-shadow: 0 0 0 1px var(--pri) inset; background: #fff3cf; }
.char-card .cc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.char-card .cc-body { display: flex; gap: 10px; align-items: flex-start; }
.char-card .cc-portrait {
  width: 60px; height: 60px; flex: none; border-radius: 8px;
  background: radial-gradient(circle at 50% 35%, #fff3cc, #ffdf95 70%);
  border: 1px solid var(--line); image-rendering: pixelated;
}
.char-card .cc-main { flex: 1; min-width: 0; }
.char-card .cc-skills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.char-card .cc-skills span {
  font-size: 10px; padding: 1px 6px; border-radius: 6px;
  color: #8a5f00; background: rgba(255,214,92,.28); border: 1px solid rgba(224,168,0,.4);
}
.char-card .cc-name { font-size: 14px; font-weight: 600; }
.char-card .cc-grade {
  font-size: 11px; padding: 1px 7px; border-radius: 8px;
  color: #9a6b00; background: rgba(255,214,92,.3); border: 1px solid rgba(224,168,0,.45);
}
.char-card .cc-stats { display: flex; gap: 10px; font-size: 12px; color: var(--sub); }
.char-card .cc-stats b { color: #5c4a1e; }
.char-card .cc-desc { font-size: 11px; color: #a3926a; line-height: 1.6; margin-top: 6px; }
.char-card .cc-pick { font-size: 11px; color: var(--pri-2); margin-top: 6px; font-weight: 600; }
.char-card .cc-pick.ghost { color: #b3a173; font-weight: 400; }
.char-card.disabled { opacity: .45; cursor: not-allowed; }

/* 开局选人 */
.sel-timer {
  position: absolute; right: 16px; top: 10px;
  font-size: 22px; font-weight: 800; color: var(--pri-2);
  font-variant-numeric: tabular-nums;
}
.sel-timer.warn { color: var(--lose); }
.sel-status { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.sel-side {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: 10px;
  background: #fff8e2; border: 1px solid #f0e2b8;
  font-size: 12px; color: var(--sub);
}
.sel-side b { color: #5c4a1e; }
.sel-side.on { border-color: var(--pri); background: #fff3cf; }
.sel-side.on span { color: var(--pri-2); font-weight: 600; }

/* ---------------- 技能栏（局内） ---------------- */
.skillbar {
  position: absolute; bottom: 46px; display: flex; gap: 8px; pointer-events: none;
}
.skillbar.left { left: 26px; }
.skillbar.right { right: 26px; flex-direction: row-reverse; }
.sk-chip {
  position: relative; width: 48px; height: 48px; border-radius: 10px;
  background: linear-gradient(160deg, #fffdf4, #ffeab5);
  border: 1px solid #d8bd78; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(140,100,20,.18);
}
.sk-chip.ready { border-color: #e0a800; box-shadow: 0 0 12px rgba(224,168,0,.55); }
.sk-chip.atk { border-style: dashed; }
.sk-chip .sk-ico {
  font-size: 15px; font-weight: 700; color: #8a5f00; line-height: 1;
  width: 100%; height: 100%; display: grid; place-items: center;
}
.sk-chip .sk-ico img {
  width: 40px; height: 40px; object-fit: contain; display: block;
  image-rendering: auto;
}
.sk-chip .sk-key {
  position: absolute; right: 3px; bottom: 2px; font-size: 9px; color: #8a6b1f;
  background: rgba(255,250,232,.85); border-radius: 3px; padding: 0 2px;
}
.sk-chip .sk-cd {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(90, 68, 20, .55); pointer-events: none;
}
.sk-chip .sk-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px #000;
}

@media (max-width: 1180px) {
  .home-main { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; width: 92vw; max-width: 440px; }
  .auth-side { display: none; }
}
@media (max-width: 720px) {
  .top-right .cur { padding: 5px 8px; font-size: 11px; }
  .side-info { width: 42vw; }
  .hud-tip { display: none; }
}
