@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700&family=Share+Tech+Mono&display=swap');

/* ── CSS VARIABLES ── */
:root {
  --navy: #0a1628;
  --navy2: #112040;
  --navy3: #1a2f55;
  --blue: #1e5fa8;
  --blue2: #2d7dd2;
  --cyan: #00c8e0;
  --cyan2: #00e8ff;
  --gold: #f0a500;
  --gold2: #ffd060;
  --green: #00c87a;
  --red: #e03c3c;
  --gray: #8899aa;
  --light: #cce0f5;
  --white: #f0f6ff;
  --card: rgba(255,255,255,0.04);
  --border: rgba(0,200,224,0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--navy); color: var(--white); font-family: 'Noto Sans TC', sans-serif; font-size: 15px; line-height: 1.7; }

/* ── WATERMARK ── */
body::before {
  content: 'ARIE AERO-RADAR';
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%,-50%) rotate(-30deg);
  font-family: 'Share Tech Mono', monospace;
  font-size: 72px; letter-spacing: 0.25em;
  color: rgba(0,200,224,0.04);
  white-space: nowrap; pointer-events: none; z-index: 0; user-select: none;
}

/* ── SCREENS ── */
.screen { display: none; min-height: 100vh; position: relative; z-index: 1; }
.screen.active { display: flex; flex-direction: column; }

/* ── COVER SCREEN ── */
#screen-cover {
  align-items: center; justify-content: center;
  background: linear-gradient(160deg, #0a1628 0%, #0d2040 50%, #0a1628 100%);
  padding: 40px 20px;
}
.cover-inner { text-align: center; max-width: 540px; }
.logo-badge {
  display: inline-block;
  border: 1.5px solid var(--cyan);
  color: var(--cyan); font-family: 'Share Tech Mono', monospace;
  font-size: 11px; letter-spacing: 0.25em;
  padding: 5px 16px; border-radius: 2px; margin-bottom: 36px;
  text-transform: uppercase;
}
.cover-title { font-size: 28px; font-weight: 700; letter-spacing: 0.06em; color: var(--white); margin-bottom: 4px; }
.cover-subtitle { font-size: 13px; color: var(--gray); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 40px; }
.form-grid { display: flex; flex-direction: column; gap: 16px; margin-bottom: 32px; text-align: left; }
.field-label { font-size: 11px; letter-spacing: 0.15em; color: var(--gray); text-transform: uppercase; margin-bottom: 6px; }
.field-input {
  width: 100%; background: rgba(255,255,255,0.06);
  border: 1px solid var(--border); border-radius: 6px;
  color: var(--white); font-family: 'Noto Sans TC', sans-serif;
  font-size: 15px; padding: 11px 14px; outline: none;
  transition: border-color 0.2s;
}
.field-input:focus { border-color: var(--cyan); }
.field-input::placeholder { color: var(--gray); }
.cover-note {
  font-size: 12px; color: var(--gray); margin-bottom: 28px;
  border-left: 2px solid var(--cyan); padding-left: 12px; text-align: left;
}
.btn-start {
  background: var(--cyan); color: var(--navy);
  border: none; border-radius: 6px; cursor: pointer;
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px; letter-spacing: 0.18em;
  padding: 14px 48px; font-weight: bold;
  transition: background 0.2s, transform 0.1s;
  text-transform: uppercase;
}
.btn-start:hover { background: var(--cyan2); transform: translateY(-1px); }
.btn-start:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.cover-stats { display: flex; gap: 32px; justify-content: center; margin-top: 32px; color: var(--gray); font-size: 12px; }
.stat-item strong { display: block; color: var(--cyan); font-size: 20px; font-family: 'Share Tech Mono', monospace; }
.loading-hint { font-size: 11px; color: var(--gray); margin-top: 12px; letter-spacing: 0.1em; min-height: 16px; transition: color .3s; }
.loading-hint.ok  { color: var(--green); }
.loading-hint.err { color: var(--red); font-weight: 600; }

