:root {
  --ink: #102225;
  --muted: #5e7174;
  --soft: #f4f8f7;
  --surface: #ffffff;
  --line: #d9e6e3;
  --teal: #0b6f6a;
  --green: #14895f;
  --orange: #e97832;
  --charcoal: #17262a;
  --shadow: 0 18px 42px rgba(16, 34, 37, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--teal), var(--green));
  font-size: 0.8rem;
  font-weight: 900;
}

.brand-icon {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  line-height: 1.1;
}

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

.nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 28px);
  color: var(--muted);
  font-size: 0.94rem;
  white-space: nowrap;
}

.nav a {
  text-decoration: none;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--teal);
}

main {
  min-height: 100svh;
}

.tool-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 18px;
  padding: clamp(18px, 3vw, 32px);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.88fr) minmax(320px, 1.12fr);
  gap: 18px;
  min-width: 0;
}

.panel,
.visual-panel,
.revenue-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(16, 34, 37, 0.05);
}

.panel {
  min-width: 0;
  padding: clamp(18px, 3vw, 24px);
}

.panel-heading,
.result-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

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

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  max-width: 13ch;
  font-size: clamp(2rem, 3vw, 3.05rem);
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.4rem);
}

h3 {
  font-size: 1.05rem;
}

.status-pill {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid rgba(11, 111, 106, 0.22);
  border-radius: 999px;
  color: var(--teal);
  background: #edf8f6;
  font-weight: 900;
  font-size: 0.78rem;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
}

textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfd;
  color: var(--ink);
  font: 1rem/1.65 "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
}

textarea:focus {
  outline: 3px solid rgba(11, 111, 106, 0.16);
  border-color: var(--teal);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

button,
.doc-link {
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
button:focus-visible,
.doc-link:hover,
.doc-link:focus-visible {
  border-color: var(--teal);
}

.primary-action {
  color: #ffffff;
  background: var(--teal);
  border-color: var(--teal);
}

.primary-action:hover,
.primary-action:focus-visible {
  background: #095d59;
}

.quick-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.quick-examples button {
  min-height: 34px;
  color: var(--muted);
  font-size: 0.88rem;
}

.result-panel {
  background: var(--charcoal);
  color: #ffffff;
}

.result-panel .eyebrow,
.result-panel .result-grid dt,
.result-panel .score-row span,
.result-panel .normalized-box span {
  color: #9ed7ce;
}

.result-top button {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.score-row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.score-row strong {
  display: block;
  font-size: 2rem;
  line-height: 1.1;
}

.meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), #69d6b3);
  transition: width 180ms ease;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.result-grid div {
  min-height: 74px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.result-grid dt {
  margin-bottom: 4px;
  font-size: 0.78rem;
  font-weight: 900;
}

.result-grid dd {
  margin: 0;
  font-weight: 850;
}

.normalized-box {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.normalized-box span,
.normalized-box strong {
  display: block;
}

.normalized-box strong {
  margin-top: 3px;
  font-size: 1.08rem;
}

pre {
  overflow: auto;
  max-height: 330px;
  margin: 16px 0 0;
  padding: 14px;
  border-radius: 8px;
  background: #091618;
  color: #d8ffef;
  font: 0.88rem/1.55 Consolas, "Cascadia Mono", monospace;
  white-space: pre-wrap;
}

.csv-preview:empty {
  display: none;
}

.csv-preview {
  max-height: 180px;
  background: #102225;
}

.visual-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 100%;
}

.visual-panel img {
  width: 100%;
  aspect-ratio: 1 / 0.82;
  object-fit: cover;
}

.visual-panel div {
  padding: 18px;
}

.visual-panel p:last-child {
  margin: 0;
  color: var(--muted);
}

.section {
  padding: clamp(52px, 7vw, 88px) clamp(18px, 5vw, 64px);
}

.section-heading {
  max-width: 790px;
  margin-bottom: 24px;
}

.section-heading p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
}

.batch-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(360px, 1.2fr);
  gap: 18px;
}

.table-panel {
  padding: 0;
}

.table-wrap {
  overflow: auto;
  max-height: 520px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: #f1f7f6;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

td {
  background: #ffffff;
}

.revenue-section {
  background: #ffffff;
}

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

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

.revenue-grid span {
  display: block;
  margin-bottom: 44px;
  color: var(--orange);
  font-weight: 900;
}

.revenue-grid p,
.next-panel li {
  color: var(--muted);
}

.paid-pack {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f8f7;
}

.paid-pack p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.paid-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.primary-link {
  color: #ffffff;
  background: var(--teal);
  border-color: var(--teal);
}

.agent-section {
  background: var(--soft);
}

.agent-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(280px, 0.95fr);
  gap: 18px;
}

.agent-grid pre {
  min-height: 100%;
  margin: 0;
  background: var(--charcoal);
}

.next-panel ul {
  margin: 16px 0 24px;
  padding-left: 20px;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  padding: 24px clamp(18px, 5vw, 64px);
  background: var(--charcoal);
  color: #d6e8e5;
}

.footer a {
  color: #9ed7ce;
  font-weight: 850;
  text-decoration: none;
}

.store-main {
  background: #ffffff;
}

.store-hero {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 360px);
  gap: 20px;
  padding: clamp(36px, 7vw, 78px) clamp(18px, 5vw, 64px);
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}

