:root {
  color-scheme: light;
  --orange-900: #71350f;
  --orange-800: #984817;
  --orange-700: #bd591e;
  --orange-600: #df6c27;
  --orange-500: #f08332;
  --orange-400: #f5a35f;
  --orange-300: #fac48f;
  --orange-200: #fde0bd;
  --orange-100: #fff0db;
  --cream-50: #fffdf8;
  --cream-100: #fbf7ef;
  --cream-200: #f4ecdf;
  --ink-900: #2f2924;
  --ink-800: #403933;
  --ink-700: #51483f;
  --ink-600: #655c54;
  --ink-500: #756a60;
  --green-600: #397a57;
  --red-600: #b94839;
  --blue-600: #39708e;
  --surface: rgba(255, 255, 255, 0.93);
  --border: rgba(122, 81, 45, 0.16);
  --shadow-sm: 0 5px 18px rgba(94, 58, 29, 0.08);
  --shadow-md: 0 16px 44px rgba(94, 58, 29, 0.12);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 30px;
  --content: 1240px;
  font-family: Inter, "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink-900);
  background:
    radial-gradient(circle at 8% 2%, rgba(248, 167, 93, 0.22), transparent 27rem),
    radial-gradient(circle at 92% 18%, rgba(255, 210, 130, 0.18), transparent 24rem),
    linear-gradient(160deg, #fffdf8 0%, #fbf6ec 48%, #fffaf1 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: var(--orange-700);
}

:focus-visible {
  outline: 3px solid rgba(240, 131, 50, 0.42);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  transform: translateY(-160%);
  padding: 10px 16px;
  border-radius: 10px;
  color: white;
  background: var(--ink-900);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  z-index: 100;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 78px;
  padding: 11px max(24px, calc((100vw - var(--content)) / 2));
  border-bottom: 1px solid rgba(126, 80, 40, 0.12);
  background: rgba(255, 252, 246, 0.9);
  box-shadow: 0 4px 24px rgba(93, 62, 33, 0.05);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 0;
  border: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 15px 15px 15px 5px;
  color: white;
  background: linear-gradient(145deg, var(--orange-500), var(--orange-700));
  box-shadow: 0 8px 18px rgba(222, 106, 36, 0.24);
  font-size: 24px;
  font-weight: 800;
}

.brand-copy {
  display: grid;
  gap: 3px;
}

.brand-copy strong {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy small {
  color: var(--ink-500);
  font-size: 11px;
  letter-spacing: 0.035em;
}

.session-panel {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: max-content;
  padding: 8px 10px 8px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink-700);
  background: rgba(255, 255, 255, 0.8);
  font-size: 13px;
}

.session-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #43a76d;
  box-shadow: 0 0 0 4px rgba(67, 167, 109, 0.13);
}

.session-time {
  min-width: 48px;
  padding: 4px 7px;
  border-radius: 8px;
  color: var(--orange-800);
  background: var(--orange-100);
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  text-align: center;
}

.text-button {
  padding: 5px 8px;
  border: 0;
  border-left: 1px solid var(--border);
  color: var(--ink-500);
  background: transparent;
  cursor: pointer;
}

.text-button:hover {
  color: var(--orange-700);
}

#main-content {
  flex: 1;
}

.app-loading {
  display: grid;
  min-height: calc(100vh - 138px);
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--ink-700);
}

.app-loading small {
  color: var(--ink-500);
}

