:root {
  --primary: #2E86AB;
  --primary-light: #E8F4F8;
  --danger: #E8505B;
  --danger-light: #FEF0F0;
  --success: #27AE60;
  --success-light: #F0FFF4;
  --warning: #F5A623;
  --warning-light: #FFF8E7;
  --gray-50: #F8F9FA;
  --gray-100: #F1F3F5;
  --gray-200: #E9ECEF;
  --gray-300: #DEE2E6;
  --gray-400: #ADB5BD;
  --gray-500: #868E96;
  --gray-600: #495057;
  --gray-700: #343A40;
  --gray-800: #212529;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", "Consolas", monospace;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-700);
  line-height: 1.6;
  min-height: 100vh;
}

.header {
  background: linear-gradient(135deg, var(--primary), #1A6B8A);
  color: #fff;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.header h1 { font-size: 1.25rem; font-weight: 700; }

.header-meta {
  font-size: 0.8rem;
  opacity: 0.85;
  display: block;
  margin-top: 2px;
}

.header-stats {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
}

.header-stats .stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header-stats .stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.header-stats .stat-label {
  font-size: 0.7rem;
  opacity: 0.8;
}

.nav {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 16px;
  position: sticky;
  top: 72px;
  z-index: 99;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar { display: none; }

.nav-btn {
  background: none;
  border: none;
  padding: 12px 16px;
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--gray-500);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.nav-btn:hover { color: var(--primary); }

.nav-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease; }

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

.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 600;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }

.section-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gray-800);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

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

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
}

th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-600);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tr:hover td { background: var(--gray-50); }

.price {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--danger);
}

.price-total {
  font-size: 1.1rem;
  font-weight: 800;
}

.reliable { color: var(--success); font-size: 0.78rem; }
.unreliable { color: var(--warning); font-size: 0.78rem; }

.warning-box {
  background: var(--danger-light);
  border-left: 4px solid var(--danger);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 16px;
  font-size: 0.88rem;
  color: #7A1A1A;
}

.info-box {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 16px;
  font-size: 0.88rem;
}

.success-box {
  background: var(--success-light);
  border-left: 4px solid var(--success);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 16px;
  font-size: 0.88rem;
}

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--gray-200);
}

.timeline-item {
  position: relative;
  padding: 6px 0;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 12px;
  align-items: start;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--primary);
}

.timeline-item.cost-item::before { background: var(--warning); box-shadow: 0 0 0 2px var(--warning); }
.timeline-item.free-item::before { background: var(--success); box-shadow: 0 0 0 2px var(--success); }

.timeline-time {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--gray-500);
  font-weight: 600;
  padding-top: 1px;
}

.timeline-act {
  font-size: 0.9rem;
  color: var(--gray-700);
}

.timeline-act .note {
  display: block;
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 1px;
}

.timeline-cost {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
  padding-top: 1px;
}

.timeline-cost.has-cost { color: var(--danger); }
.timeline-cost.no-cost { color: var(--success); }

.day-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}

.day-header {
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: background 0.2s;
}

.day-header:hover { background: var(--gray-50); }

.day-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.day-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.day-num.ext { background: var(--warning); }

.day-info h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
}

.day-info .day-sub {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.day-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.day-cost {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--danger);
  font-size: 1rem;
}

.day-hotel {
  font-size: 0.78rem;
  color: var(--gray-400);
  background: var(--gray-100);
  padding: 2px 8px;
  border-radius: 99px;
}

.day-toggle {
  font-size: 1.2rem;
  color: var(--gray-400);
  transition: transform 0.3s;
}

.day-card.open .day-toggle { transform: rotate(180deg); }

.day-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.day-card.open .day-body { max-height: 3000px; }

.day-body-inner {
  padding: 0 20px 20px;
  border-top: 1px solid var(--gray-100);
}

.phase-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.phase-tab {
  padding: 8px 20px;
  border-radius: 99px;
  border: 2px solid var(--gray-200);
  background: #fff;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.phase-tab:hover { border-color: var(--primary); color: var(--primary); }

.phase-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

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

.hotel-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.hotel-card.recommended { border-color: var(--primary); }

.hotel-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.hotel-card .hotel-tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 700;
}

.hotel-card.recommended .hotel-tag {
  background: var(--primary);
  color: #fff;
}

.hotel-stars {
  color: #F59E0B;
  font-size: 0.72rem;
  letter-spacing: 1px;
}

.hotel-card .hotel-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 4px;
}

.hotel-landmark {
  font-size: 0.76rem;
  color: var(--primary);
  margin-bottom: 6px;
  font-weight: 500;
}

.hotel-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.hotel-card .hotel-rating {
  font-size: 0.8rem;
  color: var(--warning);
}

.hotel-card .hotel-price {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--danger);
}

.hotel-price-note {
  font-size: 0.72rem;
  color: var(--gray-500);
  margin-bottom: 6px;
}

