/* ============================================================
   小三门训练测试系统 — 公共样式
   配色：深藏青绿 + 暖金（钢琴黑白键与琴弦的联想）
   字体：标题微软雅黑 / 正文宋体
   信号元素：五线谱横线，作为贯穿全站的分隔与装饰
   ============================================================ */

:root {
  --bg: #0e2a32;
  --surface: #153b45;
  --surface-hi: #1c4750;
  --border: #24525c;
  --gold: #d4af6a;
  --gold-soft: rgba(212, 175, 106, 0.16);
  --jade: #6fa89b;
  --text: #edeee9;
  --text-dim: #9fb8ba;
  --danger: #d97757;
  --font-heading: "Microsoft YaHei", "PingFang SC", "Heiti SC", sans-serif;
  --font-body: "SimSun", "Songti SC", "STSong", serif;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .heading {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 0.5em;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select {
  font-family: var(--font-body);
  font-size: 15px;
}

/* ---------- 五线谱分隔线：signature element ---------- */
.staff-rule {
  width: 100%;
  height: 34px;
  margin: 0 auto;
  background-image: repeating-linear-gradient(
    var(--border),
    var(--border) 1px,
    transparent 1px,
    transparent 8px
  );
  background-size: 100% 32px;
  background-position: top;
  opacity: 0.55;
}
.staff-rule.accent {
  background-image: repeating-linear-gradient(
    var(--gold),
    var(--gold) 1.5px,
    transparent 1.5px,
    transparent 8px
  );
  opacity: 0.35;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 顶部导航 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}
.brand {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand small {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text-dim);
  font-size: 13px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-dim);
}
.user-chip .role-tag {
  background: var(--gold-soft);
  color: var(--gold);
  border-radius: 100px;
  padding: 2px 10px;
  font-size: 12px;
  font-family: var(--font-heading);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 9px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn:hover { border-color: var(--gold); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn-primary {
  background: var(--gold);
  color: #1a2420;
  border-color: var(--gold);
  font-weight: 700;
}
.btn-primary:hover { background: #e0bd80; }
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-dim);
}
.btn-ghost:hover { color: var(--text); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- 卡片 / 三科入口 ---------- */
.hero {
  text-align: center;
  padding: 56px 0 36px;
}
.hero h1 {
  font-size: 32px;
  margin-bottom: 10px;
}
.hero p {
  color: var(--text-dim);
  font-size: 15px;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 30px 0 50px;
}
@media (max-width: 720px) {
  .subject-grid { grid-template-columns: 1fr; }
}

.subject-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 20px;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.subject-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.subject-card .note {
  font-family: var(--font-heading);
  font-size: 26px;
  color: var(--gold);
  margin-bottom: 14px;
  display: block;
}
.subject-card h3 { font-size: 18px; margin-bottom: 6px; }
.subject-card p { color: var(--text-dim); font-size: 13.5px; margin: 0 0 14px; }
.subject-card .status {
  font-size: 12px;
  font-family: var(--font-heading);
  color: var(--jade);
}
.subject-card .status.soon { color: var(--text-dim); }
.subject-card.disabled { opacity: 0.55; }
.subject-card.disabled:hover { transform: none; border-color: var(--border); }

/* ---------- 表单 / 弹层 ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 16, 19, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 380px;
}
.modal h2 { font-size: 20px; margin-bottom: 18px; }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-family: var(--font-heading);
}
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--gold);
}

.tab-switch {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  background: var(--bg);
  border-radius: 8px;
  padding: 4px;
}
.tab-switch button {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 13.5px;
}
.tab-switch button.active {
  background: var(--surface-hi);
  color: var(--gold);
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-top: -4px;
  margin-bottom: 14px;
}

.hint {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: -8px;
  margin-bottom: 14px;
}

.close-x {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
}

/* ---------- 教师/管理面板通用 ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
}
.panel h3 { font-size: 16px; margin-bottom: 14px; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data-table th, table.data-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
}
table.data-table th {
  color: var(--text-dim);
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 12.5px;
}
.join-code {
  font-family: var(--font-heading);
  color: var(--gold);
  letter-spacing: 0.15em;
  font-size: 16px;
}

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 30px 10px;
  font-size: 13.5px;
}

.footer-note {
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  padding: 30px 0 50px;
}
