/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #2c2416;
  --bg-secondary: #3d3530;
  --card-bg: #4a4038;
  --primary: #f0ead6;
  --accent: #d4af37;
  --accent-hover: #e6c75e;
  --text: #f0ead6;
  --text-light: #c5bdb0;
  --border: #5a5050;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  --radius: 12px;
  --max-w: 1100px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Serif TC', 'Georgia', serif;
  font-size: 18px;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

img {
  display: block;
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
}

/* ===== NAVBAR ===== */
.d-navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(44, 36, 22, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.d-navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.d-navbar-brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.d-navbar-brand:hover { text-decoration: none; }

.d-navbar-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.d-navbar-links a {
  color: var(--text-light);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.d-navbar-links a:hover,
.d-navbar-links a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.d-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  background: none;
  border: none;
}

.d-hamburger span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

.d-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(8px, 8px); }
.d-hamburger.open span:nth-child(2) { opacity: 0; }
.d-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(7px, -7px); }

/* ===== HERO ===== */
.d-hero {
  margin-top: 64px;
  background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
  color: #fff;
  padding: 84px 0 72px;
  position: relative;
  overflow: hidden;
}

.d-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(212, 175, 55, 0.06), transparent 28%),
    radial-gradient(circle at 82% 24%, rgba(212, 175, 55, 0.04), transparent 22%),
    linear-gradient(180deg, rgba(212,175,55,0.01), transparent 45%);
  pointer-events: none;
}

.d-hero .container {
  position: relative;
  z-index: 1;
}

.d-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.88fr);
  gap: 34px;
  align-items: stretch;
}

.d-hero-copy {
  text-align: left;
  max-width: 42rem;
}

.d-hero-kicker {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212,175,55,0.2);
  color: var(--accent);
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  margin-bottom: 18px;
  font-weight: 600;
}

.d-hero h1 {
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #f0ead6;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  margin-bottom: 16px;
}

.d-hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-light);
  margin-bottom: 24px;
  letter-spacing: 0.05em;
}

.d-hero-narrative {
  color: var(--text-light);
  font-size: 1.03rem;
  max-width: 38rem;
  margin-bottom: 24px;
  line-height: 1.8;
}

.d-hero-quote-panel {
  display: grid;
  gap: 10px;
  padding: 20px 22px;
  margin-bottom: 28px;
  border-radius: 12px;
  background: rgba(61, 53, 48, 0.6);
  border: 1px solid rgba(212,175,55,0.2);
  box-shadow: 0 20px 30px rgba(0,0,0,0.4);
}

.d-hero-quote-label {
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  font-weight: 600;
}

.d-hero-quote-text {
  font-size: 1.25rem;
  line-height: 1.8;
  color: #f0ead6;
}

.d-hero-quote-source {
  color: var(--text-light);
  font-size: 0.92rem;
}

.d-hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.d-hero-aside {
  display: grid;
  gap: 18px;
}

.d-hero-scene-card,
.d-hero-stats {
  border-radius: 12px;
  background: rgba(61, 53, 48, 0.4);
  border: 1px solid var(--border);
  box-shadow: 0 18px 30px rgba(0,0,0,0.4);
}

.d-hero-scene-card {
  padding: 20px;
}

.d-hero-scene-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: none;
}

.d-hero-scene-label {
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
  font-weight: 600;
}

.d-hero-scene-title {
  color: #f0ead6;
  font-size: 1.22rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.d-hero-scene-text {
  color: var(--text-light);
  font-size: 0.96rem;
  line-height: 1.7;
}

.d-hero-scene-link {
  display: inline-flex;
  margin-top: 16px;
  color: var(--accent);
  font-size: 0.94rem;
}

.d-hero-stats {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.d-hero-stat {
  padding: 14px 12px;
  border-radius: 12px;
  background: rgba(61,53,48,0.5);
  text-align: center;
  border: 1px solid var(--border);
}

.d-hero-stat-number {
  display: block;
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.d-hero-stat-label {
  color: var(--text-light);
  font-size: 0.82rem;
  line-height: 1.5;
}

/* ===== BUTTONS ===== */
.d-btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
  letter-spacing: 0.04em;
}

.d-btn:hover { transform: translateY(-2px); }

.d-btn-primary {
  background: var(--accent);
  color: #2c2416;
  border-color: var(--accent);
  font-weight: 600;
}

.d-btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #2c2416;
}

.d-btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.d-btn-outline:hover {
  background: rgba(212,175,55,0.1);
  border-color: var(--accent-hover);
  color: var(--accent-hover);
}

.d-btn-sm {
  padding: 8px 20px;
  font-size: 0.9rem;
}

/* ===== SECTION ===== */
.d-section {
  padding: 72px 0;
}

.d-section-alt {
  background: var(--bg-secondary);
}

.d-section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

.d-section-subtitle {
  color: var(--text-light);
  font-size: 1rem;
  margin-bottom: 48px;
  letter-spacing: 0.03em;
}

.d-section-header {
  margin-bottom: 48px;
}

/* ===== CARDS GRID ===== */
.d-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.d-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}