/* ── QUIZ SCREEN ── */
#screen-quiz { padding: 0; }
.quiz-header {
  background: rgba(10,22,40,0.95); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px; display: flex; align-items: center;
  gap: 20px; position: sticky; top: 0; z-index: 100;
}
.quiz-logo { font-family: 'Share Tech Mono', monospace; font-size: 11px; color: var(--cyan); letter-spacing: 0.2em; }
.timer-display {
  background: var(--navy3); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 14px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 20px; color: var(--gold); letter-spacing: 0.1em;
  min-width: 80px; text-align: center;
}
.timer-display.urgent { color: var(--red); animation: pulse-red 0.8s ease-in-out infinite; }
@keyframes pulse-red { 0%,100%{opacity:1} 50%{opacity:0.6} }
.progress-wrap { flex: 1; }
.progress-bar-bg { background: rgba(255,255,255,0.08); border-radius: 100px; height: 6px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--blue2), var(--cyan)); border-radius: 100px; transition: width 0.4s ease; }
.progress-text { font-size: 11px; color: var(--gray); margin-top: 4px; }

.quiz-body { padding: 32px 24px 80px; max-width: 720px; margin: 0 auto; }

.question-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px; margin-bottom: 20px;
  animation: fadeSlide 0.25s ease;
}
@keyframes fadeSlide { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

.q-num { font-size: 10px; color: var(--cyan); letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 10px; font-family: 'Share Tech Mono', monospace; }
.q-text { font-size: 16px; color: var(--white); margin-bottom: 20px; line-height: 1.65; font-weight: 500; }
.options-list { display: flex; flex-direction: column; gap: 8px; }
.option-item {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; padding: 11px 16px; cursor: pointer;
  transition: all 0.15s; user-select: none;
}
.option-item:hover { border-color: var(--cyan); background: rgba(0,200,224,0.08); }
.option-item.selected { border-color: var(--cyan); background: rgba(0,200,224,0.14); }
.option-item.selected .opt-letter { background: var(--cyan); color: var(--navy); }
.opt-letter {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Share Tech Mono', monospace; font-size: 12px; color: var(--gray);
  flex-shrink: 0; transition: all 0.15s;
}
.opt-text { font-size: 14px; color: var(--light); }

.quiz-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(10,22,40,0.97); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; z-index: 100;
}
.nav-info { font-size: 12px; color: var(--gray); }
.nav-info span { color: var(--gold); font-family: 'Share Tech Mono', monospace; }
.btn-nav {
  background: transparent; border: 1px solid var(--border);
  color: var(--light); border-radius: 6px;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 13px; padding: 9px 22px; cursor: pointer; transition: all 0.15s;
}
.btn-nav:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-nav.primary { background: var(--blue); border-color: var(--blue2); color: var(--white); }
.btn-nav.primary:hover { background: var(--blue2); }
.btn-submit { background: var(--cyan); border-color: var(--cyan); color: var(--navy); font-weight: 700; }
.btn-submit:hover { background: var(--cyan2); }
.btn-nav.cancel { border-color: rgba(224,60,60,0.35); color: rgba(224,60,60,0.7); font-size: 12px; padding: 7px 14px; }
.btn-nav.cancel:hover { border-color: var(--red); color: var(--red); background: rgba(224,60,60,0.08); }

