/* ==========================================================================
   数字教材 · 启动页（welcome.css）
   独立于阅读壳：这里还没有身份，只是一个门。
   气质：暖纸底 + 墨字 + 朱砂点色；书阵用四色布面书脊，
   深浅一致、各不相同——像一套真书摆在案上。
   不用任何外部字体与图片，离线可用。
   ========================================================================== */

:root {
  --paper: #fbf7ee;
  --paper-2: #f3ecdd;
  --ink: #1c2a24;
  --ink-2: rgba(28, 42, 36, .70);
  --ink-3: rgba(28, 42, 36, .46);
  --ink-4: rgba(28, 42, 36, .30);
  --gold: #8f6b2f;
  --gold-2: #b08a45;
  --seal: #a5432c;
  --seal-2: #bf5336;
  --line: rgba(28, 42, 36, .13);
  --line-2: rgba(28, 42, 36, .07);
  --mono: 'SF Mono', 'JetBrains Mono', 'Cascadia Code', ui-monospace, Consolas, monospace;
  --serif: 'Songti SC', 'Source Han Serif SC', 'Noto Serif SC', 'SimSun', Georgia, serif;
  --sans: -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

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

html, body { height: 100%; }

body {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(920px 540px at 84% -6%, rgba(184, 138, 69, .16), transparent 64%),
    radial-gradient(760px 640px at -4% 104%, rgba(53, 86, 107, .09), transparent 62%),
    linear-gradient(176deg, #fdfaf2 0%, var(--paper) 42%, var(--paper-2) 100%);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* 网格：48px 一格，压得极淡，只给「作图板」的秩序感 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(28, 42, 36, .035) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, rgba(28, 42, 36, .035) 0 1px, transparent 1px 48px);
  mask-image: radial-gradient(120% 92% at 50% 42%, #000 26%, transparent 84%);
  z-index: 0;
}

/* 四角准星：固定在地屏四边，像一张挂图的定位角 */
body::after {
  content: '';
  position: fixed;
  inset: 18px;
  pointer-events: none;
  border: 1px solid rgba(28, 42, 36, .085);
  z-index: 0;
}

/* ---------------------------------------------------------------- 顶栏 */
.top {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px clamp(24px, 4.2vw, 64px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 253, 247, .72), rgba(255, 253, 247, 0));
  backdrop-filter: blur(2px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  color: inherit;
}

.seal {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  color: #fdf8ec;
  background: var(--seal);
  border: 1px solid rgba(140, 52, 34, .9);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .16), 0 2px 6px rgba(140, 52, 34, .22);
}

.brand-txt { display: flex; flex-direction: column; gap: 4px; }
.brand-txt b { font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: .18em; }
.brand-txt i {
  font-family: var(--mono);
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: .22em;
  color: var(--ink-4);
  white-space: nowrap;
}

.top-right { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }

.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--ink-2);
}
.live i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4f9367;
  box-shadow: 0 0 0 3px rgba(79, 147, 103, .16);
  animation: pulse 2.8s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .38; } }

.home {
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
  letter-spacing: .04em;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color .18s, border-color .18s;
}
.home span { margin-left: 5px; font-size: 11px; color: var(--ink-4); }
.home:hover { color: var(--seal); border-color: rgba(165, 67, 44, .35); }

.enter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  padding: 11px 22px;
  font-size: 13.5px;
  letter-spacing: .14em;
  text-decoration: none;
  color: #fdf8ec;
  background: linear-gradient(180deg, var(--seal-2), var(--seal));
  border: 1px solid rgba(140, 52, 34, .9);
  box-shadow: 0 8px 20px rgba(140, 52, 34, .20);
  transition: transform .18s, box-shadow .18s, filter .18s;
}
.enter span { font-size: 12px; }
.enter:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
  box-shadow: 0 12px 26px rgba(140, 52, 34, .28);
}

/* ---------------------------------------------------------------- 主体 */
.main {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(380px, 1fr) auto;
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
  padding: 0 clamp(24px, 4.2vw, 64px);
}

.hero { padding: 40px 0 32px; max-width: 620px; }

.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--ink-4);
}
.kicker span {
  padding: 3px 8px;
  color: var(--seal);
  border: 1px solid rgba(165, 67, 44, .28);
  letter-spacing: .12em;
}
.kicker b { font-weight: 400; color: var(--ink-3); }
.kicker i { font-style: normal; color: var(--ink-4); }

