:root {
  --navy: #1b3a5c;
  --navy-2: #24507d;
  --orange: #e8730c;
  --orange-dark: #cf5f00;
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #e3e8ef;
  --text: #1f2937;
  --muted: #6b7280;
  --good: #16a34a;
  --shadow: 0 2px 12px rgba(27, 58, 92, 0.08);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 0 14px 100px; }

/* header */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff; padding: 22px 16px 20px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -30px; bottom: -30px; width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(232,115,12,.25), transparent 70%);
}
.hero .wrap { padding-bottom: 0; }
.hero h1 { margin: 0; font-size: 21px; letter-spacing: .5px; }
.hero .sub { margin-top: 6px; font-size: 13px; opacity: .9; }
.hero .meta { margin-top: 10px; font-size: 12px; opacity: .8; display: flex; gap: 12px; flex-wrap: wrap; }
.hero .bar { height: 4px; background: var(--orange); border-radius: 4px; width: 54px; margin-top: 12px; }

/* cards */
.card { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 16px; margin-top: 14px; }
.section-title { font-size: 15px; font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.section-title::before { content: ""; width: 4px; height: 16px; background: var(--orange); border-radius: 3px; }

/* tester picker */
.group-label { font-size: 13px; font-weight: 700; color: var(--orange-dark); margin: 16px 0 8px; }
.tester-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tester-btn {
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 12px;
  text-align: left; cursor: pointer; transition: .15s; font-size: 15px; font-weight: 600; color: var(--text);
}
.tester-btn:active { transform: scale(.98); }
.tester-btn small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 3px; }
.tester-btn.on { border-color: var(--orange); background: #fff8f2; }

/* node picker */
.node-list { display: flex; flex-direction: column; gap: 10px; }
.node-btn {
  display: flex; align-items: center; gap: 12px; background: #fff; border: 1.5px solid var(--line);
  border-radius: 12px; padding: 14px; cursor: pointer; text-align: left; transition: .15s;
}
.node-btn:active { transform: scale(.99); }
.node-btn .num {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 17px;
}
.node-btn .t { font-weight: 700; font-size: 15px; }
.node-btn .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.node-btn .status { margin-left: auto; font-size: 12px; }
.node-btn .status.done { color: var(--good); font-weight: 700; }

/* form fields */
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea {
  border: 1.5px solid var(--line); border-radius: 9px; padding: 9px 10px; font-size: 14px; background: #fff;
  font-family: inherit; color: var(--text); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--orange); }
.subhead { font-size: 13px; font-weight: 700; color: var(--navy-2); margin: 14px 0 8px; }

/* gear score card */
.gear { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 12px; }
.gear-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.gear-cat { font-weight: 700; color: var(--navy); font-size: 15px; }
.gear-name { font-size: 13px; color: var(--text); }
.gear-code { font-size: 11px; color: #fff; background: var(--orange); border-radius: 20px; padding: 1px 8px; font-weight: 600; }
.dim-block { padding: 8px 0 4px; border-top: 1px dashed var(--line); }
.dim-block:first-of-type { border-top: none; }
.dim-name { font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.pills { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.pill {
  height: 32px; border-radius: 7px; border: 1.5px solid var(--line); background: #fff;
  font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; transition: .1s; padding: 0;
}
.pill:active { transform: scale(.9); }
.pill.on { background: var(--orange); border-color: var(--orange); color: #fff; }

.companions { margin: 8px 0 4px; }
.comp-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 5px; }
.comp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.comp-grid input { border: 1.5px solid var(--line); border-radius: 8px; padding: 7px 9px; font-size: 13px; width: 100%; font-family: inherit; }
.comp-grid input:focus { outline: none; border-color: var(--orange); }

.proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.proscons input { border: 1.5px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; width: 100%; font-family: inherit; }
.proscons input:focus { outline: none; border-color: var(--orange); }

/* sticky submit */
.footbar {
  position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line); padding: 10px 14px; backdrop-filter: blur(8px); z-index: 20;
}
.footbar .inner { max-width: 720px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.btn {
  flex: 1; border: none; border-radius: 11px; padding: 14px; font-size: 16px; font-weight: 700; cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:active { background: var(--orange-dark); }
.btn-ghost { background: #eef1f5; color: var(--navy); flex: 0 0 auto; padding: 14px 18px; }
.btn:disabled { opacity: .5; }

.progress-hint { font-size: 12px; color: var(--muted); flex: 0 0 auto; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--navy);
  color: #fff; padding: 12px 20px; border-radius: 30px; font-size: 14px; z-index: 50; box-shadow: var(--shadow);
  opacity: 0; transition: .25s; pointer-events: none; max-width: 90%; text-align: center;
}
.toast.show { opacity: 1; bottom: 100px; }
.toast.err { background: #b91c1c; }

.back { color: var(--orange); font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }
.crumbs { font-size: 12px; color: var(--muted); margin-top: 6px; }
.crumbs b { color: var(--navy); }
.hidden { display: none !important; }
.note-tip { font-size: 11px; color: var(--muted); margin-top: 8px; }

/* admin */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { border: 1px solid var(--line); padding: 6px 8px; text-align: center; }
th { background: var(--navy); color: #fff; font-weight: 600; position: sticky; top: 0; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cell-done { color: var(--good); font-weight: 700; }
.cell-miss { color: #cbd5e1; }
.rank-avg { font-weight: 700; color: var(--orange-dark); }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.admin-actions a, .admin-actions button {
  background: var(--navy); color: #fff; border: none; text-decoration: none; padding: 9px 14px;
  border-radius: 9px; font-size: 13px; cursor: pointer; font-family: inherit;
}
