/* ===== 变量与基础 ===== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #f59e0b;
  --accent-light: #fef3c7;
  --success: #10b981;
  --danger: #ef4444;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.05);
  --radius: 12px;
  --radius-sm: 8px;
  --header-h: 64px;
  --admin-bar-h: 48px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.admin-mode {
  padding-bottom: var(--admin-bar-h);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.btn-edit {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}

.admin-mode .btn-edit {
  opacity: 1;
}

.btn-edit:hover {
  background: var(--primary-light);
}

.btn-delete {
  color: var(--danger) !important;
}

.btn-delete:hover {
  background: #fee2e2 !important;
}

.btn-icon {
  padding: 8px 12px;
  font-size: 16px;
}

.card-actions, .day-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.add-card {
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px dashed var(--border) !important;
  min-height: 100px;
  color: var(--text-muted);
  font-size: 14px;
  box-shadow: none !important;
}

.add-card:hover {
  border-color: var(--primary) !important;
  color: var(--primary);
  background: var(--primary-light);
  transform: none !important;
}

.form-section-label {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  display: block;
}

.section-header {
  text-align: center;
  margin-bottom: 24px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: -20px;
}

.section-header .section-title {
  margin-bottom: 8px;
}

/* ===== 头部 ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  color: var(--primary);
}

.logo-icon {
  font-size: 22px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--primary);
}

/* ===== 英雄区 ===== */
.hero {
  position: relative;
  margin-top: var(--header-h);
  padding: 80px 0 60px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 40%, #3b82f6 70%, #60a5fa 100%);
  z-index: 0;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
  position: relative;
  z-index: 1;
  color: #fff;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  backdrop-filter: blur(4px);
}

.hero-title {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 18px;
  opacity: 0.9;
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

.hero-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  backdrop-filter: blur(4px);
}

.hero-meta-icon {
  font-size: 18px;
}

/* ===== 区块通用 ===== */
.section {
  padding: 60px 0;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 32px;
  text-align: center;
  color: var(--text);
}

/* ===== 概览卡片 ===== */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.overview-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.overview-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.overview-card-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.overview-card-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.overview-card-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

/* ===== 时间线行程 ===== */
.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
  border-radius: 2px;
}

.day-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.day-card::before {
  content: '';
  position: absolute;
  left: -33px;
  top: 32px;
  width: 14px;
  height: 14px;
  background: var(--primary);
  border: 3px solid var(--bg);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--primary-light);
}

.day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.day-label {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-right: 12px;
}

.day-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.day-date {
  font-size: 14px;
  color: var(--text-muted);
}

.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.schedule-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 16px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.schedule-item:hover {
  background: var(--primary-light);
}

.schedule-time {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  padding-top: 2px;
}

.schedule-content h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.schedule-content p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.schedule-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  margin-top: 6px;
}

