/* ============================================================
   探秘过山车中的科学奥秘 — 笔记本手记风格
   配色：天空蓝 + 轨道橙 + 笔记纸黄
   ============================================================ */

:root {
  --sky-deep: #0a4d7a;
  --sky: #2c78ae;
  --steel: #3a6b8a;
  --track: #d95d26;
  --track-dark: #b8481a;
  --energy: #e8a317;
  --paper: #f7efd5;
  --ink: #1a3a4a;
  --red: #c93838;
  --green: #2d7a3d;
  --leaf: #5d983d;
}

/* ====== 全局 ====== */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: #07151f;
}

body {
  margin: 0;
  color: #263328;
  background: #07151f;
  font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
  line-height: 1.6;
}

a { color: inherit; }
img { display: block; max-width: 100%; }

/* ====== 容器 ====== */
.site-shell {
  width: min(100%, 540px);
  margin: 0 auto;
  min-height: 100vh;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 60px rgba(0, 0, 0, .45);
}

/* ====== HERO 封面 ====== */
.hero {
  position: relative;
  min-height: 100svh;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(180deg, #0a4d7a 0%, #2c78ae 45%, #6ab0d9 100%);
}

/* 天空渐变叠层 */
.sky-wash {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(10,77,122,.92) 0%, rgba(44,120,174,.55) 40%, rgba(106,176,217,.15) 100%);
}

/* 云朵 */
.cloud {
  position: absolute;
  background: rgba(255, 255, 255, .75);
  border-radius: 100px;
  z-index: 1;
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, .75);
  border-radius: 50%;
}

.cloud-1 {
  width: 80px; height: 28px;
  left: 8%; top: 12%;
  animation: drift-slow 12s ease-in-out infinite;
}
.cloud-1::before { width: 35px; height: 35px; left: 10px; top: -16px; }
.cloud-1::after { width: 28px; height: 28px; left: 40px; top: -10px; }

.cloud-2 {
  width: 60px; height: 22px;
  right: 10%; top: 8%;
  animation: drift-slow 15s ease-in-out infinite reverse;
}
.cloud-2::before { width: 26px; height: 26px; left: 8px; top: -12px; }
.cloud-2::after { width: 22px; height: 22px; left: 30px; top: -8px; }

.cloud-3 {
  width: 50px; height: 18px;
  left: 55%; top: 20%;
  animation: drift-slow 10s ease-in-out infinite;
  animation-delay: 2s;
}
.cloud-3::before { width: 22px; height: 22px; left: 6px; top: -10px; }
.cloud-3::after { width: 18px; height: 18px; left: 26px; top: -6px; }

@keyframes drift-slow {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(15px); }
}

/* 过山车轨道剪影 */
.track-silhouette {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  opacity: .65;
}

.track-silhouette svg {
  width: 100%;
  height: auto;
  display: block;
}

/* 速度光点 */
.speed-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff5b0;
  box-shadow: 0 0 6px rgba(255, 245, 176, .8),
              0 0 14px rgba(255, 200, 100, .55),
              0 0 24px rgba(255, 180, 60, .35);
  animation: streak 2.5s ease-in-out infinite;
  z-index: 2;
}

@keyframes streak {
  0%, 100% {
    opacity: .2;
    transform: translateX(0) scale(.5);
  }
  48% {
    opacity: 1;
    transform: translateX(8px) scale(1.3);
  }
}

/* 封面标题纸片 */
.paper-title {
  position: absolute;
  left: 0;
  top: 9%;
  width: 92%;
  padding: 29px 24px 28px 31px;
  color: var(--ink);
  transform: rotate(-1.2deg);
  z-index: 3;
  background-color: rgba(250, 245, 221, .96);
  background-image: linear-gradient(rgba(44, 120, 174, .08) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(44, 120, 174, .08) 1px, transparent 1px);
  background-size: 18px 18px;
  clip-path: polygon(0 3%, 18% 1%, 37% 3%, 58% 0, 75% 2%, 100% 0,
                     98% 92%, 84% 94%, 66% 92%, 48% 96%, 28% 93%, 0 97%);
  filter: drop-shadow(0 14px 16px rgba(0, 0, 0, .24));
}

