/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Tokens（對標 Python 的品牌色）────────────────────────── */
:root {
  --navy:   #1a3a6e;
  --gold:   #c9a84c;
  --bg:     #f4f6f9;
  --white:  #ffffff;
  --border: #e5e9f0;
  --row-alt: #fafbfd;
  --row-hover: #f0f5ff;

  --font: -apple-system, "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
}

/* ── Base ────────────────────────────────────────────────── */
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: #222; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ──────────────────────────────────────────────── */
.header {
  background: var(--white);
  border-bottom: 3px solid var(--gold);
  padding: 14px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: center;
}

.brand-logo {
  height: 48px;
  width: auto;
  display: block;
}

.header-right { text-align: right; }

.tagline {
  font-size: .78rem;
  color: var(--navy);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.update {
  font-size: .75rem;
  color: #999;
  margin-top: 3px;
}

.update span { color: var(--gold); font-weight: 600; }

/* ── Main ────────────────────────────────────────────────── */
.main {
  padding: 28px 36px;
  max-width: 1400px;
  margin: 0 auto;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  border-left: 4px solid var(--gold);
  padding-left: 12px;
  margin-bottom: 16px;
}

/* ── Toolbar ─────────────────────────────────────────────── */
.toolbar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.search-box {
  padding: 7px 14px;
  border: 1px solid #d0d8e8;
  border-radius: 7px;
  background: #f8fafc;
  color: #222;
  font-family: var(--font);
  font-size: .9rem;
  width: 240px;
  outline: none;
  transition: border .15s;
}

.search-box:focus { border-color: var(--navy); }
.search-box::placeholder { color: #aab; }

.filter-btn {
  padding: 5px 16px;
  border: 1.5px solid #d0d8e8;
  border-radius: 20px;
  background: var(--white);
  color: #555;
  cursor: pointer;
  font-family: var(--font);
  font-size: .84rem;
  font-weight: 500;
  transition: all .15s;
}

.filter-btn:hover { border-color: var(--navy); color: var(--navy); }
.filter-btn.active { background: var(--navy); color: var(--white); border-color: var(--navy); }

.count {
  margin-left: auto;
  color: #888;
  font-size: .84rem;
  background: #f0f3f8;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Table ───────────────────────────────────────────────── */
.table-wrap {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  border: 1px solid var(--border);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

thead tr { background: var(--navy); }

th {
  padding: 12px 16px;
  text-align: left;
  font-size: .78rem;
  color: var(--gold);
  white-space: nowrap;
  letter-spacing: .06em;
  font-weight: 700;
}

td {
  padding: 10px 16px;
  font-size: .87rem;
  border-bottom: 1px solid #f0f3f8;
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr.hidden { display: none; }

tbody tr:hover td { background: var(--row-hover); }
tbody tr:nth-child(even) td { background: var(--row-alt); }
tbody tr:nth-child(even):hover td { background: var(--row-hover); }

/* ── Cell styles（對標 Python CSS）──────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}

.code {
  font-weight: 800;
  color: var(--navy);
  font-size: .93rem;
  white-space: nowrap;
}

.name { font-weight: 600; color: #222; white-space: nowrap; }

.date {
  white-space: nowrap;
  color: #b8860b;
  font-weight: 700;
  font-size: .9rem;
}

.time { color: #555; font-size: .85rem; white-space: nowrap; }

.col-organizer,
.col-location { width: 160px; }

.org  { color: #444; font-size: .84rem; }

.loc  { color: #666; font-size: .83rem; }

.summary {
  color: #888;
  font-size: .8rem;
  max-width: 280px;
  line-height: 1.4;
}

.slides-link {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid rgba(26,58,110,.3);
  border-radius: 5px;
  background: rgba(26,58,110,.06);
  color: var(--navy);
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s;
}

.slides-link:hover {
  background: rgba(26,58,110,.12);
  text-decoration: none;
}

/* ── Loading / Empty ─────────────────────────────────────── */
.loading-cell {
  text-align: center;
  padding: 40px;
  color: #aaa;
  font-size: .9rem;
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 18px;
  color: #bbb;
  font-size: .76rem;
  border-top: 1px solid #e8ecf2;
  margin-top: 8px;
}

.footer span { color: var(--gold); font-weight: 600; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .header { padding: 12px 16px; }
  .main   { padding: 16px 12px 40px; }

  .brand-logo { height: 36px; }
  .tagline    { font-size: .7rem; }

  .toolbar { padding: 10px 12px; gap: 8px; }
  .search-box { width: 100%; }
}