.tag-food { background: #fef3c7; color: #92400e; }
.tag-sight { background: #dbeafe; color: #1e40af; }
.tag-transport { background: #e0e7ff; color: #3730a3; }
.tag-hotel { background: #d1fae5; color: #065f46; }
.tag-other { background: #f1f5f9; color: #475569; }

.schedule-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.map-link {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.map-link:hover {
  text-decoration: underline;
}

/* ===== 腾讯地图 ===== */
.map-section {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.map-desc {
  text-align: center;
  margin-top: -20px;
  margin-bottom: 24px;
}

.map-wrapper {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--bg);
}

#tencentMapContainer {
  width: 100%;
  height: 420px;
}

.map-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.map-placeholder-inner p {
  margin-bottom: 8px;
  font-size: 15px;
  color: var(--text);
}

.map-placeholder a {
  color: var(--primary);
}

.map-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.map-legend-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}

.map-legend-link:hover {
  background: #bfdbfe;
}

.map-info {
  padding: 4px 0;
  font-size: 13px;
  line-height: 1.5;
  min-width: 160px;
}

.map-info strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.map-info p {
  margin: 0 0 6px;
  color: #666;
}

.map-info a {
  color: var(--primary);
}

.day-notes {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: #92400e;
  border-left: 3px solid var(--accent);
}

.day-notes strong {
  display: block;
  margin-bottom: 4px;
}

/* ===== 每日导航 ===== */
.day-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
  position: sticky;
  top: calc(var(--header-h) + 8px);
  z-index: 50;
  background: var(--bg);
  padding: 12px 0;
}

.day-nav-btn {
  padding: 8px 18px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.day-nav-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.day-nav-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-add-day {
  margin-left: -40px;
}

/* ===== 行李清单 ===== */
.checklist-progress {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 500px;
  margin: 0 auto 32px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0;
}

.progress-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.checklist-group {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.checklist-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.checklist-group-header h4 {
  font-size: 15px;
  font-weight: 600;
}

.checklist-group-header .card-actions {
  position: static;
  flex-shrink: 0;
}

.checklist-edit-item {
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}

.checklist-edit-item:last-of-type {
  border-bottom: none;
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.checklist-item:hover {
  background: var(--bg);
}

.checklist-item input {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.checklist-item.checked .checkmark {
  background: var(--success);
  border-color: var(--success);
}

.checklist-item.checked .checkmark::after {
  content: '✓';
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.checklist-item.checked .checklist-label {
  text-decoration: line-through;
  color: var(--text-light);
}

.checklist-label {
  font-size: 14px;
  color: var(--text);
}

/* ===== 贴士 ===== */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.tip-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  position: relative;
}

.tip-card-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.tip-card h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.tip-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== 页脚 ===== */
.footer {
  background: var(--text);
  color: var(--text-light);
  padding: 24px 0;
  text-align: center;
  font-size: 14px;
}

/* ===== 弹窗 ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  width: 90%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}

.modal-lg {
  max-width: 640px;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.modal-close:hover {
  color: var(--text);
}

.modal-content h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ===== 表单 ===== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.2s;
  background: var(--bg);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.form-error {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 18px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 16px;
  text-align: center;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

.login-user-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.login-user-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.login-user-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.login-user-item.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.login-user-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.schedule-edit-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
}

.schedule-edit-item .form-row {
  margin-bottom: 8px;
}

.btn-add-item {
  width: 100%;
  padding: 10px;
  border: 2px dashed var(--border);
  background: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add-item:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-remove-item {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
}

/* ===== 管理员工具栏 ===== */
.admin-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--admin-bar-h);
  background: #1e293b;
  color: #fff;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 100;
  padding: 0 24px;
}

.admin-bar.active {
  display: flex;
}

.admin-bar-text {
  font-size: 14px;
  font-weight: 500;
  margin-right: auto;
}

.admin-bar .btn-outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.admin-bar .btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ===== 景迈山入口 ===== */
.nav-link.jm-link {
  color: #2d5016;
  font-weight: 600;
}

.nav-link.jm-link:hover {
  color: #1a3009;
}

.nav-link.jm-link:hover {
  color: #1a3009;
}

.nav-link.pg-link {
  color: #ea580c;
  font-weight: 600;
}

.nav-link.pg-link:hover {
  color: #c2410c;
}

.promo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.pg-promo-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #fffbf7 0%, #ffedd5 100%);
  border: 1.5px solid #fdba74;
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pg-promo-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.pg-promo-card .jm-promo-text strong {
  color: #ea580c;
}

/* ===== 普洱旅游攻略图 ===== */
.travel-map-section {
  padding-top: 36px;
  padding-bottom: 20px;
  background: linear-gradient(180deg, #f0fdf4 0%, var(--bg) 100%);
}

.travel-map-desc {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin: -18px auto 16px;
}

.travel-map-figure {
  margin: 0 auto;
  max-width: 480px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  background: #faf8f3;
  cursor: zoom-in;
  transition: box-shadow 0.2s, transform 0.2s;
}

.travel-map-media {
  display: block;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #faf8f3;
  /* 600×800 比例占位，防止 Safari / 微信加载前高度塌陷 */
  padding-top: 133.333%;
}

.travel-map-media .travel-map-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: default;
  pointer-events: none;
}

.travel-map-figure:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.travel-map-lightbox-inner img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 92vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.travel-map-hint {
  line-height: 1.4;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  background: #faf8f3;
  border-top: 1px solid var(--border);
}

.travel-map-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.travel-map-lightbox.active {
  display: flex;
}

.travel-map-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.travel-map-lightbox-inner {
  position: relative;
  max-width: min(96vw, 720px);
  max-height: 92vh;
  z-index: 1;
  -webkit-overflow-scrolling: touch;
}

body.travel-map-lightbox-open {
  overflow: hidden;
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
}

.travel-map-lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.travel-map-lightbox-close:hover {
  opacity: 0.85;
}

#viewTiantianBtn {
  display: none;
}

.server-offline-banner {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 200;
  background: #fef3c7;
  border-bottom: 1px solid #fcd34d;
  padding: 10px 16px;
  font-size: 13px;
  color: #92400e;
  text-align: center;
}

.server-offline-banner.active {
  display: block;
}

.account-section {
  margin-top: 20px;
}

.account-section h4 {
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--text-muted);
}

.account-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}

.account-row.is-active {
  border-color: #f472b6;
  background: #fdf2f8;
}

.account-row.is-self {
  border-color: #93c5fd;
  background: #eff6ff;
}

.account-id {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.account-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.account-create-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.modal-content-wide {
  max-width: 560px;
}

.view-user-banner {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 199;
  background: #dbeafe;
  border-bottom: 1px solid #93c5fd;
  padding: 10px 16px;
  font-size: 13px;
  color: #1e40af;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.view-user-banner.active {
  display: flex;
}

.is-mobile .server-offline-banner,
.is-mobile .view-user-banner {
  top: var(--header-h);
  font-size: 12px;
}

.checklist-item.readonly {
  opacity: 0.92;
  cursor: default;
}

.checklist-item.readonly .checkmark {
  opacity: 0.75;
}

.tiantian-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #be185d;
  background: #fce7f3;
  border: 1px solid #f9a8d4;
  border-radius: 999px;
  white-space: nowrap;
  vertical-align: middle;
}

.tiantian-changed-block {
  position: relative;
  outline: 2px solid #f9a8d4;
  outline-offset: 2px;
  background: linear-gradient(135deg, rgba(252, 231, 243, 0.45) 0%, rgba(255, 255, 255, 0) 100%);
}

.admin-change-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #1d4ed8;
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  white-space: nowrap;
  vertical-align: middle;
}

.admin-changed-block {
  position: relative;
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.45) 0%, rgba(255, 255, 255, 0) 100%);
}