.paper-title .eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--steel);
  letter-spacing: .04em;
}

.paper-title h1 {
  margin: 0;
  font: 900 46px/1.15 'KaiTi', 'STKaiti', serif;
  color: var(--ink);
  letter-spacing: .02em;
}

.paper-title .subtitle {
  margin: 10px 0 0;
  font: 400 14px 'KaiTi', 'STKaiti', serif;
  color: var(--track);
}

.title-star {
  position: absolute;
  right: 22px;
  top: 20px;
  font-size: 22px;
  color: var(--track);
  opacity: .5;
  transform: rotate(15deg);
}

/* 封面对话气泡 */
.hero-dialogues {
  position: absolute;
  bottom: 110px;
  left: 18px;
  right: 18px;
  z-index: 3;
  display: grid;
  gap: 9px;
}

.hero-dialogues p {
  margin: 0;
  padding: 10px 14px;
  border-radius: 3px 14px 14px;
  background: rgba(255, 255, 255, .92);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  box-shadow: 0 3px 0 rgba(44, 120, 174, .15);
}

.hero-dialogues b {
  display: inline-block;
  padding: 3px 8px;
  margin-right: 8px;
  border-radius: 999px;
  color: white;
  font-size: 11px;
  font-weight: 800;
  background: var(--track);
}

.hero-dialogues p:nth-child(2) b { background: var(--sky); }
.hero-dialogues p:nth-child(3) b { background: var(--energy); }

/* 滚动提示 */
.scroll-cue {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  text-align: center;
  color: rgba(255, 255, 255, .85);
  text-decoration: none;
  font-size: 13px;
}

.scroll-cue b {
  display: block;
  font-size: 20px;
  margin-top: 4px;
  animation: bob 1.8s ease-in-out infinite;
}

@keyframes bob {
  50% { transform: translateY(5px); }
}

/* ====== 笔记本页面 ====== */
.paper-page {
  position: relative;
  padding: 32px 20px 0 37px;
  background-color: var(--paper);
  background-image: linear-gradient(rgba(44, 120, 174, .06) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(44, 120, 174, .06) 1px, transparent 1px);
  background-size: 19px 19px;
}

/* 左侧虚线 */
.paper-page::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 23px;
  border-left: 2px dashed rgba(44, 120, 174, .2);
}

/* 顶部阴影 */
.paper-page::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 26px;
  background: linear-gradient(180deg, rgba(28, 42, 55, .18), transparent);
  pointer-events: none;
}

/* 装订孔 */
.binding {
  position: absolute;
  z-index: 4;
  left: 2px;
  top: 62px;
  display: grid;
  gap: 168px;
}

.binding i {
  display: block;
  width: 23px;
  height: 9px;
  border: 3px solid #78694a;
  border-left: 0;
  border-radius: 0 9px 9px 0;
  box-shadow: 1px 1px 1px rgba(0, 0, 0, .25);
}

/* ====== 章节导航 ====== */
.chapter-nav {
  position: sticky;
  z-index: 8;
  top: 9px;
  display: flex;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 30px;
  padding: 5px;
  border: 1px solid rgba(44, 120, 174, .25);
  border-radius: 999px;
  background: rgba(251, 247, 225, .92);
  box-shadow: 0 5px 16px rgba(38, 57, 65, .12);
  backdrop-filter: blur(8px);
}

.chapter-nav a {
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--steel);
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s;
}

.chapter-nav a:hover {
  background: rgba(44, 120, 174, .12);
}

/* ====== 卡片通用 ====== */
.note-card {
  position: relative;
  scroll-margin-top: 78px;
  margin-bottom: 28px;
  padding: 22px 18px;
  background: rgba(255, 252, 232, .79);
  border: 1.5px solid rgba(44, 120, 174, .35);
  box-shadow: 3px 5px 0 rgba(44, 91, 120, .1);
}

