:root {
  color-scheme: light;
  --ink: #132b29;
  --muted: #647875;
  --paper: #f5f3ed;
  --panel: #fffdf8;
  --line: #dce2dc;
  --brand: #0b5b50;
  --brand-dark: #083d36;
  --accent: #ffcb69;
  --danger: #a43a32;
  --shadow: 0 20px 60px rgba(19, 43, 41, 0.09);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); line-height: 1.55; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.topbar { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px max(22px, calc((100vw - 1180px) / 2)); background: color-mix(in srgb, var(--paper) 88%, transparent); border-bottom: 1px solid rgba(11, 91, 80, .1); backdrop-filter: blur(18px); }
.brand { display: flex; gap: 10px; align-items: center; color: var(--ink); text-decoration: none; font-size: 20px; font-weight: 750; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 12px; color: white; background: var(--brand); }
nav { display: flex; gap: 10px; }
main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.hero { min-height: 590px; display: grid; grid-template-columns: 1.4fr .8fr; gap: 70px; align-items: center; padding: 72px 32px; }
.eyebrow { margin: 0 0 9px; color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1 { max-width: 780px; margin: 0; font-size: clamp(42px, 6vw, 78px); line-height: 1.03; letter-spacing: -.045em; }
h2 { margin: 0; font-size: clamp(27px, 4vw, 40px); line-height: 1.1; letter-spacing: -.025em; }
h3 { margin: 0 0 12px; font-size: 20px; }
.hero-text { max-width: 650px; margin: 28px 0; color: var(--muted); font-size: 19px; }
.hero-actions, .action-row, .inline-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hero-card { min-height: 340px; display: grid; padding: 28px; border: 1px solid rgba(255,255,255,.3); border-radius: 32px; color: white; background: radial-gradient(circle at 80% 0, #218b77, transparent 45%), var(--brand-dark); box-shadow: var(--shadow); transform: rotate(2deg); }
.metric { display: flex; flex-direction: column; justify-content: center; border-bottom: 1px solid rgba(255,255,255,.15); }
.metric:last-child { border: 0; }
.metric strong { color: var(--accent); font-size: 34px; }
.metric span { opacity: .8; }
.button { border: 1px solid transparent; border-radius: 13px; padding: 10px 16px; font-weight: 720; text-decoration: none; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.button.primary { color: white; background: var(--brand); }
.button.primary:hover { background: var(--brand-dark); }
.button.secondary { color: var(--brand-dark); background: var(--panel); border-color: var(--line); }
.button.ghost { color: var(--brand-dark); background: transparent; border-color: var(--line); }
.button.large { padding: 14px 20px; }
.button.full { width: 100%; margin-top: 12px; }
.text-button, .text-link { padding: 0; border: 0; color: var(--brand); background: none; font-weight: 700; text-decoration: none; }
.system-status { display: inline-flex; margin-top: 28px; padding: 7px 11px; border-radius: 100px; color: var(--muted); background: rgba(255,255,255,.55); font-size: 13px; }
.workspace { margin: 0 0 28px; padding: clamp(22px, 4vw, 42px); border: 1px solid var(--line); border-radius: 28px; background: var(--panel); box-shadow: 0 10px 40px rgba(19,43,41,.05); }
.section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 30px; }
.badge { align-self: center; display: inline-flex; padding: 7px 11px; border-radius: 100px; color: var(--brand); background: #e4f1ec; font-size: 12px; font-weight: 750; white-space: nowrap; }
.badge.warning { color: #775213; background: #fff0c8; }
.setup-grid { display: grid; grid-template-columns: .8fr 1.35fr; gap: 22px; }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.form-panel { display: grid; gap: 15px; }
label { display: grid; gap: 7px; color: #344e4b; font-size: 13px; font-weight: 700; }
input, select { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #cbd5d1; border-radius: 11px; color: var(--ink); background: white; outline: none; }
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11,91,80,.1); }
.hint, .fine-print { margin: 0; color: var(--muted); }
.hint { font-size: 13px; }
.fine-print { margin-top: 16px; font-size: 12px; }
.drop-zone { min-height: 310px; display: grid; place-items: center; text-align: center; border-style: dashed; border-width: 2px; transition: border-color .15s, background .15s; }
.drop-zone.dragging { border-color: var(--brand); background: #f0f8f5; }
.upload-icon { display: grid; width: 60px; height: 60px; margin: 0 auto 18px; place-items: center; border-radius: 20px; color: white; background: var(--brand); font-size: 32px; }
.drop-zone p { margin: 0 0 20px; color: var(--muted); }
.preview-wrap { width: 100%; }
.preview-wrap img { display: block; width: 100%; max-height: 320px; object-fit: contain; border-radius: 14px; background: #edf1ef; }
.preview-wrap > div { display: flex; justify-content: space-between; gap: 14px; margin-top: 12px; }
.action-row { margin-top: 22px; }
.action-message { color: var(--muted); font-size: 13px; }
.notice { margin-bottom: 20px; padding: 14px 17px; border-radius: 12px; }
.notice.warning { color: #72500f; background: #fff2cf; }
.course-editor { display: grid; gap: 14px; }
.course-form { position: relative; display: grid; grid-template-columns: 1.5fr 1fr 1fr .65fr .65fr .65fr 1.1fr; gap: 12px; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: white; }
.course-form.low-confidence { border-color: #e3b960; background: #fffbef; }
.course-form .remove-course { position: absolute; top: 7px; right: 9px; border: 0; color: var(--danger); background: none; font-size: 20px; }
.reminder-control { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding-top: 4px; }
.reminder-control .check-label { display: flex; flex-direction: row; align-items: center; gap: 5px; }
.reminder-control input[type="checkbox"] { width: auto; }
.danger { color: var(--danger); }
.course-warning { grid-column: 1 / -1; margin: 0; color: #8a5d0b; font-size: 12px; }
.sticky-actions { position: sticky; bottom: 16px; justify-content: flex-end; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,253,248,.9); backdrop-filter: blur(12px); }
.week-picker { display: flex; grid-auto-flow: column; align-items: center; gap: 8px; }
.week-picker input { width: 62px; }
.next-course { margin-bottom: 20px; padding: 15px 18px; border-left: 4px solid var(--accent); border-radius: 0 12px 12px 0; background: #fff7df; }
.schedule-grid { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); gap: 10px; overflow-x: auto; }
.day-column { min-width: 130px; padding: 12px; border-radius: 14px; background: #f2f5f2; }
.day-column h3 { font-size: 14px; }
.schedule-course { margin-top: 9px; padding: 11px; border-left: 3px solid var(--brand); border-radius: 9px; background: white; box-shadow: 0 3px 10px rgba(19,43,41,.05); }
.schedule-course strong, .schedule-course span { display: block; }
.schedule-course span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.empty-state { display: grid; min-height: 160px; place-items: center; color: var(--muted); text-align: center; }
.utility-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; background: transparent; box-shadow: none; }
dialog { width: min(440px, calc(100% - 30px)); border: 0; border-radius: 24px; padding: 0; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(8,32,29,.5); backdrop-filter: blur(4px); }
.dialog-card { position: relative; padding: 30px; }
.dialog-close { position: absolute; top: 12px; right: 15px; border: 0; background: none; font-size: 26px; }
.dialog-card label { margin-top: 18px; }
.toast { position: fixed; z-index: 50; right: 20px; bottom: 20px; max-width: 390px; padding: 13px 17px; border-radius: 12px; color: white; background: var(--brand-dark); box-shadow: var(--shadow); opacity: 0; transform: translateY(20px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
footer { display: flex; justify-content: space-between; width: min(1180px, calc(100% - 32px)); margin: 30px auto; padding: 20px; color: var(--muted); font-size: 12px; }
footer a { color: inherit; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 30px; padding: 60px 5px 45px; }
  .hero-card { min-height: 220px; transform: none; }
  .setup-grid, .utility-grid { grid-template-columns: 1fr; }
  .course-form { grid-template-columns: 1fr 1fr; }
  .course-form label:first-child, .course-warning { grid-column: 1 / -1; }
  .section-heading { align-items: start; flex-direction: column; }
}

@media (max-width: 520px) {
  main { width: min(100% - 20px, 1180px); }
  .topbar { padding: 10px; }
  .topbar nav .ghost { display: none !important; }
  h1 { font-size: 42px; }
  .workspace { padding: 20px 15px; border-radius: 20px; }
  .course-form { grid-template-columns: 1fr; padding: 18px 13px; }
  .course-form label:first-child, .course-warning { grid-column: auto; }
  .sticky-actions { position: static; }
  .sticky-actions .button { width: 100%; }
  footer { flex-direction: column; gap: 8px; }
}

/* Development guide */
.guide-page { width: min(1160px, calc(100% - 32px)); margin: 0 auto; padding: 46px 0 80px; }
.guide-hero { padding: 34px 0 24px; }
.guide-hero h1 { max-width: 820px; font-size: clamp(38px, 6vw, 66px); line-height: 1.02; margin: 8px 0 18px; }
.guide-hero > p:not(.eyebrow) { max-width: 780px; color: var(--muted); font-size: 18px; line-height: 1.75; }
.guide-metrics { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.guide-metrics span { border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; color: var(--muted); }
.guide-metrics strong { color: var(--ink); margin-right: 4px; }
.guide-nav { position: sticky; top: 72px; z-index: 5; display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; background: var(--paper); border-bottom: 1px solid var(--line); }
.guide-nav a { flex: 0 0 auto; color: var(--muted); text-decoration: none; padding: 7px 10px; border-radius: 999px; }
.guide-nav a:hover { color: var(--brand); background: #e4f1ec; }
.guide-section { scroll-margin-top: 130px; padding: 56px 0; border-bottom: 1px solid var(--line); }
.guide-section h2 { font-size: clamp(28px, 4vw, 42px); margin: 6px 0 24px; }
.guide-section > h3 { font-size: 22px; margin: 36px 0 16px; }
.architecture-flow { display: grid; grid-template-columns: 1fr 42px 1fr 42px 1fr; align-items: center; gap: 8px; }
.architecture-flow article { min-height: 190px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.architecture-flow article:nth-of-type(2) { border-color: var(--brand); background: #e4f1ec; }
.architecture-flow h3 { margin: 12px 0 8px; font-size: 20px; }
.architecture-flow p { color: var(--muted); line-height: 1.7; }
.flow-arrow { text-align: center; color: var(--muted); font-size: 24px; }
.secondary-flow { margin-top: 14px; }
.secondary-flow article { min-height: 150px; }
.guide-number { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 50%; color: var(--brand); font-weight: 800; }
.file-tree { margin: 0; padding: 24px; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: #fff; font: 14px/1.75 ui-monospace, SFMono-Regular, Consolas, monospace; }
.guide-file-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.guide-file-list article { padding: 18px; border-top: 1px solid var(--line); }
.guide-file-list p { color: var(--muted); line-height: 1.7; margin: 8px 0 0; }
.guide-flow-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.guide-flow-grid article { border: 1px solid var(--line); border-radius: 16px; padding: 22px; background: #fff; }
.guide-flow-grid h3 { margin: 0 0 14px; font-size: 20px; }
.guide-flow-grid ol { margin: 0; padding-left: 22px; color: var(--muted); line-height: 1.75; }
.guide-flow-grid li + li { margin-top: 8px; }
.guide-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.guide-table { width: 100%; min-width: 760px; border-collapse: collapse; text-align: left; }
.guide-table th, .guide-table td { padding: 13px 15px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.55; }
.guide-table th { color: var(--muted); font-size: 13px; background: #e4f1ec; }
.guide-table tr:last-child td { border-bottom: 0; }
.guide-two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.guide-two-column article { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.guide-two-column h3 { margin-top: 0; }
.guide-two-column li { margin: 9px 0; }
.guide-checklist { padding-left: 22px; line-height: 1.8; }
.guide-glossary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.guide-glossary div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.guide-glossary dt { font-weight: 800; color: var(--brand); }
.guide-glossary dd { margin: 0; color: var(--muted); line-height: 1.65; }
.guide-finish { border-bottom: 0; }
@media (max-width: 800px) {
  .architecture-flow { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); }
  .guide-file-list, .guide-flow-grid, .guide-two-column, .guide-glossary { grid-template-columns: 1fr; }
  .guide-glossary div { grid-template-columns: 105px 1fr; }
  .guide-nav { top: 62px; }
}
