:root {
  color-scheme: light;
  --ink: #17212f;
  --muted: #667085;
  --line: #d9e0ea;
  --panel: #ffffff;
  --soft: #f4f7fb;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --amber: #b45309;
  --red: #b42318;
  --green: #087443;
  --blue: #2457a6;
  --footer: #101828;
  --shadow: 0 16px 45px rgba(23, 33, 47, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #eef3f8;
  color: var(--ink);
  font-family:
    "Noto Sans TC",
    "Microsoft JhengHei",
    system-ui,
    sans-serif;
}

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

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

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(217, 224, 234, 0.86);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1280px, 100%);
  min-height: 72px;
  margin: 0 auto;
  padding: 0 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #2457a6);
  font-weight: 900;
}

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

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 850;
}

.nav-links a {
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--muted);
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--accent-dark);
  background: #e8f5f3;
}

.app-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 16px;
}

.hero-copy,
.hero-media,
.input-panel,
.results-panel,
.ad-slot,
.content-page {
  border: 1px solid rgba(217, 224, 234, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px;
}

.hero-copy h1 {
  max-width: 12em;
  margin: 0;
  font-size: clamp(2.15rem, 5vw, 4.1rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-copy p:not(.eyebrow) {
  max-width: 650px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.hero-media {
  overflow: hidden;
  min-height: 420px;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.primary-link,
.secondary-link {
  min-height: 42px;
  border-radius: 7px;
  padding: 10px 16px;
  text-decoration: none;
  font-weight: 900;
}

.primary-link {
  color: #fff;
  background: var(--accent);
}

.secondary-link {
  color: var(--blue);
  background: #e9f0fb;
}

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

h1,
h2 {
  letter-spacing: 0;
}

.tool-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 0 12px;
}

.tool-intro h2 {
  margin: 0;
  font-size: 1.45rem;
}

.tool-intro p {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.knowledge-section {
  margin-top: 28px;
}

.directory-hero {
  margin-bottom: 18px;
  border: 1px solid rgba(217, 224, 234, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  padding: 30px;
}

.directory-hero h1 {
  max-width: 12em;
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.12;
}

.directory-hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.section-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.55rem;
}

.section-heading p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.article-card {
  overflow: hidden;
  border: 1px solid rgba(217, 224, 234, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.article-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.article-card span {
  display: block;
  padding: 13px;
  font-weight: 900;
  line-height: 1.45;
}

.article-card p {
  margin: -4px 13px 14px;
  color: var(--muted);
  line-height: 1.65;
}

.directory-grid .article-card {
  min-height: 100%;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(330px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  min-height: 680px;
}

.input-panel,
.results-panel {
  padding: 20px;
}

.input-panel {
  display: flex;
  flex-direction: column;
}

.score-strip {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.score-strip h2 {
  margin: 0;
  font-size: 1.34rem;
  line-height: 1.18;
}

.field-label {
  margin-top: 16px;
  margin-bottom: 7px;
  color: #344054;
  font-weight: 850;
  font-size: 0.9rem;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

select,
input {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 320px;
  flex: 1;
  resize: vertical;
  padding: 13px;
  line-height: 1.65;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.13);
}

.button-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.primary-btn,
.ghost-btn,
.tab {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 900;
}

.primary-btn {
  flex: 1;
  color: #fff;
  background: var(--accent);
}

.primary-btn:hover {
  background: var(--accent-dark);
}

.ghost-btn {
  color: var(--blue);
  background: #e9f0fb;
}

.risk-badge {
  flex: 0 0 auto;
  min-width: 78px;
  border-radius: 999px;
  padding: 8px 12px;
  color: #fff;
  text-align: center;
  font-weight: 900;
  font-size: 0.88rem;
}

.risk-badge.idle {
  color: var(--muted);
  background: #e8edf4;
}

.risk-badge.low {
  background: var(--green);
}

.risk-badge.medium {
  background: var(--amber);
}

.risk-badge.high,
.risk-badge.critical {
  background: var(--red);
}

.summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.summary-row strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.tab {
  color: var(--muted);
  background: #edf1f6;
}

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

.tab-panel {
  display: none;
  min-height: 288px;
}

.tab-panel.active {
  display: block;
}

.notice,
.issue,
.rewrite-card,
.term-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 13px;
  margin-bottom: 9px;
}

.issue {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
}

.tag {
  align-self: start;
  border-radius: 999px;
  padding: 5px 9px;
  color: #fff;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 900;
}

.tag.low {
  background: var(--green);
}

.tag.medium {
  background: var(--amber);
}

.tag.high,
.tag.critical {
  background: var(--red);
}

.issue h3,
.rewrite-card h3,
.term-card h3,
.notice h3 {
  margin: 0 0 6px;
  font-size: 0.98rem;
}

.issue p,
.rewrite-card p,
.term-card p,
.notice p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.highlight-copy {
  border-left: 4px solid var(--accent);
  background: #f3faf8;
  padding: 11px;
  line-height: 1.7;
}

.ad-slot {
  display: grid;
  place-items: center;
  color: #8a94a6;
  background:
    repeating-linear-gradient(
      135deg,
      #f8fafc 0,
      #f8fafc 10px,
      #eef2f7 10px,
      #eef2f7 20px
    );
  box-shadow: none;
}

.top-ad {
  height: 76px;
  margin: 16px 0;
}

.side-ad {
  min-height: 92px;
  margin-top: 14px;
}

.ad-slot span {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 850;
}

.page-shell {
  width: min(1120px, 100%);
}

.content-page {
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(0, 1.08fr);
  gap: 28px;
  align-items: start;
  padding: 24px;
}

.page-visual {
  position: sticky;
  top: 96px;
  overflow: hidden;
  margin: 0;
  border-radius: 8px;
  background: var(--soft);
}

.page-visual img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.page-copy h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.12;
}

.page-copy h2 {
  margin-top: 24px;
  margin-bottom: 8px;
  font-size: 1.14rem;
}

.page-copy p,
.page-copy li {
  color: var(--muted);
  line-height: 1.85;
}

.page-copy ul {
  margin: 8px 0 0;
  padding-left: 22px;
}

.page-copy a {
  color: var(--accent-dark);
  font-weight: 850;
}

.source-note {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: 0.92rem;
}

.info-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 6px;
}

.info-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 13px;
}

.info-list span,
.info-list strong,
.info-list a {
  display: block;
}

.info-list span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.info-list strong,
.info-list a {
  margin-top: 4px;
  color: var(--ink);
  font-weight: 900;
}

.site-footer {
  margin-top: 28px;
  padding: 26px 22px;
  color: #d0d5dd;
  background: var(--footer);
}

.site-footer > div,
.site-footer > p {
  width: min(1280px, 100%);
  margin-right: auto;
  margin-left: auto;
}

.site-footer strong,
.site-footer span {
  display: inline-block;
  margin-right: 10px;
}

.site-footer strong {
  color: #fff;
}

.site-footer p {
  margin-top: 8px;
  margin-bottom: 0;
  line-height: 1.7;
}

.site-footer a {
  color: #e6fffb;
  font-weight: 850;
}

.footer-brand-link {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}

.footer-brand-link span {
  color: #d0d5dd;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 960px) {
  .site-nav {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    padding: 14px 18px;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .hero,
  .workspace,
  .content-page {
    grid-template-columns: 1fr;
  }

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

  .hero-media {
    min-height: 300px;
  }

  .tool-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-visual {
    position: static;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 14px;
  }

  .brand {
    align-items: flex-start;
  }

  .nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .nav-links a {
    padding-right: 8px;
    padding-left: 8px;
    text-align: center;
  }

  .hero-copy,
  .input-panel,
  .results-panel,
  .content-page {
    padding: 16px;
  }

  .hero-copy h1 {
    font-size: 2.1rem;
  }

  .hero-actions,
  .score-strip,
  .button-row {
    flex-direction: column;
  }

  .primary-link,
  .secondary-link,
  .risk-badge,
  .primary-btn,
  .ghost-btn {
    width: 100%;
    text-align: center;
  }

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

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

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

  textarea {
    min-height: 240px;
  }
}