/* Unanswered indicator */
.unanswered-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--gold);
  display: inline-block; margin-left: 6px; vertical-align: middle;
  animation: pulse-gold 1s ease-in-out infinite;
}
@keyframes pulse-gold { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ── RESULT SCREEN ── */
#screen-result {
  padding: 40px 20px; align-items: center;
  background: linear-gradient(160deg, #0a1628 0%, #0d2040 60%, #0a1628 100%);
}
.result-inner { max-width: 680px; width: 100%; }
.result-header { text-align: center; margin-bottom: 40px; }
.result-logo { font-family: 'Share Tech Mono', monospace; font-size: 10px; color: var(--cyan); letter-spacing: 0.3em; margin-bottom: 20px; }
.result-name { font-size: 22px; font-weight: 700; color: var(--white); margin-bottom: 4px; }
.result-meta { font-size: 12px; color: var(--gray); }

.psi-display { text-align: center; margin-bottom: 36px; }
.psi-ring-wrap { position: relative; display: inline-block; margin-bottom: 16px; }
.psi-ring { width: 160px; height: 160px; }
.psi-number { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-family: 'Share Tech Mono', monospace; font-size: 38px; font-weight: bold; }
.psi-label { font-size: 11px; color: var(--gray); letter-spacing: 0.2em; text-transform: uppercase; margin-top: 8px; }
.psi-tag { display: inline-block; padding: 5px 20px; border-radius: 100px; font-size: 13px; font-weight: 700; letter-spacing: 0.1em; margin-top: 10px; }
.psi-tag.s5 { background: rgba(0,200,122,0.15); color: var(--green); border: 1px solid rgba(0,200,122,0.3); }
.psi-tag.s4 { background: rgba(0,200,224,0.15); color: var(--cyan); border: 1px solid var(--border); }
.psi-tag.s3 { background: rgba(240,165,0,0.15); color: var(--gold); border: 1px solid rgba(240,165,0,0.3); }
.psi-tag.s2 { background: rgba(224,60,60,0.15); color: var(--red); border: 1px solid rgba(224,60,60,0.2); }
.psi-tag.s1 { background: rgba(224,60,60,0.25); color: var(--red); border: 1px solid rgba(224,60,60,0.4); }

.dims-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.dim-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.dim-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.dim-name { font-size: 11px; color: var(--gray); letter-spacing: 0.12em; text-transform: uppercase; }
.dim-score { font-family: 'Share Tech Mono', monospace; font-size: 18px; font-weight: bold; }
.dim-desc { font-size: 11px; color: var(--gray); margin-bottom: 10px; }
.dim-bar { height: 4px; background: rgba(255,255,255,0.08); border-radius: 100px; overflow: hidden; }
.dim-fill { height: 100%; border-radius: 100px; transition: width 1s ease; }

.indices-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 28px; }
.idx-card { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.idx-label { font-size: 10px; color: var(--gray); letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 6px; }
.idx-value { font-family: 'Share Tech Mono', monospace; font-size: 24px; font-weight: bold; margin-bottom: 4px; }
.idx-desc { font-size: 11px; color: var(--gray); }

.report-section { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 16px; }
.report-section h3 { font-size: 11px; letter-spacing: 0.2em; color: var(--cyan); text-transform: uppercase; margin-bottom: 12px; font-weight: 500; }
.report-section p { font-size: 14px; color: var(--light); line-height: 1.7; }
.report-section ul { list-style: none; padding: 0; }
.report-section li { font-size: 13px; color: var(--light); padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.05); display: flex; align-items: flex-start; gap: 8px; }
.report-section li:last-child { border-bottom: none; }
.li-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); flex-shrink: 0; margin-top: 7px; }
.warn-dot { background: var(--gold); }
.danger-dot { background: var(--red); }

.result-actions { display: flex; gap: 12px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.btn-action {
  padding: 11px 28px; border-radius: 6px; cursor: pointer;
  font-family: 'Noto Sans TC', sans-serif; font-size: 14px; font-weight: 500;
  transition: all 0.15s; border: 1px solid var(--border);
}
.btn-action.primary { background: var(--cyan); color: var(--navy); border-color: var(--cyan); font-weight: 700; }
.btn-action.primary:hover { background: var(--cyan2); }
.btn-action.secondary { background: transparent; color: var(--light); }
.btn-action.secondary:hover { border-color: var(--cyan); color: var(--cyan); }

.penalty-notice {
  background: rgba(240,165,0,0.08); border: 1px solid rgba(240,165,0,0.25);
  border-radius: 8px; padding: 12px 16px; margin-bottom: 16px;
  font-size: 12px; color: var(--gold); display: flex; gap: 8px; align-items: flex-start;
}
.validity-notice {
  background: rgba(224,60,60,0.08); border: 1px solid rgba(224,60,60,0.25);
  border-radius: 8px; padding: 12px 16px; margin-bottom: 16px;
  font-size: 12px; color: var(--red); display: flex; gap: 8px; align-items: flex-start;
}

@media (max-width: 520px) {
  .dims-grid, .indices-row { grid-template-columns: 1fr; }
  .quiz-header { flex-wrap: wrap; gap: 10px; }
  .timer-display { font-size: 16px; padding: 5px 10px; }
}
