:root {
  color-scheme: light;
  --ink: #152029;
  --muted: #5f6d78;
  --line: #d8e0e6;
  --soft-line: #edf2f5;
  --panel: #ffffff;
  --page: #f7f9fa;
  --workspace: #fbfcfd;
  --teal: #159a9c;
  --teal-dark: #087577;
  --coral: #ef5d54;
  --yellow: #f6bd2b;
  --shadow: 0 18px 45px rgba(18, 31, 42, 0.08);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}

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

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

button {
  border: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  height: 72px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 0 22px;
  color: #f6fbfc;
  background: linear-gradient(180deg, #1b242b 0%, #111a20 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  font-weight: 760;
  letter-spacing: 0;
}

.brand span {
  color: #23c4c6;
}

.command-row,
.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.command-row {
  justify-content: center;
}

.site-nav {
  justify-content: end;
  gap: 22px;
  font-weight: 650;
}

.site-nav a {
  color: rgba(246, 251, 252, 0.92);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: #50d6d8;
}

.toolbar-button,
.icon-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 14px;
  border-radius: 7px;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.toolbar-button:hover,
.toolbar-button:focus-visible,
.icon-button:hover,
.icon-button:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.status-pill {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(246, 251, 252, 0.9);
  font-size: 0.78rem;
  font-weight: 750;
}

.toolbar-button svg,
.icon-button svg,
.tool-button svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.1;
}

.app-main {
  position: relative;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 242px;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 24px 18px 18px;
}

.tool-rail,
.tips-panel,
.control-strip {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.tool-rail {
  display: grid;
  grid-template-rows: repeat(7, 70px) 1fr repeat(3, 48px);
  overflow: hidden;
  border-radius: var(--radius);
}

.tool-button,
.mini-tool {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}

.tool-button {
  flex-direction: column;
  border-bottom: 1px solid var(--soft-line);
  font-size: 0.8rem;
  font-weight: 700;
}

.mini-tool {
  justify-content: flex-start;
  padding: 0 12px;
  border-top: 1px solid var(--soft-line);
  font-size: 0.76rem;
  font-weight: 700;
}

.tool-button:hover,
.tool-button:focus-visible,
.mini-tool:hover,
.mini-tool:focus-visible,
.tool-button.is-active {
  color: #fff;
  background: linear-gradient(145deg, var(--teal), var(--teal-dark));
  outline: none;
}

.canvas-region {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 18px;
}

.canvas-wrap {
  position: relative;
  min-height: 460px;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background:
    linear-gradient(var(--soft-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--soft-line) 1px, transparent 1px),
    linear-gradient(#fdfefe, #fdfefe);
  background-size: 18px 18px, 18px 18px, 100% 100%;
}

canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#previewCanvas {
  pointer-events: none;
}

.tips-panel {
  border-radius: var(--radius);
  overflow: hidden;
}

.tips-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 0 16px;
  border-bottom: 1px solid var(--soft-line);
}

.tips-head h2 {
  margin: 0;
  color: var(--teal-dark);
  font-size: 1rem;
}

.tips-body {
  padding: 18px 16px;
  font-size: 0.9rem;
}

.tips-body h3 {
  margin: 24px 0 12px;
  color: var(--teal-dark);
  font-size: 0.95rem;
}

.shortcut-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 14px;
  align-items: center;
}

kbd {
  display: inline-flex;
  min-width: 32px;
  height: 30px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-bottom-color: #b7c3ca;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 1px 0 #d7e0e6;
  color: #35414a;
  font-size: 0.84rem;
  font-weight: 700;
}

.tip-note {
  margin-top: 26px;
  padding-left: 14px;
  border-left: 3px solid var(--yellow);
  color: #31404a;
}

.control-strip {
  grid-column: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-radius: var(--radius);
  overflow: hidden;
}

.control-group {
  min-height: 94px;
  display: grid;
  align-content: center;
  gap: 11px;
  padding: 14px 16px;
  border-right: 1px solid var(--soft-line);
}

.control-group:last-child {
  border-right: 0;
}

.control-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #2d3a43;
  font-size: 0.86rem;
  font-weight: 750;
}