.d-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
}

.d-card-media {
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
}

.d-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
  transition: transform 0.35s ease;
}

.d-card:hover .d-card-img {
  transform: scale(1.04);
}

.d-card-overlay {
  position: absolute;
  top: 12px; left: 12px;
  display: flex;
  gap: 8px;
}

.d-story-kicker,
.d-story-readtime {
  background: rgba(26,26,26,0.85);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  border: 1px solid var(--border);
}

.d-card-body {
  padding: 20px;
  flex: 1;
}

.d-card-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 0.78rem;
  color: var(--text-light);
}

.d-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.d-story-hook {
  font-size: 0.92rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.d-card-summary {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.65;
}

.d-card-footer {
  padding: 12px 20px 20px;
  border-top: 1px solid var(--border);
}

/* ===== STORY EXPAND ===== */
.d-story-expand {
  display: none;
  padding: 0 20px 20px;
}

.d-story-expand.open {
  display: block;
}

.d-story-lead-block {
  padding: 16px;
  background: rgba(61, 53, 48, 0.6);
  border-radius: var(--radius);
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.d-story-lead {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 12px;
}

.d-story-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.d-story-pill {
  font-size: 0.75rem;
  color: var(--text-light);
  background: transparent;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.d-story-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.d-story-section:last-child {
  border-bottom: none;
}

.d-story-section h4 {
  font-size: 0.78rem;
  font-weight: 700;
  color: #d4af37;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.d-story-section p {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.7;
}

.d-story-dialogue {
  font-style: italic;
  border-left: 2px solid var(--accent);
  padding-left: 14px;
  color: var(--text-light);
}

.d-story-lesson {
  margin-top: 12px;
  padding: 14px 16px;
  background: rgba(61, 53, 48, 0.6);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text);
  border-left: 3px solid #d4af37;
}

/* ===== STORY SPOTLIGHT ===== */
.d-story-spotlight {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 48px;
  background: rgba(61, 53, 48, 0.6);
  border-radius: var(--radius);
  margin-bottom: 48px;
  border: 1px solid var(--border);
}

.d-story-spotlight-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.d-story-spotlight-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f0ead6;
  margin-bottom: 14px;
}

.d-story-spotlight-text {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.75;
}

.d-story-spotlight-quote {
  font-size: 1.35rem;
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  line-height: 1.6;
}

/* ===== PAGE HERO ===== */
.d-page-hero {
  margin-top: 64px;
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #3d3530 0%, #2c2416 100%);
}

.d-page-hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f0ead6;
  margin-bottom: 10px;
}

.d-page-hero p {
  font-size: 1.05rem;
  color: var(--text-light);
}

/* ===== PERSON CARD ===== */
.d-person-card {
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}

.d-person-card:last-of-type { border-bottom: none; }

.d-person-header {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 24px;
}

.d-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(61, 53, 48, 0.8);
  flex-shrink: 0;
  box-shadow: none;
  border: 2px solid #d4af37;
}

.d-person-name {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  margin-bottom: 2px;
}

.d-person-english {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: 10px;
}

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

.d-tag {
  font-size: 0.75rem;
  color: var(--text-light);
  background: rgba(61, 53, 48, 0.6);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
}

.d-person-quote {
  font-size: 1.05rem;
  color: #d4af37;
  font-style: italic;
  margin: 20px 0 14px;
  padding-left: 16px;
  border-left: 2px solid #d4af37;
}

.d-person-desc {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.75;
}

.d-person-related-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 28px 0 16px;
}

/* ===== FEATURED PERSON ===== */
.d-featured-person {
  display: flex;
  gap: 28px;
  align-items: center;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(61, 53, 48, 0.6);
}

.d-featured-person-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #d4af37;
}

.d-featured-person-name {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  margin-bottom: 4px;
}

.d-featured-person-role {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 10px;
}

.d-featured-person-quote {
  font-size: 1rem;
  font-style: italic;
  color: #f0ead6;
}

/* ===== TIMELINE ===== */
.d-timeline {
  position: relative;
  padding-left: 0;
}

.d-timeline::before {
  content: '';
  position: absolute;
  left: 56px;
  top: 0; bottom: 0;
  width: 1px;
  background: #d4af37;
  opacity: 0.3;
}