.store-hero p:not(.eyebrow) {
  max-width: 720px;
  color: var(--muted);
}

.review-card,
.policy-panel,
.contact-box {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.review-card {
  display: grid;
  gap: 8px;
}

.review-card strong,
.contact-box strong {
  color: var(--muted);
  font-size: 0.82rem;
}

.store-section {
  padding-top: clamp(44px, 7vw, 76px);
  padding-bottom: clamp(44px, 7vw, 76px);
}

.alt-section {
  background: var(--soft);
}

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

.price-card,
.policy-grid article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.price-card.is-active {
  border-color: rgba(11, 111, 106, 0.45);
  box-shadow: var(--shadow);
}

.price-card span {
  color: var(--teal);
  font-weight: 900;
}

.price-card strong {
  display: block;
  margin: 14px 0;
  font-size: 2rem;
}

.policy-panel {
  margin-top: 16px;
}

.policy-panel ol {
  margin-bottom: 0;
  padding-left: 22px;
}

.policy-grid p,
.price-card p {
  color: var(--muted);
}

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

.contact-box div {
  display: grid;
  gap: 4px;
}

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

.photo-grid figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.photo-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.photo-grid figcaption {
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 850;
}

@media (max-width: 1120px) {
  .tool-shell,
  .workspace,
  .batch-layout,
  .agent-grid {
    grid-template-columns: 1fr;
  }

  .visual-panel {
    display: grid;
    grid-template-columns: minmax(240px, 0.8fr) minmax(240px, 1fr);
  }

  .visual-panel img {
    height: 100%;
    aspect-ratio: auto;
  }

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

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.88rem;
    overflow-x: auto;
  }

  .tool-shell,
  .section {
    padding-left: 14px;
    padding-right: 14px;
  }

  h1 {
    max-width: 11ch;
    font-size: clamp(2rem, 11vw, 2.9rem);
  }

  .panel-heading,
  .result-top {
    flex-direction: column;
  }

  .score-row,
  .result-grid,
  .visual-panel,
  .revenue-grid,
  .paid-pack {
    grid-template-columns: 1fr;
  }

  .paid-actions {
    justify-content: stretch;
  }

  .paid-actions .doc-link {
    width: 100%;
    text-align: center;
  }

  .store-hero,
  .pricing-grid,
  .policy-grid,
  .contact-box,
  .photo-grid {
    grid-template-columns: 1fr;
  }

  .toolbar button {
    flex: 1 1 100%;
  }

  .visual-panel img {
    aspect-ratio: 16 / 9;
  }
}