.loading-orbit {
  width: 46px;
  height: 46px;
  border: 4px solid var(--orange-200);
  border-top-color: var(--orange-600);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

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

.home-page {
  overflow: hidden;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 64px;
  align-items: center;
  width: min(var(--content), calc(100% - 48px));
  min-height: 540px;
  margin: 0 auto;
  padding: 72px 0 54px;
}

.hero::before {
  position: absolute;
  z-index: -1;
  top: 46px;
  right: -160px;
  width: 520px;
  height: 420px;
  border-radius: 48% 52% 42% 58%;
  background: linear-gradient(135deg, rgba(255, 216, 168, 0.34), rgba(245, 163, 95, 0.08));
  content: "";
  transform: rotate(-8deg);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0 0 18px;
  padding: 7px 12px;
  border: 1px solid rgba(226, 108, 37, 0.2);
  border-radius: 999px;
  color: var(--orange-800);
  background: rgba(255, 241, 219, 0.68);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.eyebrow::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange-500);
  content: "";
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(44px, 5vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.hero h1 span {
  position: relative;
  color: var(--orange-600);
  white-space: nowrap;
}

.hero-lead {
  max-width: 680px;
  margin: 24px 0 30px;
  color: var(--ink-700);
  font-size: 18px;
  line-height: 1.85;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.button[aria-busy="true"] {
  cursor: wait;
}

.button-primary {
  color: white;
  background: linear-gradient(135deg, var(--orange-500), var(--orange-700));
  box-shadow: 0 10px 25px rgba(211, 92, 25, 0.24);
}

.button-secondary {
  border-color: var(--border);
  color: var(--ink-700);
  background: white;
}

.button-quiet {
  border-color: transparent;
  color: var(--orange-700);
  background: transparent;
}

.button-quiet:hover:not(:disabled) {
  border-color: var(--orange-200);
  background: var(--orange-100);
}

.button-danger {
  color: white;
  background: var(--red-600);
}

.hero-note {
  color: var(--ink-500);
  font-size: 13px;
}

.hero-visual {
  position: relative;
  min-height: 390px;
}

.visual-card {
  position: absolute;
  border: 1px solid rgba(132, 83, 41, 0.14);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

.visual-main {
  inset: 18px 28px 34px 10px;
  padding: 28px;
  border-radius: 32px 32px 32px 10px;
  transform: rotate(2deg);
}

.visual-main h2 {
  margin: 8px 0 6px;
  font-size: 24px;
}

.visual-main p {
  margin: 0;
  color: var(--ink-500);
  line-height: 1.6;
}

.visual-badge {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: var(--orange-500);
  font-weight: 900;
}

.mini-flow {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.flow-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border-radius: 15px;
  background: var(--cream-100);
}

.flow-num {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  color: var(--orange-800);
  background: var(--orange-100);
  font-weight: 800;
}

.flow-row strong {
  font-size: 14px;
}

.flow-row small {
  color: var(--ink-500);
}

.flow-state {
  color: var(--green-600);
  font-size: 12px;
  font-weight: 800;
}

.visual-float {
  right: -4px;
  bottom: 2px;
  display: grid;
  gap: 3px;
  min-width: 160px;
  padding: 17px 20px;
  border-radius: 18px 18px 5px 18px;
  transform: rotate(-3deg);
}

.visual-float strong {
  color: var(--orange-700);
  font-size: 22px;
}

.visual-float small {
  color: var(--ink-500);
}

.home-section {
  width: min(var(--content), calc(100% - 48px));
  margin: 0 auto;
  padding: 52px 0 76px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 0 0 7px;
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: -0.035em;
}

.section-heading p {
  max-width: 640px;
  margin: 0;
  color: var(--ink-500);
  line-height: 1.65;
}

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

.module-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 330px;
  padding: 25px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.module-card::after {
  position: absolute;
  right: -42px;
  bottom: -50px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--module-accent, var(--orange-500));
  content: "";
  opacity: 0.08;
}

.module-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.module-card-featured {
  grid-column: span 2;
}

.module-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.module-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 17px 17px 17px 6px;
  color: white;
  background: var(--module-accent, var(--orange-500));
  font-size: 23px;
  font-weight: 900;
  box-shadow: 0 9px 18px color-mix(in srgb, var(--module-accent, var(--orange-500)) 24%, transparent);
}

.pill {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--orange-800);
  background: var(--orange-100);
  font-size: 12px;
  font-weight: 700;
}

.module-card h3 {
  margin: 25px 0 8px;
  font-size: 25px;
}

.module-subtitle {
  margin: 0 0 13px;
  color: var(--orange-700);
  font-weight: 700;
}

.module-description {
  flex: 1;
  margin: 0 0 20px;
  color: var(--ink-500);
  line-height: 1.7;
}

.module-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 18px;
  color: var(--ink-500);
  font-size: 13px;
}

