:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --text: #101828;
  --muted: #667085;
  --border: #e6e8ee;
  --accent: #4f46e5;
  --accent-2: #0d9488;
  --accent-contrast: #ffffff;
  --agree: #15803d;
  --disagree: #b91c1c;
  --pass: #98a2b3;
  --group-0: #4f6fb5;
  --group-1: #c9793d;
  --group-2: #5e9550;
  --group-3: #8a5ca5;
  --group-4: #b0567f;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 6px 18px -6px rgba(16, 24, 40, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101318;
    --surface: #171b22;
    --surface-2: #1d222b;
    --text: #eceef2;
    --muted: #98a2b3;
    --border: #2a303b;
    --accent: #818cf8;
    --accent-2: #2dd4bf;
    --accent-contrast: #0e1015;
    --agree: #4ade80;
    --disagree: #f87171;
    --pass: #7b8494;
    --group-0: #7c98d8;
    --group-1: #dd9a63;
    --group-2: #8cbb7c;
    --group-3: #b795d1;
    --group-4: #d38aab;
    --shadow: none;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang TC", "Noto Sans TC", -apple-system, "Segoe UI", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.4rem 4rem;
}

main.narrow {
  max-width: 720px;
  padding-top: 1.2rem;
}

h1 {
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.3rem;
  margin: 3rem 0 0.9rem;
  letter-spacing: -0.01em;
}

main.narrow h2 {
  font-size: 1.15rem;
  margin-top: 2.2rem;
}

h3 {
  font-size: 1.02rem;
  margin: 0 0 0.5rem;
}

p {
  margin: 0.4rem 0;
}

a {
  color: var(--accent);
}

ul {
  padding-left: 1.3rem;
  margin: 0.5rem 0;
}

li {
  margin: 0.3rem 0;
}

.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.grad-text {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  margin: 1rem 0;
  box-shadow: var(--shadow);
}

/* ---- 導覽列 ---- */

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  padding: 1.2rem 0 0.6rem;
}

.site-nav .wordmark {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}

.site-nav .wordmark img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.site-nav .wordmark .zh {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-nav a:not(.wordmark):not(.lang) {
  font-size: 0.92rem;
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:not(.wordmark):not(.lang):hover {
  color: var(--accent);
}

.lang-switch a,
.site-nav .lang {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.14rem 0.7rem;
  white-space: nowrap;
}

.lang-switch a:hover,
.site-nav .lang:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.page-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-top: 1.2rem;
}

.site-nav.compact {
  padding: 1rem 0 0.85rem;
  margin-bottom: 1.4rem;
  border-bottom: 1px solid var(--border);
}

.site-nav.compact .wordmark {
  font-size: 0.95rem;
}

.site-nav.compact .wordmark img {
  width: 26px;
  height: 26px;
}

.site-nav.compact .lang-switch {
  margin-left: auto;
}

/* ---- Hero ---- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}

.eyebrow::before {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
}

.hero {
  display: grid;
  grid-template-columns: 11fr 9fr;
  gap: 2.6rem;
  align-items: center;
  margin: 2.2rem 0 1rem;
}

.hero h1 {
  font-size: 2.5rem;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.hero .tagline {
  font-size: 1.06rem;
  color: var(--muted);
  margin: 0.9rem 0 0.4rem;
}

.hero .lede {
  font-size: 1rem;
  margin: 0.7rem 0 0;
}

.hero-figure {
  filter: drop-shadow(0 18px 30px rgba(16, 24, 40, 0.12));
}

.hero-figure svg {
  width: 100%;
  height: auto;
}

@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  .hero h1 {
    font-size: 1.9rem;
  }

  .hero-figure {
    max-width: 380px;
  }
}

.hero-actions {
  margin: 1.4rem 0 0.9rem;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 0.9rem;
}

.check-row span::before {
  content: "✓";
  color: var(--accent-2);
  font-weight: 700;
  margin-right: 0.35rem;
}

/* ---- 按鈕 ---- */

button,
.button {
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}

button:hover,
.button:hover {
  border-color: var(--accent);
}

button:active,
.button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

button.primary,
.button.primary {
  background: linear-gradient(110deg, var(--accent), var(--accent-2));
  border: none;
  color: var(--accent-contrast);
  border-radius: 999px;
  padding: 0.62rem 1.5rem;
  font-weight: 600;
  box-shadow: 0 6px 16px -6px rgba(79, 70, 229, 0.45);
}

button.primary:hover,
.button.primary:hover {
  box-shadow: 0 8px 20px -6px rgba(79, 70, 229, 0.55);
}

button.agree {
  border-color: var(--agree);
  color: var(--agree);
}

button.disagree {
  border-color: var(--disagree);
  color: var(--disagree);
}

button.pass {
  color: var(--pass);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.7rem;
  align-items: center;
}

/* ---- 表單 ---- */

input[type="text"],
textarea {
  font: inherit;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}

input[type="text"]:focus,
textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-color: var(--accent);
}

