:root {
  --bg: #edf6f4;
  --surface: #fbfefd;
  --surface-soft: #dff0ee;
  --text: #102524;
  --muted: #55706e;
  --line: #c7ddda;
  --primary: #0f766e;
  --primary-dark: #0c4f4d;
  --blue: #1f6f8b;
  --blue-soft: #d8ecf2;
  --mint: #7dc9bd;
  --shadow: 0 18px 46px rgba(15, 79, 77, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(216, 236, 242, 0.75), transparent 35%),
    var(--bg);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.65;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 54px);
  border-bottom: 1px solid rgba(199, 221, 218, 0.86);
  background: rgba(237, 246, 244, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-dark), var(--blue));
  font-weight: 900;
  font-size: 21px;
}

.brand span:last-child {
  display: grid;
  line-height: 1.12;
}

.brand strong {
  font-size: 18px;
}

.brand small,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: clamp(12px, 2.8vw, 30px);
}

.main-nav a {
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  text-underline-offset: 7px;
}

.main-nav a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

main {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  min-height: 610px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: clamp(28px, 6vw, 76px);
  padding: 56px 0 44px;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(40px, 6vw, 74px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 630px;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 10px 18px;
  color: var(--primary-dark);
  background: transparent;
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  color: #fff;
  background: var(--primary-dark);
}

.button.secondary {
  color: var(--primary-dark);
  background: #eef9f7;
}

.hero-art {
  position: relative;
  min-height: 450px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.78), rgba(223, 240, 238, 0.72)),
    repeating-linear-gradient(90deg, rgba(15, 118, 110, 0.08) 0 1px, transparent 1px 28px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.book {
  position: absolute;
  display: grid;
  align-items: end;
  width: 44%;
  min-height: 255px;
  padding: 18px;
  border: 1px solid rgba(16, 37, 36, 0.14);
  border-radius: 6px;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 18px 32px rgba(16, 37, 36, 0.12);
}

.book-a {
  left: 8%;
  top: 12%;
  background: linear-gradient(150deg, #0c4f4d, #1f6f8b);
  transform: rotate(-6deg);
}

.book-b {
  right: 9%;
  top: 18%;
  background: linear-gradient(150deg, #16877e, #7dc9bd);
  transform: rotate(4deg);
}

.book-c {
  left: 24%;
  bottom: 10%;
  background: linear-gradient(150deg, #234d63, #0f766e);
}

.progress-orbit {
  position: absolute;
  right: 8%;
  bottom: 9%;
  display: grid;
  width: 132px;
  height: 132px;
  place-items: center;
  align-content: center;
  border: 12px solid var(--blue-soft);
  border-top-color: var(--primary);
  border-right-color: var(--blue);
  border-radius: 50%;
  background: #fff;
}

.progress-orbit strong {
  font-size: 28px;
}

.progress-orbit span {
  color: var(--muted);
  font-size: 13px;
}

.section {
  padding: 58px 0;
  border-top: 1px solid var(--line);
}

.section-head {
  max-width: 740px;
  margin-bottom: 24px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.16;
}

.section-head p:last-child,
.form-note {
  color: var(--muted);
}

.monthly-layout,
.excerpt-layout,
.mine-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.ebook-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 20px;
}

.panel-head,
.ebook-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-head h3,
.panel-head p,
.ebook-item p {
  margin: 0;
}

.ebook-list {
  display: grid;
  gap: 12px;
}

.ebook-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  background: #f5fbfa;
}

.ebook-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.ebook-leader {
  color: var(--primary-dark);
  font-weight: 800;
}

.ebook-reader {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  box-shadow: inset 0 4px 0 rgba(15, 118, 110, 0.12);
}

.ebook-reader[hidden] {
  display: none;
}

.reader-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reader-head h3 {
  margin: 0;
}

.reader-note {
  margin: 0;
  color: var(--muted);
}

.reader-tip {
  margin: 0;
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 700;
}

.ebook-reader-body {
  min-height: 420px;
}

.ebook-frame {
  width: 100%;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.reader-open-link {
  margin-top: 10px;
  width: fit-content;
}

.ebook-text {
  min-height: 420px;
  max-height: 680px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  background: #fff;
  color: var(--text);
  font: 16px/1.8 "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  white-space: pre-wrap;
}

.ebook-image {
  display: block;
  max-width: 100%;
  max-height: 720px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: contain;
}

.reader-fallback {
  display: grid;
  gap: 10px;
  align-content: center;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px;
  background: #f5fbfa;
}

.current-book,
.panel,
.event-card,
.article-card,
.reading-activity {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 254, 253, 0.92);
  box-shadow: var(--shadow);
}

.current-book {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  padding: 22px;
}

.cover {
  min-height: 250px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  color: #fff;
  background: linear-gradient(145deg, var(--primary-dark), var(--blue));
  font-size: 28px;
  font-weight: 900;
  line-height: 1.35;
}

.image-cover {
  background: #eef7f5;
}

.image-cover img {
  width: 100%;
  height: 100%;
  min-height: 250px;
  object-fit: cover;
  display: block;
}

.tag {
  display: inline-flex;
  margin-bottom: 10px;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--primary-dark);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 800;
}

.current-book h3,
.event-card h3,
.article-card h3,
.panel h3 {
  margin: 0;
}

.current-book p,
.event-card p,
.article-card p,
.comment-item,
.empty-state span {
  color: var(--muted);
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.chapter-grid button {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  background: #f4fbfa;
  font-weight: 700;
  text-align: left;
}

.chapter-grid button:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: #e9f7f5;
}

.reading-activity {
  display: flex;
  min-height: 290px;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: rgba(251, 254, 253, 0.96);
}

.activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.activity-head h3 {
  margin: 0;
}

.activity-head span {
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--primary-dark);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 900;
}

