
/* 旅游攻略助手样式 - 优化版本 */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* 字体优化 - 使用系统字体栈提高加载速度 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #ffffff;
    font-display: swap; /* 优化字体加载 */
}

.navbar {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.card {
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 12px;
    margin-bottom: 20px;
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--light-color), #e9ecef);
    border-bottom: 1px solid #dee2e6;
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.highlight {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--warning-color);
    margin: 15px 0;
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.budget-result {
    background: var(--light-color);
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
}

.checklist-item {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.checklist-item:last-child {
    border-bottom: none;
}

.checklist-item input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.weather-card {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
}

.emergency-card {
    background: linear-gradient(135deg, #fd79a8, #e84393);
    color: white;
}

.table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table th {
    background: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
}

.table td {
    border-color: #dee2e6;
    vertical-align: middle;
}

.footer {
    background: var(--dark-color);
    color: white;
    padding: 40px 0;
    margin-top: 50px;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .card {
        margin-bottom: 15px;
    }
    
    .btn-lg {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
}

/* 打印样式 */
@media print {
    .navbar, .btn, .footer {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 性能优化 */
* {
    box-sizing: border-box;
}

/* 图片优化 */
img {
    max-width: 100%;
    height: auto;
    loading: lazy; /* 懒加载 */
}

/* 减少重绘和回流 */
.card, .btn {
    will-change: transform;
}

/* 预加载关键资源 */
.preload {
    display: none;
}

/* 优化滚动性能 */
.scroll-container {
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
}

/* 减少动画对性能的影响 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 优化表格渲染 */
.table {
    table-layout: fixed;
}

/* 优化文本渲染 */
.text-optimize {
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
