/* 八家路演投票 · 移动端样式（手机优先，大屏也能用） */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --navy: #0f2742;
  --navy2: #1b3a5c;
  --gold: #d9a441;
  --red: #d9534f;
  --bg: #f2f4f8;
  --card: #ffffff;
  --ink: #1f2a37;
  --muted: #7a8699;
  --line: #e5e9f0;
  --green: #2fa36b;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5;
}
.hidden { display: none !important; }
.page { max-width: 560px; margin: 0 auto; min-height: 100vh; }

/* ---------- 登记页 ---------- */
#page-login {
  display: flex; align-items: center; justify-content: center; padding: 24px 18px;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy2) 100%);
}
.login-card {
  width: 100%; background: var(--card); border-radius: 18px; padding: 30px 24px 26px;
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
}
.brand { color: var(--gold); font-size: 13px; font-weight: 600; letter-spacing: .5px; }
.login-card h1 { font-size: 24px; margin: 8px 0 6px; color: var(--navy); }
.sub { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--navy2); margin: 14px 0 8px; }
.input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 13px;
  font-size: 16px; font-family: inherit; outline: none; background: #fbfcfe;
}
.input:focus { border-color: var(--navy2); background: #fff; }
.textarea { resize: none; line-height: 1.5; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.role-wrap { margin-top: 10px; }
.chip {
  border: 1.5px solid var(--line); background: #fbfcfe; color: var(--ink);
  border-radius: 999px; padding: 9px 16px; font-size: 14.5px; cursor: pointer; user-select: none;
}
.chip.active { border-color: var(--navy); background: var(--navy); color: #fff; }
.chip.guest.active { border-color: var(--gold); background: var(--gold); color: #3a2a05; }
.btn-primary {
  background: var(--navy); color: #fff; border: none; border-radius: 12px;
  padding: 14px 22px; font-size: 16px; font-weight: 600; cursor: pointer; width: 100%; margin-top: 22px;
}
.btn-primary:active { opacity: .85; }
.btn-primary:disabled { background: #b4bcc9; cursor: not-allowed; }
.fineprint { text-align: center; color: var(--muted); font-size: 11.5px; margin-top: 12px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; gap: 10px;
}
.topbar-title { display: flex; align-items: baseline; gap: 10px; font-size: 17px; }
.who { font-size: 12.5px; opacity: .75; }
.pill { font-size: 12.5px; border-radius: 999px; padding: 4px 12px; background: rgba(47,163,107,.25); color: #93e6b9; border: 1px solid rgba(147,230,185,.4); white-space: nowrap; }
.pill.closed { background: rgba(217,83,79,.22); color: #f3b4b2; border-color: rgba(243,180,178,.4); }

/* ---------- 进度 ---------- */
.progress-wrap { background: #fff; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.progress-text { font-size: 14px; font-weight: 600; color: var(--navy); }
.progress-bar { height: 8px; border-radius: 99px; background: #e8ecf3; margin-top: 8px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--navy2), var(--gold)); border-radius: 99px; transition: width .3s; }
.progress-hint { font-size: 12px; color: var(--muted); margin-top: 7px; }

/* ---------- 企业列表 ---------- */
.company-list { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.co-card {
  background: var(--card); border-radius: 14px; padding: 14px 16px;
  display: flex; align-items: center; gap: 13px; box-shadow: 0 1px 3px rgba(15,39,66,.06);
  cursor: pointer; border: 1.5px solid transparent;
}
.co-card:active { border-color: var(--navy2); }
.co-card.done { border-color: rgba(47,163,107,.55); }
.co-card.self { opacity: .55; background: #f6f7fa; cursor: not-allowed; }
.co-no {
  width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px;
}
.co-card.done .co-no { background: var(--green); }
.co-main { flex: 1; min-width: 0; }
.co-name { font-size: 16.5px; font-weight: 700; color: var(--navy); }
.co-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-badges { display: flex; gap: 5px; margin-top: 5px; }
.mini-badge { font-size: 11px; border-radius: 6px; padding: 1px 7px; }
.mini-badge.hot { background: #fdf0d7; color: #9a6a12; }
.mini-badge.interest { background: #fbe2ec; color: #b23b63; }
.co-state { flex: none; font-size: 13px; font-weight: 600; color: var(--muted); }
.co-state.done { color: var(--green); }
.co-state.locked { color: #a6adba; font-size: 12px; }

/* ---------- 详情 ---------- */
#page-detail { padding-bottom: 110px; background: var(--bg); }
.btn-ghost { background: transparent; border: none; color: #fff; font-size: 16px; padding: 6px 4px; cursor: pointer; }
.save-state { font-size: 12px; opacity: .8; }
.detail-head { padding: 20px 18px 6px; display: flex; align-items: center; gap: 12px; }
.detail-index { background: var(--gold); color: #3a2a05; font-weight: 700; border-radius: 9px; padding: 5px 10px; font-size: 13px; }
.detail-head h2 { font-size: 22px; color: var(--navy); }
.card { background: #fff; margin: 12px; border-radius: 14px; padding: 16px; box-shadow: 0 1px 3px rgba(15,39,66,.06); }
.card h3 { font-size: 14.5px; color: var(--navy); margin-bottom: 12px; }

.dim-row { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.dim-row:last-child { border-bottom: none; }
.dim-label { font-size: 15px; font-weight: 600; }
.dim-hint { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.stars { display: flex; gap: 10px; }
.star {
  font-size: 32px; line-height: 1; color: #d4dae4; cursor: pointer; user-select: none;
  transition: transform .08s;
}
.star.on { color: var(--gold); }
.star.tap { transform: scale(1.2); }
.star-nums { margin-left: auto; font-size: 13px; color: var(--muted); align-self: flex-end; padding-bottom: 4px; }
.dim-line { display: flex; align-items: flex-end; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; gap: 12px; cursor: pointer; }
.toggle-main { font-size: 15px; font-weight: 600; }
.toggle-main small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 2px; }
.switch { position: relative; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i {
  display: block; width: 48px; height: 28px; border-radius: 999px; background: #d4dae4; transition: background .15s; position: relative;
}
.switch i::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + i { background: var(--navy); }
.switch input:checked + i::after { left: 23px; }
#row-hot .switch input:checked + i { background: #e08a1e; }
#row-interest .switch input:checked + i { background: #d94f7a; }
.sub-input { margin: -4px 0 6px; }

.detail-actions { position: fixed; bottom: 0; left: 0; right: 0; max-width: 560px; margin: 0 auto; background: #fff; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.btn-block { margin-top: 0; width: 100%; }
.detail-tip { text-align: center; font-size: 12px; color: var(--muted); margin-top: 7px; min-height: 16px; }
.detail-tip.ok { color: var(--green); }
.detail-tip.err { color: var(--red); }

.closed-banner { margin: 12px; background: #fdecea; color: #b03a36; border-radius: 12px; padding: 12px 14px; font-size: 13.5px; text-align: center; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: rgba(15,39,66,.92); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 14px; z-index: 99; max-width: 86%; text-align: center;
}
