:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --paper: #ffffff;
  --paper-2: #eef6f7;
  --ink: #111827;
  --muted: #5f6b7a;
  --line: #d9e2e7;
  --cyan: #0b98a8;
  --green: #3d9568;
  --coral: #df654d;
  --amber: #ca8a04;
  --deep: #142033;
  --shadow: 0 20px 56px rgba(17, 24, 39, 0.14);
  --radius: 8px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

body.nav-open {
  overflow: hidden;
}

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

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

button {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  transform: translateY(-140%);
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius);
}

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

.site-header {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 50;
  width: min(calc(100% - 32px), var(--max));
  min-height: 64px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 12px 10px 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(217, 226, 231, 0.92);
  border-radius: var(--radius);
  box-shadow: 0 14px 38px rgba(17, 24, 39, 0.12);
  backdrop-filter: blur(18px);
}

.site-header.compact {
  top: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  padding: 10px 11px;
  border-radius: 6px;
  color: #334155;
  font-size: 0.94rem;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: #edf7f8;
  color: var(--ink);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
}

.workspace-hero {
  position: relative;
  min-height: 780px;
  display: grid;
  align-items: end;
  overflow: hidden;
  padding: 128px 24px 42px;
  background: #dde9ed;
}

.hero-image,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(246, 248, 251, 0.97) 0%, rgba(246, 248, 251, 0.9) 43%, rgba(246, 248, 251, 0.28) 78%),
    linear-gradient(0deg, rgba(246, 248, 251, 0.92) 0%, rgba(246, 248, 251, 0) 44%);
}

.hero-grid {
  position: relative;
  z-index: 2;
  width: min(100%, var(--max));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 42px;
  align-items: end;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 7vw, 6.1rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.15rem;
  line-height: 1.25;
}

.hero-lede {
  max-width: 720px;
  margin-bottom: 24px;
  color: #344256;
  font-size: clamp(1.04rem, 2vw, 1.24rem);
}

.global-search {
  max-width: 720px;
  margin-bottom: 18px;
}

.global-search label {
  display: block;
  margin-bottom: 8px;
  color: #334155;
  font-weight: 800;
}

.global-search div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 10px;
}

.global-search input,
.feedback-form input,
.feedback-form select,
.feedback-form textarea,
.tool-surface input,
.tool-surface textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
}

.global-search input {
  min-height: 48px;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.08);
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  padding: 10px 16px;
  font-weight: 820;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.button-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.2);
}