.number-box,
.color-input,
.select-box,
.text-box {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.number-box {
  width: 58px;
  padding: 0 8px;
  text-align: center;
  color: #2b3740;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.swatch {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 5px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.07);
  cursor: pointer;
}

.swatch.is-active {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.swatch-divider {
  width: 1px;
  height: 28px;
  background: var(--line);
  margin: 0 8px;
}

.color-stack,
.template-stack {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-input {
  width: 50px;
  padding: 3px;
}

.select-box {
  width: 100%;
  padding: 0 10px;
  color: #2b3740;
}

.text-box {
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  color: #2b3740;
}

.template-stack .select-box {
  min-width: 0;
}

.small-action {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fbfc;
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 800;
}

.small-action:hover,
.small-action:focus-visible {
  border-color: rgba(21, 154, 156, 0.55);
  background: #edf8f8;
  outline: none;
}

.zoom-controls {
  grid-column: 3;
  grid-row: 2;
  align-self: end;
  justify-self: end;
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: var(--shadow);
}

.zoom-controls button,
.zoom-value {
  min-width: 46px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--soft-line);
  color: #31404a;
  background: #fff;
  font-weight: 760;
}

.zoom-controls button:last-child {
  border-right: 0;
}

.zoom-controls button {
  cursor: pointer;
}

.home-seo {
  background: #fff;
  border-top: 1px solid var(--line);
}

.home-seo-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 54px 24px 64px;
}

.home-seo h1 {
  max-width: 780px;
  margin: 0 0 14px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.06;
}

.home-seo h2 {
  margin: 42px 0 14px;
  font-size: 1.45rem;
}

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

.feature-grid article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.feature-grid h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.feature-grid p {
  margin: 0;
  color: #33424c;
}

.faq-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.faq-list summary {
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 800;
}

.faq-list p {
  margin: 0;
  padding: 0 18px 18px;
  color: #33424c;
}

.app-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 24px;
  padding: 18px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.app-footer a:hover,
.app-footer a:focus-visible {
  color: var(--teal-dark);
  outline: none;
}

.content-page {
  min-height: 100vh;
  background: #fff;
}

.content-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

.content-main h1 {
  max-width: 780px;
  margin: 0 0 18px;
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.lead {
  max-width: 760px;
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 1.18rem;
}

.content-main h2 {
  margin: 42px 0 10px;
  font-size: 1.45rem;
}

.content-main h3 {
  margin: 28px 0 8px;
  font-size: 1.1rem;
}

.content-main p,
.content-main li {
  color: #33424c;
}

.content-main a {
  color: var(--teal-dark);
  font-weight: 750;
}

.breadcrumb {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.article-page {
  max-width: 860px;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0;
}

.info-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: #fbfcfd;
}

.guide-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0 36px;
}

.guide-link {
  display: grid;
  gap: 8px;
  min-height: 118px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.guide-link:hover,
.guide-link:focus-visible {
  border-color: rgba(21, 154, 156, 0.55);
  box-shadow: 0 10px 24px rgba(21, 154, 156, 0.1);
  outline: none;
}

.guide-link span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.guide-link strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
}

.compact-guides .guide-link {
  min-height: 96px;
}

.footer-note {
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: 1fr;
    height: auto;
    gap: 12px;
    padding: 16px;
  }

  .command-row,
  .site-nav {
    justify-content: start;
    flex-wrap: wrap;
  }

  .app-main {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .tips-panel {
    display: none;
  }

  .control-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-main {
    grid-template-columns: 1fr;
    padding: 14px;
  }

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

  .mini-tool {
    display: none;
  }

  .canvas-wrap {
    min-height: 420px;
  }

  .control-strip {
    grid-column: 1;
    grid-template-columns: 1fr;
  }

  .zoom-controls {
    position: static;
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
    width: 100%;
    margin-top: -4px;
  }

  .zoom-controls button,
  .zoom-value {
    flex: 1;
  }

  .control-group {
    min-height: 82px;
    border-right: 0;
    border-bottom: 1px solid var(--soft-line);
  }

  .content-main {
    padding: 36px 18px 60px;
  }

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

  .guide-list {
    grid-template-columns: 1fr;
  }

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

  .home-seo-inner {
    padding: 38px 18px 52px;
  }
}
