:root {
  color-scheme: dark;
  --canvas: #101614;
  --surface: #17211e;
  --surface-raised: #1d2925;
  --line: #31433c;
  --line-strong: #4b665b;
  --text: #eef7f2;
  --muted: #afc0b7;
  --faint: #82958b;
  --mint: #5ee0ae;
  --mint-dark: #123a2c;
  --cyan: #73cfe5;
  --gold: #f1c66b;
  --rose: #ec9b92;
  --max: 1180px;
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--text); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.site-header, main, footer { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
.site-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: max-content; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand span { display: grid; line-height: 1; gap: 4px; }
.brand strong { font-size: 16px; letter-spacing: 0; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: 0; }
.header-actions { display: flex; align-items: center; gap: 14px; }
nav { display: flex; align-items: center; gap: 20px; font-size: 14px; color: var(--muted); }
nav a:hover { color: var(--text); }
.account-link { border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px 12px; color: var(--text); }
.language-switch { display: inline-flex; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; }
.language-switch a { min-width: 34px; padding: 7px 8px; color: var(--faint); font-size: 12px; font-weight: 800; text-align: center; }
.language-switch a + a { border-left: 1px solid var(--line); }
.language-switch a:hover { color: var(--text); background: var(--surface-raised); }
.language-switch a.is-active { color: #072218; background: var(--mint); }

.intro { display: grid; grid-template-columns: minmax(0, 1.24fr) minmax(300px, 0.76fr); gap: 64px; padding: 80px 0 70px; align-items: end; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 14px; color: var(--mint); font-size: 12px; font-weight: 800; letter-spacing: 0; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 700px; margin-bottom: 18px; font-size: clamp(42px, 6vw, 72px); line-height: 1.08; letter-spacing: 0; }
.lede { max-width: 650px; margin-bottom: 28px; color: var(--muted); font-size: 18px; line-height: 1.75; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 6px; padding: 10px 15px; font-size: 14px; font-weight: 750; }
.button.primary { background: var(--mint); color: #092018; }
.button.primary:hover { background: #90efca; }
.button.secondary { border-color: var(--line-strong); color: var(--text); }
.button.secondary:hover { border-color: var(--mint); color: var(--mint); }

.workflow-summary { padding: 24px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.summary-label { margin-bottom: 18px; color: var(--cyan); font-size: 12px; font-weight: 800; }
.workflow-summary ol { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.workflow-summary li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; }
.workflow-summary li > span { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--mint); font-size: 10px; font-weight: 800; }
.workflow-summary strong, .workflow-summary small { display: block; }
.workflow-summary strong { margin-bottom: 4px; font-size: 14px; }
.workflow-summary small { color: var(--muted); font-size: 13px; line-height: 1.45; }

.catalog-section, .principles, .how-it-works { padding: 68px 0; border-bottom: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr); gap: 40px; align-items: end; margin-bottom: 28px; }
.section-heading.compact { display: block; }
.section-heading h2 { margin-bottom: 0; font-size: clamp(28px, 3.6vw, 42px); line-height: 1.2; letter-spacing: 0; }
.section-heading > p { margin: 0; color: var(--muted); line-height: 1.65; }

.catalog-controls { display: grid; grid-template-columns: minmax(0, 1fr) 176px; gap: 10px; }
.search-field input, .category-field select { width: 100%; height: 46px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 13px; outline: none; color: var(--text); background: var(--surface); }
.search-field input::placeholder { color: var(--faint); }
.search-field input:focus, .category-field select:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(94, 224, 174, 0.12); }
.catalog-status { display: flex; gap: 5px; margin: 16px 0; color: var(--faint); font-size: 13px; }
.catalog-status [data-result-count] { color: var(--mint); font-weight: 800; }
.skill-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.skill-card { min-height: 245px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; padding: 20px; background: var(--surface); }
.skill-card:hover { border-color: var(--line-strong); background: var(--surface-raised); }
.card-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 18px; color: var(--cyan); font-size: 12px; font-weight: 750; }
.card-meta span:last-child { color: var(--gold); text-align: right; }
.skill-card h3 { margin-bottom: 12px; font-size: 19px; line-height: 1.35; }
.skill-card p { margin-bottom: 20px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.card-footer span { color: var(--faint); font-size: 12px; }
.card-footer button { border: 0; padding: 0; color: var(--mint); background: transparent; cursor: pointer; font-size: 13px; font-weight: 800; }
.card-footer button:hover { color: #a3f5d2; }
.empty-state { margin: 28px 0 0; color: var(--muted); }

.principle-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.principle-grid article { min-height: 154px; padding: 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.principle-grid span { color: var(--mint); font-size: 14px; font-weight: 800; }
.principle-grid p { margin: 13px 0 0; color: var(--muted); line-height: 1.65; }

.handoff-row { display: grid; grid-template-columns: 1fr 34px 1fr 34px 1fr; align-items: center; gap: 10px; }
.handoff-row > div { min-height: 112px; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.handoff-row strong, .handoff-row span { display: block; }
.handoff-row strong { margin-bottom: 10px; font-size: 16px; }
.handoff-row span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.handoff-row i { height: 1px; background: var(--line-strong); }

footer { min-height: 94px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--faint); font-size: 13px; }
footer a { color: var(--muted); }
footer a:hover { color: var(--mint); }

.skill-dialog { position: fixed; width: min(720px, calc(100% - 32px)); max-height: min(740px, calc(100% - 32px)); overflow: auto; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0; color: var(--text); background: var(--surface-raised); box-shadow: 0 22px 80px rgba(0, 0, 0, 0.55); }
.skill-dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
.dialog-content { padding: 38px; }
.dialog-content h2 { margin: 0 42px 12px 0; font-size: clamp(26px, 4vw, 38px); line-height: 1.25; }
.dialog-content > p { color: var(--muted); line-height: 1.65; }
.dialog-label { margin: 26px 0 10px; color: var(--cyan); font-size: 12px; font-weight: 800; }
.dialog-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.dialog-list li { border: 1px solid var(--line); border-radius: 5px; padding: 8px 10px; color: var(--muted); font-size: 13px; }
.dialog-note { margin-top: 24px; border-left: 3px solid var(--gold); padding: 11px 0 11px 14px; color: #ead6a5; font-size: 13px; line-height: 1.65; }
.prompt-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: 11px; background: #101614; }
.prompt-box code { overflow-wrap: anywhere; color: #d9f5e8; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; line-height: 1.6; }
.prompt-box button { min-height: 36px; border: 1px solid var(--line-strong); border-radius: 5px; padding: 0 10px; color: var(--text); background: var(--surface); cursor: pointer; font-size: 12px; font-weight: 750; }
.prompt-box button:hover { border-color: var(--mint); color: var(--mint); }
.icon-button { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: transparent; cursor: pointer; font-size: 24px; line-height: 1; }
.close-button { position: absolute; top: 16px; right: 16px; }
.icon-button:hover { color: var(--text); border-color: var(--line-strong); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

@media (max-width: 880px) {
  .intro, .section-heading { grid-template-columns: 1fr; gap: 24px; }
  .intro { padding-top: 58px; }
  .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .handoff-row { grid-template-columns: 1fr; gap: 9px; }
  .handoff-row i { width: 1px; height: 18px; margin: 0 auto; }
}

@media (max-width: 620px) {
  .site-header, main, footer { width: min(var(--max), calc(100% - 28px)); }
  .site-header { min-height: 66px; }
  .header-actions { gap: 8px; }
  nav { gap: 12px; font-size: 13px; }
  nav a:not(.account-link) { display: none; }
  h1 { font-size: 42px; }
  .lede { font-size: 16px; }
  .catalog-section, .principles, .how-it-works { padding: 48px 0; }
  .catalog-controls, .skill-grid, .principle-grid { grid-template-columns: 1fr; }
  .skill-card { min-height: 220px; }
  .principle-grid { border-right: 1px solid var(--line); }
  .principle-grid article { border-right: 0; }
  .dialog-content { padding: 28px 20px; }
  .prompt-box { grid-template-columns: 1fr; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 7px; }
}