textarea {
  resize: vertical;
}

label {
  display: block;
  margin: 1rem 0 0.3rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.checkbox-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0.55rem 0;
  font-weight: 400;
  font-size: 0.95rem;
}

.checkbox-row input {
  flex-shrink: 0;
}

/* ---- 參與頁 ---- */

.statement-card {
  min-height: 8.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.25rem;
  padding: 2.2rem 1.6rem;
  line-height: 1.6;
}

.vote-buttons {
  display: flex;
  gap: 0.6rem;
  margin: 0.9rem 0 0.4rem;
}

.vote-buttons button {
  flex: 1;
  padding: 0.9rem 0.5rem;
  font-size: 1.02rem;
  font-weight: 600;
  border-width: 1.5px;
  border-radius: 12px;
}

.progress-track {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
  margin: 0.7rem 0 0.2rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  width: 0;
  transition: width 0.3s;
}

/* ---- 結果頁 ---- */

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}

.stat {
  flex: 1 1 7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow);
}

.stat .value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat .label {
  color: var(--muted);
  font-size: 0.82rem;
}

.map-svg {
  width: 100%;
  height: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.map-svg circle.dot {
  animation: dot-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

@keyframes dot-pop {
  from {
    opacity: 0;
    transform: scale(0);
    transform-origin: center;
    transform-box: fill-box;
  }
  to {
    opacity: 1;
    transform: scale(1);
    transform-origin: center;
    transform-box: fill-box;
  }
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  margin: 0.6rem 0;
  font-size: 0.88rem;
}

.legend .dot {
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  border-radius: 50%;
  margin-right: 0.35em;
}

.statement-row {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border);
}

.statement-row:first-child {
  border-top: none;
}

.statement-row .text {
  flex: 1;
  min-width: 0;
}

.tag {
  display: inline-block;
  font-size: 0.76rem;
  border-radius: 999px;
  padding: 0.08rem 0.6rem;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 0.25rem;
}

.tag.agree {
  color: var(--agree);
  border-color: color-mix(in srgb, var(--agree) 45%, transparent);
  background: color-mix(in srgb, var(--agree) 8%, transparent);
}

.tag.disagree {
  color: var(--disagree);
  border-color: color-mix(in srgb, var(--disagree) 45%, transparent);
  background: color-mix(in srgb, var(--disagree) 8%, transparent);
}

.tag.pending {
  color: var(--accent);
  border-color: var(--accent);
}

.vote-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--border);
  margin-top: 0.45rem;
  max-width: 420px;
}

.vote-bar .agree {
  background: var(--agree);
}

.vote-bar .disagree {
  background: var(--disagree);
}

.vote-bar .pass {
  background: var(--pass);
}

.group-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}


/* ---- AI 審議綜整與階層式報告 ---- */

