@import url('/brand.css');
/* ==========================================================================
   Maple 在线模考 — 外层壳（选卷页 / 成绩页 / 记录页等）
   颜色、圆角、字体 token 全部来自 /brand.css（与 maplesgedu.com 同一套），
   顶栏页脚是 brand.css 里的 .mx-*。这里只写组件形态，不写色值。
   考试内部（exam / speaking）用 app.css，不用这套。
   ========================================================================== */

/* ⛔ src/maple-auth.js 渲染的登录中转页只引 /shell.css，外加写死浅色的内联样式
   （.mb 灰字、白底按钮）。那段在 src/ 里改不了；深色模式下灰字落在深底上看不清。
   所以这类页面固定用浅色 token，不跟系统深色。 */
:root:has(body > .mb) {
  color-scheme: light;
  --bg: #FFFFFF;
  --surface: #F7F7F5;
  --text: #1F2A30;
  --text-muted: #55636B;
  --heading: #0F2E3D;
  --link: #0B5A86;
  --border: #E2E5E7;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* 锚点跳转时给吸顶头留位置 */
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  font-family: var(--font);
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-wrap: break-word;
}

/* ========================================
   Typography
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  overflow-wrap: anywhere;
  color: var(--heading);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.875rem, 1.35rem + 2.1vw, 2.5rem); line-height: 1.25; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.1vw, 1.875rem); font-weight: 600; line-height: 1.35; }
h3 { font-size: clamp(1.1875rem, 1.1rem + 0.35vw, 1.375rem); font-weight: 600; line-height: 1.45; }

p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color .15s ease;
}

a:hover { color: var(--heading); text-decoration: underline; text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

strong { color: var(--text); }

code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 1px 6px;
}

.muted { color: var(--text-muted); font-size: 0.9rem; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ========================================
   Layout
   ======================================== */

.container {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin: 0 auto;
}

.container.narrow { max-width: 820px; }

.section { padding: clamp(56px, 7vw, 88px) 0; }
.section-alt { background: var(--surface); }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}

.section-header p { margin-bottom: 0; }

.overline {
  display: inline-block;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--accent-text);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 12px;
}

/* ========================================
   Buttons（与官网 .btn 一致：扁平、10px 圆角、44px 起）
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.3;
  border: 1.5px solid transparent;
  border-radius: var(--radius-btn);
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn-accent { background: var(--accent-strong); color: var(--on-accent-strong); border-color: var(--accent-strong); }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent-strong); }

.btn-secondary, .btn-ghost { background: transparent; color: var(--heading); border-color: var(--border-strong); }
.btn-secondary:hover, .btn-ghost:hover { background: var(--surface); color: var(--heading); border-color: var(--heading); }

.btn-sm { min-height: 44px; padding: 8px 16px; font-size: .9375rem; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ========================================
   Hero
   ======================================== */

.hero {
  position: relative;
  padding: clamp(40px, 6vw, 72px) 0 clamp(40px, 6vw, 64px);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.hero-text { max-width: 760px; }
.hero-text h1 { margin-bottom: 1.25rem; }
/* 与官网一致：h1 里的 span 是强调色。.nowrap 只是防断行，不参与配色 */
.hero-text h1 span { color: var(--accent-text); }
.hero-text h1 .nowrap { color: inherit; }

.hero-text .lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* 三步说明（hero 下方） */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 24px;
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.step {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.step-n {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 14px;
}

.step h4 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.step p { font-size: 0.92rem; margin-bottom: 0; line-height: 1.7; }

/* ========================================
   Cards（扁平：细线分隔，hover 只换边框色）
   ======================================== */

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: border-color .15s ease;
}

.card:hover { border-color: var(--border-strong); }

.card h3 { margin-bottom: 0.75rem; }
.card p { margin-bottom: 1.5rem; }
.card p:last-child { margin-bottom: 0; }

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--link);
  font-weight: 600;
}

/* ========================================
   Tags
   ======================================== */

.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.tag-ielts { background: var(--tint); color: var(--heading); }
.tag-toefl { background: var(--warn-bg); color: var(--accent-text); }
.tag-plain { background: var(--surface-2); color: var(--text-muted); }

.card > .tag { margin-bottom: 14px; }

/* ========================================
   卷子列表
   ======================================== */

.exam-group + .exam-group { margin-top: 56px; }

.exam-group-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.exam-group-head h3 { margin-bottom: 0; font-size: clamp(1.15rem, 2.6vw, 1.4rem); }
.exam-group-head .count { font-size: 0.9rem; color: var(--text-muted); }

.paper-card {
  display: flex;
  flex-direction: column;
  padding: 26px;
}

.paper-card h3 {
  font-size: 1.15rem;
  margin: 12px 0 8px;
}

.paper-card .blurb {
  font-size: 0.92rem;
  line-height: 1.75;
  margin-bottom: 16px;
}

.paper-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.paper-meta span {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 11px;
}

.paper-card .btn { margin-top: auto; align-self: flex-start; }
.paper-card .hint { font-size: 0.8rem; color: var(--text-muted); margin: 10px 0 0; }


/* ========================================
   CTA Section（官网的深色品牌带：扁平 --panel，不做渐变动画）
   ======================================== */

.cta-section {
  padding: clamp(56px, 7vw, 88px) 0;
  color: var(--on-panel);
  text-align: center;
  background: var(--panel);
}

.cta-section h2 { margin-bottom: 1rem; color: var(--on-panel); }

.cta-section p {
  color: var(--on-panel-muted);
  max-width: 640px;
  margin: 0 auto 2rem;
}

.cta-section a:not(.btn) { color: var(--on-panel); text-decoration: underline; }
.cta-section .btn-secondary { color: var(--on-panel); border-color: rgba(255, 255, 255, 0.5); } /* 半透明白线只画在深色 --panel 上 */
.cta-section .btn-secondary:hover { background: transparent; color: var(--on-panel); border-color: var(--on-panel); }

.cta-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ========================================
   Misc
   ======================================== */

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 992px) {
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .hero-text .lead { font-size: 1.0625rem; }
  .hero-buttons { flex-direction: column; gap: 12px; }
  .hero-buttons .btn { width: 100%; }

  .steps { margin-top: 2.25rem; padding-top: 2rem; gap: 16px; }

  .section-header { margin-bottom: 36px; }

  .grid-3, .grid-4 { grid-template-columns: 1fr; }

  .card { padding: 24px; }
  .paper-card { padding: 22px; }
  .paper-card .btn { width: 100%; align-self: stretch; }


  .cta-buttons { flex-direction: column; }
  .cta-buttons .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
