:root {
    --primary: #cda87a;
    --primary-dark: #b59265;
    --bg-dark: #000000;
    --bg-card: #1c1c1e;
    --bg-outer: #000000;
    --bg-elevated: #2c2c2e;
    --text-main: #f5f5f7;
    --text-muted: #86868b;
    --border: rgba(255,255,255,0.08);
    --safe-bottom: env(safe-area-inset-bottom, 20px);
    --phone-width: 420px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
    background-color: var(--bg-outer); color: var(--text-main);
    line-height: 1.5; min-height: 100%; display: flex; justify-content: center;
    -webkit-font-smoothing: antialiased;
}

/* ========== Shell ========== */
.phone-shell {
    width: 100%; max-width: var(--phone-width); min-height: 100vh;
    background-color: var(--bg-dark); position: relative;
    padding-bottom: calc(80px + var(--safe-bottom));
}

/* ========== Header ========== */
.header {
    padding: 16px 20px 14px;
    background: rgba(0,0,0,0.72);
    backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    position: sticky; top: 0; z-index: 100;
    border-bottom: 1px solid var(--border);
}
.header h1 { font-size: 22px; font-weight: 700; color: var(--text-main); letter-spacing: 0.3px; }
.header p { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.back-link {
    display: inline-block; color: var(--primary); text-decoration: none;
    font-size: 15px; margin-bottom: 4px;
}
.back-link:active { opacity: 0.5; }

/* ========== Day Selector ========== */
.day-selector {
    display: flex; overflow-x: auto; padding: 16px 20px 12px; gap: 8px; scrollbar-width: none;
}
.day-selector::-webkit-scrollbar { display: none; }
.day-btn {
    padding: 7px 16px; border-radius: 100px; background: var(--bg-card);
    color: var(--text-muted); border: none; font-size: 13px;
    white-space: nowrap; cursor: pointer; transition: all 0.2s; font-weight: 500;
}
.day-btn:active { transform: scale(0.95); }
.day-btn.active { background: var(--primary); color: #fff; font-weight: 600; }

/* ========== Level Tabs (iOS segmented control) ========== */
.level-tabs {
    display: flex; margin: 0 20px 16px;
    background: rgba(118,118,128,0.12); border-radius: 9px; padding: 2px;
}
.level-tab {
    flex: 1; text-align: center; padding: 7px 0; font-size: 13px;
    color: var(--text-muted); border-radius: 7px; cursor: pointer;
    transition: all 0.2s; font-weight: 500;
}
.level-tab:active { transform: scale(0.97); }
.level-tab.active {
    background: var(--bg-elevated); color: var(--text-main); font-weight: 600;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* ========== Hotel Cards ========== */
.hotel-list { padding: 0 20px; display: flex; flex-direction: column; gap: 16px; }
.hotel-card {
    background: var(--bg-card); border-radius: 14px; overflow: hidden;
    position: relative; transition: all 0.2s; cursor: pointer;
}
.hotel-card:active { transform: scale(0.98); opacity: 0.9; }
.hotel-card.selected { box-shadow: 0 0 0 2px var(--primary); }

.hotel-img-wrapper { width: 100%; height: 200px; position: relative; overflow: hidden; }
.hotel-img-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.card-badge {
    position: absolute; top: 12px; left: 12px;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(10px);
    padding: 4px 10px; border-radius: 100px; font-size: 11px; color: rgba(255,255,255,0.9);
}
.card-photo-count {
    position: absolute; bottom: 12px; right: 12px;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(10px);
    padding: 4px 10px; border-radius: 100px; font-size: 11px; color: rgba(255,255,255,0.85);
}

.hotel-info { padding: 14px 16px 16px; }
.hotel-title {
    font-size: 17px; font-weight: 600; margin-bottom: 4px;
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.hotel-rating {
    color: var(--primary); font-size: 11px; font-weight: 600;
    background: rgba(205,168,122,0.1); padding: 3px 8px; border-radius: 6px;
    white-space: nowrap; flex-shrink: 0; border: none;
}
.hotel-location { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.hotel-desc {
    font-size: 14px; color: var(--text-muted); margin-bottom: 12px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; line-height: 1.5;
}
.card-footer { display: flex; justify-content: space-between; align-items: center; }
.card-enter { color: var(--primary); font-size: 13px; font-weight: 500; }
.card-selected-tag {
    background: var(--primary); color: #fff; font-size: 12px;
    padding: 4px 12px; border-radius: 100px; font-weight: 600;
}

/* ========== Bottom Bar ========== */
.bottom-bar {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: var(--phone-width);
    background: rgba(0,0,0,0.72);
    backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    padding: 12px 20px calc(12px + var(--safe-bottom));
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid var(--border); z-index: 100;
}
.selection-info { font-size: 14px; color: var(--text-muted); }
.selection-info span { color: var(--primary); font-weight: 700; font-size: 18px; }
.copy-btn {
    background: var(--primary); color: #fff; border: none;
    padding: 10px 24px; border-radius: 100px;
    font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.copy-btn:active { transform: scale(0.95); opacity: 0.9; }

/* ========== Detail Modal ========== */
.detail-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.5);
    display: flex; justify-content: center; align-items: flex-end;
    animation: fadeIn 0.2s ease;
}
.detail-overlay.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.detail-panel {
    width: 100%; max-width: var(--phone-width); max-height: 92vh;
    background: var(--bg-card); border-radius: 14px 14px 0 0;
    overflow-y: auto; position: relative;
    animation: slideUp 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.detail-close {
    position: absolute; top: 12px; right: 12px; z-index: 10;
    width: 30px; height: 30px; border-radius: 50%;
    background: rgba(255,255,255,0.15); backdrop-filter: blur(10px);
    border: none; color: #fff; font-size: 14px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

.detail-gallery {
    width: 100%; height: 260px; overflow-x: auto; display: flex;
    scroll-snap-type: x mandatory; scrollbar-width: none;
}
.detail-gallery::-webkit-scrollbar { display: none; }
.detail-gallery img {
    width: 100%; height: 100%; object-fit: cover;
    flex: 0 0 100%; scroll-snap-align: start;
}
.gallery-counter { text-align: center; padding: 8px 0; font-size: 12px; color: var(--text-muted); }

.detail-body { padding: 0 20px 30px; }
.detail-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 6px; gap: 10px;
}
.detail-header h2 { font-size: 20px; font-weight: 700; }
.detail-location { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.detail-desc { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 20px; }

/* Facilities */
.facilities-section { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.facilities-section h3 { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.facility-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.facility-tag {
    background: rgba(205,168,122,0.1); color: var(--primary);
    padding: 5px 12px; border-radius: 100px; font-size: 12px; white-space: nowrap;
}

/* Room Types */
.room-section h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.room-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.room-item {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    background: var(--bg-elevated); border: none; border-radius: 12px;
    cursor: pointer; transition: all 0.15s;
}
.room-item:active { transform: scale(0.98); }
.room-item.active { box-shadow: 0 0 0 2px var(--primary); }
.room-radio {
    width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.room-item.active .room-radio { border-color: var(--primary); background: var(--primary); }
.room-item.active .room-radio::after { content: '✓'; color: #fff; font-size: 12px; font-weight: 700; }
.room-name { font-size: 15px; flex: 1; }
.room-price { font-size: 13px; color: var(--primary); white-space: nowrap; }
.no-room-hint { font-size: 13px; color: var(--text-muted); padding: 10px 0; }

/* Confirm */
.detail-confirm-btn {
    width: 100%; padding: 15px; border-radius: 14px; border: none;
    background: var(--primary); color: #fff; font-size: 16px;
    font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.detail-confirm-btn:active { transform: scale(0.98); opacity: 0.9; }
.detail-confirm-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ========== Toast ========== */
.toast {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(50,50,50,0.9); color: #fff; padding: 14px 24px;
    border-radius: 14px; z-index: 1000; pointer-events: none;
    opacity: 0; transition: opacity 0.25s; font-size: 14px;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.toast.show { opacity: 1; }

/* ========== Loader ========== */
.loader { text-align: center; padding: 50px 20px; color: var(--text-muted); font-size: 14px; }

/* ========== 首页 Hero ========== */
.index-hero {
    padding: 60px 40px 36px; text-align: center;
}
.hero-line {
    width: 40px; height: 1px; margin: 0 auto;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}
.brand-title {
    font-size: 30px; font-weight: 300; letter-spacing: 8px; margin: 20px 0 10px;
    background: linear-gradient(180deg, #e8d5b5 0%, var(--primary) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.brand-slogan {
    font-size: 12px; color: var(--text-muted); letter-spacing: 4px;
    margin-bottom: 20px; font-weight: 300;
}

/* ========== 行程选择区 ========== */
.trip-section { padding: 0 28px 40px; }
.trip-section-header {
    display: flex; align-items: center; gap: 16px; margin-bottom: 24px;
}
.section-line { flex: 1; height: 1px; background: var(--border); }
.trip-section-header h2 {
    font-size: 13px; font-weight: 400; color: var(--text-muted);
    letter-spacing: 4px; white-space: nowrap;
}

/* Trip Cards */
.trip-list { display: flex; flex-direction: column; gap: 0; }
.trip-card {
    display: block; text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: all 0.2s; animation: cardFadeIn 0.4s ease both;
}
.trip-card:first-child { border-top: 1px solid rgba(255,255,255,0.06); }
.trip-card:active { opacity: 0.6; }
.trip-card-content {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 4px;
}
.trip-card-left { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.trip-name {
    font-size: 16px; font-weight: 500; color: var(--text-main);
    letter-spacing: 1px;
}
.trip-detail { font-size: 12px; color: var(--text-muted); letter-spacing: 0.5px; }
.trip-badge {
    padding: 5px 14px; border-radius: 2px; font-size: 11px; font-weight: 400;
    border: 1px solid rgba(205,168,122,0.3); color: var(--primary);
    background: transparent; letter-spacing: 1px;
}

/* Animations */
.trip-loading { text-align: center; padding: 50px 0; }
.loading-dots { display: flex; gap: 8px; justify-content: center; }
.loading-dots span {
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--primary); opacity: 0.3;
    animation: dotPulse 1.4s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse { 0%,100% { opacity: 0.2; } 50% { opacity: 0.8; } }
@keyframes cardFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.trip-empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.trip-empty p:first-child { font-size: 15px; margin-bottom: 8px; letter-spacing: 2px; }
.trip-empty p:last-child { font-size: 12px; }
.index-footer { text-align: center; padding: 30px 20px 50px; }
.footer-line {
    width: 24px; height: 1px; margin: 0 auto 14px;
    background: linear-gradient(90deg, transparent, rgba(205,168,122,0.3), transparent);
}
.index-footer p { font-size: 10px; color: var(--text-muted); opacity: 0.3; letter-spacing: 6px; }

/* ========== 图片查看器 ========== */
.img-viewer {
    position: fixed; inset: 0; z-index: 500;
    background: rgba(0,0,0,0.95); display: flex; flex-direction: column;
    animation: viewerFadeIn 0.2s ease;
}
@keyframes viewerFadeIn { from { opacity: 0; } to { opacity: 1; } }

.viewer-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; flex-shrink: 0; z-index: 2;
}
.viewer-counter { color: rgba(255,255,255,0.6); font-size: 14px; }
.viewer-close {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,0.12); border: none; color: #fff;
    font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

.viewer-body {
    flex: 1; display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative; touch-action: none;
    user-select: none; -webkit-user-select: none;
}
.viewer-body img {
    max-width: 100%; max-height: 100%; object-fit: contain;
    transition: transform 0.15s ease; transform-origin: center center;
    cursor: grab; pointer-events: auto;
}
.viewer-body img.zoomed { cursor: move; max-width: none; max-height: none; }

.viewer-nav {
    position: absolute; top: 50%; left: 0; right: 0; z-index: 2;
    display: flex; justify-content: space-between; padding: 0 8px;
    pointer-events: none; transform: translateY(-50%);
}
.viewer-prev, .viewer-next {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,0.1); border: none; color: #fff;
    font-size: 24px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    pointer-events: auto;
}
