/* Civic Talk - Style */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --border: #e5e5e0;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --accent-hover: #1d4ed8;
  --pro: #16a34a;
  --con: #dc2626;
  --neutral: #9333ea;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
}

body {
  font-family: 'Noto Sans TC', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.container { max-width: 800px; margin: 0 auto; padding: 0 20px; }

/* Header */
header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 0;
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 800px; margin: 0 auto; padding: 0 20px;
}
.logo {
  font-size: 1.15rem; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.logo span { color: var(--accent); }
.header-nav { display: flex; gap: 16px; align-items: center; }
.header-nav a { color: var(--text-muted); font-size: 0.9rem; }
.header-nav a:hover { color: var(--text); text-decoration: none; }

/* Main */
main { padding: 40px 0 80px; }

/* Section heading */
.page-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 8px; }
.page-subtitle { color: var(--text-muted); margin-bottom: 32px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card:hover { border-color: #c5c5be; }

/* Issue card */
.issue-card { display: block; color: inherit; }
.issue-card:hover { text-decoration: none; }
.issue-title { font-size: 1.15rem; font-weight: 600; margin-bottom: 6px; }
.issue-meta { display: flex; gap: 12px; font-size: 0.85rem; color: var(--text-muted); align-items: center; }
.status-badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: 0.78rem; font-weight: 500;
}
.status-collecting { background: #fef3c7; color: #92400e; }
.status-summarizing { background: #e0f2fe; color: #0369a1; }
.status-published { background: #dcfce7; color: #15803d; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: all 0.15s;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; color: white; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }

/* Forms */
.form-group { margin-bottom: 20px; }
label { display: block; font-size: 0.9rem; font-weight: 500; margin-bottom: 6px; }
.label-hint { font-weight: 400; color: var(--text-muted); font-size: 0.82rem; margin-left: 6px; }
input[type="text"], input[type="url"], select, textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.95rem; font-family: inherit; color: var(--text);
  background: var(--surface); transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
textarea { resize: vertical; min-height: 140px; }

/* Stance colors */
.stance-pro { color: var(--pro); font-weight: 500; }
.stance-con { color: var(--con); font-weight: 500; }
.stance-neutral { color: var(--neutral); font-weight: 500; }

/* Material card */
.material-card { margin-bottom: 12px; }
.material-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.material-source { font-size: 0.85rem; color: var(--text-muted); }
.material-content { font-size: 0.92rem; white-space: pre-wrap; line-height: 1.7; }
.material-url { font-size: 0.8rem; color: var(--accent); }

/* Briefing */
.briefing-section { margin-bottom: 24px; }
.briefing-section h3 { font-size: 1rem; font-weight: 600; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 2px solid var(--accent-light); }
.briefing-text { font-size: 0.95rem; white-space: pre-wrap; line-height: 1.8; }

/* Prompt box */
.prompt-box {
  background: #f8f8f6; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  font-family: 'Courier New', monospace; font-size: 0.85rem;
  white-space: pre-wrap; line-height: 1.6;
  max-height: 320px; overflow-y: auto;
}
.prompt-actions { display: flex; gap: 8px; margin-top: 10px; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab {
  padding: 10px 18px; font-size: 0.9rem; cursor: pointer;
  border: none; background: transparent; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-family: inherit;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }
.tab:hover:not(.active) { color: var(--text); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Empty state */
.empty { text-align: center; color: var(--text-muted); padding: 40px 0; }
.empty-icon { font-size: 2rem; margin-bottom: 12px; }

/* Alert */
.alert {
  padding: 14px 16px; border-radius: var(--radius);
  font-size: 0.9rem; margin-bottom: 20px;
}
.alert-info { background: var(--accent-light); color: #1e40af; border: 1px solid #bfdbfe; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* Opinion card */
.opinion-card { border-left: 3px solid var(--accent-light); padding-left: 14px; }
.opinion-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; }

/* Step indicator */
.steps { display: flex; gap: 0; margin-bottom: 32px; }
.step {
  flex: 1; text-align: center; padding: 12px 8px;
  font-size: 0.8rem; border-bottom: 2px solid var(--border);
  color: var(--text-muted);
}
.step.active { border-bottom-color: var(--accent); color: var(--accent); font-weight: 500; }
.step.done { border-bottom-color: var(--pro); color: var(--pro); }
.step-num { display: block; font-size: 1rem; margin-bottom: 2px; }

/* Toast */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1a1a1a; color: white; padding: 12px 20px;
  border-radius: 8px; font-size: 0.9rem;
  opacity: 0; transition: opacity 0.3s; pointer-events: none; z-index: 999;
}
#toast.show { opacity: 1; }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }

/* Utility */
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.flex { display: flex; } .items-center { align-items: center; } .gap-8 { gap: 8px; } .gap-16 { gap: 16px; }
.justify-between { justify-content: space-between; }
.font-bold { font-weight: 700; } .font-medium { font-weight: 500; }