.button-secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.status-panel {
  padding: 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(217, 226, 231, 0.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel-title,
.library-toolbar,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-title {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.panel-title strong {
  color: var(--ink);
  font-size: 0.86rem;
}

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

.status-list div {
  min-height: 92px;
  padding: 13px;
  background: #f8fbfc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.status-list span,
.library-toolbar span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.status-list strong {
  display: block;
  margin-top: 8px;
  font-size: 1.34rem;
  line-height: 1.1;
}

.announcement {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.metric-strip {
  width: min(calc(100% - 48px), var(--max));
  margin: -18px auto 0;
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.metric-strip div {
  padding: 23px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.metric-strip div:last-child {
  border-right: 0;
}

.metric-strip strong {
  display: block;
  margin-bottom: 4px;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1;
}

.metric-strip span {
  color: rgba(255, 255, 255, 0.72);
}

.section {
  padding: 92px 24px;
}

.section-light {
  background: var(--bg);
}

.section-paper {
  background: #edf3f5;
}

.section-ink {
  background: var(--deep);
  color: #f8fafc;
}

.section-heading {
  width: min(100%, var(--max));
  margin: 0 auto 34px;
}

.section-heading p:not(.eyebrow) {
  max-width: 780px;
  color: var(--muted);
  font-size: 1.05rem;
}

.section-ink .section-heading p:not(.eyebrow) {
  color: rgba(248, 250, 252, 0.72);
}

.tool-layout,
.resource-controls,
.resource-grid,
.library-toolbar,
.media-grid,
.checklist-layout,
.wiring-grid,
.feedback-section {
  width: min(100%, var(--max));
  margin: 0 auto;
}

.tool-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
}

.tool-tabs {
  display: grid;
  gap: 9px;
  align-content: start;
}

.tool-tab,
.chip {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-weight: 820;
}

.tool-tab {
  min-height: 50px;
}

.tool-tab.active,
.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.tool-surface,
.resource-grid article,
.media-card,
.progress-card,
.checklist,
.wiring-grid article,
.feedback-form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.tool-surface {
  min-height: 520px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.tool-panel label,
.compact-form label,
.feedback-form label {
  display: grid;
  gap: 7px;
}

.tool-panel span,
.compact-form span,
.feedback-form span {
  color: #334155;
  font-size: 0.9rem;
  font-weight: 780;
}

.tool-heading {
  margin-bottom: 18px;
}

.tool-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

textarea {
  resize: vertical;
}

.result-box {
  display: block;
  min-height: 58px;
  margin-top: 14px;
  padding: 14px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  background: #f8fbfc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #1f2937;
}

.compact-form {
  display: grid;
  gap: 14px;
}

.password-options {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.password-options label:first-child {
  grid-template-columns: 80px minmax(0, 1fr) 48px;
  align-items: center;
}

.resource-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 12px;
}

.resource-controls span {
  color: var(--muted);
  font-size: 0.92rem;
}

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

.resource-grid article {
  min-height: 220px;
  padding: 20px;
}

.resource-grid article[hidden] {
  display: none;
}

.resource-type,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 5px;
  background: #e7f5f6;
  color: #087887;
  font-size: 0.78rem;
  font-weight: 840;
}

.resource-grid p,
.media-card p,
.wiring-grid p,
.feedback-copy p {
  color: var(--muted);
}

.resource-tags,
.media-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.tag {
  background: #f5efe1;
  color: #7a5a12;
}

.library-toolbar {
  margin-bottom: 18px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

.media-card {
  overflow: hidden;
}

.media-visual {
  display: grid;
  height: 148px;
  place-items: center;
  background: linear-gradient(135deg, #e3f4f6, #f8f0da 52%, #f9e1da);
  color: #102033;
  font-size: 2rem;
  font-weight: 900;
}

.media-card:nth-child(2n) .media-visual {
  background: linear-gradient(135deg, #eef5ee, #d8edf1 52%, #f7e4cf);
}

.media-card-body {
  padding: 18px;
}

.media-meta span {
  padding: 5px 8px;
  background: #f3f7f8;
  border-radius: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.checklist-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
}

.progress-card,
.checklist {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  padding: 22px;
}

.progress-card span {
  color: rgba(248, 250, 252, 0.68);
}

.progress-card strong {
  display: block;
  margin: 12px 0;
  font-size: 3rem;
  line-height: 1;
}

.progress-bar {
  height: 12px;
  margin-bottom: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.progress-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--green));
}

.checklist {
  display: grid;
  gap: 12px;
}

.checklist label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: rgba(248, 250, 252, 0.88);
}

.checklist input {
  margin-top: 5px;
}

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

.wiring-grid article {
  min-height: 220px;
  padding: 22px;
}

.wiring-grid span {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  margin-bottom: 24px;
  background: #e7f5f6;
  color: #087887;
  border-radius: 6px;
  font-weight: 900;
}

.wiring-grid article:nth-child(2) span {
  background: #eaf5ef;
  color: #2f7d57;
}

.wiring-grid article:nth-child(3) span {
  background: #fff2e7;
  color: #a94a31;
}

.feedback-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(330px, 1fr);
  gap: 34px;
  align-items: start;
}

.feedback-form {
  display: grid;
  gap: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.form-message {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
}

.site-footer {
  width: min(calc(100% - 48px), var(--max));
  margin: 0 auto;
  padding: 34px 0 46px;
  color: var(--muted);
}

.site-footer strong,
.site-footer span {
  display: block;
}

.site-footer a {
  color: var(--ink);
  font-weight: 850;
}

@media (max-width: 1000px) {
  .hero-grid,
  .tool-layout,
  .checklist-layout,
  .feedback-section {
    grid-template-columns: 1fr;
  }

  .status-panel {
    max-width: 620px;
  }

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

  .resource-grid,
  .media-grid,
  .wiring-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-header {
    top: 8px;
    width: min(calc(100% - 20px), var(--max));
  }

  .nav-toggle {
    display: inline-block;
  }

  .site-nav {
    position: fixed;
    top: 78px;
    left: 10px;
    right: 10px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  body.nav-open .site-nav {
    display: flex;
  }

  .workspace-hero {
    min-height: 880px;
    padding: 116px 18px 34px;
  }

  .hero-shade {
    background:
      linear-gradient(90deg, rgba(246, 248, 251, 0.98), rgba(246, 248, 251, 0.76)),
      linear-gradient(0deg, rgba(246, 248, 251, 0.94), rgba(246, 248, 251, 0.12));
  }

  h1 {
    font-size: clamp(2.55rem, 14vw, 4.2rem);
  }

  .global-search div,
  .metric-strip,
  .editor-grid,
  .resource-grid,
  .media-grid,
  .wiring-grid {
    grid-template-columns: 1fr;
  }

  .metric-strip {
    width: min(calc(100% - 28px), var(--max));
  }

  .metric-strip div {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .metric-strip div:last-child {
    border-bottom: 0;
  }

  .section {
    padding: 72px 18px;
  }

  .resource-controls,
  .library-toolbar,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 500px) {
  .brand {
    min-width: auto;
  }

  .brand small {
    display: none;
  }

  .hero-actions,
  .button-row {
    display: grid;
  }

  .button {
    width: 100%;
  }

  .status-list,
  .tool-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .password-options label:first-child {
    grid-template-columns: 1fr;
  }
}
