/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS变量定义 - 统一主题色 */
:root {
    --primary-color: #e74c3c;
    --primary-dark: #c0392b;
    --primary-light: #fadbd8;
    --secondary-color: #3498db;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #999;
    --bg-primary: #fff;
    --bg-secondary: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 50%;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

/* 应用容器 */
#app {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--bg-primary);
    min-height: 100vh;
    position: relative;
    box-shadow: var(--shadow-md);
}

/* 页面通用样式 */
.page {
    display: none;
    min-height: 100vh;
    flex-direction: column;
}

.page.active {
    display: flex;
}

/* 头部样式 */
.app-header,
.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}

.app-title {
    font-size: 20px;
    font-weight: bold;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-role {
    font-size: 14px;
}

.login-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.login-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.back-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.back-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.page-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    text-align: center;
    flex: 1;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.header-actions button {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.header-actions button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* 主内容区域 */
.app-main,
.page-main {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background-color: var(--bg-primary);
}

/* 核心功能入口网格 */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.feature-item {
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.feature-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.feature-icon {
    font-size: 40px;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.feature-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.feature-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* 推荐路线 */
.section-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: "📍";
    font-size: 20px;
    color: var(--primary-color);
}

.route-list {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-secondary);
}

.route-list::-webkit-scrollbar {
    height: 6px;
}

.route-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.route-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: var(--radius-sm);
}

.route-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.route-card {
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    min-width: 220px;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.1);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.route-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
}

.route-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 24px rgba(231, 76, 60, 0.2);
    border-color: var(--primary-dark);
}

.route-card h3 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 12px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.route-card h3::before {
    content: "📌";
    font-size: 20px;
}

.route-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.view-route-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.view-route-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), #a93226);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
    transform: translateY(-2px);
}

/* 底部导航 */
.bottom-nav {
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.nav-item.active {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.nav-item:hover {
    color: var(--primary-color);
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
    transition: var(--transition);
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-text {
    font-size: 12px;
    font-weight: 500;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    position: relative;
}

.search-bar input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    background-color: var(--bg-secondary);
}

.search-bar input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
    background-color: var(--bg-primary);
}

.search-bar button {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    border: none;
    padding: 12px 16px;
    border-radius: 24px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: bold;
    box-shadow: var(--shadow-sm);
}

.search-bar button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 点位列表 */
.spot-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.spot-item {
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.spot-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.spot-item h3 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.spot-item h3::before {
    content: "📍";
    font-size: 16px;
    color: var(--primary-color);
}

.spot-item p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.spot-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-light);
    flex-wrap: wrap;
}

.spot-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.spot-meta span::before {
    content: "•";
    color: var(--primary-color);
    font-size: 16px;
    line-height: 1;
}

/* 路线标签页 */
.route-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
    background-color: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-lg);
}

.tab-btn {
    background: var(--bg-primary);
    border: none;
    padding: 12px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    flex: 1;
    text-align: center;
}

.tab-btn.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.tab-btn:hover:not(.active) {
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* 生成路线按钮 */
.generate-route-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 24px;
    width: 100%;
    font-weight: bold;
    box-shadow: var(--shadow-sm);
}

.generate-route-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 地图样式 */
.route-map {
    width: 100%;
    height: 250px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.route-map:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

/* 横屏适配 */
@media (orientation: landscape) {
    .feature-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .tools-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* 横屏时地图高度调整 */
    .route-map {
        height: 300px;
    }
}

/* 大屏设备适配 */
@media (min-width: 768px) {
    #app {
        max-width: 768px;
        margin: 0 auto;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    }
    
    /* 大屏时地图高度调整 */
    .route-map {
        height: 400px;
    }
}

/* 打卡状态 */
.checkin-status {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.checkin-status h3 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #333;
}

.progress-bar {
    background-color: #f0f0f0;
    border-radius: 12px;
    height: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.progress-fill {
    background-color: #e74c3c;
    height: 100%;
    border-radius: 12px;
    transition: width 0.3s;
}

.checkin-status p {
    font-size: 14px;
    color: #666;
    text-align: right;
}

/* 工具网格 */
.tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.tool-item {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tool-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: #e74c3c;
}

.tool-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.tool-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

/* 个人中心 */
.user-profile {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar {
    font-size: 64px;
}

.user-details h3 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 4px;
    color: #333;
}

.user-stats {
    font-size: 14px;
    color: #666;
}

.profile-menu {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.3s;
    color: #333;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background-color: #f8f9fa;
    color: #e74c3c;
}

.menu-icon {
    font-size: 20px;
}

.menu-text {
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .app-title {
        font-size: 18px;
    }
    
    .feature-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .feature-icon {
        font-size: 32px;
    }
    
    .feature-title {
        font-size: 14px;
    }
    
    .route-list {
        gap: 12px;
    }
    
    .route-card {
        min-width: 160px;
        padding: 12px;
    }
    
    .nav-icon {
        font-size: 18px;
    }
    
    .nav-text {
        font-size: 11px;
    }
}

/* 横屏适配 */
@media (orientation: landscape) {
    .feature-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .tools-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}