.report-section {
  margin: 2.2rem 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.section-header h2 {
  margin-bottom: 0.4rem;
}

.sub-section {
  margin: 1.8rem 0;
}

.ai-badge-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface-2);
}

.badge.ai-model-badge {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.badge.ai-status-badge.ready {
  color: var(--accent-2);
  border-color: color-mix(in srgb, var(--accent-2) 30%, transparent);
  background: color-mix(in srgb, var(--accent-2) 8%, transparent);
}

.badge.ai-status-badge.info {
  color: var(--muted);
}

.badge.ai-status-badge.warning {
  color: var(--disagree);
  border-color: color-mix(in srgb, var(--disagree) 30%, transparent);
}

.badge.count-badge {
  font-size: 0.72rem;
  font-weight: 500;
}

.ai-overview-card {
  border-left: 4px solid var(--accent);
  padding: 1.4rem 1.6rem;
}

.lead-text {
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.65;
  margin: 0 0 0.5rem;
}

/* 議題網格 */
.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem;
  margin: 1rem 0;
}

.theme-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.theme-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.theme-card.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
  box-shadow: 0 0 0 1px var(--accent);
}

.theme-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.theme-header h3 {
  margin: 0;
  font-size: 1.02rem;
}

.theme-desc {
  margin: 0.4rem 0 0.8rem;
  font-size: 0.88rem;
}

.theme-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.theme-action-row {
  margin-top: 0.8rem;
  display: flex;
  justify-content: flex-end;
}

.theme-filter-btn {
  font-size: 0.82rem;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.theme-filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-filter-btn.active {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.more-badge {
  font-size: 0.76rem;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px dashed var(--border);
}

/* 引用標籤按鈕 */
.sid-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.12rem 0.5rem;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
}

.sid-chip:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.sid-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* 目標陳述反白動畫 */
.highlight-target {
  animation: pulse-highlight 2.2s ease-out;
}

@keyframes pulse-highlight {
  0% {
    background-color: color-mix(in srgb, var(--accent) 25%, transparent);
  }
  100% {
    background-color: transparent;
  }
}

.stale-banner {
  border-left-color: var(--disagree);
  background: color-mix(in srgb, var(--disagree) 8%, var(--surface-2));
  margin: 0 0 0.8rem 0;
  padding: 0.45rem 0.8rem;
  font-size: 0.88rem;
}

.provenance-line {
  font-size: 0.8rem;
  border-top: 1px dashed var(--border);
  padding-top: 0.6rem;
  margin-top: 0.8rem;
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.badge.pulse {
  animation: badge-pulse 1.8s infinite ease-in-out;
}

/* 跨群共識卡片 */
.common-ground-card {
  border-left: 4px solid var(--agree);
}

.cg-points-list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.cg-point-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.2rem;
}

.cg-point-header h4 {
  margin: 0;
}

.cg-point-item h4 {
  margin: 0 0 0.3rem;
  font-size: 0.98rem;
  color: var(--text);
}

.cg-point-item p {
  margin: 0 0 0.4rem;
  font-size: 0.92rem;
}

.citations-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.3rem;
}

.citations-row .label {
  font-size: 0.78rem;
}

/* 分歧與張力卡片 */
.tension-card {
  border-left: 4px solid var(--group-1);
  margin: 0.9rem 0;
}

.tension-topic {
  margin: 0 0 0.5rem;
  font-size: 1.04rem;
}

.tension-perspectives {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
  margin: 0.7rem 0;
}

.perspective-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  font-size: 0.88rem;
}

.perspective-box strong {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.tension-explanation {
  font-size: 0.92rem;
  margin: 0.6rem 0;
}

.bridging-question-box {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  margin: 0.7rem 0;
}

.bq-badge {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1;
}

.bq-content strong {
  color: var(--accent);
  font-size: 0.86rem;
  display: block;
}

.bq-content span {
  font-size: 0.92rem;
  font-weight: 500;
}

/* 張力數據即時對比與引用列表 */
.tension-stat-compare {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  margin-left: 0.4rem;
}

.tension-stat-compare .group-stat-pill {
  font-weight: 600;
}

.tension-citation-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin: 0.25rem 0;
}

