/* ==========================================================================
   Maple 在线模考 — 外层壳（选卷页 / 说明页）
   设计 token 与组件形态直接对齐 maplesgedu.com/css/style.css，
   让学生从官网点进来视觉不断裂。考试内部（exam / speaking）不用这套。
   注意：本文件与 app.css 独立，互不覆盖；app.css 仍被 exam/result/speaking 引用。
   ========================================================================== */

:root {
  /* --- 与 maplesgedu.com 完全一致，勿改 --- */
  --primary: #4A90D9;
  --primary-light: #6BA8E8;
  --primary-dark: #3A7BC8;
  --accent: #E84A27;
  --accent-light: #F06847;
  --green: #A4C639;
  --sky: #A8D8EA;
  --text: #2D2D2D;
  --text-light: #555555;
  --bg: #ffffff;
  --bg-alt: #F5FAFC;
  --bg-dark: #2D2D2D;
  --border: #e0e0e0;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --transition: all 0.3s ease;

  /* --- 本站附加（官网没有对应变量，不覆盖上面任何一条） --- */
  --text-mute: #7a7a7a;
  --radius-sm: 8px;
  --header-h: 72px;
  --header-h-sm: 60px;
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  overflow-wrap: anywhere;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover { color: var(--accent); }

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

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
}

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

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

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

.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }

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

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

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

.overline {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 6px 16px;
  background: linear-gradient(135deg, var(--sky) 0%, rgba(74, 144, 217, 0.2) 100%);
  border-radius: 20px;
  margin-bottom: 1rem;
}

/* ========================================
   Header & Navigation
   ======================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.header.scrolled { box-shadow: var(--shadow); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
  position: relative;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.logo-en { font-size: 1.25rem; }
.logo-zh { font-size: 0.95rem; color: var(--accent); }

.nav-links {
  display: flex;
  list-style: none;
  gap: 28px;
  align-items: center;
}

.nav-links a {
  color: var(--text);
  font-weight: 500;
  padding: 8px 0;
  position: relative;
  white-space: nowrap;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease, background-color 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.nav-links a:hover { color: var(--primary); }

.nav-cta { display: none; }

.nav-contact {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  background: none;
  border: none;
}

.mobile-menu-btn span {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--text);
  transition: var(--transition);
}

/* ========================================
   Buttons
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.btn:hover::before { left: 100%; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover {
  background: var(--primary-light);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(74, 144, 217, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-secondary:hover { background: var(--primary); color: #fff; }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover {
  background: var(--accent-light);
  color: #fff;
  box-shadow: 0 10px 30px rgba(232, 74, 39, 0.4);
}

.btn-sm { padding: 9px 18px; font-size: 0.9rem; border-radius: var(--radius-sm); }

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

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

.hero {
  position: relative;
  overflow: hidden;
  padding: calc(var(--header-h) + 64px) 0 72px;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%);
}

.hero::before {
  content: '';
  position: absolute;
  /* 必须铺满整个 hero：只盖一部分的话，装饰层边界会在背景上留一道竖着的接缝 */
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 80% 20%, rgba(74, 144, 217, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 20% 80%, rgba(164, 198, 57, 0.1) 0%, transparent 50%);
}

.hero .container { position: relative; z-index: 1; }

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

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

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

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

.step {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.step-n {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  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
   ======================================== */

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 40px rgba(74, 144, 217, 0.15);
}

.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(--primary);
  font-weight: 600;
}
.card-link:hover { gap: 12px; }

/* ========================================
   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: #E8F2FC; color: var(--primary-dark); }
.tag-toefl { background: #FDEDE8; color: #C23A18; }
.tag-plain { background: #F0F0F0; color: #6b6b6b; }

.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: 2px 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-mute); }

.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-light);
  background: var(--bg-alt);
  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-mute); margin: 10px 0 0; }

/* ========================================
   考号查询
   ======================================== */

