/* ===== 苹果专属全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: -apple-system, 'SF Pro Text', 'Helvetica Neue', system-ui, sans-serif;
}

:root {
    --primary: #c44536;
    --primary-dark: #a33528;
    --secondary: #25465f;
    --secondary-light: #3a5f7a;
    --bg-light: #f8f7f4;
    --bg-dark: #1a242b;
    --card-light: rgba(255,255,255,0.95);
    --card-dark: rgba(38,50,56,0.95);
    --border-light: rgba(0,0,0,0.05);
    --border-dark: rgba(255,255,255,0.1);
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
    --tab-bar-height: 82px;
}

body {
    background-color: var(--bg-light);
    color: #1e2b34;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 0 var(--tab-bar-height) 0;
    transition: background-color 0.3s ease;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

body.night-mode {
    background-color: var(--bg-dark);
    color: #e0e0e0;
}

/* ===== 毛玻璃效果 ===== */
.glass-effect {
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

body.night-mode .glass-effect {
    background: rgba(38,50,56,0.8);
    border-color: rgba(255,255,255,0.1);
}

/* ===== 顶部导航 ===== */
.top-nav {
    background: linear-gradient(135deg, var(--secondary), #16323f);
    color: white;
    padding: 16px 20px;
    padding-top: max(16px, var(--safe-top));
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-controls {
    display: flex;
    gap: 12px;
}

.nav-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}

.nav-btn:active {
    transform: scale(0.92);
    background: rgba(255,255,255,0.3);
}

/* ===== 快捷入口 ===== */
.quick-jump {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 16px 16px;
    margin: 0 12px 20px 12px;
    background: white;
    border-radius: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body.night-mode .quick-jump {
    background: var(--card-dark);
}

.jump-btn {
    background: #f0f4f8;
    border: none;
    padding: 16px 0;
    border-radius: 36px;
    font-weight: 600;
    color: var(--secondary);
    cursor: pointer;
    font-size: 16px;
    text-align: center;
    text-decoration: none;
    display: block;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

body.night-mode .jump-btn {
    background: #2e3b43;
    color: #e0e0e0;
}

.jump-btn:active {
    background: var(--primary);
    color: white;
    transform: scale(0.96);
}

/* ===== 日期卡片 ===== */
.day-card {
    background: white;
    border-radius: 32px;
    margin: 16px 12px 20px 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: all 0.3s;
    border: 1px solid var(--border-light);
}

body.night-mode .day-card {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.day-header {
    background: linear-gradient(135deg, var(--secondary), #1d3a4a);
    color: white;
    padding: 22px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s;
    -webkit-tap-highlight-color: transparent;
}

.day-header:active {
    background: var(--secondary-light);
}

.day-title {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.day-arrow {
    font-size: 26px;
    transition: transform 0.3s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.day-content.expanded {
    max-height: 5000px;
}

/* ===== 景点卡片（首页版本 - 只有标题和时间）===== */
.spot-card {
    border-bottom: 1px solid var(--border-light);
    padding: 0;
}

.spot-header {
    padding: 20px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s;
}

.spot-header:active {
    background: rgba(196,69,54,0.05);
}

body.night-mode .spot-header:active {
    background: rgba(255,255,255,0.05);
}

.spot-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(196,69,54,0.2);
}

.spot-name {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    line-height: 1.3;
}

.spot-time {
    background: var(--secondary);
    color: white;
    padding: 8px 14px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.spot-arrow {
    font-size: 20px;
    color: #888;
    flex-shrink: 0;
    transition: transform 0.3s;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spot-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0,0,0,0.02);
}

body.night-mode .spot-content {
    background: rgba(255,255,255,0.02);
}

.spot-content.expanded {
    max-height: 2000px;
}

/* ===== 动态加载的内容样式 ===== */
.loading-spinner {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 16px;
}

.error-message {
    text-align: center;
    padding: 30px;
    color: var(--primary);
    font-size: 16px;
}

/* ===== 底部悬浮工具栏 ===== */
.bottom-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 16px;
    padding-bottom: max(12px, var(--safe-bottom));
    display: flex;
    justify-content: space-around;
    gap: 8px;
    border-top: 1px solid var(--border-light);
    max-width: 600px;
    margin: 0 auto;
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}

body.night-mode .bottom-toolbar {
    background: rgba(38,50,56,0.95);
    border-color: var(--border-dark);
}

.tool-btn {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 14px 0;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
    flex: 1;
    max-width: 100px;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 10px rgba(37,70,95,0.2);
}

.tool-btn:active {
    transform: scale(0.94);
    background: var(--secondary-light);
}

/* ===== 灵动岛适配 ===== */
@supports (padding-top: env(safe-area-inset-top)) {
    .top-nav {
        padding-top: max(16px, env(safe-area-inset-top));
    }
    .bottom-toolbar {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
}

/* ===== iPhone SE 等小屏优化 ===== */
@media (max-width: 375px) {
    .spot-time {
        font-size: 12px;
        padding: 6px 10px;
    }
    .spot-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    .spot-name {
        font-size: 16px;
    }
    .day-title {
        font-size: 20px;
    }
    .tool-btn {
        font-size: 14px;
        padding: 12px 0;
    }
}