/* ============================================================
   主页样式 —— 深时 / 生命长河主题（仅 index.html 使用）
   books.html 仍使用 style.css
   ============================================================ */

:root {
  --deep: #f7fafc;        /* 明亮之底 */
  --deep2: #f1f7f9;
  --ink: #22313f;
  --ink-dim: #5c7386;
  --cyan: #0f766e;        /* 现代生命科学（深青） */
  --amber: #a16207;       /* 化石 / 深时（深琥珀） */
  --card: rgba(255, 255, 255, .85);
  --line: rgba(15, 118, 110, .22);
}

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

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  line-height: 1.85;
  min-height: 100vh;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(15,118,110,.06), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(161,98,7,.05), transparent 55%),
    linear-gradient(175deg, #ffffff 0%, var(--deep2) 55%, var(--deep) 100%);
  background-attachment: fixed;
}

/* ---- 右上角资源链接 ---- */

main {
  max-width: 780px;
  margin: 0 auto;
  padding: 88px 22px 90px;
}

/* ---- 页头：生命长河 ---- */
#hero { margin-bottom: 64px; }
#hero .kicker {
  font-size: .82rem;
  letter-spacing: .45em;
  color: var(--amber);
  margin-bottom: 10px;
}
#hero h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
  font-weight: 700;
  letter-spacing: .06em;
}
#hero h1 em {
  font-style: normal;
  color: var(--cyan);
}
#hero .sub {
  margin-top: 14px;
  max-width: 34em;
  color: var(--ink-dim);
  font-size: .95rem;
}
/* 长河：一条自左向右流淌的光带 */
#hero .river {
  margin-top: 26px;
  height: 2px;
  background: linear-gradient(90deg,
    transparent, rgba(161,98,7,.45) 15%,
    var(--cyan) 55%, rgba(15,118,110,.12) 85%, transparent);
  position: relative;
  overflow: visible;
}
#hero .river::after {
  content: "";
  position: absolute;
  right: -3px; top: -3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px 2px rgba(15,118,110,.35);
}
/* 参考书入口：长河尽头引出书架 */
#shelf {
  margin-top: 20px;
  font-size: .9rem;
}
#shelf a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px dashed rgba(15,118,110,.5);
  padding-bottom: 2px;
}
#shelf a:hover { color: var(--amber); border-bottom-color: var(--amber); }

/* ---- 课程日历 ---- */
.group-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 1.05rem;
  letter-spacing: .3em;
  color: var(--amber);
  margin: 34px 0 18px;
}
.group-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(161,98,7,.4), transparent);
}

.cal-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.cal-legend .evt { cursor: default; }
.cal-legend .evt:hover { filter: none; }
#lessons .cal-note {
  flex-basis: 100%;
  margin: -8px 0 0;
  font-size: .8rem;
  color: var(--ink-dim);
}

#lessons .cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
#lessons .cal-wd {
  text-align: center;
  font-size: .78rem;
  letter-spacing: .1em;
  color: var(--ink-dim);
  padding-bottom: 4px;
}
#lessons .cal-day {
  min-width: 0;
  min-height: 86px;
  border: 1px solid rgba(92, 115, 134, .18);
  border-radius: 10px;
  padding: 6px 8px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(34, 49, 63, .05);
}
#lessons .cal-day .dnum {
  font-size: .82rem;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
#lessons .cal-day.has-class {
  border-color: rgba(15, 118, 110, .38);
  background: rgba(15, 118, 110, .05);
}
#lessons .cal-day.has-class .dnum { color: var(--cyan); font-weight: 600; }
#lessons .cal-day.has-due {
  border-color: rgba(161, 98, 7, .4);
  background: rgba(161, 98, 7, .045);
}
#lessons .cal-day.has-due .dnum { color: var(--amber); font-weight: 600; }
#lessons .cal-day.has-class.has-due {
  border-color: rgba(161, 98, 7, .45);
  background: linear-gradient(135deg, rgba(15,118,110,.05), rgba(161,98,7,.05));
}

#lessons .evt {
  display: block;
  font-size: .74rem;
  line-height: 1.45;
  padding: 2px 7px;
  border-radius: 6px;
  text-decoration: none;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
#lessons .evt.class {
  color: var(--cyan);
  background: rgba(15, 118, 110, .08);
  border-left: 2px solid var(--cyan);
}
#lessons .evt.class.wip {
  color: var(--ink-dim);
  background: transparent;
  border-left: 2px dashed var(--ink-dim);
}
#lessons .evt.due {
  color: var(--amber);
  background: rgba(161, 98, 7, .08);
  border-left: 2px solid var(--amber);
}
#lessons .evt.assign {
  color: #475569;
  background: rgba(71, 85, 105, .10);
  border-left: 2px dashed #475569;
}
#lessons .evt:hover { filter: brightness(1.12); }

/* ---- 页脚 ---- */
#colophon {
  margin-top: 56px;
  text-align: center;
  font-size: .8rem;
  letter-spacing: .12em;
  color: rgba(92, 115, 134, .6);
}

@media (max-width: 600px) {
  main { padding-top: 40px; }
  #lessons .cal { gap: 4px; }
  #lessons .cal-day { min-height: 64px; padding: 4px 5px; border-radius: 8px; }
  #lessons .evt { font-size: .62rem; padding: 1px 4px; }
}
#cc { margin-top: 14px; text-align: center; font-size: .72rem; line-height: 1.7; color: rgba(92, 115, 134, .75); }
#cc a { color: inherit; text-decoration: underline dotted; }