.tension-citations-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.5rem;
}

/* 群體畫像網格 */
.portraits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem;
  margin: 1rem 0;
}

.portrait-card h4 {
  margin: 0 0 0.4rem;
  font-size: 1.02rem;
}

.portrait-summary {
  font-size: 0.9rem;
  margin: 0 0 0.7rem;
}

.portrait-stances {
  display: grid;
  gap: 0.45rem;
}

.stance-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.84rem;
}

.stance-desc {
  color: var(--muted);
}

/* 打印樣式 */
@media print {
  body {
    background: #ffffff;
    color: #000000;
  }
  .actions,
  .site-nav .lang-switch,
  button:not(.sid-chip) {
    display: none !important;
  }
  .sid-chip {
    border: 1px solid #999999 !important;
    background: transparent !important;
    color: #000000 !important;
    display: inline-flex !important;
  }
  .card {
    box-shadow: none;
    border: 1px solid #cccccc;
    page-break-inside: avoid;
  }
}
/* ---- 分享連結 / 程式碼 ---- */

.link-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.45rem 0 0.9rem;
  flex-wrap: wrap;
}

.link-row code {
  flex: 1 1 14rem;
  overflow-wrap: anywhere;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  font-size: 0.84rem;
}

pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-size: 0.86rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.05rem 0.35rem;
  font-size: 0.86em;
}

.notice {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0.9rem;
  background: var(--surface-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1rem 0;
}

.error {
  color: var(--disagree);
}

/* ---- Landing 區塊 ---- */

.cards-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  margin: 1rem 0;
}

.cards-3 .card {
  margin: 0;
}

.cards-3 p {
  font-size: 0.92rem;
  color: var(--muted);
}

.steps {
  padding-left: 0;
  margin: 1rem 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 0.7rem;
}

.steps li {
  counter-increment: step;
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
}

.steps li > div {
  flex: 1;
  min-width: 0;
}

.steps li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 1.7rem;
  height: 1.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: var(--accent-contrast);
  font-size: 0.85rem;
  font-weight: 700;
  transform: translateY(0.25rem);
}

ol.steps-plain {
  padding-left: 1.3rem;
  margin: 0.6rem 0;
}

ol.steps-plain li {
  margin: 0.5rem 0;
}

details.faq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1.2rem;
  margin: 0.55rem 0;
}

details.faq summary {
  cursor: pointer;
  font-weight: 600;
}

details.faq p {
  margin-top: 0.6rem;
  color: var(--muted);
}

details.plain-box {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 1.1rem;
  margin: 0.8rem 0;
  color: var(--muted);
}

details.plain-box summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.mt-lg {
  margin-top: 1.5rem;
}

.hidden {
  display: none !important;
}

/* ---- Footer ---- */

footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

footer .inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.4rem 1.4rem 2.6rem;
  color: var(--muted);
  font-size: 0.85rem;
}

footer .inner.narrow {
  max-width: 720px;
}

footer .credit {
  margin-top: 0.6rem;
  font-weight: 600;
}

/* 行動裝置觸控目標尺寸（44px 最小觸控範圍） */
@media (pointer: coarse) {
  .sid-chip,
  .theme-filter-btn,
  .button,
  .site-nav .lang,
  .lang-switch a {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 360px) {
  .tag {
    white-space: normal;
  }
}

/* 減少動態：置於檔尾並加 !important，確保勝過上方同特異性的 animation 宣告 */
@media (prefers-reduced-motion: reduce) {
  .map-svg circle.dot,
  .highlight-target,
  .badge.pulse {
    animation: none !important;
  }
  * {
    transition-duration: 0.001ms !important;
  }
}
