/* ==========================================================================
   夕络 · 在山水与日常之间 (Jiangxiang Journal)
   Design System & Responsive Styles
   ========================================================================== */

:root {
  --ink: #243b3a;
  --ink-light: #3d5856;
  --muted: #788783;
  --paper: #f3f4ef;
  --paper-card: #e8ede8;
  --sage: #dce5df;
  --sage-border: #cad6ce;
  --line: rgba(36, 59, 58, 0.14);
  --accent: #2e5954;
  --accent-light: #528079;
  --accent-gold: #c29b62;
  --serif: 'Noto Serif SC', 'Source Han Serif SC', serif;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --shadow-sm: 0 2px 8px rgba(20, 38, 36, 0.05);
  --shadow-md: 0 8px 24px rgba(20, 38, 36, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

/* ==========================================================================
   Home Hero Section & Ambient Media
   ========================================================================== */

.home {
  position: relative;
  min-height: min(840px, 100svh);
  height: 100svh;
  max-height: 1040px;
  color: #f8fbf8;
  overflow: hidden;
  background: #254245 url('background.jpg') center/cover no-repeat;
}

.video-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.home-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.5s ease-in-out;
}

.video-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 40%, rgba(20, 45, 46, 0.15) 0%, rgba(15, 33, 34, 0.5) 100%);
}

.home-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(14, 36, 38, 0.55), rgba(17, 43, 44, 0.15) 75%),
              linear-gradient(0deg, rgba(15, 35, 35, 0.45), transparent 28%, rgba(14, 35, 35, 0.25));
}

/* Topbar */
.topbar {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 0;
  width: 100%;
  height: 92px;
  padding: 0 7.3%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.16em;
  font-weight: 500;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 14px;
}

.main-nav {
  display: flex;
  gap: 48px;
  margin-left: 110px;
}

.main-nav a {
  font-size: 13px;
  letter-spacing: 0.15em;
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
  padding: 6px 0;
  position: relative;
}

.main-nav a:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.3s ease;
}

.main-nav a:hover::after {
  width: 100%;
}

/* Sound Button */
.sound-button {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 30px;
  background: rgba(20, 45, 46, 0.35);
  color: #ffffff;
  padding: 9px 18px;
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.25s ease;
}

.sound-button:hover {
  background: rgba(20, 45, 46, 0.6);
  border-color: rgba(255, 255, 255, 0.7);
}

.sound-icon {
  font-size: 14px;
}

.sound-bars {
  height: 14px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.sound-bars i {
  height: 4px;
  width: 2px;
  background: #d6e3d8;
  display: block;
  border-radius: 2px;
  transition: height 0.2s ease;
}

.sound-button.playing .sound-bars i {
  animation: wave 0.8s ease-in-out infinite alternate;
}

.sound-bars i:nth-child(2) { animation-delay: 0.2s; }
.sound-bars i:nth-child(3) { animation-delay: 0.4s; }
.sound-bars i:nth-child(4) { animation-delay: 0.15s; }

@keyframes wave {
  0% { height: 3px; }
  100% { height: 13px; }
}

/* Hero Content */
.hero-content {
  position: absolute;
  left: 14.5%;
  top: 50%;
  transform: translateY(-46%);
  z-index: 5;
  max-width: 680px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  letter-spacing: 0.22em;
}

.eyebrow span {
  width: 26px;
  height: 1px;
  background: #d4e0d7;
}

.hero-content h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 5.2vw, 68px);
  line-height: 1.42;
  letter-spacing: 0.08em;
  margin: 32px 0 22px;
  text-shadow: 0 2px 25px rgba(0, 0, 0, 0.2);
}

.hero-content h1 em {
  font-style: normal;
  color: #d8e5d9;
}

.hero-description {
  font-size: 14px;
  line-height: 2.2;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.86);
}

.hero-actions {
  display: flex;
  gap: 28px;
  align-items: center;
  margin-top: 36px;
}

.hero-link {
  display: inline-flex;
  gap: 16px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.65);
  font-size: 13px;
  letter-spacing: 0.12em;
  transition: all 0.2s ease;
}

.hero-link:hover {
  border-bottom-color: #ffffff;
  color: #dce5df;
  transform: translateX(3px);
}