.activity-list {
  position: relative;
  flex: 1;
  min-height: 200px;
  overflow: hidden;
}

.activity-item {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--mint);
  border-radius: 6px;
  padding: 18px;
  background: #f5fbfa;
  opacity: 0;
  transform: translateY(18px);
  animation: activityCarousel var(--activity-duration, 15s) infinite;
}

.activity-item strong {
  font-size: 18px;
  line-height: 1.45;
}

.activity-item span {
  color: var(--muted);
  font-size: 14px;
}

@keyframes activityCarousel {
  0%,
  7% {
    opacity: 0;
    transform: translateY(18px);
  }

  12%,
  28% {
    opacity: 1;
    transform: translateY(0);
  }

  35%,
  100% {
    opacity: 0;
    transform: translateY(-18px);
  }
}

.editor-panel,
.register-panel,
.admin-login,
.admin-upload,
.admin-plan,
.reading-detail {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.plan-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.excerpt-layout {
  grid-template-columns: 360px minmax(0, 1fr);
}

label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--text);
  background: #fff;
}

textarea {
  resize: vertical;
}

.article-list,
.event-grid,
.user-notes,
.user-comments {
  display: grid;
  gap: 14px;
}

.article-card {
  padding: 20px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.article-body {
  white-space: pre-wrap;
}

.comment-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.comment-box h4 {
  margin: 0 0 10px;
}

.comment-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.comment-item {
  margin: 0;
  border-left: 3px solid var(--mint);
  border-radius: 0 6px 6px 0;
  padding: 9px 12px;
  background: #f2fbfa;
}

.comment-item strong {
  color: var(--text);
}

.comment-form {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) auto;
  gap: 10px;
}

.event-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.event-card {
  display: grid;
  gap: 8px;
  padding: 20px;
}

.event-card time {
  color: var(--primary-dark);
  font-weight: 900;
}

.mine-layout {
  grid-template-columns: minmax(0, 1fr);
}

.empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
}

.profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.avatar {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--blue));
  font-size: 22px;
  font-weight: 900;
}

.earned-board {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

.earned-board strong {
  color: var(--primary-dark);
  font-size: 13px;
}

.earned-board div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.earned-board em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.mini-medal {
  position: relative;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.16);
}

.mini-book {
  background: linear-gradient(145deg, #f3ce6d, #b87908);
}

.mini-week {
  background: linear-gradient(145deg, #ff8c7f, #b93232);
}

.mini-excerpt {
  background: linear-gradient(145deg, #62c7ea, #1f6f8b);
}

.progress-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  background: #f5fbfa;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--blue-soft);
}

.progress-track span {
  display: block;
  width: var(--progress);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--blue));
}

.medal-section {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  background: #fff;
}

.medal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.medal-head h3 {
  margin: 0;
}

.medal-head span,
.medal-card small {
  color: var(--muted);
  font-size: 13px;
}

.medal-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.medal-card {
  display: grid;
  justify-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 10px;
  background: #f7fcfb;
  text-align: center;
}

.medal-card.locked {
  opacity: 0.58;
  filter: grayscale(0.35);
}

.medal {
  position: relative;
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  box-shadow: inset 0 -8px 14px rgba(0, 0, 0, 0.13), 0 10px 20px rgba(15, 79, 77, 0.14);
}

.mini-medal,
.medal {
  border: 4px solid rgba(255, 255, 255, 0.55);
  outline: 2px solid rgba(16, 37, 36, 0.08);
}

.mini-medal::before {
  content: "";
  position: absolute;
  inset: 16%;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
}

.medal::before,
.medal::after {
  content: "";
  position: absolute;
  bottom: -18px;
  width: 18px;
  height: 30px;
  border-radius: 0 0 4px 4px;
  z-index: -1;
}

.medal::before {
  left: 21px;
  transform: rotate(14deg);
}

.medal::after {
  right: 21px;
  transform: rotate(-14deg);
}

.medal i {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  font-style: normal;
}

.medal-book {
  background: radial-gradient(circle at 30% 25%, #ffe9a3, #e1a928 58%, #b87908);
}

.medal-book::before,
.medal-book::after {
  background: #c6921f;
}

.medal-week {
  background: radial-gradient(circle at 30% 25%, #ffb1a6, #d84f45 58%, #9f2828);
}

.medal-week::before,
.medal-week::after {
  background: #b93a35;
}

.medal-excerpt {
  background: radial-gradient(circle at 30% 25%, #b5e9ff, #3a9ed0 58%, #1f6f8b);
}

.medal-excerpt::before,
.medal-excerpt::after {
  background: #2c7fa8;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.detail-grid article {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fff;
}

.detail-grid strong {
  display: block;
  color: var(--primary-dark);
  font-size: 24px;
}

.mini-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini-list li {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
}

.admin-panel {
  overflow-x: auto;
  padding: 0;
}

.admin-login {
  border-bottom: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  text-align: left;
}

th {
  color: var(--primary-dark);
  background: #f3fbfa;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 34px 16px 44px;
  color: var(--muted);
}

.site-footer strong {
  color: var(--primary-dark);
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-nav {
    justify-content: flex-start;
  }

  .hero,
  .monthly-layout,
  .excerpt-layout,
  .mine-layout,
  .current-book {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 36px;
  }

  .event-grid {
    grid-template-columns: 1fr;
  }

  .comment-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  main {
    width: min(100% - 24px, 1160px);
  }

  .hero h1 {
    font-size: 38px;
  }

  .hero-art {
    min-height: 380px;
  }

  .book {
    width: 54%;
    min-height: 210px;
  }

  .button,
  .hero-actions {
    width: 100%;
  }

  .chapter-grid,
  .plan-fields,
  .medal-list,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