.d-timeline-item {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 24px;
  margin-bottom: 48px;
  position: relative;
}

.d-timeline-year-col {
  text-align: right;
  padding-top: 2px;
}

.d-timeline-year {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.d-timeline-dot {
  position: absolute;
  left: 52px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d4af37;
  border: 2px solid #2c2416;
  box-shadow: 0 0 0 1px #d4af37;
}

.d-timeline-content { }

.d-timeline-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #d4af37;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.d-timeline-location {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.d-timeline-desc {
  font-size: 0.92rem;
  color: var(--text-light);
  line-height: 1.7;
}

/* ===== VALUES ===== */
.d-values-intro {
  font-size: 1.05rem;
  color: var(--text-light);
  margin-bottom: 40px;
  max-width: 600px;
}

.d-value-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(61, 53, 48, 0.6);
  margin-bottom: 20px;
}

.d-value-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #d4af37;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.d-value-desc {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.7;
}

/* ===== GALLERY ===== */
.d-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}

.d-gallery-item {
  background: var(--card-bg);
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.d-gallery-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  border-radius: 0;
  box-shadow: none;
  transition: transform 0.35s ease;
}

.d-gallery-item:hover .d-gallery-img {
  transform: scale(1.04);
}

.d-gallery-caption {
  padding: 16px;
}

.d-gallery-caption h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.d-gallery-caption p {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.5;
}

.d-gallery-placeholder {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(61, 53, 48, 0.6);
  font-size: 2rem;
  color: var(--text-light);
}

/* ===== ABOUT ===== */
.d-about-block h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  margin-bottom: 12px;
}

.d-about-block p,
.d-about-block li {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.75;
}

.d-about-block ul,
.d-about-block ol {
  padding-left: 20px;
  margin-bottom: 16px;
}

.d-about-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

code {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  background: rgba(61, 53, 48, 0.8);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  color: #d4af37;
}

/* ===== FOOTER ===== */
.d-footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  background: rgba(61, 53, 48, 0.6);
}

.d-footer p {
  font-size: 0.82rem;
  color: var(--text-light);
  text-align: center;
  line-height: 2;
}

.d-footer a {
  color: #d4af37;
}

.d-footer a:hover {
  color: #e6c75e;
}

.d-version-switch {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--text-light);
  text-align: center;
}

.d-version-switch a {
  color: #d4af37;
}

/* ===== BACK TO TOP ===== */
#d-back-to-top {
  position: fixed;
  bottom: 32px; right: 32px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(61, 53, 48, 0.8);
  border: 1px solid var(--border);
  color: #d4af37;
  font-size: 1rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

#d-back-to-top.visible { display: flex; }
#d-back-to-top:hover { background: #d4af37; color: #2c2416; border-color: #d4af37; }

/* ===== MOBILE NAV OPEN ===== */
.d-navbar-links.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 64px; left: 0; right: 0;
  background: rgba(26,26,26,0.97);
  backdrop-filter: blur(12px);
  padding: 16px 24px 24px;
  border-bottom: 1px solid var(--border);
  gap: 4px;
  z-index: 99;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .d-navbar-links {
    display: none;
  }

  .d-hamburger {
    display: flex;
  }

  .d-hero {
    padding: 64px 0 52px;
  }

  .d-hero-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .d-hero-aside {
    order: -1;
  }

  .d-hero h1 {
    font-size: 2rem;
  }

  .d-hero-stats {
    grid-template-columns: 1fr;
  }

  .d-page-hero h1 {
    font-size: 1.6rem;
  }

  .d-story-spotlight {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px;
  }

  .d-timeline::before {
    left: 0;
  }

  .d-timeline-item {
    grid-template-columns: 1fr;
    padding-left: 20px;
  }

  .d-timeline-year-col {
    text-align: left;
  }

  .d-timeline-dot {
    left: -4px;
  }

  .d-person-header {
    flex-direction: column;
    gap: 16px;
  }

  .d-featured-person {
    flex-direction: column;
    text-align: center;
    padding: 24px;
  }

  .d-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 480px) {
  .d-hero h1 {
    font-size: clamp(28px, 8vw, 40px);
  }

  .d-cards-grid {
    grid-template-columns: 1fr;
  }

  .d-hero-buttons {
    flex-direction: column;
  }

  .d-btn {
    width: 100%;
    text-align: center;
  }

  .d-hero-stats {
    grid-template-columns: 1fr;
  }

  .d-gallery-grid {
    grid-template-columns: 1fr;
  }

  .d-value-card {
    padding: 20px;
  }
}