.module-progress {
  display: grid;
  gap: 7px;
  margin-bottom: 18px;
}

.progress-track {
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: var(--cream-200);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--module-accent, var(--orange-500));
}

.progress-label {
  display: flex;
  justify-content: space-between;
  color: var(--ink-500);
  font-size: 12px;
}

.coming-card {
  justify-content: center;
  border-style: dashed;
  text-align: center;
  background: rgba(255, 253, 248, 0.6);
}

.coming-card span {
  font-size: 34px;
}

.coming-card h3 {
  margin-top: 15px;
}

.feature-strip {
  background: linear-gradient(120deg, #3a3029, #554335);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  width: min(var(--content), calc(100% - 48px));
  margin: 0 auto;
  padding: 44px 0;
  color: white;
}

.feature-item {
  padding: 12px 28px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.feature-item:last-child {
  border: 0;
}

.feature-item strong {
  display: block;
  margin-bottom: 7px;
  color: #ffd4a5;
  font-size: 17px;
}

.feature-item span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  line-height: 1.55;
}

.error-state,
.expired-state {
  display: grid;
  min-height: calc(100vh - 140px);
  place-content: center;
  justify-items: center;
  padding: 32px;
  text-align: center;
}

.error-state span,
.expired-state span {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 20px;
  color: var(--orange-800);
  background: var(--orange-100);
  font-size: 30px;
  font-weight: 900;
}

.error-state h1,
.expired-state h1 {
  margin: 20px 0 8px;
}

.error-state p,
.expired-state p {
  max-width: 520px;
  margin: 0 0 22px;
  color: var(--ink-500);
  line-height: 1.7;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 22px 24px;
  border-top: 1px solid var(--border);
  color: var(--ink-500);
  background: rgba(255, 252, 246, 0.72);
  font-size: 12px;
}

.confirm-dialog {
  width: min(430px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: white;
  box-shadow: 0 30px 90px rgba(44, 31, 21, 0.28);
}

.confirm-dialog::backdrop {
  background: rgba(47, 41, 36, 0.46);
  backdrop-filter: blur(5px);
}

.confirm-dialog form {
  display: grid;
  justify-items: center;
  padding: 32px;
  text-align: center;
}

.dialog-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 17px;
  color: var(--orange-800);
  background: var(--orange-100);
  font-size: 25px;
  font-weight: 900;
}

.confirm-dialog h2 {
  margin: 18px 0 8px;
}

.confirm-dialog p {
  margin: 0 0 24px;
  color: var(--ink-500);
  line-height: 1.65;
}

.dialog-actions {
  display: flex;
  gap: 10px;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 50px;
  }

  .hero-visual {
    min-height: 330px;
  }

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

  .module-card-featured {
    grid-column: span 2;
  }

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

  .feature-item:nth-child(2) {
    border-right: 0;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    padding: 10px 16px;
  }

  .brand-copy small,
  .session-panel > span:not(.session-dot):not(.session-time) {
    display: none;
  }

  .brand-copy strong {
    max-width: 180px;
    font-size: 14px;
  }

  .session-panel {
    gap: 5px;
    padding-left: 9px;
  }

  .text-button {
    font-size: 12px;
  }

  .hero,
  .home-section,
  .feature-grid {
    width: min(100% - 30px, var(--content));
  }

  .hero {
    min-height: 0;
    padding: 44px 0 34px;
  }

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

  .hero-lead {
    font-size: 16px;
  }

  .hero-visual {
    min-height: 315px;
  }

  .visual-main {
    inset: 8px 5px 28px;
    padding: 22px;
  }

  .visual-float {
    right: 0;
  }

  .module-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .module-card-featured {
    grid-column: auto;
  }

  .section-heading {
    display: block;
  }

  .feature-item {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .site-footer {
    flex-direction: column;
    gap: 5px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