/* 章节标题 */
.section-heading {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.section-heading > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: white;
  background: var(--sky);
  font: 800 18px/1 'KaiTi', serif;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .12);
}

.section-heading p {
  margin: 0;
  font-size: 12px;
  color: var(--steel);
  letter-spacing: .04em;
}

.section-heading h2 {
  margin: 2px 0 0;
  font: 700 22px/1.3 'KaiTi', 'STKaiti', serif;
  color: var(--ink);
}

/* 引用 */
blockquote {
  margin: 12px 0;
  padding: 10px 14px;
  border-left: 3px solid var(--track);
  background: rgba(217, 93, 38, .06);
  font: italic 14px/1.6 'KaiTi', serif;
  color: var(--track-dark);
  border-radius: 0 6px 6px 0;
}

/* 对话框 */
.dialogue {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
}

.dialogue span {
  padding: 5px 9px;
  border-radius: 999px;
  color: white;
  font-size: 11px;
  font-weight: 800;
  background: var(--track);
}

.dialogue p {
  margin: 0;
  padding: 9px 12px;
  border-radius: 3px 14px 14px;
  background: white;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 2px 0 rgba(44, 78, 120, .14);
}

/* 科学注释 */
.science-note {
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(232, 163, 23, .12);
  font-size: 12px;
  color: var(--steel);
  text-align: center;
}

.small-note {
  margin-top: 10px;
  font-size: 12px;
  color: #6b8290;
  text-align: center;
}

/* ====== 图片卡片 ====== */
.photo-note,
.chart-note {
  position: relative;
  margin: 5px 8px 36px;
  padding: 8px 8px 15px;
  background: #fffbed;
  box-shadow: 2px 5px 12px rgba(52, 55, 35, .18);
}

.photo-note img,
.chart-note img {
  width: 100%;
  height: auto;
  aspect-ratio: 4/4.75;
  object-fit: cover;
  object-position: center;
  filter: saturate(.9) contrast(1.02);
}

.photo-note figcaption {
  margin-top: 8px;
  font-size: 11px;
  color: #6b7a85;
  text-align: center;
  font-family: 'KaiTi', serif;
}

.tilt-right { transform: rotate(1.2deg); }
.tilt-left { transform: rotate(-1.2deg); }

/* ====== 研究目的卡片 ====== */
.objective-grid {
  display: grid;
  gap: 12px;
}

.objective-card {
  padding: 14px;
  border: 1.5px solid rgba(44, 120, 174, .25);
  border-radius: 4px;
  background: rgba(255, 255, 255, .6);
  box-shadow: 2px 3px 0 rgba(44, 91, 120, .08);
}

.objective-card header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.obj-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 16px;
  color: white;
}

.obj-a .obj-icon { background: var(--track); }
.obj-b .obj-icon { background: var(--energy); }
.obj-c .obj-icon { background: var(--sky); }

.objective-card header span {
  font: 800 16px 'KaiTi', serif;
  color: var(--ink);
}

.objective-card p {
  margin: 0;
  font-size: 13px;
  color: #3a5060;
}

/* ====== 实验材料网格 ====== */
.materials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.material-item {
  text-align: center;
  padding: 12px 6px;
  border: 1.5px solid rgba(44, 120, 174, .2);
  border-radius: 6px;
  background: rgba(255, 255, 255, .55);
}

.mat-icon {
  display: block;
  font-size: 22px;
  color: var(--track);
  margin-bottom: 4px;
}

.material-item p {
  margin: 0;
  font-size: 11px;
  color: var(--ink);
  font-weight: 600;
}

/* ====== 轨道设计 ====== */
.track-design {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  padding: 20px 8px 8px;
  border-bottom: 2px solid #435e5c;
  min-height: 120px;
}

.track-point {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.track-point .track-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.track-point .track-arrow {
  font-size: 14px;
  color: var(--track);
}

.highest { height: 100px; }
.slope { height: 75px; }
.dive { height: 55px; }
.curve { height: 35px; }
.lowest { height: 15px; }

.track-point::before {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--sky);
  box-shadow: 0 0 8px rgba(44, 120, 174, .3);
  margin-bottom: 4px;
}