.tiantian-changed-nav {
  border-color: #f472b6 !important;
  color: #be185d !important;
  background: #fce7f3 !important;
}

.admin-sync-status {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.admin-sync-status.has-changes {
  color: #be185d;
  background: #fce7f3;
  border-color: #f9a8d4;
  font-weight: 600;
}

.tiantian-online-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #86efac;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  animation: tt-online-pulse 2s ease-in-out infinite;
}

@keyframes tt-online-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgb(34 197 94 / 0.3); }
  50% { box-shadow: 0 0 0 4px rgb(34 197 94 / 0); }
}

.tiantian-online-status.is-offline {
  color: #b91c1c;
  background: #fee2e2;
  border-color: #fca5a5;
  animation: none;
}

.is-mobile .tiantian-online-status {
  width: 100%;
  justify-content: center;
  order: -2;
}

.tiantian-sync-toast {
  position: fixed;
  left: 50%;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(20px);
  z-index: 400;
  padding: 12px 20px;
  background: rgba(190, 24, 93, 0.95);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgb(190 24 93 / 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.tiantian-sync-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.is-mobile .tiantian-sync-toast {
  bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px));
  max-width: 92vw;
  text-align: center;
}

.is-mobile .admin-sync-status {
  width: 100%;
  text-align: center;
  order: -1;
}

