/* 全局样式 */
:root {
  --primary-color: #3b82f6;
  --primary-gradient: linear-gradient(135deg, #1e70eb, #60a5fa);
  --secondary-color: #6b7280;
  --border-color: #e5e7eb;
  --hover-color: #f3f4f6;
  --active-color: #ebf5ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #333;
    background-color: #f5f5f5;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
header {
    background: var(--primary-gradient);
    color: white;
    padding: 1.5rem 0;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 10;
}

header h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 0.25rem;
}

.trip-info {
    font-size: 1rem;
    opacity: 0.9;
}

/* 主内容区域 */
main {
    padding: 20px 0;
}

.trip-container {
    display: flex;
    box-shadow: var(--shadow-md);
    background-color: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 80vh;
}

/* 左侧行程列表 */
.itinerary-panel {
    width: 400px;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.day-tabs {
    display: flex;
    padding: 0.5rem;
    gap: 0.5rem;
    background: #f8fafc;
    border-radius: var(--radius-lg) 0 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.day-tab {
    padding: 0.75rem;
    cursor: pointer;
    flex: 1;
    text-align: center;
    transition: var(--transition);
    font-weight: 600;
    border-radius: var(--radius-md);
    color: var(--secondary-color);
}

.day-tab:hover {
    background-color: var(--hover-color);
}

.day-tab.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.spots-container {
    padding: 1rem;
}

.day-content {
    display: none;
}

.day-content.active {
    display: block;
}

.day-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.day-description {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 0.9375rem;
}

.spot-item {
    margin-bottom: 12px;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    padding-left: 60px; /* 为序号腾出空间 */
    background-color: #f9f9f9;
    border: 1px solid transparent;
    animation: fadeIn 0.4s ease-out;
}

.spot-item:hover {
    background-color: var(--hover-color);
    transform: translateY(-2px);
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.spot-item.active {
    background-color: var(--active-color);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.spot-index {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 2.25rem;
    height: 2.25rem;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.spot-time {
    position: absolute;
    right: 15px;
    top: 15px;
    background-color: #dbeafe;
    color: #1e40af;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
}

.spot-category {
    display: inline-block;
    background-color: #eee;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-bottom: 5px;
    color: #1f2937;
}

.spot-name {
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #111827;
}

.spot-description {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
    line-height: 1.5;
}

.spot-details {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-top: 10px;
}

.spot-transport, .spot-cost, .spot-tips {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    background: #f8fafc;
}

.spot-transport:before {
    content: "🚗";
    margin-right: 8px;
    color: var(--primary-color);
}

.spot-cost:before {
    content: "💰";
    margin-right: 8px;
    color: var(--primary-color);
}

.spot-tips:before {
    content: "💡";
    margin-right: 8px;
    color: #ea580c;
}

.spot-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.spot-link {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-md);
    background: #f3f4f6;
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: var(--transition);
}

.spot-link:hover {
    background: var(--active-color);
    color: var(--primary-color);
}

.spot-link.video:before {
    content: "🎬";
    margin-right: 5px;
}

.spot-link.website:before {
    content: "🔗";
    margin-right: 5px;
}

/* 地图容器 */
.map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* 标记样式 */
.marker-content {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.marker-content:hover {
    transform: scale(1.1);
}

.marker-index {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s;
}

.marker-label {
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 3px 8px;
    border-radius: var(--radius-md);
    font-size: 12px;
    white-space: nowrap;
    color: #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    transform-origin: bottom center;
    transform: translateX(-50%) scale(0.9);
    pointer-events: none;
}

.marker-content:hover .marker-label {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* 信息窗口样式 */
.info-window {
    width: 280px;
    max-width: 90vw;
}

.info-title {
    font-size: 16px;
    font-weight: bold;
    color: #1f2937;
    padding-bottom: 5px;
    margin-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
}

.info-body {
    font-size: 13px;
    color: #4b5563;
}

.info-time, .info-cost, .info-tips {
    margin-top: 5px;
}

.info-desc {
    margin-bottom: 10px;
    line-height: 1.5;
}

/* 页脚样式 */
footer {
    background-color: #f9fafb;
    color: var(--secondary-color);
    padding: 20px 0;
    margin-top: 30px;
    text-align: center;
    font-size: 0.875rem;
}

/* 移动端控制 */
.mobile-controls {
    display: none;
}

/* 自定义滚动条 */
.itinerary-panel::-webkit-scrollbar {
    width: 6px;
}

.itinerary-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

.itinerary-panel::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 6px;
}

.itinerary-panel::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* 移动设备布局样式优化 */
@media (max-width: 768px) {
    header {
        padding: 1rem 0;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .trip-info {
        font-size: 0.875rem;
    }
    
    .trip-container {
        flex-direction: column;
        height: calc(100vh - 100px);
        overflow: hidden;
    }
    
    .itinerary-panel {
        width: 100%;
        height: 60vh; /* 屏幕的3/5 */
        overflow-y: auto;
        border-right: none;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 2;
    }
    
    .map-container {
        width: 100%;
        height: 40vh; /* 屏幕的2/5 */
        position: relative;
        z-index: 1;
    }
    
    .day-tabs {
        padding: 0.375rem;
        gap: 0.25rem;
    }
    
    .day-tab {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    .spot-item {
        padding: 1rem;
        padding-left: 50px;
    }
    
    .spot-index {
        left: 10px;
        width: 2rem;
        height: 2rem;
        font-size: 12px;
    }
    
    .spot-time {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    .spot-name {
        font-size: 1.1rem;
    }
    
    .day-title {
        font-size: 1.25rem;
    }
    
    .info-window {
        width: 250px;
    }
    
    /* 隐藏视图切换按钮，使用固定布局 */
    .mobile-controls {
        display: none;
    }
    
    /* 地图通知的位置调整 */
    .map-notice {
        bottom: 10px;
        left: 10px;
        font-size: 0.75rem;
        padding: 0.5rem;
    }

    /* 调整视图切换按钮位置 */
    .view-toggle-button {
        bottom: 20px;
        right: 20px;
    }
}

/* 优化移动端天气显示 */
@media (max-width: 768px) {
    .day-heading-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .weather-info {
        padding: 0.5rem;
    }
}

/* 修复移动端景点切换和地图联动 */
@media (max-width: 768px) {
    .settings-input, 
    .weather-provider-select,
    .weather-city-input {
        font-size: 0.875rem;
        padding: 0.5rem;
    }
    
    .settings-button {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

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

.map-loading svg {
    animation: rotate 2s linear infinite;
}

.amap-marker-animation {
    animation: pulse 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.marker-content:hover .marker-index {
    animation: pulse 1s infinite;
}

.amap-info-content {
    max-width: 90vw !important;
}

.marker-content.active {
    transform: scale(1.1);
}

.day-content {
    animation: fadeIn 0.3s ease-out;
}

/* 天气信息样式 */
.day-heading-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.weather-info {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-md);
    padding: 0.375rem 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
    max-width: fit-content;
}

.weather-icon {
    font-size: 1.25rem;
    margin-right: 0.5rem;
}

.weather-temp {
    font-weight: 600;
    margin-right: 0.5rem;
}

.weather-desc {
    color: var(--secondary-color);
    font-size: 0.875rem;
}

.weather-loading {
    color: var(--secondary-color);
    font-size: 13px;
    animation: pulse 1.2s infinite;
}

.weather-simulated {
    font-size: 10px;
    opacity: 0.7;
    color: var(--secondary-color);
    margin-left: 5px;
    font-style: italic;
}

.settings-input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #ddd);
    font-size: 14px;
    margin-top: 5px;
    background-color: var(--bg-light);
    transition: border-color 0.2s ease;
}

.settings-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.settings-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.settings-button:hover {
    background-color: var(--primary-dark, #2563eb);
}

.settings-button:active {
    transform: scale(0.98);
}

.settings-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.weather-api-settings {
    border-top: 1px solid var(--border-color, #ddd);
    margin-top: 16px;
    padding-top: 16px;
}

.weather-provider-select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #ddd);
    font-size: 14px;
    margin-top: 5px;
    background-color: var(--bg-light);
    transition: border-color 0.2s ease;
    cursor: pointer;
}

.weather-provider-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.weather-api-status {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.weather-api-status.success {
    background-color: rgba(76, 175, 80, 0.2);
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.weather-api-status.error {
    background-color: rgba(244, 67, 54, 0.2);
    color: #c62828;
    border: 1px solid #f44336;
}

.weather-api-status-icon {
    margin-right: 6px;
    font-size: 16px;
}

/* 天气API测试按钮 */
.weather-api-test-btn {
    margin-top: 8px;
    padding: 5px 10px;
    background-color: #4a89dc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.weather-api-test-btn:hover {
    background-color: #3a6bbb;
}

.weather-api-test-btn:active {
    background-color: #2a4b8d;
}

/* Visual Crossing API Key输入 */
#visual-crossing-api-key-container {
    margin-top: 10px;
}

#visual-crossing-api-key {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

/* 天气设置部分 */
.weather-settings {
    margin-top: 15px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
}

.weather-api-test-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 16px;
    background-color: #4285f4;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.weather-api-test-btn:hover {
    background-color: #3367d6;
}

.weather-api-test-btn:active {
    background-color: #2a56c6;
}

.weather-api-status {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
}

.weather-api-status.success {
    background-color: #e6f4ea;
    color: #137333;
    border: 1px solid #ceead6;
}

.weather-api-status.error {
    background-color: #fce8e6;
    color: #c5221f;
    border: 1px solid #f6cccb;
}

@media (max-width: 768px) {
    .settings-input, 
    .weather-provider-select,
    .weather-city-input {
        font-size: 0.875rem;
        padding: 0.5rem;
    }
    
    .settings-button {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
}

/* 行内天气样式 */
.inline-weather {
    display: inline-flex;
    align-items: center;
    background-color: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-md);
    padding: 0.25rem 0.6rem;
    margin-left: 0.75rem;
    font-size: 0.875rem;
    font-weight: normal;
    color: var(--secondary-color);
    vertical-align: middle;
}

.inline-weather .weather-icon {
    font-size: 1.1rem;
    margin-right: 0.35rem;
}

.inline-weather .weather-temp {
    font-weight: 600;
    margin-right: 0.35rem;
    color: #333;
}

.inline-weather .weather-desc {
    color: var(--secondary-color);
    font-size: 0.85rem;
}

.inline-weather .weather-loading {
    font-size: 0.75rem;
    color: var(--secondary-color);
}

/* 地图提示信息 */
.map-notice {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    color: #333;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* 设置面板样式 */
.settings-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    max-width: 90%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 1100;
    display: none;
    transition: all 0.3s ease;
}

.settings-panel.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.settings-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.settings-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--secondary-color);
}

.settings-content {
    padding: 20px;
}

.settings-item {
    margin-bottom: 20px;
}

.settings-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.settings-desc {
    font-size: 13px;
    color: var(--secondary-color);
    margin-top: 5px;
}

.settings-footer {
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 14px;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

/* 半透明浮动切换按钮 */
.view-toggle-button {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(59, 130, 246, 0.7);  /* 半透明蓝色背景 */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.view-toggle-button:hover {
    background-color: rgba(59, 130, 246, 0.9);
    transform: scale(1.05);
}

.view-toggle-button:active {
    transform: scale(0.95);
}

.view-toggle-icon {
    color: white;
    font-size: 22px;
}

/* 全屏地图模式的样式 */
.map-fullscreen-mode .itinerary-panel {
    display: none;
}

.map-fullscreen-mode .map-container {
    width: 100%;
    height: calc(100vh - 100px);
    border-radius: var(--radius-lg);
}

/* 移动设备上的全屏地图模式 */
@media (max-width: 768px) {
    .map-fullscreen-mode .map-container {
        height: calc(100vh - 100px);
        border-radius: var(--radius-lg);
    }
} 