.highest::before { background: var(--red); }
.dive::before { background: var(--track); }
.curve::before { background: var(--energy); }
.lowest::before { background: var(--steel); }

/* ====== 制作步骤 ====== */
.process-steps {
  display: grid;
  gap: 12px;
}

.step-card {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1.5px solid rgba(44, 120, 174, .2);
  border-radius: 4px;
  background: rgba(255, 255, 255, .55);
}

.step-card header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-card header b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: white;
  font: 800 14px sans-serif;
  background: var(--track);
}

.step-card header span {
  font: 800 15px 'KaiTi', serif;
  color: var(--ink);
}

.step-card p {
  margin: 0;
  grid-column: 2;
  font-size: 13px;
  color: #3a5060;
}

/* ====== 实验现象 ====== */
.observation-list {
  display: grid;
  gap: 12px;
}

.observation-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px;
  border-left: 3px solid var(--energy);
  background: rgba(255, 255, 255, .55);
  border-radius: 0 6px 6px 0;
}

.observation-item .obs-num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: white;
  font: 800 13px sans-serif;
  background: var(--energy);
}

.observation-item p {
  margin: 0;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.6;
}

.observation-item b {
  color: var(--track);
}

/* ====== 表格 ====== */
.ledger-wrap {
  margin: 0 -8px 16px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

table {
  width: 100%;
  min-width: 380px;
  border-collapse: collapse;
  font-size: 12px;
}

th, td {
  padding: 9px 6px;
  border-right: 1px solid rgba(44, 120, 174, .3);
  border-bottom: 1px solid rgba(44, 120, 174, .22);
  text-align: center;
  white-space: nowrap;
}

th {
  color: var(--ink);
  background: rgba(44, 120, 174, .2);
  font-weight: 800;
}

tbody tr:nth-child(even) {
  background: rgba(44, 120, 174, .06);
}

.peak-row {
  color: var(--track-dark);
  font-weight: 800;
  background: rgba(232, 163, 23, .18) !important;
}

/* ====== 柱状图 ====== */
.vertical-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: end;
  min-height: 200px;
  padding: 28px 18px 0;
  border-bottom: 2px solid #435e5c;
  margin-bottom: 16px;
}

.vertical-bars b {
  position: relative;
  display: block;
  width: 60px;
  min-height: 42px;
  color: white;
  background: var(--steel);
  border-radius: 3px 3px 0 0;
  box-shadow: inset 0 0 18px rgba(255, 255, 255, .18);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6px;
  font-size: 12px;
  font-weight: 700;
}

.vertical-bars .orange-bar {
  background: var(--track);
}

.vertical-bars p {
  text-align: center;
  font-size: 11px;
  color: var(--steel);
  margin: 8px 0 0;
  line-height: 1.4;
}

.vertical-bars > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

/* ====== 大数字结果 ====== */
.big-result {
  text-align: center;
  padding: 16px;
  border: 1.5px solid rgba(217, 93, 38, .3);
  border-radius: 6px;
  background: rgba(255, 255, 255, .55);
}

.big-result span {
  font-size: 12px;
  color: var(--steel);
}

.big-result strong {
  display: block;
  margin: 4px 0;
  font: 900 32px 'KaiTi', serif;
  color: var(--track);
}

.big-result p {
  margin: 0;
  font-size: 12px;
  color: #6b7a85;
}

/* ====== 科学原理网格 ====== */
.principle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.principle-item {
  padding: 14px;
  border: 1.5px solid rgba(44, 120, 174, .2);
  border-radius: 6px;
  background: rgba(255, 255, 255, .55);
  text-align: center;
}

.principle-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  color: white;
  margin-bottom: 8px;
}

.p-gravity .principle-icon { background: var(--track); }
.p-inertia .principle-icon { background: var(--sky); }
.p-centripetal .principle-icon { background: var(--green); }
.p-height .principle-icon { background: var(--energy); }