.tiantian-changes-section {
  padding-top: 28px;
  padding-bottom: 12px;
  background: linear-gradient(180deg, #fdf2f8 0%, var(--bg) 100%);
}

/* 管理员顶部 — 甜甜修改位置 */
.admin-tiantian-topbar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 196;
  background: linear-gradient(180deg, #fce7f3 0%, #fff 100%);
  border-bottom: 1px solid #f9a8d4;
  box-shadow: 0 4px 16px rgb(190 24 93 / 0.08);
}

.admin-tiantian-topbar-inner {
  max-width: var(--container-w, 1100px);
  margin: 0 auto;
  padding: 10px 16px 12px;
}

.admin-tiantian-success-msg {
  display: none;
  margin: 0 0 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
}

.admin-tiantian-success-msg.is-visible {
  display: block;
  animation: adminTtSuccessIn 0.35s ease;
}

@keyframes adminTtSuccessIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-tiantian-topbar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.admin-tiantian-topbar-title {
  font-size: 14px;
  color: #be185d;
}

.admin-tiantian-topbar-count {
  font-size: 12px;
  color: #9d174d;
  background: #fce7f3;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid #f9a8d4;
}

.admin-tiantian-topbar-count em {
  font-style: normal;
  font-weight: 700;
}

.admin-tiantian-topbar-link {
  margin-left: auto;
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.admin-tiantian-topbar-online {
  font-size: 11px;
  font-weight: 600;
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #86efac;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.admin-tiantian-loc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
}

.admin-tiantian-topbar.is-idle .admin-tiantian-loc-list {
  max-height: none;
}

.admin-tiantian-loc-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #fbcfe8;
  border-radius: 8px;
  font-size: 12px;
}

.admin-tiantian-loc-item.is-empty {
  color: var(--text-muted);
  justify-content: center;
  background: transparent;
  border-style: dashed;
}

.admin-tiantian-loc-icon {
  flex-shrink: 0;
  font-size: 16px;
}

.admin-tiantian-loc-body {
  min-width: 0;
  flex: 1;
}

.admin-tiantian-loc-label {
  display: block;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.admin-tiantian-loc-value {
  display: block;
  color: var(--text-muted);
  margin-top: 2px;
  word-break: break-word;
}

body.admin-tt-topbar-active .hero {
  margin-top: calc(var(--header-h) + var(--admin-tt-topbar-offset, 160px));
}

body.admin-tt-topbar-active.view-user-active .hero {
  margin-top: calc(var(--header-h) + 44px + var(--admin-tt-topbar-offset, 160px));
}

body.admin-tt-topbar-active .admin-tiantian-topbar.is-idle {
  --admin-tt-topbar-offset: 100px;
}

body.admin-tt-topbar-active .admin-tiantian-topbar:not(.is-idle) {
  --admin-tt-topbar-offset: 180px;
}

.tiantian-changes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.tiantian-changes-header .section-title {
  margin-bottom: 0;
  font-size: 22px;
}

.tiantian-changes-desc {
  text-align: left;
  margin: 0 0 4px;
}

.tiantian-changes-count {
  font-size: 13px;
  color: #be185d;
  background: #fce7f3;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #f9a8d4;
  white-space: nowrap;
}

.tiantian-changes-live {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.tiantian-changes-empty {
  margin: 16px 0 0;
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  background: rgba(252, 231, 243, 0.35);
  border: 1px dashed #f9a8d4;
  border-radius: var(--radius);
}

.tiantian-changelog {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #fbcfe8;
}

.tiantian-changelog-title {
  margin: 0 0 12px;
  font-size: 16px;
  color: #be185d;
}

.tiantian-changelog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
}

.tiantian-changelog-item {
  display: grid;
  grid-template-columns: 130px 56px 1fr;
  gap: 8px 12px;
  align-items: baseline;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #fbcfe8;
  border-radius: var(--radius);
  font-size: 13px;
}

.tiantian-changelog-time {
  color: var(--text-muted);
  font-size: 12px;
}

.tiantian-changelog-action {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #be185d;
  background: #fce7f3;
  text-align: center;
}

.tiantian-changelog-label {
  color: var(--text);
  font-weight: 600;
}

.tiantian-changelog-value {
  grid-column: 3;
  color: var(--text-muted);
  word-break: break-word;
}

.tiantian-changelog-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  background: rgba(252, 231, 243, 0.25);
  border-radius: var(--radius);
}

.tiantian-changes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.tt-change-card {
  background: #fff;
  border: 1.5px solid #fbcfe8;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 2px 10px rgb(190 24 93 / 0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tt-change-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.tt-change-card-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fdf2f8;
  border-radius: 10px;
}

.tt-change-card-titles {
  flex: 1;
  min-width: 0;
}

.tt-change-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #831843;
  margin: 0 0 4px;
  line-height: 1.4;
}