.hotel-card .hotel-highlight {
  font-size: 0.82rem;
  color: var(--gray-600);
  line-height: 1.5;
}

.hotel-fit {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
}

.hotel-note {
  font-size: 0.74rem;
  color: var(--gray-500);
  margin-top: 4px;
  line-height: 1.4;
}

.hotel-card .hotel-warning {
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--gray-200);
}

.tips-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.stat-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.stat-badge.severe { background: var(--danger-light); color: var(--danger); }
.stat-badge.medium { background: var(--warning-light); color: #B8860B; }
.stat-badge.info { background: var(--success-light); color: var(--success); }
.stat-badge.total { background: var(--gray-100); color: var(--gray-600); }

.tip-card {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.tip-card.severe { background: var(--danger-light); border-left: 4px solid var(--danger); }
.tip-card.medium { background: var(--warning-light); border-left: 4px solid var(--warning); }
.tip-card.info { background: var(--success-light); border-left: 4px solid var(--success); }

.tip-card:last-child { border-bottom: none; margin-bottom: 0; }

.tip-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.tip-level {
  font-size: 0.72rem;
  font-weight: 700;
}

.tip-id {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.tip-content { flex: 1; }

.tip-pitfall {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 2px;
}

.tip-fix {
  font-size: 0.82rem;
  color: var(--success);
  margin-bottom: 2px;
}

.tip-detail {
  font-size: 0.76rem;
  color: var(--gray-500);
  font-style: italic;
  line-height: 1.4;
}

.must-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
}

.must-item:last-child { border-bottom: none; }

.must-priority {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  padding-top: 2px;
}

.must-priority .star {
  width: 14px;
  height: 14px;
  display: inline-block;
}

.must-priority .star.filled { color: var(--warning); }
.must-priority .star.empty { color: var(--gray-200); }

.must-info { flex: 1; }

.must-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--gray-800);
}

.must-detail {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.must-price {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--danger);
  font-size: 0.85rem;
  white-space: nowrap;
}

.budget-bar-wrap {
  margin-bottom: 12px;
}

.budget-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.budget-bar-label span:first-child { font-weight: 600; color: var(--gray-700); }
.budget-bar-label span:last-child { font-family: var(--font-mono); font-weight: 700; color: var(--danger); }

.budget-bar {
  height: 8px;
  background: var(--gray-100);
  border-radius: 99px;
  overflow: hidden;
}

.budget-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s ease;
}

.plan-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.plan-btn {
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--gray-200);
  background: #fff;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.plan-btn:hover { border-color: var(--primary); }

.plan-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.total-card {
  background: linear-gradient(135deg, var(--primary), #1A6B8A);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin-bottom: 20px;
}

.total-card .total-label {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-bottom: 4px;
}

.total-card .total-amount {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 800;
}

.total-card .total-sub {
  font-size: 0.82rem;
  opacity: 0.75;
  margin-top: 4px;
}

.compare-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}

.compare-row:last-child { border-bottom: none; }

.compare-label {
  font-size: 0.82rem;
  color: var(--gray-500);
  text-align: center;
}

.compare-val {
  font-size: 0.92rem;
  font-weight: 600;
}

.compare-val.winner {
  color: var(--success);
  background: var(--success-light);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-align: center;
}

.compare-val.loser {
  color: var(--gray-500);
  text-align: center;
}

.city-section { margin-bottom: 24px; }

.city-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.city-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.city-dates {
  font-size: 0.8rem;
  color: var(--gray-400);
}

.city-landmark {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 500;
}

.category-filter {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid var(--gray-200);
  background: #fff;
  font-family: var(--font);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover { border-color: var(--primary); color: var(--primary); }

.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.economy-badge {
  display: inline-block;
  background: var(--success-light);
  color: var(--success);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
}

.footer {
  text-align: center;
  padding: 16px;
  font-size: 0.75rem;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-200);
  background: #fff;
}

@media (max-width: 768px) {
  .header h1 { font-size: 1.05rem; }
  .header-stats { gap: 10px; }
  .header-stats .stat-value { font-size: 0.95rem; }
  .nav { top: 64px; }
  .nav-btn { padding: 10px 12px; font-size: 0.82rem; }
  .main { padding: 12px 10px 70px; }
  .card { padding: 14px; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .hotel-grid { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 44px 1fr auto; gap: 8px; }
  .compare-row { grid-template-columns: 1fr; gap: 4px; }
  .compare-row .compare-label { text-align: left; order: -1; }
  .day-header { padding: 12px 14px; }
  .day-body-inner { padding: 0 14px 14px; }
  .day-num { width: 34px; height: 34px; font-size: 0.8rem; }
  .total-card .total-amount { font-size: 1.8rem; }
}

@media print {
  .header, .nav, .footer { display: none; }
  .main { padding: 0; max-width: 100%; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .day-card { break-inside: avoid; }
  .day-body { max-height: none !important; }
  .tab-panel { display: block !important; }
  .tab-panel:not(.active) { display: block !important; }
}
