:root {
  color-scheme: light;
  --ink: #182126;
  --muted: #667078;
  --line: #d9e0e4;
  --paper: #f7f8f5;
  --panel: #ffffff;
  --green: #28745d;
  --blue: #275c91;
  --gold: #b5812b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 245, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  font-weight: 800;
}

nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

nav a {
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
}

nav a.active,
nav a:hover {
  color: var(--ink);
  background: #e8eeea;
}

.home-shell,
.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 52px 0;
}

.home-shell {
  min-height: calc(100vh - 68px);
  display: grid;
  align-content: center;
  gap: 34px;
}

.narrow {
  width: min(760px, calc(100% - 32px));
}

.intro,
.section-title {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 68px);
  line-height: 1.08;
}

h2 {
  margin: 0;
  font-size: 28px;
}

p {
  color: var(--muted);
  line-height: 1.8;
}

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

.module-card,
.diagnosis-panel,
.upload-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 20px 55px rgba(24, 33, 38, 0.08);
}

.module-card {
  min-height: 240px;
  padding: 28px;
  display: grid;
  align-content: space-between;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.module-card:hover {
  transform: translateY(-3px);
  border-color: #a7b7bd;
}

.module-card span,
.tag {
  color: var(--gold);
  font-weight: 800;
}

.diagnosis-panel {
  min-height: 460px;
  padding: 42px;
  display: grid;
  align-content: center;
}

.primary-link,
button,
.download-link {
  width: fit-content;
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  color: #fff;
  background: var(--green);
  cursor: pointer;
  font-weight: 800;
}

.library-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  margin-top: 28px;
  min-height: 640px;
}

.materials-list {
  display: grid;
  align-content: start;
  gap: 12px;
}

.material-item {
  width: 100%;
  display: grid;
  gap: 8px;
  text-align: left;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: none;
}

.material-item small {
  color: var(--muted);
  line-height: 1.5;
}

.material-item b {
  color: var(--blue);
}

.material-item.active {
  border-color: var(--green);
  outline: 3px solid rgba(40, 116, 93, 0.14);
}

.preview-pane {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf1f2;
}

.empty-preview {
  min-height: 640px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

iframe {
  width: 100%;
  height: 640px;
  display: none;
  border: 0;
}

.pay-bar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 34px rgba(24, 33, 38, 0.16);
}

.pay-bar span {
  display: block;
  color: var(--blue);
  font-weight: 800;
}

.pay-dialog {
  width: min(440px, calc(100% - 32px));
  border: 0;
  border-radius: 8px;
  padding: 26px;
}

.pay-dialog::backdrop {
  background: rgba(24, 33, 38, 0.45);
}

.icon-close {
  float: right;
  padding: 4px 10px;
  color: var(--ink);
  background: #edf1f2;
}

.pay-box {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  margin: 18px 0;
  border: 1px dashed #a7b7bd;
  border-radius: 8px;
  color: var(--muted);
  background: #f8faf9;
}

.muted {
  font-size: 14px;
}

.upload-form {
  margin-top: 26px;
  padding: 24px;
  display: grid;
  gap: 16px;
}

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

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfb;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.status-line {
  min-height: 28px;
  font-weight: 800;
}

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

  .site-header {
    padding: 14px 16px;
  }

  .module-grid,
  .library-layout,
  .form-row {
    grid-template-columns: 1fr;
  }

  .page-shell,
  .home-shell {
    padding: 30px 0;
  }
}