.tt-change-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.tt-change-card-head .tiantian-badge {
  flex-shrink: 0;
  margin: 0;
  font-size: 10px;
  padding: 2px 6px;
}

.tt-change-card-head .admin-change-badge {
  flex-shrink: 0;
  margin: 0;
  font-size: 10px;
  padding: 2px 6px;
}

.tt-change-fields {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px dashed #fbcfe8;
}

.tt-change-field {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  align-items: start;
}

.tt-change-field dt {
  font-size: 12px;
  font-weight: 600;
  color: #9d174d;
  margin: 0;
}

.tt-change-field dd {
  font-size: 13px;
  color: var(--text);
  margin: 0;
  line-height: 1.5;
  word-break: break-word;
}

.tt-change-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px dashed #fbcfe8;
}

.tt-change-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
}

.tt-change-chip.is-checked {
  background: #fce7f3;
  color: #9d174d;
  border: 1px solid #f9a8d4;
}

.tt-change-chip.is-unchecked {
  background: #f8fafc;
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-decoration: line-through;
  opacity: 0.85;
}

.is-mobile .tiantian-changes-grid {
  grid-template-columns: 1fr;
}

.is-mobile .tt-change-field {
  grid-template-columns: 1fr;
  gap: 2px;
}

.is-mobile .tiantian-changes-header .section-title {
  font-size: 20px;
}

.is-mobile .tiantian-changelog-item {
  grid-template-columns: 1fr;
  gap: 4px;
}

.is-mobile .tiantian-changelog-value {
  grid-column: 1;
}

.jm-promo-section {
  padding: 0 0 24px;
  margin-top: -20px;
}

.jm-promo-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #fafff7 0%, #e8f5e0 100%);
  border: 1.5px solid #a3c987;
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

.jm-promo-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.jm-promo-icon {
  font-size: 36px;
  flex-shrink: 0;
}

.jm-promo-text strong {
  display: block;
  font-size: 16px;
  color: #2d5016;
  margin-bottom: 4px;
}

.jm-promo-text span {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .nav-link {
    display: none;
  }

  .hero {
    padding: 60px 0 40px;
  }

  .hero-meta {
    flex-direction: column;
    align-items: center;
  }

  .timeline {
    padding-left: 28px;
  }

  .day-card::before {
    left: -21px;
  }

  .schedule-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .day-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .admin-bar {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 16px;
    gap: 8px;
  }

  body.admin-mode {
    padding-bottom: 80px;
  }

  .day-nav {
    top: var(--header-h);
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }

  .btn-add-day {
    margin-left: -28px;
  }

  .promo-grid {
    grid-template-columns: 1fr;
  }

  #tencentMapContainer {
    height: 300px;
  }

  .map-placeholder {
    min-height: 300px;
  }
}

/* ===== 打印样式 ===== */
@media print {
  .header, .admin-bar, .day-nav, .btn-edit, .btn-delete, .card-actions,
  .day-actions, .add-card, .checklist-item input, #printBtn, #adminBtn,
  .map-section, .map-link, .mobile-tabbar, .mobile-more-sheet, .mobile-admin-btn, .view-toggle,
  .travel-map-lightbox {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .hero {
    margin-top: 0;
    padding: 30px 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .hero-bg {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .section {
    padding: 24px 0;
    page-break-inside: avoid;
  }

  .day-card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .checklist-item.checked .checklist-label {
    text-decoration: line-through;
  }

  .checkmark {
    border: 2px solid #999;
  }

  .checklist-item.checked .checkmark {
    background: #10b981;
  }
}
