@import './student-theme.css';

:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #303846;
  background: #fff;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 1200px; }
/* 首页仅展示入口与介绍，禁选文字，兼容 Safari。 */
body, body * { -webkit-user-select: none; user-select: none; }
img { -webkit-user-drag: none; }
h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--brand-ring); outline-offset: 4px; }
.container { width: min(1120px, calc(100% - 80px)); margin-inline: auto; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.skip-link { position: fixed; z-index: 10; top: 12px; left: 12px; padding: 12px 16px; background: white; border: 1px solid var(--brand-primary); border-radius: var(--student-radius-control); transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.site-header { position: absolute; top: 0; left: 0; width: 100%; z-index: 3; }
.header-inner { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand-wordmark { display: block; width: 172px; height: auto; }
.main-nav { display: flex; align-items: center; gap: 36px; font-size: 14px; color: #526e69; }
.main-nav a { display: inline-flex; min-height: 44px; align-items: center; }
.main-nav a:hover { color: var(--brand-primary); }
.main-nav .nav-login { color: var(--brand-primary); font-size: 14px; }
.main-nav .nav-login:hover { color: var(--brand-hover); }
/* Animate.css 管理进场；只用淡入和小幅上移，按钮自身的悬停不参与进场位移。 */
.home-enter.animate__animated, .home-reveal.animate__animated {
  --animate-duration: 720ms;
  animation-delay: var(--home-enter-delay, 0ms);
  animation-timing-function: cubic-bezier(.22, 1, .36, 1);
  animation-iteration-count: 1;
}
.home-enter.animate__fadeInUp, .home-reveal.animate__fadeInUp { animation-name: home-rise; }
.header-inner.home-enter { --animate-duration: 500ms; }
.hero h1.home-enter { --home-enter-delay: 80ms; }
.hero-action.home-enter { --home-enter-delay: 160ms; }
.hero-product-stage.home-enter { --home-enter-delay: 240ms; --animate-duration: 840ms; }
.hero-scroll.home-enter { --home-enter-delay: 360ms; --animate-duration: 500ms; }
.feature-link:nth-child(2) { --home-enter-delay: 80ms; }
.feature-link:nth-child(3) { --home-enter-delay: 160ms; }
.home-reveal.is-reveal-pending { opacity: 0; }
@keyframes home-rise {
  from { opacity: 0; transform: translate3d(0, var(--home-enter-distance, 18px), 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
/* 首屏：文案与主按钮在上，真实作答界面在下。 */
.hero-band { position: relative; isolation: isolate; overflow: hidden; background: linear-gradient(135deg, var(--brand-soft), var(--brand-subtle) 75%); }
.hero-background { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.hero-background canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-background-grid { mask: linear-gradient(#000000fc 0%, #000000e8 8.98%, transparent 100%); -webkit-mask: linear-gradient(#000000fc 0%, #000000e8 8.98%, transparent 100%); }
.hero {
  --hero-height: max(100svh, 600px);
  --hero-top-space: clamp(104px, 12svh, 160px);
  --hero-stage-padding: clamp(20px, 3svh, 40px);
  --hero-product-gap: 56px;
  --hero-scroll-space: 56px;
  --hero-copy-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: var(--hero-height);
  padding-block: var(--hero-top-space) var(--hero-scroll-space);
}
.hero-copy { width: 100%; max-width: 760px; text-align: center; }
.hero h1 { font-size: clamp(40px, min(4.6vw, 6.7svh), 60px); line-height: 1.25; font-weight: 500; color: var(--brand-ink); }
.hero h1 > span { white-space: nowrap; }
.hero h1 .hero-title-line { display:block; }
.hero-intro { margin:16px auto 0; max-width:600px; font-size:14px; line-height:1.8; color:var(--brand-secondary-text); }
.hero-title-accent { color: var(--brand-primary); }
.hero-description { font-size: 14px; line-height: 1.8; color: var(--brand-secondary-text); margin-bottom: 16px; }
.hero-description strong { color: var(--brand-primary); font-weight: 500; }
.primary-button { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-width: 184px; min-height: 52px; padding: 14px 24px; margin-top: 28px; border-radius: var(--student-radius-control); background: var(--brand-primary); color: #fff; font-size: 16px; line-height: 1.5; font-weight: 500; box-shadow: 0 3px 10px var(--brand-halo), 0 1px 2px var(--brand-shadow-soft); transition: background .16s, box-shadow .16s, transform .16s; user-select: none; }
.primary-button .icon { width: 20px; height: 20px; stroke-width: 1.8; }
.primary-button:hover { background: var(--brand-hover); }
.primary-button:active { background: #174f48; transform: none; box-shadow: 0 1px 3px var(--brand-shadow-soft); }
.hero-product-stage { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 100%; padding-block: var(--hero-product-gap) var(--hero-stage-padding); }
/* 按电脑本体居中，仅收起原图上下的透明留白，保留机身和阴影。 */
.hero-product {
  position: relative;
  /* 同时受内容宽度、用户确认的最大宽度和首屏剩余高度约束。 */
  width: min(88%, max(240px, calc((var(--hero-height) - var(--hero-top-space) - var(--hero-copy-height) - var(--hero-product-gap) - var(--hero-stage-padding) - var(--hero-scroll-space)) * 1.4821052632)));
  max-width: 720px;
  aspect-ratio: 1536 / 912;
  overflow: hidden;
}
.hero-product img { display: block; position: absolute; top: 0; left: 0; width: 100%; height: auto; transform: translateY(-6.25%); }
.hero-scroll { position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: var(--student-radius-control); color: var(--brand-secondary-text); transition: color .16s, background .16s; }
.hero-scroll .icon { width: 32px; height: 32px; }
.hero-scroll:hover { color: var(--brand-primary); background: var(--brand-soft); }
.hero-scroll:active { background: var(--brand-pressed); }
.content { scroll-margin-top: 0; background: white; }
/* 宣传区沿用首屏的轻量标题与松石青，大区留白区别于学习页的紧凑控件。 */
.section-title { font-size: clamp(28px, 3vw, 36px); font-weight: 500; line-height: 1.4; color: var(--brand-ink); text-align: center; }
.feature-section { padding-block: 80px; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 40px; }
.feature-link { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: 32px; border: 1px solid transparent; border-radius: var(--student-radius-control); background: var(--brand-subtle); transition: background .16s, border-color .16s; }
.feature-heading { display: flex; align-items: center; gap: 16px; }
.feature-heading img { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.feature-heading h3 { margin: 0; font-size: 20px; font-weight: 500; line-height: 1.5; color: var(--brand-ink); }
.feature-link p { font-size: 14px; line-height: 1.8; color: var(--brand-secondary-text); margin-block: 16px 28px; }
.feature-action { display: inline-flex; align-items: center; gap: 12px; margin-top: auto; font-size: 13px; line-height: 1.7; color: var(--brand-primary); }
.feature-action .icon { width: 16px; height: 16px; }
.feature-link:hover, .feature-link:focus-visible { background: var(--brand-soft); border-color: var(--brand-border); }
.feature-link:active { background: var(--brand-pressed); }
.level-section { padding-block:0 80px; }
.section-intro { margin:16px auto 0; max-width:640px; font-size:14px; line-height:1.8; text-align:center; color:var(--brand-secondary-text); }
.level-links { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; margin-top:32px; }
.level-link { display:flex; flex-direction:column; gap:16px; min-width:0; padding:24px 20px; border:1px solid var(--brand-border); border-radius:var(--student-radius-control); background:#fff; }
.level-link strong { font-size:18px; line-height:1.5; font-weight:500; color:var(--brand-ink); }
.level-link > span { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:13px; line-height:1.7; color:var(--brand-primary); }
.level-link .icon { width:16px; height:16px; flex-shrink:0; }
.level-link:hover,.level-link:focus-visible { background:var(--brand-soft); border-color:var(--brand-primary); }
.level-link:active { background:var(--brand-pressed); }
.home-score-note { margin:24px 0 0; font-size:13px; line-height:1.7; text-align:center; color:#707c8b; }
.site-footer { background: var(--brand-subtle); border-top: 1px solid var(--brand-border); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 28px; }
.footer-inner .brand-wordmark { width: 136px; }
.footer-inner p { font-size: 13px; line-height: 1.7; color: #707c8b; }
@media (hover: hover) and (pointer: fine) {
  .primary-button:hover { transform: translateY(-1px); box-shadow: 0 5px 14px var(--brand-halo), 0 2px 3px var(--brand-shadow-soft); }
  .primary-button:active { transform: none; box-shadow: 0 1px 3px var(--brand-shadow-soft); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .home-enter.animate__animated, .home-reveal.animate__animated { animation: none !important; }
  .home-reveal.is-reveal-pending { opacity: 1; }
  .primary-button:hover { transform: none; }
}
