:root {
  --navy: #0b2545;
  --navy-deep: #061a36;
  --gold: #c9a24b;
  --gold-bright: #e6c878;
  --cream: #faf6ee;
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --line: rgba(11, 37, 69, 0.12);
  --shadow: 0 8px 32px rgba(11, 37, 69, 0.12);
  --shadow-lift: 0 16px 48px rgba(11, 37, 69, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  line-height: 1.75;
  font-size: 19px;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ===== 封面 ===== */
.cover {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: var(--cream);
  padding: 56px 40px 48px;
}

.cover-inner {
  max-width: 1600px;
  margin: 0 auto;
  text-align: center;
}

.cover-date {
  display: inline-block;
  font-size: 30px;
  letter-spacing: 6px;
  color: var(--gold-bright);
  border: 1px solid var(--gold);
  padding: 10px 32px;
  margin-bottom: 24px;
  font-weight: 300;
}

.cover-title {
  font-size: clamp(56px, 6vw, 84px);
  letter-spacing: 4px;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--cream);
}

.cover-subtitle {
  font-size: 26px;
  color: var(--gold-bright);
  letter-spacing: 3px;
  margin-bottom: 36px;
}

.cover-meta {
  display: inline-flex;
  gap: 32px;
  font-size: 18px;
  color: rgba(250, 246, 238, 0.78);
  letter-spacing: 2px;
}

.cover-meta span strong {
  color: var(--gold-bright);
  font-weight: 600;
  margin-right: 4px;
}

/* ===== 主體 ===== */
.main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 32px 40px 80px;
}

/* ===== 分類 tabs ===== */
.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.cat-tab {
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 24px;
  font-size: 18px;
  color: var(--ink-soft);
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s;
  font-family: inherit;
}

.cat-tab:hover {
  border-color: var(--gold);
  color: var(--navy);
}

.cat-tab.active {
  background: var(--navy);
  color: var(--gold-bright);
  border-color: var(--navy);
}

.cat-tab .count {
  display: inline-block;
  margin-left: 6px;
  font-size: 16px;
  opacity: 0.7;
}

/* ===== 學員卡網格 ===== */
.cat-section {
  margin-bottom: 48px;
}

.cat-heading {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gold);
}

.cat-heading h2 {
  font-size: 32px;
  color: var(--navy);
  letter-spacing: 2px;
  font-weight: 700;
}

.cat-heading .count {
  font-size: 18px;
  color: var(--ink-soft);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 24px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold);
  opacity: 0;
  transition: opacity 0.2s;
}

.card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.card:hover::before { opacity: 1; }

.card-no {
  font-size: 16px;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 2px;
}

.card-name {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 1px;
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.card-name .en {
  display: block;
  font-size: 17px;
  color: var(--ink-soft);
  font-weight: 400;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

.card-company {
  font-size: 18px;
  color: var(--ink-soft);
  line-height: 1.55;
  min-height: 3em;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.card-company .title {
  color: var(--navy);
  font-weight: 500;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.tag {
  display: inline-block;
  font-size: 15px;
  padding: 4px 14px;
  border-radius: 999px;
  letter-spacing: 1px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

.tag-b2b { background: rgba(11, 37, 69, 0.08); color: var(--navy); }
.tag-market { background: rgba(201, 162, 75, 0.15); color: #8a6a2a; }
.tag-size { background: rgba(74, 74, 74, 0.08); color: var(--ink-soft); }
.tag-empty { background: rgba(0,0,0,0.05); color: #999; font-style: italic; }

.card.empty {
  background: rgba(255, 255, 255, 0.5);
  border-style: dashed;
}

.card.empty .card-company {
  color: #aaa;
  font-style: italic;
}

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 26, 54, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-backdrop.show {
  display: flex;
}

.modal {
  background: var(--cream);
  border-radius: 14px;
  width: 100%;
  max-width: 1500px;
  height: calc(100vh - 40px);
  max-height: 940px;
  padding: 26px 36px 28px;
  position: relative;
  box-shadow: var(--shadow-lift);
  border-top: 4px solid var(--gold);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#modal-body {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 16px;
  background: none;
  border: none;
  font-size: 32px;
  color: var(--ink-soft);
  cursor: pointer;
  line-height: 1;
  padding: 4px 12px;
  border-radius: 6px;
  transition: all 0.15s;
  z-index: 2;
}

.modal-close:hover {
  background: rgba(11, 37, 69, 0.08);
  color: var(--navy);
}

.modal-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  padding-right: 60px;
}

.modal-no {
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 3px;
  font-weight: 600;
}

.modal-name {
  font-size: 32px;
  color: var(--navy);
  font-weight: 700;
  letter-spacing: 2px;
  margin: 2px 0 6px;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.2;
  display: inline-block;
  margin-right: 12px;
}

.modal-name .en {
  display: inline-block;
  font-size: 18px;
  color: var(--ink-soft);
  font-weight: 400;
  margin-left: 10px;
  letter-spacing: 1px;
}

.modal-company {
  font-size: 16px;
  color: var(--ink-soft);
  margin-bottom: 8px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.modal-company .title {
  color: var(--navy);
  font-weight: 600;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 32px;
  min-height: 0;
  overflow: hidden;
  font-size: 15px;
}

.sections-grid .col {
  display: block;
  min-height: 0;
  overflow: hidden;
}

.sections-grid .col .section {
  margin-bottom: 14px;
}

.sections-grid .col .section:last-child {
  margin-bottom: 0;
}

.section {
  min-height: 0;
  break-inside: avoid;
}

.section h3 {
  font-size: 0.85em;
  color: var(--gold);
  letter-spacing: 3px;
  font-weight: 700;
  margin-bottom: 6px;
  padding-left: 10px;
  border-left: 3px solid var(--gold);
}

.section .body {
  font-size: 1em;
  color: var(--ink);
  line-height: 1.65;
  white-space: pre-wrap;
}

.section.empty .body {
  color: #aaa;
  font-style: italic;
}

.section .body ul {
  margin: 4px 0 0 18px;
}

.section.full-width {
  grid-column: 1 / -1;
}

/* ===== 響應式 ===== */
@media (max-width: 1100px) {
  .sections-grid { grid-template-columns: 1fr; gap: 12px; overflow-y: auto; }
  .modal { max-width: 760px; }
}

@media (max-width: 900px) {
  .main { padding: 24px 20px 60px; }
  .cover { padding: 40px 20px 36px; }
  .cover-title { font-size: 36px; letter-spacing: 2px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
  .card { padding: 14px 16px; }
  .card-name { font-size: 16px; }
  .modal {
    padding: 22px 22px 24px;
    height: calc(100vh - 24px);
    max-height: none;
    border-radius: 10px;
  }
  .modal-backdrop { padding: 12px; }
  .modal-name { font-size: 26px; }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-tabs { gap: 6px; }
  .cat-tab { padding: 6px 12px; font-size: 12px; }
  .cover-meta { flex-direction: column; gap: 8px; }
  .modal-backdrop { padding: 0; }
  .modal { border-radius: 0; height: 100vh; }
}
