:root {
  --color-ink: #102033;
  --color-muted: #5e7088;
  --color-border: #dbe4ee;
  --color-panel: rgba(255, 255, 255, 0.9);
  --color-primary: #0d4f8f;
  --color-primary-dark: #073763;
  --color-accent: #1a936f;
  --color-warn: #b7791f;
  --color-bg: #eef4f9;
  --shadow-soft: 0 24px 60px rgba(16, 32, 51, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --content-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--color-ink);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(26, 147, 111, 0.16), transparent 34rem),
    linear-gradient(135deg, #f7fbff 0%, var(--color-bg) 48%, #e8f1f8 100%);
}

button,
textarea,
a {
  font: inherit;
}

button,
a {
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

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

.page-shell {
  width: min(100% - 32px, var(--content-width));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(219, 228, 238, 0.8);
  border-radius: 36px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 247, 252, 0.88)),
    repeating-linear-gradient(90deg, transparent 0 38px, rgba(13, 79, 143, 0.04) 38px 39px);
  box-shadow: var(--shadow-soft);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -120px -180px auto;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  background: rgba(13, 79, 143, 0.12);
  filter: blur(2px);
}

.topbar,
.hero-grid,
.workspace,
.notice-section {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 22px 28px;
  border-bottom: 1px solid rgba(219, 228, 238, 0.75);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.brand-mark small,
.panel-kicker,
.soft-badge {
  color: var(--color-muted);
  font-size: 0.86rem;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: white;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  box-shadow: 0 14px 28px rgba(13, 79, 143, 0.24);
}

.soft-badge {
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.74);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
  align-items: center;
  padding: 64px 52px 72px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 8px;
  color: var(--color-accent);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 720px;
  margin-bottom: 18px;
  font-size: clamp(2.35rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
  text-wrap: balance;
}

.hero-text {
  max-width: 620px;
  color: var(--color-muted);
  font-size: 1.12rem;
  line-height: 1.85;
}

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

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 999px;
  padding: 0 20px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  font-weight: 800;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  box-shadow: 0 16px 30px rgba(13, 79, 143, 0.25);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.secondary-button,
.ghost-button {
  color: var(--color-primary-dark);
  background: white;
  border: 1px solid var(--color-border);
}

.trust-card {
  padding: 24px;
  border: 1px solid rgba(219, 228, 238, 0.9);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(16px);
}

.trust-card-header {
  margin-bottom: 18px;
  font-weight: 900;
}

.trust-card ul {
  display: grid;
  gap: 14px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.trust-card li {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 12px;
  color: var(--color-muted);
}

.trust-card li span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: var(--color-primary);
  font-weight: 900;
  background: #eaf3fb;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
  gap: 22px;
  margin-top: 24px;
}

.input-panel,
.result-panel,
.notice-card {
  border: 1px solid rgba(219, 228, 238, 0.9);
  border-radius: var(--radius-xl);
  background: var(--color-panel);
  box-shadow: 0 18px 48px rgba(16, 32, 51, 0.08);
}

.input-panel,
.result-panel {
  padding: 26px;
}

.panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

label {
  display: block;
  margin: 18px 0 8px;
  font-weight: 800;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  color: var(--color-ink);
  background: rgba(255, 255, 255, 0.78);
  line-height: 1.65;
  outline: none;
}

textarea:focus {
  border-color: rgba(13, 79, 143, 0.55);
  box-shadow: 0 0 0 4px rgba(13, 79, 143, 0.1);
}

.result-panel {
  min-height: 560px;
}

.result-empty {
  display: grid;
  min-height: 390px;
  place-items: center;
  align-content: center;
  padding: 32px;
  color: var(--color-muted);
  text-align: center;
  border: 1px dashed #c6d4e2;
  border-radius: var(--radius-lg);
  background: rgba(247, 251, 255, 0.74);
}

.result-empty h3 {
  color: var(--color-ink);
  margin-bottom: 8px;
}

.document-icon {
  width: 78px;
  height: 96px;
  margin-bottom: 18px;
  border-radius: 18px;
  background:
    linear-gradient(#dbe8f3 0 0) 16px 26px / 46px 5px no-repeat,
    linear-gradient(#dbe8f3 0 0) 16px 42px / 36px 5px no-repeat,
    linear-gradient(#dbe8f3 0 0) 16px 58px / 44px 5px no-repeat,
    linear-gradient(135deg, white, #eef5fb);
  border: 1px solid var(--color-border);
  box-shadow: 0 18px 34px rgba(16, 32, 51, 0.09);
}

.answer-card {
  min-height: 390px;
  white-space: pre-wrap;
  border-radius: var(--radius-lg);
  padding: 22px;
  line-height: 1.82;
  background: #ffffff;
  border: 1px solid var(--color-border);
}

.answer-card.loading {
  color: var(--color-muted);
}

.hidden {
  display: none;
}

.notice-section {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
  gap: 22px;
  margin-top: 22px;
}

.notice-card {
  grid-column: 1 / -1;
  padding: 20px 22px;
}

.notice-card p {
  margin: 8px 0 0;
  color: var(--color-muted);
  line-height: 1.7;
}

.notice-card strong {
  color: var(--color-primary-dark);
}

@media (max-width: 900px) {
  .topbar,
  .panel-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-grid,
  .workspace,
  .notice-section {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    padding: 42px 24px 46px;
  }

  .page-shell {
    width: min(100% - 20px, var(--content-width));
    padding-top: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
