/* ============================================================
   镇江丹阳铁路机位汇总 —— 全局样式（现代黑白极简风）
   ============================================================ */

:root {
  --bg: #ffffff;
  --ink: #0b0b0b;
  --muted: #6b6b6b;
  --faint: #9a9a9a;
  --line: #e8e8e8;
  --paper: #f6f6f4;
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .08);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ---------- 页面切换动画 ---------- */
@view-transition { navigation: auto; }

::view-transition-old(root) { animation: vtOut .3s var(--ease) both; }
::view-transition-new(root) { animation: vtIn .45s var(--ease) both; }
@keyframes vtOut { to { opacity: 0; transform: translateY(10px); } }
@keyframes vtIn  { from { opacity: 0; transform: translateY(14px); } }

body.enter { animation: pageIn .5s var(--ease) both; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
body.leaving { opacity: 0; transform: translateY(10px); transition: opacity .28s ease, transform .28s ease; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img {
  width: 38px; height: 38px; border-radius: 9px;
  object-fit: cover; border: 1px solid var(--line); flex-shrink: 0;
}
.brand-text {
  font-family: var(--serif);
  font-size: 17px; font-weight: 700; letter-spacing: .04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.theme-toggle {
  margin-left: auto; margin-right: 6px;
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid var(--line); background: var(--bg);
  color: var(--ink); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .35s var(--ease);
}
.theme-toggle:hover { border-color: var(--ink); transform: rotate(20deg) scale(1.05); }
.theme-toggle:active { transform: scale(.92); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .ic-sun { display: none; }
html[data-theme="dark"] .theme-toggle .ic-moon { display: none; }
html[data-theme="dark"] .theme-toggle .ic-sun { display: block; }

.nav-admin {
  margin-left: 0; font-size: 13px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
  transition: all .25s var(--ease);
}
.nav-admin:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- 主体 ---------- */
.page { flex: 1; }

.hero {
  max-width: 1200px; margin: 0 auto; padding: 56px 22px 20px;
  text-align: center;
}
.hero-kicker {
  display: inline-block; font-size: 12px; letter-spacing: .32em;
  color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 16px; margin-bottom: 22px;
  text-transform: uppercase;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 700; letter-spacing: .05em; line-height: 1.25;
}
.hero-sub { margin-top: 14px; color: var(--muted); font-size: 15px; }

/* ---------- 搜索框 ---------- */
.search-box {
  max-width: 640px; margin: 36px auto 0; position: relative;
}
.search-box svg {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; stroke: var(--muted); pointer-events: none;
}
.search-box input {
  width: 100%; padding: 16px 22px 16px 54px;
  font-size: 16px; color: var(--ink);
  border: 1px solid var(--ink); border-radius: 999px;
  background: var(--bg); outline: none;
  transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
.search-box input::placeholder { color: var(--faint); }
.search-box input:focus { box-shadow: 0 0 0 4px rgba(11, 11, 11, .06); }

/* ---------- 筛选区 ---------- */
.filter-bar {
  max-width: 1200px; margin: 26px auto 0; padding: 0 22px;
  display: flex; flex-wrap: wrap; gap: 18px; justify-content: center;
  align-items: flex-start;
}
.filter-group { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.filter-label {
  font-size: 12px; letter-spacing: .18em; color: var(--faint);
  text-transform: uppercase;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  font-size: 13px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  transition: all .22s var(--ease); user-select: none;
}
.chip:hover { border-color: var(--ink); transform: translateY(-1px); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- 机位卡片网格 ---------- */
.spot-grid {
  max-width: 1200px; margin: 40px auto 60px; padding: 0 22px;
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.spot-card {
  position: relative; overflow: hidden;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), opacity .3s ease;
  animation: cardIn .5s var(--ease) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.spot-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.spot-card .cover { aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper); }
.spot-card .cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s var(--ease);
}
.spot-card:hover .cover img { transform: scale(1.05); }
.spot-card .name {
  padding: 14px 16px 16px; font-size: 15px; font-weight: 600;
  display: flex; align-items: baseline; gap: 8px;
}
.spot-card .name .alias { font-size: 12px; color: var(--faint); font-weight: 400; }
.spot-card.hide { display: none; }

/* 空状态 */
.empty {
  max-width: 1200px; margin: 60px auto; padding: 60px 20px; text-align: center;
  color: var(--muted); font-size: 15px;
}

/* ---------- 详情页 ---------- */
.detail {
  max-width: 880px; margin: 0 auto; padding: 26px 22px 80px;
}
.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--muted);
  padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px;
  transition: all .25s var(--ease); margin-bottom: 34px;
}
.back-btn:hover { border-color: var(--ink); color: var(--ink); }
.spot-title { margin-bottom: 4px; }
.spot-title h1 {
  font-family: var(--serif); font-size: clamp(26px, 4vw, 40px); font-weight: 700;
  letter-spacing: .04em;
}
.spot-title .alias { color: var(--faint); font-size: 15px; margin-top: 4px; }
.cover-main {
  margin-top: 24px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--paper);
}
.cover-main img { width: 100%; max-height: 520px; object-fit: cover; }

.section { margin-top: 44px; }
.section-label {
  font-size: 12px; letter-spacing: .28em; color: var(--faint);
  text-transform: uppercase; margin-bottom: 16px;
  display: flex; align-items: center; gap: 14px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.gallery {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.gallery figure { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: var(--paper); }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; transition: transform .4s var(--ease); }
.gallery img:hover { transform: scale(1.02); }

.video-wrap {
  display: grid; gap: 16px; grid-template-columns: 1fr;
}
.video-wrap video {
  width: 100%; border-radius: var(--radius-sm); background: #000;
  border: 1px solid var(--line); max-height: 480px;
}

.text-block {
  padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); font-size: 15px; white-space: pre-wrap;
}

/* 附近机位 */
.nearby-list { display: flex; flex-direction: column; gap: 12px; }
.nearby-item {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px 20px; background: var(--bg);
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.nearby-item:hover { border-color: var(--ink); transform: translateX(4px); }
.nearby-item .nname { font-size: 16px; font-weight: 600; }
.nearby-item .nname .arr { color: var(--faint); font-weight: 400; font-size: 12px; margin-left: 6px; }
.nearby-item .ntime { margin-top: 8px; font-size: 14px; color: var(--muted); white-space: pre-wrap; }

/* ---------- 反馈 ---------- */
.feedback-zone { max-width: 880px; margin: 0 auto 70px; padding: 0 22px; text-align: center; }
.feedback-btn {
  background: var(--ink); color: #fff; border: none;
  padding: 14px 30px; border-radius: 999px; font-size: 15px;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.feedback-btn:hover { opacity: .85; transform: translateY(-2px); }

.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, .42);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility .3s;
}
.modal-mask.show { opacity: 1; visibility: visible; }
.modal {
  width: 100%; max-width: 520px; background: #fff; border-radius: var(--radius);
  padding: 28px; transform: translateY(16px); transition: transform .35s var(--ease);
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}
.modal-mask.show .modal { transform: none; }
.modal h3 { font-family: var(--serif); font-size: 20px; margin-bottom: 6px; }
.modal p.hint { font-size: 13px; color: var(--faint); margin-bottom: 16px; }
.modal textarea {
  width: 100%; min-height: 120px; padding: 14px; font-size: 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); resize: vertical; outline: none;
  transition: border-color .25s;
}
.modal textarea:focus { border-color: var(--ink); }
.modal-actions { margin-top: 16px; display: flex; gap: 12px; justify-content: flex-end; }
.btn-ghost {
  background: none; border: 1px solid var(--line); color: var(--ink);
  padding: 10px 20px; border-radius: 999px; transition: all .25s;
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-solid {
  background: var(--ink); color: #fff; border: none;
  padding: 10px 22px; border-radius: 999px; transition: opacity .25s;
}
.btn-solid:hover { opacity: .85; }
.btn-solid:disabled { opacity: .4; cursor: not-allowed; }
.modal .form-msg { margin-top: 12px; font-size: 13px; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line); padding: 0 20px 26px; text-align: center; font-size: 13px;
}
.footer-main {
  max-width: 1200px; margin: 0 auto; padding: 30px 0 22px;
  display: flex; flex-direction: column; gap: 18px; align-items: center;
  border-bottom: 1px dashed var(--line);
}
.footer-about { max-width: 760px; color: var(--muted); font-size: 14px; line-height: 1.9; text-align: justify; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: center; }
.footer-links a { color: var(--muted); font-size: 14px; transition: color .25s var(--ease); }
.footer-links a:hover { color: var(--ink); }
.footer-author { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.footer-author .fa-label { color: var(--faint); font-size: 13px; }
.footer-author a {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px;
  color: var(--ink); font-size: 13px; transition: all .25s var(--ease);
}
.footer-author a:hover { border-color: var(--ink); transform: translateY(-1px); }
.footer-copy { padding-top: 22px; color: var(--faint); }

/* ---------- 公共文本页（用户协议等） ---------- */
.page-doc { max-width: 820px; margin: 0 auto; padding: 26px 22px 90px; }
.page-doc h1 {
  font-family: var(--serif); font-size: clamp(26px, 4vw, 38px); font-weight: 700;
  letter-spacing: .04em; margin-bottom: 26px; padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.page-content { font-size: 15px; line-height: 2; color: var(--ink); }

/* ---------- 自定义背景 ---------- */
body.has-bg {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
body.has-bg::before {
  content: "";
  position: fixed; inset: 0;
  background: rgba(var(--bg-overlay-color, 255, 255, 255), var(--bg-overlay, .88));
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: -1;
}

/* ---------- 轮播图 ---------- */
.carousel-slot {
  max-width: 1200px; margin: 26px auto; padding: 0 22px;
}
.carousel-group-label {
  font-size: 12px; letter-spacing: .24em; color: var(--faint);
  text-transform: uppercase; margin: 6px 2px 12px;
}
.carousel {
  position: relative; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--paper);
}
.carousel-track { display: flex; transition: transform .65s var(--ease); }
.carousel-slide { flex: 0 0 100%; position: relative; cursor: pointer; }
.carousel-slide img { width: 100%; max-height: 480px; object-fit: cover; display: block; }
.carousel-slide.noimg { min-height: 220px; background: var(--paper); }
.carousel-slide.noimg img { display: none; }
.carousel-slide.noimg::after {
  content: "图片加载失败";
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--faint); font-size: 14px; letter-spacing: .1em;
}
.carousel-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 44px 22px 18px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .55));
  color: #fff; font-size: 15px; font-weight: 600;
}
.carousel-caption em {
  font-style: normal; font-weight: 400; font-size: 12px;
  opacity: .82; margin-left: 10px; letter-spacing: .02em;
}
.car-author { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.car-author b { color: var(--ink); font-weight: 600; }
.carousel-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .6); background: rgba(0, 0, 0, .25);
  color: #fff; font-size: 22px; line-height: 1; z-index: 5;
  transition: background .2s;
}
.carousel-nav:hover { background: rgba(0, 0, 0, .55); }
.carousel-nav.prev { left: 14px; }
.carousel-nav.next { right: 14px; }
.carousel-dots {
  position: absolute; left: 0; right: 0; bottom: 12px;
  display: flex; justify-content: center; gap: 8px; z-index: 5;
}
.carousel-dots .dot {
  width: 8px; height: 8px; border-radius: 50%; border: none; padding: 0;
  background: rgba(255, 255, 255, .6); transition: all .25s;
}
.carousel-dots .dot.active { background: #fff; width: 20px; border-radius: 999px; }

/* 轮播信息弹窗 */
.car-modal {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0, 0, 0, .82);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; visibility: hidden; transition: all .25s ease;
}
.car-modal.in { opacity: 1; visibility: visible; }
.car-modal-box {
  position: relative; width: 100%; max-width: 860px; max-height: 92vh;
  background: #fff; border-radius: 14px; overflow: auto;
  display: grid; grid-template-columns: 1.4fr 1fr;
  transform: translateY(14px) scale(.98); transition: transform .3s var(--ease);
}
.car-modal.in .car-modal-box { transform: none; }
.car-close {
  position: absolute; top: 12px; right: 14px; z-index: 6;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0, 0, 0, .35); color: #fff; border: none; font-size: 20px;
}
.car-img { background: #000; display: flex; align-items: center; justify-content: center; min-height: 260px; }
.car-img img { max-width: 100%; max-height: 78vh; object-fit: contain; }
.car-info { padding: 26px 26px 30px; overflow-y: auto; }
.car-info h4 { font-family: var(--serif); font-size: 22px; margin-bottom: 12px; }
.car-caption { color: #555; font-size: 14px; line-height: 1.8; white-space: pre-wrap; margin-bottom: 14px; }
.car-spot {
  display: inline-block; margin-bottom: 16px; font-size: 14px; font-weight: 600;
  border-bottom: 1px solid var(--ink); padding-bottom: 2px;
}
.car-exif { border-top: 1px solid var(--line); padding-top: 16px; }
.car-exif-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.car-exif-row span { color: var(--muted); }
.car-exif-row b { font-weight: 600; text-align: right; }
.car-exif-empty { color: var(--faint); font-size: 13px; padding-top: 12px; }

/* ---------- 底部轮播文本 ---------- */
.banner-ticker {
  max-width: 1200px; margin: 0 auto; padding: 18px 22px 8px;
  text-align: center; min-height: 34px;
}
.banner-ticker .bt-text {
  display: inline-block; font-size: 14px; color: var(--muted);
  letter-spacing: .04em; transition: opacity .4s ease;
}

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .nav-inner { padding: 12px 16px; }
  .brand-text { font-size: 15px; }
  .hero { padding-top: 40px; }
  .filter-bar { gap: 14px; }
  .spot-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .spot-card .name { font-size: 14px; padding: 12px 13px 14px; }
  .detail { padding: 18px 16px 60px; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .back-btn { margin-bottom: 26px; }
}
@media (max-width: 420px) {
  .gallery { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .car-modal-box { grid-template-columns: 1fr; }
  .car-info { padding: 18px; }
  .carousel-slide img { max-height: 300px; }
}

/* ============================================================
   深色 / 浅色模式
   ============================================================ */
html[data-theme="dark"] {
  --bg: #121212;
  --ink: #f0efec;
  --muted: #b3b3ae;
  --faint: #80807b;
  --line: #333332;
  --paper: #1c1c1b;
  --shadow: 0 10px 30px rgba(0, 0, 0, .55);
  --bg-overlay-color: 0, 0, 0;
  color-scheme: dark;
}
html[data-theme="dark"] .site-header { background: rgba(18, 18, 18, .86); }
html[data-theme="dark"] .modal,
html[data-theme="dark"] .car-modal-box { background: #1a1a19; }
html[data-theme="dark"] .chip.active { color: #121212; }
html[data-theme="dark"] .btn-solid,
html[data-theme="dark"] .feedback-btn { color: #121212; }
html[data-theme="dark"] .gallery figure,
html[data-theme="dark"] .nearby-item,
html[data-theme="dark"] .text-block { background: var(--paper); }
html[data-theme="dark"] .footer-about { color: var(--muted); }
html[data-theme="dark"] .banner-ticker .bt-text { color: var(--muted); }

/* 主题渐变切换遮罩 */
.theme-fade {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background: #ffffff; opacity: 0;
  transition: opacity .3s ease;
}
.theme-fade.dark { background: #121212; }
.theme-fade.in { opacity: 1; }

body.theme-switching :not(.theme-fade),
body.theme-switching {
  transition: background-color .5s ease, color .5s ease, border-color .5s ease,
              box-shadow .5s ease, fill .5s ease, stroke .5s ease, opacity .5s ease !important;
}