h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(46px, 5.6vw, 82px);
  line-height: 1.14;
  letter-spacing: .06em;
  color: var(--ink);
}
h1 em {
  font-style: normal;
  color: var(--seal);
  position: relative;
}
/* 朱线只压在第二行底下，像一条分界，不抢字 */
h1 em::after {
  content: '';
  position: absolute;
  left: 2px; right: .18em; bottom: -10px;
  height: 1px;
  background: linear-gradient(90deg, rgba(165, 67, 44, .55), rgba(165, 67, 44, 0));
}

.lead {
  margin-top: 30px;
  font-size: 15px;
  line-height: 2.05;
  color: var(--ink-2);
  letter-spacing: .02em;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 34px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stats div {
  flex: 1 1 0;
  min-width: 92px;
  padding: 14px 16px 12px 0;
  border-right: 1px solid var(--line-2);
}
.stats div:last-child { border-right: 0; }
.stats dt {
  font-size: 10.5px;
  letter-spacing: .18em;
  color: var(--ink-3);
}
.stats dd {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 23px;
  letter-spacing: .04em;
  color: var(--gold);
}

.hint {
  margin-top: 22px;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: .04em;
}

/* ---------------------------------------------------------------- 书阵
   四本书各自一色，明度接近、色相错开：
   靛青 / 赭石 / 松绿 / 紫檀。整体不再是一片绿。 */
.stage {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-self: end;
  width: max-content;
  max-width: 100%;
  gap: clamp(10px, 1.1vw, 18px);
  padding: 26px 0 32px;
}
/* 四角准星：把书阵框成一块「版位」，比整页边框更收敛 */
.stage::before {
  content: '';
  position: absolute;
  inset: -16px -14px 18px -14px;
  pointer-events: none;
  background:
    linear-gradient(var(--line), var(--line)) 0 0 / 18px 1px no-repeat,
    linear-gradient(var(--line), var(--line)) 0 0 / 1px 18px no-repeat,
    linear-gradient(var(--line), var(--line)) 100% 0 / 18px 1px no-repeat,
    linear-gradient(var(--line), var(--line)) 100% 0 / 1px 18px no-repeat,
    linear-gradient(var(--line), var(--line)) 0 100% / 18px 1px no-repeat,
    linear-gradient(var(--line), var(--line)) 0 100% / 1px 18px no-repeat,
    linear-gradient(var(--line), var(--line)) 100% 100% / 18px 1px no-repeat,
    linear-gradient(var(--line), var(--line)) 100% 100% / 1px 18px no-repeat;
}

.stage-label {
  position: absolute;
  top: -38px;
  left: 2px;
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .2em;
  color: var(--ink-4);
  white-space: nowrap;
}
.stage-label b { font-weight: 400; font-size: 10px; letter-spacing: .16em; color: var(--gold); }

/* 书阵脚下的基准线 */
.stage::after {
  content: '';
  position: absolute;
  left: -6px; right: -6px; bottom: 26px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(28, 42, 36, .22) 12%, rgba(28, 42, 36, .22) 88%, transparent);
}

.book {
  --c1: #35566b;
  --c2: #24404f;
  --sheen: rgba(255, 255, 255, .13);
  position: relative;
  width: clamp(112px, 10vw, 158px);
  height: clamp(252px, 23vw, 332px);
  padding: 17px 12px 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  background:
    linear-gradient(180deg, var(--sheen), rgba(255, 255, 255, 0) 22%, rgba(0, 0, 0, .16)),
    linear-gradient(102deg, var(--c1) 0%, var(--c2) 62%, rgba(0, 0, 0, .18) 100%),
    var(--c2);
  border: 1px solid rgba(0, 0, 0, .16);
  border-radius: 2px 3px 3px 2px;
  box-shadow:
    0 16px 32px rgba(62, 46, 24, .20),
    0 2px 4px rgba(62, 46, 24, .14),
    inset 0 1px 0 rgba(255, 255, 255, .14),
    inset -4px 0 8px -4px rgba(0, 0, 0, .45);
  transition: transform .26s ease, box-shadow .26s;
  animation: rise .7s cubic-bezier(.2, .7, .3, 1) backwards;
}
.book:nth-of-type(1) { animation-delay: .06s; }
.book:nth-of-type(2) { animation-delay: .14s; }
.book:nth-of-type(3) { animation-delay: .22s; }
.book:nth-of-type(4) { animation-delay: .30s; }

