:root {
  --ink: #18211f;
  --muted: #63706c;
  --line: #dbe2df;
  --surface: #ffffff;
  --surface-soft: #f4f7f5;
  --green: #176b4d;
  --green-dark: #0e5038;
  --green-soft: #e5f3ed;
  --blue: #255f85;
  --amber: #a45c12;
  --red: #a53d39;
  --shadow: 0 10px 30px rgba(26, 47, 41, 0.08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: #f7f9f8;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.header-inner,
.page-shell,
.footer-inner {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: white;
  background: var(--green);
  font-size: 15px;
  font-weight: 900;
}

.brand small { color: var(--muted); font-size: 13px; font-weight: 500; }
.top-nav { display: flex; align-items: center; gap: 6px; }
.top-nav a { padding: 8px 11px; color: #44504c; font-size: 14px; }
.top-nav a:hover { color: var(--green); background: var(--green-soft); border-radius: 6px; }

.page-shell { padding: 44px 0 72px; }

.workspace-head {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  align-items: end;
  gap: 40px;
  margin-bottom: 34px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1, h2, h3 { margin-top: 0; line-height: 1.3; }
h1 { margin-bottom: 14px; font-size: clamp(32px, 4vw, 54px); letter-spacing: 0; }
h2 { margin-bottom: 16px; font-size: 25px; letter-spacing: 0; }
h3 { margin-bottom: 8px; font-size: 17px; letter-spacing: 0; }
p { margin-top: 0; }
.lead { max-width: 690px; margin-bottom: 0; color: var(--muted); font-size: 17px; }

.search-box { position: relative; }
.search-box svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #71807b; }
.search-box input {
  width: 100%;
  height: 50px;
  padding: 0 16px 0 46px;
  border: 1px solid #cbd6d2;
  border-radius: 7px;
  background: white;
  color: var(--ink);
  outline: none;
}
.search-box input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

.category-tabs { display: flex; gap: 8px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 2px; }
.category-tabs button {
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: #4a5753;
}
.category-tabs button.active { color: white; background: var(--green); border-color: var(--green); }

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

.tool-card {
  min-height: 188px;
  padding: 21px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.tool-card:hover { transform: translateY(-2px); border-color: #a8c5b9; box-shadow: var(--shadow); }
.tool-card .icon-box { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 7px; background: var(--green-soft); color: var(--green); }
.tool-card p { margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.tool-card .tool-link { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 14px; font-weight: 700; }
.badge { display: inline-flex; align-items: center; width: fit-content; margin-bottom: 8px; color: var(--blue); font-size: 12px; font-weight: 700; }

.empty-state { display: none; padding: 38px 0; color: var(--muted); text-align: center; }

.section-band { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 20px; }
.section-heading p { max-width: 580px; margin-bottom: 0; color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { padding-top: 17px; border-top: 3px solid var(--green); }
.step-number { color: var(--green); font-size: 12px; font-weight: 800; }
.step p { color: var(--muted); font-size: 14px; }

.breadcrumb { margin-bottom: 22px; color: var(--muted); font-size: 13px; }
.breadcrumb a:hover { color: var(--green); }

.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 28px; align-items: start; }
.tool-main, .side-panel, .content-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.tool-main { padding: 28px; }
.tool-title { margin-bottom: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.tool-title h1 { margin-bottom: 9px; font-size: 31px; }
.tool-title p { margin-bottom: 0; color: var(--muted); }
.privacy-note { display: flex; align-items: center; gap: 8px; margin-top: 13px; color: var(--green); font-size: 13px; font-weight: 700; }

.upload-zone {
  min-height: 210px;
  padding: 30px;
  display: grid;
  place-items: center;
  border: 2px dashed #b9c8c2;
  border-radius: 8px;
  background: var(--surface-soft);
  text-align: center;
  transition: border-color .18s, background .18s;
}
.upload-zone.dragging { border-color: var(--green); background: var(--green-soft); }
.upload-zone input { position: absolute; opacity: 0; pointer-events: none; }
.upload-zone .upload-icon { margin: 0 auto 12px; color: var(--green); }
.upload-zone p { margin-bottom: 5px; font-weight: 700; }
.upload-zone small { color: var(--muted); }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn {
  min-height: 42px;
  padding: 9px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 700;
}
.btn-primary { color: white; background: var(--green); }
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary { color: var(--ink); background: white; border-color: var(--line); }
.btn-secondary:hover { border-color: #9eb6ad; }
.btn:disabled { cursor: not-allowed; opacity: .5; }

.file-list { margin-top: 18px; display: grid; gap: 8px; }
.file-row { min-height: 48px; padding: 8px 11px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.file-row .file-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.file-row small { color: var(--muted); }
.icon-btn { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 5px; background: transparent; color: var(--muted); }
.icon-btn:hover { color: var(--red); background: #faeceb; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 700; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 43px;
  padding: 9px 11px;
  border: 1px solid #cbd6d2;
  border-radius: 6px;
  background: white;
  outline: none;
}
.field textarea { min-height: 260px; resize: vertical; font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

.status { display: none; margin-top: 16px; padding: 11px 13px; border-radius: 6px; font-size: 14px; }
.status.show { display: block; }
.status.info { color: #245477; background: #e8f2f8; }
.status.success { color: var(--green-dark); background: var(--green-soft); }
.status.error { color: #842e2a; background: #fae9e8; }

.side-panel { padding: 21px; }
.side-panel + .side-panel { margin-top: 14px; }
.side-panel h2 { font-size: 17px; }
.side-panel ul { margin: 0; padding: 0; list-style: none; }
.side-panel li + li { border-top: 1px solid var(--line); }
.side-panel a { padding: 10px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.side-panel a:hover { color: var(--green); }
.side-panel p { color: var(--muted); font-size: 13px; }

.content-section { margin-top: 20px; padding: 28px; }
.content-section p, .content-section li { color: #4e5b57; }
.content-section li + li { margin-top: 7px; }
.faq-item { padding: 16px 0; border-top: 1px solid var(--line); }
.faq-item:first-of-type { border-top: 0; }
.faq-item h3 { margin-bottom: 6px; font-size: 15px; }
.faq-item p { margin-bottom: 0; font-size: 14px; }

.result-panel { margin-top: 18px; padding: 18px; border: 1px solid #b8d2c7; border-radius: 7px; background: var(--green-soft); }
.result-value { display: block; color: var(--green-dark); font-size: 30px; font-weight: 800; }
.result-detail { color: #466159; font-size: 13px; }
.mapping-table { width: 100%; margin-top: 18px; border-collapse: collapse; font-size: 13px; }
.mapping-table th, .mapping-table td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; word-break: break-all; }
.mapping-table th { color: var(--muted); background: var(--surface-soft); }

.media-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
}
.preview-stage {
  min-height: 420px;
  padding: 18px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background-color: #eef2f0;
  background-image: linear-gradient(45deg, #dde4e1 25%, transparent 25%), linear-gradient(-45deg, #dde4e1 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #dde4e1 75%), linear-gradient(-45deg, transparent 75%, #dde4e1 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
  overflow: hidden;
}
.preview-stage canvas { width: auto; max-width: 100%; max-height: 560px; display: block; box-shadow: 0 8px 22px rgba(23, 40, 35, .16); }
.preview-placeholder { max-width: 360px; color: #63706c; text-align: center; }
.preview-placeholder svg { margin-bottom: 10px; }
.control-panel { display: grid; gap: 18px; }
.control-group { padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.control-group:last-child { padding-bottom: 0; border-bottom: 0; }
.control-group h3 { margin-bottom: 11px; font-size: 14px; }
.swatches { display: flex; flex-wrap: wrap; gap: 9px; }
.swatch {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #aab6b2;
}
.swatch.active { box-shadow: 0 0 0 3px var(--green); }
.segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; padding: 4px; border-radius: 7px; background: var(--surface-soft); }
.segmented button { min-height: 37px; padding: 5px 7px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 13px; }
.segmented button.active { color: var(--green-dark); background: white; box-shadow: 0 1px 4px rgba(24, 44, 38, .12); font-weight: 700; }
.range-field { display: grid; grid-template-columns: 72px 1fr 38px; align-items: center; gap: 8px; margin-top: 9px; font-size: 12px; color: var(--muted); }
.range-field input { width: 100%; accent-color: var(--green); }
.comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.comparison figure { margin: 0; }
.comparison img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: contain; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); }
.comparison figcaption { margin-top: 6px; color: var(--muted); font-size: 12px; text-align: center; }
.consent-row { margin-top: 15px; display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 13px; }
.consent-row input { margin-top: 4px; accent-color: var(--green); }
.upload-summary { margin-top: 14px; padding: 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.upload-summary strong { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.upload-summary small { color: var(--muted); }

.site-footer { padding: 28px 0; color: #64716d; background: #edf1ef; border-top: 1px solid var(--line); font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; }

@media (max-width: 900px) {
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-head, .tool-layout { grid-template-columns: 1fr; }
  .workspace-head { gap: 24px; }
  .tool-sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .side-panel + .side-panel { margin-top: 0; }
  .media-workspace { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .header-inner, .page-shell, .footer-inner { width: min(100% - 24px, 1180px); }
  .header-inner { min-height: 58px; }
  .brand small, .top-nav a:not(:last-child) { display: none; }
  .page-shell { padding-top: 28px; }
  h1 { font-size: 34px; }
  .tool-grid, .steps, .tool-sidebar, .form-grid { grid-template-columns: 1fr; }
  .tool-main, .content-section { padding: 20px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .section-heading p { max-width: none; }
  .tool-title h1 { font-size: 26px; }
  .upload-zone { min-height: 185px; padding: 22px 12px; }
  .field.full { grid-column: auto; }
  .footer-inner { flex-direction: column; }
  .preview-stage { min-height: 330px; padding: 10px; }
  .comparison { grid-template-columns: 1fr; }
}
