:root {
  color-scheme: light;
  --ink: #172331;
  --muted: #5a6878;
  --line: #d9e1e8;
  --surface: #ffffff;
  --soft: #f4f7f8;
  --brand: #163b59;
  --brand-2: #1f7a70;
  --accent: #c44a32;
  --warn: #8d2f22;
  --shadow: 0 10px 26px rgba(21, 42, 62, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--soft);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, #eef4f4 0, #f8fafb 260px, #f4f7f8 100%);
}

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

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 16px 12px;
  background: rgba(244, 247, 248, 0.94);
  border-bottom: 1px solid rgba(217, 225, 232, 0.8);
  backdrop-filter: blur(14px);
}

.kicker {
  margin: 0 0 3px;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 700;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(20px, 6vw, 28px);
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 22px;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

main {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 16px 14px calc(92px + env(safe-area-inset-bottom));
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head p,
.export-tips p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.small-link,
.count-pill {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 10px;
  color: var(--brand);
  background: #e7eff2;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.icon-button,
.primary-button,
.ghost-button,
.danger-button,
.file-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.icon-button {
  width: 44px;
  color: white;
  background: var(--brand);
  font-size: 28px;
  line-height: 1;
}

.primary-button {
  width: 100%;
  color: white;
  background: var(--brand);
  box-shadow: var(--shadow);
}

.ghost-button {
  padding: 0 14px;
  color: var(--brand);
  background: #e7eff2;
}

.danger-button {
  width: 100%;
  color: white;
  background: var(--warn);
}

.now-box,
.export-panel,
.export-tips,
.note-form {
  margin-bottom: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.now-box strong {
  display: block;
  margin-bottom: 4px;
  color: var(--brand);
  font-size: 18px;
}

.agenda-image-wrap {
  overflow: auto;
  margin-bottom: 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.agenda-image-wrap img {
  display: block;
  width: 100%;
  min-width: 720px;
  height: auto;
}

.timeline,
.notes-list,
.people-grid,
.brief-list {
  display: grid;
  gap: 10px;
}

.agenda-card,
.note-card,
.person-card,
.brief-card {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.agenda-card.active-now {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 2px rgba(31, 122, 112, 0.15);
}

.agenda-card .time {
  color: var(--brand-2);
  font-weight: 900;
}

.agenda-card .meta,
.note-card .meta,
.person-card .meta,
.brief-card .meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  padding: 4px 8px;
  color: #234;
  background: #eef4f4;
  border: 1px solid #dce7e6;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.note-form {
  display: grid;
  gap: 12px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fbfcfd;
  border: 1px solid #cbd7df;
  border-radius: 8px;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

.quick-tags,
.attachment-controls,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-tags button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--brand);
  background: #eef4f4;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 800;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 0 14px;
  color: white;
  background: var(--brand-2);
}

.file-button input {
  display: none;
}

.status-line,
.pending-files {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.filter-row {
  margin: 14px 0;
}

.filter-row input {
  flex: 1 1 180px;
}

.filter-row select {
  flex: 0 0 128px;
}

.wide-search {
  margin-bottom: 14px;
}

.note-card h3,
.person-card h3,
.brief-card h3,
.agenda-card h3 {
  margin: 4px 0 6px;
}

.note-card p,
.agenda-card p,
.person-card p,
.brief-card p {
  margin-bottom: 8px;
  line-height: 1.5;
}

.note-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.note-actions button {
  min-height: 36px;
  padding: 0 10px;
  color: var(--warn);
  background: #f8eae7;
  border: 1px solid #efcbc3;
  border-radius: 8px;
  font-weight: 800;
}

.attachment-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.brief-card ul {
  margin: 8px 0 0;
  padding-left: 20px;
  line-height: 1.5;
}

.toggle-line {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 15px;
}

.toggle-line input {
  width: 20px;
  min-height: 20px;
}

.export-panel {
  display: grid;
  gap: 10px;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.nav-btn {
  min-width: 0;
  min-height: 46px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
}

.nav-btn.active {
  color: white;
  background: var(--brand);
}

@media (max-width: 430px) {
  main {
    padding-right: 10px;
    padding-left: 10px;
  }

  .app-header {
    padding-right: 12px;
    padding-left: 12px;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .small-link,
  .count-pill {
    width: fit-content;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .filter-row select {
    flex: 1 1 120px;
  }
}