.book:nth-of-type(1) { --c1: #35566b; --c2: #24404f; }   /* 靛青 */
.book:nth-of-type(2) { --c1: #8c5c3b; --c2: #6d4327; }   /* 赭石 */
.book:nth-of-type(3) { --c1: #4c6d59; --c2: #365140; }   /* 松绿 */
.book:nth-of-type(4) { --c1: #6c4b5f; --c2: #513646; }   /* 紫檀 */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.book:hover {
  transform: translateY(-7px);
  box-shadow:
    0 26px 48px rgba(62, 46, 24, .26),
    0 3px 6px rgba(62, 46, 24, .16),
    inset 0 1px 0 rgba(255, 255, 255, .2);
}

/* 书脊上的烫印细框：精装书的常见做法，比压痕更像纸 */
.book::before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 1px;
  pointer-events: none;
}
/* 底端切口线 */
.book::after {
  content: '';
  position: absolute;
  left: 10px; right: 10px; bottom: 8px;
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .34) 0 1px, transparent 1px 5px);
  opacity: .55;
}

.code {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .2em;
  color: rgba(247, 240, 225, .72);
}

.name {
  writing-mode: vertical-rl;
  text-orientation: upright;
  white-space: nowrap;            /* 竖排不折列：书名最多 7 字，一列放得下 */
  font-family: var(--serif);
  font-size: clamp(17px, 1.45vw, 22px);
  letter-spacing: .18em;
  line-height: 1.2;
  color: #f8f2e3;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .28);
}

.meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  font-size: 10px;
  text-align: center;
}
.meta > span {
  white-space: nowrap;
  font-family: var(--mono);
  letter-spacing: .02em;
  color: rgba(247, 240, 225, .68);
}
.meta b { font-weight: 500; color: #f2ddb4; }
.meta i {
  font-style: normal;
  font-size: 9px;
  white-space: nowrap;
  color: rgba(247, 240, 225, .52);
  letter-spacing: .04em;
}

/* ---------------------------------------------------------------- 页脚 */
.foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(24px, 4.2vw, 64px);
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: .03em;
}
.icp {
  color: var(--ink-3);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.icp:hover { color: var(--ink-2); border-color: rgba(28, 42, 36, .2); }
.ticker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--ink-4);
}
.org { letter-spacing: .1em; color: var(--ink-3); }

/* ---------------------------------------------------------------- 窄屏 */
@media (max-width: 1080px) {
  body { overflow-y: auto; }
  .main {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
    padding-top: 24px;
    padding-bottom: 28px;
  }
  .hero { max-width: none; }
  .lead br { display: none; }
  .stage { justify-self: stretch; width: auto; justify-content: flex-start; overflow-x: auto; padding-bottom: 34px; }
  .book { height: 260px; }
}

@media (max-width: 720px) {
  .top { flex-wrap: nowrap; gap: 10px; padding: 14px 20px; }
  .top-right { width: auto; margin-left: auto; gap: 8px; }
  .live, .home { display: none; }
  .enter { margin-left: auto; padding: 9px 15px; font-size: 12.5px; letter-spacing: .1em; }
  .brand-txt i { display: none; }
  .main { padding: 18px 20px 24px; }
  h1 { font-size: 40px; }
  .lead { font-size: 14px; line-height: 1.95; }
  .stats div { min-width: 76px; }
  /* 四本并排铺满一行，不做横向滚动——启动页不该让人先学会滑动 */
  .stage { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; overflow: visible; }
  .stage::before { inset: -10px -8px 16px; }
  .stage::after { bottom: 22px; }
  .stage-label { top: -24px; font-size: 8px; letter-spacing: .14em; }
  .stage-label b { font-size: 9px; }
  .book { width: auto; height: 208px; padding: 11px 6px 11px; }
  .book::before { inset: 5px; }
  .name { font-size: 14px; letter-spacing: .08em; }
  .code { font-size: 8.5px; letter-spacing: .14em; }
  .meta { font-size: 8.5px; gap: 4px; }
  .meta i { font-size: 8px; }
  .foot { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 20px; }
  .ticker { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .book, .live i { animation: none; }
  .book, .enter { transition: none; }
}
