:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #68707a;
  --line: #d8dde3;
  --paper: #fbfcfd;
  --surface: #ffffff;
  --accent: #b42318;
  --accent-dark: #871b12;
  --steel: #33566b;
  --mint: #e9f3ee;
  --gold: #f4d35e;
  --shadow: 0 18px 48px rgba(31, 43, 55, 0.13);
}

* {
  box-sizing: border-box;
}

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

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

button {
  cursor: pointer;
}

.site-header {
  position: relative;
  min-height: 300px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #111;
}

.cat-banner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.74;
}

.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(11, 17, 22, 0.86), rgba(11, 17, 22, 0.46), rgba(11, 17, 22, 0.08));
}

.header-copy {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 44px;
  color: #fff;
}

.header-copy h1 {
  margin: 8px 0 12px;
  font-size: clamp(36px, 7vw, 72px);
  line-height: 1.03;
  letter-spacing: 0;
}

.header-copy p {
  max-width: 650px;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 18px;
  line-height: 1.7;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-shell {
  width: min(1120px, calc(100% - 24px));
  margin: -22px auto 56px;
  position: relative;
  z-index: 2;
}

.panel {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.panel.active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 4px 0 0;
  font-size: 28px;
  letter-spacing: 0;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
}

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

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

.secondary-button {
  color: var(--steel);
  background: #f2f6f8;
  border-color: #cad7df;
}

.input-stack {
  display: grid;
  gap: 7px;
}

.input-stack label {
  color: #39434d;
  font-weight: 800;
  font-size: 14px;
}

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

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

textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.75;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--steel);
  box-shadow: 0 0 0 3px rgba(51, 86, 107, 0.14);
}

.news-list {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.placeholder {
  color: var(--muted);
  background: #f6f8fa;
  border: 1px dashed #c8d0d8;
  border-radius: 8px;
  padding: 18px;
  line-height: 1.7;
}

.news-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  background: #fff;
}

.news-item h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.watchbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
}

.watchbar p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 220px;
  font-weight: 800;
}

.toggle input {
  width: 20px;
  height: 20px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 12px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.filters label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #34424e;
  font-weight: 700;
}

.filters input {
  width: 16px;
  height: 16px;
}

.news-item {
  display: grid;
  gap: 9px;
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.news-item a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.new-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

dialog {
  width: min(560px, calc(100% - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 0;
}

dialog::backdrop {
  background: rgba(24, 31, 38, 0.36);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h3 {
  margin: 0;
}

.dialog-head button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: #f1f3f5;
  font-size: 24px;
  line-height: 1;
}

#dialogContent {
  padding: 18px;
  line-height: 1.7;
}

@media (max-width: 760px) {
  .site-header {
    min-height: 260px;
  }

  .header-copy {
    padding-bottom: 34px;
  }

  .header-copy p {
    font-size: 16px;
  }

  .app-shell {
    width: min(100% - 16px, 680px);
    margin-top: -16px;
  }

  .panel {
    padding: 16px;
  }

  .section-heading,
  .watchbar,
  .status-row {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}

.audio-transcribe-panel {
  margin-top: 18px;
}

.audio-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1.4fr);
  gap: 18px;
  align-items: start;
}

.audio-controls,
.audio-output,
.analysis-box {
  display: grid;
  gap: 14px;
}

.audio-hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.placeholder.compact {
  padding: 12px;
}

#audioTranscribeStatus[data-tone="success"] {
  color: #1d6f42;
  background: #ecf8f0;
  border-color: #b7dfc4;
}

#audioTranscribeStatus[data-tone="warning"] {
  color: #73510d;
  background: #fff8df;
  border-color: #eed386;
}

#audioTranscribeStatus[data-tone="error"] {
  color: #8d221a;
  background: #fff0ee;
  border-color: #e5b8b3;
}

.analysis-box {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.analysis-box h3 {
  margin: 0;
  font-size: 15px;
}

.analysis-box p,
.analysis-box ul {
  margin: 0;
  color: #39434d;
  line-height: 1.7;
}

.analysis-box ul {
  padding-left: 20px;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-list span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: #edf3f6;
  color: var(--steel);
  font-weight: 800;
  font-size: 13px;
}

@media (max-width: 760px) {
  .audio-grid {
    grid-template-columns: 1fr;
  }
}
