@font-face {
  font-family: "Playfair Display";
  src: url("/static/fonts/playfair-display-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans TC";
  src: url("/static/fonts/noto-sans-tc-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans TC";
  src: url("/static/fonts/noto-sans-tc-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Noto Serif TC";
  src: url("/static/fonts/noto-serif-tc-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --huro-green: #0f3d2e;
  --huro-gold: #c9a24a;
  --huro-ivory: #faf8f2;
  --huro-ink: #1a1a1a;
  --huro-muted: #5a6b63;
  --huro-danger: #8b2e2e;
  --tap-min: 44px;
  --font-display: "Playfair Display", "Noto Serif TC", "Songti TC", "Noto Serif CJK TC", Georgia, serif;
  --font-ui: "Inter", "Noto Sans TC", "PingFang TC", "Noto Sans CJK TC", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(ellipse at top, rgba(201, 162, 74, 0.12), transparent 55%),
    linear-gradient(180deg, #f3efe4 0%, var(--huro-ivory) 40%, #eef3ef 100%);
  color: var(--huro-ink);
  font-family: var(--font-ui);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--huro-green);
  color: var(--huro-ivory);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}

.topbar-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

main {
  width: min(48rem, 100%);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  flex: 1;
}

h1 {
  font-family: var(--font-display);
  color: var(--huro-green);
  font-size: 1.75rem;
  margin: 0 0 0.5rem;
}

.lede {
  color: var(--huro-muted);
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

input[type="text"],
textarea {
  width: 100%;
  min-height: var(--tap-min);
  padding: 0.65rem 0.75rem;
  border: 1px solid #c5d0c9;
  border-radius: 0.35rem;
  background: #fff;
  font: inherit;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  min-width: var(--tap-min);
  padding: 0.6rem 1.1rem;
  border: none;
  border-radius: 0.35rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--huro-green);
  color: var(--huro-ivory);
}

.btn-secondary {
  background: transparent;
  color: var(--huro-ivory);
  border: 1px solid rgba(250, 248, 242, 0.55);
}

.btn-secondary.on-light {
  color: var(--huro-green);
  border-color: var(--huro-green);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.msg {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.35rem;
  line-height: 1.45;
}

.msg.error {
  background: #f8e8e8;
  color: var(--huro-danger);
}

.msg.info {
  background: #e8f0ea;
  color: var(--huro-green);
}

.consent-box {
  max-height: 22rem;
  overflow: auto;
  padding: 1rem;
  background: #fff;
  border: 1px solid #d5ddd7;
  border-radius: 0.35rem;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 0.95rem;
}

.card-result {
  margin-top: 1.25rem;
  padding: 1rem 0;
  border-top: 1px solid #d5ddd7;
}

.card-result h2 {
  font-family: var(--font-display);
  color: var(--huro-green);
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.card-result ol {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
  line-height: 1.55;
}

.disclaimer {
  font-size: 0.95rem;
  color: var(--huro-muted);
  margin: 0.75rem 0;
}

.official-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  color: var(--huro-green);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn.is-current {
  background: var(--huro-ivory);
  color: var(--huro-green);
  border-color: var(--huro-ivory);
}

.demo-flag {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.75rem;
  min-height: var(--tap-min);
  line-height: 1.8;
  background: var(--huro-green);
  color: var(--huro-ivory);
  font-weight: 600;
  border-radius: 0.35rem;
}

.policy-list {
  margin: 0 0 1.25rem;
}

.policy-list div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #d5ddd7;
}

.policy-list dt {
  font-weight: 600;
  color: var(--huro-green);
}

.policy-list dd {
  margin: 0;
  text-align: right;
}

.board-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-variant-numeric: tabular-nums;
}

.board-table th,
.board-table td {
  text-align: left;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid #d5ddd7;
  vertical-align: top;
}

.board-table th {
  color: var(--huro-green);
  font-weight: 600;
}

.diagram-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0.75rem 0 1rem;
}

.diagram-open {
  display: block;
  width: 100%;
  min-height: var(--tap-min);
  padding: 0;
  border: 1px solid #d5ddd7;
  border-radius: 0.35rem;
  background: #fff;
  cursor: zoom-in;
}

.diagram-open img {
  display: block;
  width: 100%;
  height: auto;
}

#diagram-dialog {
  width: min(40rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  border: none;
  border-radius: 0.35rem;
  padding: 1rem;
  background: var(--huro-ivory);
}

#diagram-dialog::backdrop {
  background: rgba(15, 61, 46, 0.72);
}

.diagram-dialog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.diagram-dialog-title {
  margin: 0;
  font-weight: 600;
  color: var(--huro-green);
}

#diagram-full {
  display: block;
  width: 100%;
  height: auto;
}

.hidden {
  display: none !important;
}
