/* 新干线精选 - 样式表（自 index.html 拆出，并修复封面布局与品牌色透明度问题） */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root[data-theme="dark"] {
  --bg: #100A18;
  --surface: #1D1425;
  --text: #E8DFF5;
  --text-muted: #9B8CA8;
  --border: rgba(147,119,167,.2);
  --brand: #B87FD8;
  --brand-hover: #9F5FC7;
  --brand-rgb: 184,127,216;
}

:root[data-theme="light"] {
  --bg: #FBF3F0;
  --surface: #FFFDFC;
  --text: #2A1D23;
  --text-muted: #806F77;
  --border: rgba(111,48,73,.13);
  --brand: #A52F60;
  --brand-hover: #842247;
  --brand-rgb: 165,47,96;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.site { max-width: 1400px; margin: 0 auto; padding: 20px; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-logo-text {
  width: 48px;
  height: 48px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.brand span span { font-size: 13px; color: var(--text-muted); margin-left: 6px; }

.actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.btn, .ghost {
  padding: 10px 20px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: all .2s;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
}

.btn { background: var(--brand); color: #fff; border: none; }
.btn:hover { background: var(--brand-hover); }

.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.ghost:hover { border-color: var(--brand); color: var(--brand); }
.ghost.on { background: var(--brand); color: #fff; border-color: var(--brand); }

.panel {
  background: var(--surface);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 28px;
}

.finder-search {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.city-trigger {
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(var(--brand-rgb), .1);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

input[type="search"], .form input, .form select, .form textarea {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}

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

.album-card {
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  border: 1px solid var(--border);
  cursor: pointer;
}

.album-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.2);
}

/* 修复：封面容器补回定位/宽高比/底色，::after 仅负责右下角渐变遮罩 */
.album-cover {
  position: relative;
  aspect-ratio: 1 / 1.2;
  background: #2A2232;
  overflow: hidden;
}

.album-cover::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 120px;
  height: 40px;
  background: linear-gradient(135deg, transparent 0%, rgba(42,34,50,0.9) 50%, rgba(42,34,50,0.95) 100%);
  pointer-events: none;
}

.album-cover img {
  filter: brightness(1.05) contrast(1.05);
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.album-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255,215,0,.9);
  color: #000;
  font-size: 12px;
  font-weight: 700;
  z-index: 2;
}

.fav-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s, background .2s;
  z-index: 3;
}
.fav-btn:hover { transform: scale(1.12); }
.fav-btn.on { background: rgba(165,47,96,.9); }

.album-code {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  z-index: 2;
}

.album-body { padding: 16px; }

.album-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.album-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  flex: 1;
}

.album-price {
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.album-meta {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.album-stats {
  margin-top: 10px;
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

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

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 32px 0 24px;
  flex-wrap: wrap;
}

.pagebtn {
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s;
}

.pagebtn:hover:not(.disabled) {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.pagebtn.on {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.pagebtn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagebtn svg { display: block; }

/* 底部导航（原为 a 标签，现为 button，补齐按钮重置） */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--border); display: none; padding: 8px 0; z-index: 100; }
.bottom-nav-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; max-width: 600px; margin: 0 auto; }
.bottom-nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; text-decoration: none; color: var(--text-muted); font-size: 11px; background: transparent; border: none; cursor: pointer; font-family: inherit; }
.bottom-nav-item.active { color: var(--brand); }
.bottom-nav-icon { font-size: 22px; }

/* 弹窗通用 */
.city-modal, .product-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.modal-narrow { max-width: 440px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--border);
  color: var(--text);
}

.modal-body {
  padding: 24px;
  max-height: 60vh;
  overflow-y: auto;
}

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

.city-item {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}

.city-item:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.city-item.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* 商品详情弹窗 */
.product-modal { z-index: 2000; }

/* 预约弹窗从详情内打开，必须覆盖详情层；成功/记录层再覆盖预约层 */
#booking-modal { z-index: 2100; }
#booking-success-modal,
#booking-records-modal { z-index: 2200; }

.product-modal-content {
  position: relative;
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  background: var(--surface);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 70px rgba(0,0,0,.4);
}

.product-modal-content > .modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  background: rgba(0,0,0,.4);
  color: #fff;
}

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-height: 85vh;
  overflow-y: auto;
}

.product-image-section {
  background: #2A2232;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.product-image-section img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
}

.product-info-section {
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.product-info-section h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.product-price-big {
  font-size: 32px;
  font-weight: 700;
  color: var(--brand);
}

.product-meta-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meta-item {
  display: flex;
  gap: 8px;
  font-size: 15px;
  color: var(--text-muted);
}

.meta-item span:first-child {
  font-weight: 600;
  color: var(--text);
}

.product-stats-big {
  display: flex;
  gap: 20px;
  padding: 16px;
  background: var(--bg);
  border-radius: 12px;
}

.stat-item {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.product-actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
}

.btn-primary {
  flex: 1;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: var(--brand);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary:hover { background: var(--brand-hover); }

.btn-secondary {
  padding: 14px 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-secondary:hover { background: var(--border); }

/* 表单（登录/注册/预约/客服） */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); font-weight: 600; }
.form textarea { resize: vertical; min-height: 72px; }
.btn-block { width: 100%; }
.muted { color: var(--text-muted); font-size: 12px; line-height: 1.6; }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.auth-tab {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}
.auth-tab.on { background: var(--brand); color: #fff; border-color: var(--brand); }

.auth-logged { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }

.booking-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  background: #30A46C;
}

.success-summary { text-align: left; }
.success-actions { display: flex; flex-direction: column; gap: 10px; }

.booking-record-list { display: flex; flex-direction: column; gap: 12px; }
.booking-record {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}
.booking-record-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}
.booking-record-head span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}
.booking-record-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  color: var(--text-muted);
  font-size: 13px;
}
.booking-record-note {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.booking-summary, .support-info {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg);
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.empty-icon { font-size: 44px; }

/* Toast 提示（替代 alert） */
.toast-wrap {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 22px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  opacity: 0;
  transform: translateY(-8px);
  transition: all .25s;
  font-size: 14px;
  max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: #e5484d; color: #ff6369; }

@media (max-width: 720px) {
  body { padding-bottom: 70px; }
  .site { padding: 12px; }
  .topbar { padding: 12px 16px; }
  .results { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .bottom-nav { display: block; }
  .finder-search { grid-template-columns: 1fr auto; }
  .city-trigger { grid-column: 1 / -1; }
  .booking-record-grid { grid-template-columns: 1fr; }
  .product-detail { grid-template-columns: 1fr; }
  .product-image-section { padding: 20px; }
  .product-info-section { padding: 24px; }
  .product-info-section h2 { font-size: 22px; }
  .product-price-big { font-size: 26px; }
}