.lookup {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.lookup input {
  flex: 1 1 200px;
  min-width: 0;
  max-width: 260px;
  padding: 14px 16px;
  font-size: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.lookup input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.lookup-msg {
  font-size: 0.9rem;
  color: var(--text-mute);
  flex-basis: 100%;
  text-align: center;
  min-height: 1.4em;
}
.lookup-msg.err { color: var(--accent); }

/* ========================================
   CTA Section
   ======================================== */

.cta-section {
  padding: 80px 0;
  color: #fff;
  text-align: center;
  background: linear-gradient(-45deg, var(--primary), var(--primary-dark), #3A7BC8, var(--primary-light));
  background-size: 400% 400%;
  animation: gradientMove 8s ease infinite;
}

.cta-section h2 { margin-bottom: 1rem; }

.cta-section p {
  color: rgba(255, 255, 255, 0.85);
  max-width: 640px;
  margin: 0 auto 2rem;
}

.cta-section .btn-primary { background: #fff; color: var(--primary); }
.cta-section .btn-primary:hover { background: var(--accent); color: #fff; }

.cta-section .btn-secondary { color: #fff; border-color: rgba(255, 255, 255, 0.7); }
.cta-section .btn-secondary:hover { background: #fff; color: var(--primary); border-color: #fff; }

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

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ========================================
   Footer
   ======================================== */

.footer {
  background: var(--bg-dark);
  color: #fff;
  padding: 60px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .logo { color: #fff; }
.footer-brand .logo-zh { color: var(--accent-light); }

.footer-brand p {
  color: rgba(255, 255, 255, 0.7);
  margin: 1rem 0 0;
  font-size: 0.92rem;
}

.footer h4 {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  color: #fff;
}

.footer-links { list-style: none; }

.footer-links li {
  margin-bottom: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.92rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  position: relative;
  display: inline-block;
  transition: var(--transition);
}

.footer-links a:hover { color: var(--accent); }

.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.footer-links a:hover::after { width: 100%; }

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}

.footer-bottom p { color: inherit; margin: 0; }

/* ========================================
   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; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  html { scroll-padding-top: calc(var(--header-h-sm) + 12px); }

  .container { padding: 0 16px; }

  .nav { height: var(--header-h-sm); }

  .nav-contact { display: none; }

  .mobile-menu-btn { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    /* 绝对定位的偏移是相对 .nav 的 padding box（含 container 的左右内边距），
       所以 0 就正好铺满视口宽；用 -16px 会把面板撑出屏幕两侧 */
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 16px 16px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  .nav-links.open { display: flex; }

  .nav-links li { border-bottom: 1px solid var(--border); }
  .nav-links li:last-child { border-bottom: none; }

  /* 只把普通导航项拉成整行；.nav-cta 里是按钮，不能被 display:block 覆盖掉自身布局 */
  .nav-links li:not(.nav-cta) a { display: block; padding: 13px 0; }
  .nav-links a::after { display: none; }

  .nav-cta { display: block; padding-top: 14px; }
  /* `.nav-links a` 的 padding 特异性高于 `.btn`，这里必须把按钮的内边距要回来 */
  .nav-cta .btn { width: 100%; padding: 14px 28px; }

  .hero { padding: calc(var(--header-h-sm) + 44px) 0 52px; }
  .hero-text .lead { font-size: 1.05rem; }
  .hero-buttons { flex-direction: column; gap: 12px; }
  .hero-buttons .btn { width: 100%; }

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

  .section { padding: 50px 0; }
  .section-header { margin-bottom: 40px; }

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

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

  .lookup input { max-width: none; flex-basis: 100%; }
  .lookup .btn { width: 100%; }

  .cta-section { padding: 50px 0; }
  .cta-buttons { flex-direction: column; }
  .cta-buttons .btn { width: 100%; }

  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  .overline { font-size: 0.75rem; letter-spacing: 1.5px; }
  .logo-en { font-size: 1.1rem; }
  .logo-zh { font-size: 0.85rem; }
}

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

.logo {align-items:center}
.logo img {width:44px;height:50px;object-fit:contain}
.brand-text {display:flex;flex-direction:column;line-height:1.2}
.brand-text b {font-size:15px}
.brand-text em {font-size:12px;font-style:normal;color:#ec5935;font-weight:400;margin-top:3px}

.exam-landing {padding-top:var(--header-h)}