.hero-link.secondary {
  opacity: 0.85;
  border-bottom-color: rgba(255, 255, 255, 0.35);
}

.hero-bottom {
  position: absolute;
  z-index: 5;
  bottom: 34px;
  left: 7.3%;
  right: 7.3%;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.scroll-cue i {
  font-style: normal;
  margin-left: 8px;
  display: inline-block;
  animation: bounce 1.8s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* Toast Notice */
.music-notice {
  position: absolute;
  z-index: 20;
  right: 7.3%;
  top: 105px;
  padding: 12px 18px;
  background: rgba(24, 48, 47, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #ffffff;
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 14px;
}

.music-notice.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.music-notice button {
  color: rgba(255, 255, 255, 0.8);
  font-size: 18px;
  line-height: 1;
}

/* ==========================================================================
   Intro Strip & Portal Navigation Cards
   ========================================================================== */

.intro-strip {
  min-height: 180px;
  padding: 48px 12%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.intro-label {
  color: #89958e;
  font-size: 10px;
  letter-spacing: 0.22em;
  align-self: flex-start;
  margin-top: 10px;
}

.intro-strip p {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.95;
  letter-spacing: 0.08em;
  color: #3b504e;
}

.intro-flower {
  color: #aab8ad;
  font-size: 34px;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 48px 7.3% 72px;
  gap: 20px;
  background: var(--paper);
}

.portal-card {
  min-height: 280px;
  padding: 30px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #dbe4df;
  border-radius: var(--radius-sm);
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.3s ease;
  overflow: hidden;
}

.portal-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.portal-hiking { background: #e0e3db; }
.portal-gallery { background: #dce3e4; }

.portal-index {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: rgba(36, 59, 58, 0.6);
  font-weight: 500;
}

.portal-card h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.09em;
  margin: 0 0 10px;
}

.portal-card p {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #657571;
  line-height: 1.8;
}

.portal-arrow {
  position: absolute;
  right: 28px;
  bottom: 26px;
  font-size: 22px;
  color: #71817a;
  transition: transform 0.25s ease;
}

.portal-card:hover .portal-arrow {
  transform: translate(3px, -3px);
  color: var(--ink);
}

/* Site Footer */
.site-footer {
  min-height: 96px;
  padding: 24px 7.3%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #77847e;
  background: var(--paper);
  border-top: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.site-footer .brand {
  font-size: 16px;
  color: var(--ink);
}

.site-footer .brand-mark {
  width: 26px;
  height: 26px;
  font-size: 12px;
}

/* ==========================================================================
   Full Screen Page Layer (Subpages: Hardware, Hiking, Gallery)
   ========================================================================== */

.page-layer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--paper);
  overflow-y: auto;
  overflow-x: hidden;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-layer.open {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 80px;
  padding: 0 7.3%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(243, 244, 239, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.page-header .brand {
  font-size: 18px;
}

.page-header .main-nav {
  margin: 0;
}

.page-header .main-nav a {
  color: var(--ink);
}

.close-page {
  border: 1px solid var(--line);
  background: transparent;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  color: var(--ink);
  transition: all 0.2s ease;
}

.close-page:hover {
  background: var(--ink);
  color: #ffffff;
  transform: rotate(90deg);
}

.page-wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 72px 40px 120px;
}

.page-kicker {
  font-size: 11px;
  letter-spacing: 0.24em;
  color: #7b8c84;
  font-weight: 500;
}

.page-title {
  font-family: var(--serif);
  font-size: clamp(38px, 5.5vw, 56px);
  font-weight: 400;
  letter-spacing: 0.08em;
  margin: 18px 0;
  color: var(--ink);
}

.page-lead {
  color: #61736b;
  font-size: 15px;
  line-height: 2.1;
  letter-spacing: 0.04em;
  max-width: 820px;
}

.section-heading {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.09em;
  margin: 64px 0 28px;
  color: var(--ink);
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ==========================================================================
   Section 1: Hardware Projects & Roadmap
   ========================================================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.project-card {
  background: #e7ece6;
  border: 1px solid var(--sage-border);
  border-radius: var(--radius-sm);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s, box-shadow 0.25s;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-sm);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.project-tag {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.project-tag.in-progress { background: #d2e4d8; color: #21543d; border: 1px solid #b5d5be; }
.project-tag.pending { background: #e8e2d4; color: #6a5323; border: 1px solid #d8cca8; }
.project-tag.planning { background: #e0e5e8; color: #325164; border: 1px solid #c4d2d8; }

.project-date {
  font-size: 11px;
  color: #88968f;
}

.project-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 10px;
  line-height: 1.45;
  color: var(--ink);
}

.project-desc {
  font-size: 12px;
  color: #6a7973;
  line-height: 1.9;
  margin-bottom: 20px;
  flex: 1;
}

.progress-track {
  height: 5px;
  background: #d4ded7;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-val {
  height: 100%;
  background: linear-gradient(90deg, #4d7a73, #2d554f);
  border-radius: 4px;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #798782;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

/* Roadmap */
.roadmap-timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.timeline-item {
  background: #eef2ed;
  border-left: 3px solid var(--accent-light);
  padding: 20px;
}

.timeline-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.1em;
  display: inline-block;
  margin-bottom: 8px;
}

.timeline-content h4 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
}

.timeline-content p {
  font-size: 12px;
  color: #6b7a74;
  line-height: 1.8;
}

/* Entry List (Articles) */
.entry-list {
  border-top: 1px solid var(--line);
}

.entry {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s;
}

.entry:hover {
  background: rgba(220, 229, 223, 0.3);
}

.entry-date {
  font-size: 12px;
  color: #89968e;
  letter-spacing: 0.08em;
}

.entry h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 6px;
}

.entry p {
  font-size: 13px;
  color: #6b7a74;
  line-height: 1.8;
}

.btn-read {
  border: 1px solid #cbd5ce;
  background: transparent;
  padding: 8px 16px;
  border-radius: 20px;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.06em;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-read:hover {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

/* ==========================================================================
   Section 2: Hiking Routes & Dossiers
   ========================================================================== */

.routes-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.route-card-rich {
  background: #e8eee8;
  border: 1px solid var(--sage-border);
  border-radius: var(--radius-sm);
  padding: 28px 30px;
}

.route-title-box {
  margin-bottom: 18px;
}

.route-badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #2b554e;
  background: #d4e2d8;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.route-title-box h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 6px;
}

.route-title-box p {
  font-size: 12px;
  color: #6b7973;
}

.route-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #dfe5df;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 16px;
  text-align: center;
}

.stat-item strong {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 2px;
}

.stat-item span {
  font-size: 11px;
  color: #72817a;
}

.route-tips {
  font-size: 12px;
  color: #556760;
  line-height: 1.8;
  background: rgba(255, 255, 255, 0.4);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Section 3: Live Photo Gallery & 30-Day Auto Retention
   ========================================================================== */

.gallery-retention-notice {
  background: #e3eae4;
  border: 1px solid #bfd0c5;
  border-radius: var(--radius-sm);
  padding: 24px 28px;
  margin: 32px 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.retention-info {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.retention-icon {
  font-size: 26px;
  line-height: 1;
}

.retention-info strong {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
  display: block;
  margin-bottom: 4px;
}

.retention-info p {
  font-size: 12px;
  color: #61736b;
  line-height: 1.8;
}

.gallery-actions {
  flex-shrink: 0;
}

.btn-upload {
  background: var(--ink);
  color: #ffffff;
  padding: 11px 22px;
  border-radius: 30px;
  font-size: 13px;
  letter-spacing: 0.08em;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.btn-upload:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(36, 59, 58, 0.2);
}

.gallery-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #788782;
  margin-bottom: 20px;
  padding: 0 4px;
}

.gallery-realtime-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #2b554e;
  font-weight: 500;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #399166;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(57, 145, 102, 0.7);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(57, 145, 102, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(57, 145, 102, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(57, 145, 102, 0); }
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.photo-card {
  background: #e6eae4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
  border: 1px solid var(--sage-border);
}

.photo-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.photo-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #254245;
}

.photo-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

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

.retention-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(18, 38, 37, 0.76);
  color: #ffffff;
  padding: 4px 9px;
  border-radius: 20px;
  font-size: 11px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(6px);
}

.retention-pill.expired {
  background: rgba(170, 50, 40, 0.85);
}

.photo-meta {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.photo-info {
  overflow: hidden;
  flex: 1;
}

.photo-name {
  font-size: 12px;
  font-weight: 500;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
  margin-bottom: 3px;
}

.photo-sub {
  font-size: 11px;
  color: #7b8a84;
  display: block;
}

.btn-download {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  font-weight: 500;
  transition: color 0.2s, border-color 0.2s;
}

.btn-download:hover {
  color: #0c1a19;
  border-color: #0c1a19;
}

.empty-gallery {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #8b9790;
  font-size: 13px;
  line-height: 2;
  background: #eef2ee;
  border: 1px dashed #cad6ce;
  border-radius: var(--radius-sm);
}

.feature-note {
  margin-top: 50px;
  padding: 26px 30px;
  background: #e6ece6;
  border-left: 3px solid #7c9486;
  color: #5d6e66;
  font-size: 13px;
  line-height: 2;
}

.page-bottom {
  margin-top: 80px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: #88958e;
  display: flex;
  justify-content: space-between;
  letter-spacing: 0.1em;
}

/* ==========================================================================
   Modals & Dialogs (Article Reader, Lightbox, Upload)
   ========================================================================== */

dialog {
  border: none;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  max-width: 90vw;
  margin: auto;
  color: var(--ink);
  background: var(--paper);
}

dialog::backdrop {
  background: rgba(18, 36, 35, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Article Reader Dialog */
.article-dialog {
  width: min(780px, 92vw);
  max-height: 86vh;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dialog-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ebeee8;
}

.dialog-category {
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--accent);
  font-weight: 500;
}

.dialog-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  color: #63736c;
  transition: all 0.2s;
}

.dialog-close:hover {
  background: rgba(36, 59, 58, 0.1);
  color: var(--ink);
}

.dialog-body {
  padding: 36px 36px 48px;
  overflow-y: auto;
}

.dialog-title {
  font-family: var(--serif);
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 10px;
}

.dialog-meta {
  font-size: 12px;
  color: #88958e;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.dialog-article-text {
  font-size: 14px;
  line-height: 2.1;
  color: #3f524e;
}

.dialog-article-text p.lead {
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 20px;
  font-weight: 500;
}

.dialog-article-text h3 {
  font-family: var(--serif);
  font-size: 18px;
  margin: 28px 0 12px;
  color: var(--ink);
}

.dialog-article-text ul,
.dialog-article-text ol {
  padding-left: 20px;
  margin-bottom: 20px;
}

.dialog-article-text li {
  margin-bottom: 10px;
}

.dialog-article-text code {
  background: #e2e8e2;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 13px;
}

.note-box {
  background: #e2ede6;
  border-left: 3px solid #4a806c;
  padding: 14px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 24px 0;
  font-size: 13px;
  color: #244b3c;
}

/* Photo Lightbox Dialog */
.photo-dialog {
  background: #112222;
  color: #ffffff;
  padding: 0;
  width: min(1080px, 94vw);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.photo-dialog-inner {
  position: relative;
  display: flex;
  flex-direction: column;
}

.photo-dialog-close {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  font-size: 22px;
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
}

.photo-dialog-view {
  background: #091414;
  display: flex;
  justify-content: center;
  align-items: center;
  max-height: 72vh;
  overflow: hidden;
}

.photo-dialog-view img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
}

.photo-dialog-info {
  padding: 20px 28px;
  background: #152727;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.photo-dialog-titles h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 4px;
}

.photo-dialog-meta {
  font-size: 12px;
  color: #9ab0aa;
}

.photo-dialog-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.photo-retention-pill {
  font-size: 12px;
  color: #e2c07d;
  background: rgba(226, 192, 125, 0.15);
  border: 1px solid rgba(226, 192, 125, 0.3);
  padding: 5px 12px;
  border-radius: 20px;
}

.btn-primary {
  background: #ffffff;
  color: #112222;
  padding: 9px 20px;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: #d8e5d9;
}

/* Upload Dialog */
.upload-dialog {
  width: min(540px, 92vw);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.upload-dialog-inner {
  padding: 0;
}

.upload-form {
  padding: 24px 28px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--ink);
}

.input-text {
  width: 100%;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #cad6ce;
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.input-text:focus {
  border-color: var(--accent);
}

.drop-zone {
  border: 2px dashed #a8b8ae;
  background: #ebf0eb;
  border-radius: var(--radius-sm);
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.drop-zone:hover,
.drop-zone.drag-hover {
  background: #e1ebe2;
  border-color: var(--accent);
}

.drop-icon {
  font-size: 36px;
  margin-bottom: 10px;
}

.drop-zone strong {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 6px;
}

.drop-zone p {
  font-size: 11px;
  color: #798782;
}

.file-hidden {
  display: none;
}

.upload-file-list {
  margin-bottom: 16px;
  max-height: 120px;
  overflow-y: auto;
}

.selected-files-header {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  padding: 6px 10px;
  border-radius: 4px;
  margin-bottom: 4px;
  font-size: 11px;
}

.file-item-del {
  color: #b33939;
  font-size: 16px;
  line-height: 1;
}

.upload-progress-container {
  margin-bottom: 20px;
}

.progress-bar {
  height: 6px;
  background: #d8e2d8;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

#progressText {
  font-size: 11px;
  color: #63736b;
  text-align: center;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-secondary {
  padding: 8px 18px;
  border: 1px solid #cad6ce;
  border-radius: 20px;
  font-size: 12px;
  color: var(--ink);
}

.upload-form .btn-primary {
  background: var(--ink);
  color: #ffffff;
  border-radius: 20px;
}

/* ==========================================================================
   Responsive Adaptations (Mobile & Tablet)
   ========================================================================== */

@media (max-width: 900px) {
  .portal-grid,
  .projects-grid,
  .roadmap-timeline {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .route-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .gallery-retention-notice {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 700px) {
  .home {
    height: 88svh;
    min-height: 600px;
    max-height: 780px;
  }

  .topbar {
    height: 72px;
    padding: 0 5%;
  }

  .brand {
    font-size: 17px;
  }

  .main-nav {
    gap: 18px;
    margin-left: 0;
  }

  .main-nav a {
    font-size: 12px;
    letter-spacing: 0.08em;
  }

  .sound-button {
    padding: 7px 12px;
    gap: 6px;
  }

  .sound-button #soundLabel {
    display: none;
  }

  .hero-content {
    left: 7%;
    right: 7%;
    top: 48%;
  }

  .eyebrow {
    font-size: 9px;
  }

  .hero-content h1 {
    font-size: clamp(34px, 8.8vw, 46px);
    margin: 22px 0 16px;
  }

  .hero-description {
    font-size: 13px;
    line-height: 2;
  }

  .hero-actions {
    margin-top: 24px;
    gap: 18px;
  }

  .hero-bottom {
    left: 5%;
    right: 5%;
    bottom: 22px;
    font-size: 9px;
  }

  .hero-bottom > span:first-child {
    display: none;
  }

  .music-notice {
    right: 5%;
    top: 80px;
    font-size: 11px;
    padding: 8px 14px;
  }

  .intro-strip {
    min-height: 140px;
    padding: 32px 7%;
    display: block;
    position: relative;
  }

  .intro-label {
    margin: 0 0 10px;
  }

  .intro-strip p {
    font-size: 17px;
    line-height: 1.8;
  }

  .intro-flower {
    position: absolute;
    right: 7%;
    top: 36px;
    font-size: 24px;
  }

  .mobile-only {
    display: block;
  }

  .desktop-only {
    display: none;
  }

  .portal-grid {
    padding: 24px 5% 48px;
    gap: 12px;
  }

  .portal-card {
    min-height: 200px;
    padding: 22px;
  }

  .portal-card h2 {
    font-size: 22px;
  }

  .site-footer {
    padding: 20px 5%;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .page-header {
    height: 64px;
    padding: 0 5%;
  }

  .page-header .main-nav {
    gap: 16px;
  }

  .page-header .main-nav a {
    font-size: 11px;
  }

  .page-wrap {
    padding: 44px 5% 72px;
  }

  .page-title {
    font-size: 36px;
  }

  .page-lead {
    font-size: 13px;
  }

  .section-heading {
    font-size: 20px;
    margin: 44px 0 20px;
  }

  .entry {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 20px 0;
  }

  .entry-date {
    font-size: 11px;
  }

  .entry .btn-read {
    justify-self: flex-start;
  }

  .photo-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .dialog-body {
    padding: 24px 20px 36px;
  }

  .photo-dialog-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