.principle-item header {
  margin-bottom: 6px;
}

.principle-item b {
  font: 800 15px 'KaiTi', serif;
  color: var(--ink);
}

.principle-item p {
  margin: 0;
  font-size: 12px;
  color: #4a6275;
  line-height: 1.5;
}

/* ====== 思考与收获 ====== */
.thought-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.thought-row {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 11px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(45, 122, 61, .25);
  background: rgba(255, 255, 255, .58);
  border-radius: 4px;
}

.thought-row > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: white;
  font-size: 14px;
  font-weight: 800;
}

.thought-row.yes > span {
  background: var(--green);
}

.thought-row b {
  display: block;
  color: var(--ink);
  font: 800 14px/1.45 'KaiTi', serif;
}

.thought-row small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #6b7a85;
}

/* 最终答案 */
.final-answer {
  margin: 14px 0 8px;
  padding: 12px 16px;
  border: 1.5px solid var(--track);
  border-radius: 6px;
  background: rgba(217, 93, 38, .06);
  font: italic 15px/1.6 'KaiTi', serif;
  color: var(--track-dark);
  text-align: center;
}

.scope-note {
  margin-top: 8px;
  font-size: 11px;
  color: #8a9ba5;
  text-align: center;
}

/* ====== 继续探索 ====== */
.question-stickers {
  display: grid;
  gap: 10px;
}

.question-stickers p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 3px 10px 10px;
  background: rgba(232, 163, 23, .12);
  border-left: 3px solid var(--energy);
  font-size: 13px;
  color: var(--ink);
}

.question-stickers b {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  margin-right: 8px;
  color: white;
  font-size: 11px;
  font-weight: 800;
  background: var(--energy);
}

/* ====== 保护提示 ====== */
.protect-note {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  margin: 4px 0 42px;
  padding: 18px 16px;
  color: #fff5bd;
  background: linear-gradient(135deg, #0a4d7a, #173856);
  border: 1px solid rgba(44, 120, 174, .5);
  box-shadow: 4px 5px 0 rgba(50, 70, 90, .18);
  transform: rotate(-.5deg);
  border-radius: 6px;
}

.protect-note > span {
  display: grid;
  place-items: center;
  font-size: 22px;
  color: var(--energy);
}

.protect-note h2 {
  margin: 0 0 4px;
  font: 800 16px 'KaiTi', serif;
  color: #fff5bd;
}

.protect-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255, 245, 189, .85);
}

/* ====== Footer ====== */
footer {
  position: relative;
  margin: 0 -20px 0 -37px;
  padding: 52px 28px 42px 43px;
  color: #fff7cf;
  text-align: center;
  background: linear-gradient(180deg, #0a4d7a, #071923);
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image: radial-gradient(circle, #e8a317 0 2px, transparent 3px);
  background-size: 57px 63px;
  animation: drift 6s linear infinite;
}

@keyframes drift {
  to { background-position: 57px -63px; }
}

footer > * { position: relative; z-index: 2; }

.gear {
  margin: 0 auto 18px;
  display: flex;
  justify-content: center;
}

.gear svg {
  animation: spin 8s linear infinite;
}

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

footer p {
  margin: 0 0 12px;
  font: 400 14px/1.7 'KaiTi', serif;
  color: rgba(255, 247, 207, .9);
}

footer span {
  font-size: 12px;
  color: rgba(255, 247, 207, .6);
}

/* ====== 响应式 ====== */
@media (min-width: 541px) {
  body { padding: 24px 0; }
  .site-shell { border-radius: 24px; }
  .hero { min-height: 860px; }
}

@media (max-width: 370px) {
  .paper-title { padding-left: 24px; }
  .paper-title h1 { font-size: 38px; }
  .section-heading h2 { font-size: 20px; }
  .paper-page { padding-left: 34px; padding-right: 15px; }
  .chapter-nav a { min-width: 53px; padding-inline: 9px; }
  .materials-grid { grid-template-columns: repeat(2, 1fr); }
  .principle-grid { grid-template-columns: 1fr; }
}

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