/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #000000;
    --primary-hover: #333333;
    --secondary-color: #6b7280;
    --background: #ffffff;
    --surface: #f9fafb;
    --border: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --success: #10b981;
    --error: #ef4444;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 登录页面 */
.page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: white;
    padding: 48px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.logo {
    margin-bottom: 24px;
}

.login-card h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 16px;
}

.privacy-note {
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

/* 主页面 */
#mainPage {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

header {
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 24px;
    font-weight: 700;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* 筛选器 */
.filter-section {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.date-picker {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.date-input {
    flex: 1;
    min-width: 200px;
}

.date-input label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-secondary);
}

.date-input input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.date-input input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 统计信息 */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-card p {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

/* 行程列表 */
.trips-list {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.loading {
    text-align: center;
    padding: 48px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 48px;
    color: var(--text-secondary);
}

.empty-state svg {
    margin-bottom: 16px;
}

/* 行程卡片 */
.trips-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.trip-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
    background: var(--surface);
}

.trip-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.trip-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.trip-date {
    font-size: 14px;
    color: var(--text-secondary);
}

.trip-price {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
}

.trip-route {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.trip-route svg {
    flex-shrink: 0;
}

.route-details {
    flex: 1;
}

.route-from, .route-to {
    display: flex;
    align-items: center;
    gap: 8px;
}

.route-from {
    margin-bottom: 8px;
}

.location-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.location-dot.from {
    background: var(--success);
}

.location-dot.to {
    background: var(--error);
}

.trip-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.trip-actions a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: opacity 0.2s;
}

.trip-actions a:hover {
    opacity: 0.7;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 16px;
    }
    
    .date-picker {
        flex-direction: column;
    }
    
    .date-input {
        width: 100%;
    }
    
    .login-card {
        padding: 32px 24px;
    }
    
    .trip-header {
        flex-direction: column;
        gap: 8px;
    }
}