/* 基础样式重置 */
:root {
    --primary-gradient: linear-gradient(135deg, #4054b2 0%, #5d2f82 100%);
    --secondary-gradient: linear-gradient(135deg, #4054b2, #5d2f82);
    --primary-color: #4054b2;
    --secondary-color: #5d2f82;
    --text-main: #333;
    --text-secondary: #586466;
    --text-dark: #2c3e50;
    --bg-light: #f8f9fa;
    --bg-white: rgba(255, 255, 255, 0.95);
    --border-color: #e0e6ed;
    --shadow-main: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 5px 15px rgba(102, 126, 234, 0.4);
    --radius-main: 12px;
    --radius-btn: 25px;
    --transition: all 0.3s ease;
    --mobile-nav-height: 64px;
}

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

/* 视觉隐藏但保留在无障碍树和键盘焦点顺序中。 */
.visually-hidden,
.visually-hidden-control {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

html {
    min-height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--text-main);
    font-size: 14px;
    margin: 0;
    padding: 0;
}

.container {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

/* 头部样式 */
header {
    background: var(--bg-white);
    padding: 15px 20px;
    border-radius: 0;
    margin: 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.header-left {
    text-align: left;
}

.header-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-btn {
    padding: 10px 16px;
    background: var(--secondary-gradient);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    font-size: 14px;
    white-space: nowrap;
}

.header-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

header h1 {
    color: var(--text-dark);
    font-size: 2.2rem;
    margin-bottom: 8px;
    font-weight: 700;
}

header p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

/* 主要内容区域 */
.main-content {
    display: flex;
    gap: 20px;
    flex: 1;
    min-height: 0;
    padding: 15px 20px;
    overflow: hidden;
    box-sizing: border-box;
}

/* 侧边栏样式 */
.sidebar {
    width: 35%;
    min-width: 320px;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    overflow-y: auto;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex-shrink: 0;
    min-height: 0;
}

.sidebar h3 {
    color: #2c3e50;
    font-size: 1.25rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 搜索区域 */
.search-section {
    flex-shrink: 0;
}

.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.search-box input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e6ed;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
}

.search-box input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box button,
.control-btn,
.clear-btn,
.optimize-btn,
.show-route-btn,
.add-blank-btn,
.add-btn {
    padding: 12px 18px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 14px;
}

.search-box button:hover,
.control-btn:hover,
.clear-btn:hover,
.optimize-btn:hover,
.show-route-btn:hover,
.add-blank-btn:hover,
.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.search-box button:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
    box-shadow: none;
}

.search-box .reset-search-btn {
    padding-inline: 16px;
    background: #ffffff;
    color: #596275;
    border: 2px solid #d8dee8;
    box-shadow: none;
}

.search-box .reset-search-btn:hover {
    background: #f3f5f8;
    border-color: #aeb8c8;
    color: #2c3e50;
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.14);
}

.search-box .reset-search-btn:focus-visible,
.search-box button:focus-visible {
    outline: 3px solid rgba(102, 126, 234, 0.28);
    outline-offset: 2px;
}

/* 搜索结果样式 */
.search-results {
    border-radius: 10px;
}

.search-result-item {
    padding: 12px 18px;
    background: #f8f9fa;
    margin-bottom: 6px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    width: 100%;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    text-align: left;
    font: inherit;
}

.search-result-item:hover {
    background: #e9ecef;
    border-left-color: #667eea;
    transform: translateX(5px);
}

.search-result-name {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    font-size: 14px;
}

.search-result-address {
    display: block;
    font-size: 14px;
    color: #7f8c8d;
    line-height: 1.3;
}

/* Toast消息样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* 复制和导航按钮样式 */
.copy-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.copy-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f5582);
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.4);
}

.navigate-to-btn {
    background: linear-gradient(135deg, #e67e22, #d35400);
}

.navigate-to-btn:hover {
    background: linear-gradient(135deg, #d35400, #bf6516);
    box-shadow: 0 3px 10px rgba(230, 126, 34, 0.4);
}

/* 城市过滤按钮特殊样式 */
.city-filter-btn {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    position: relative;
    overflow: hidden;
}

.city-filter-btn:hover {
    background: linear-gradient(135deg, #d35400 0%, #bf6516 100%);
    box-shadow: 0 5px 15px rgba(230, 126, 34, 0.4);
}

.city-filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.city-filter-btn:hover::before {
    left: 100%;
}

/* 恢复总地图按钮样式 */
.return-overview-btn {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    display: none;
}

.return-overview-btn:hover {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

/* 游玩列表区域样式 */
.playlist-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.playlist-section h3 {
    margin-bottom: 15px;
}

.travel-list,
.pending-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 游玩列表控制按钮 */
.playlist-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.add-blank-btn {
    flex: 1;
}

.clear-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    flex: 1;
}

.optimize-btn {
    background: linear-gradient(135deg, #27ae60, #229954);
    flex: 1;
}

.undo-optimize-btn {
    background: #16324f;
    color: white;
    flex: 1;
}

.undo-optimize-btn[hidden] {
    display: none;
}

.show-route-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    flex: 1;
}

/* 游玩列表 */
.travel-list {
    list-style: none;
    margin-bottom: 15px;
}

/* 无坐标路线段样式 */
.route-line.no-coordinates {
    background: repeating-linear-gradient(90deg,
            #ddd 0px,
            #ddd 5px,
            transparent 5px,
            transparent 10px);
}

.route-info-card.disabled {
    opacity: 0.6;
    background: #f5f5f5;
}

.route-info-card.disabled .distance-info {
    color: #999;
    font-style: italic;
}

.travel-item {
    background: #f8f9fa;
    padding: 14px;
    margin-bottom: 8px;
    border-radius: 10px;
    cursor: move;
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
    position: relative;
    min-height: 65px;
}

.travel-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.travel-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.travel-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    position: relative;
    height: 36px;
}

.travel-item-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.drag-handle {
    color: #999;
    font-size: 14px;
    cursor: grab;
    user-select: none;
    opacity: 0.7;
    transition: all 0.3s ease;
    padding: 2px 4px;
    border-radius: 4px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drag-handle:hover {
    color: #667eea;
    opacity: 1;
    background: rgba(102, 126, 234, 0.1);
}

.travel-item.dragging .drag-handle {
    cursor: grabbing;
    color: #667eea;
    opacity: 1;
}

.travel-item-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
    line-height: 1.4;
    height: 32px;
    display: flex;
    align-items: center;
}

.travel-item-order {
    background: #667eea;
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.travel-item-address {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 10px;
    line-height: 1.3;
}

/* 路线连接段样式 */
.route-segment {
    list-style: none;
    margin: 0;
    padding: 0;
}

.route-connector {
    display: flex;
    align-items: center;
    padding: 6px 0;
    position: relative;
    overflow: visible;
}

.route-line {
    width: 4px;
    height: 32px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    margin-right: 15px;
    position: relative;
}

.route-line::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -2px;
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    border: 1px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.route-line::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: -2px;
    width: 8px;
    height: 8px;
    background: #764ba2;
    border-radius: 50%;
    border: 1px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.route-info-card {
    flex: 1;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 紧凑版路线信息卡片 */
.route-info-card.compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    border: 1px solid rgba(102, 126, 234, 0.15);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    overflow: visible;
    position: relative;
}

/* 紧凑版路线信息 */
.route-info {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
}

.route-info .distance-info,
.route-info .duration-info {
    font-size: 12px;
    color: #27ae60;
    font-weight: 600;
    background: rgba(39, 174, 96, 0.1);
    padding: 3px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

/* 紧凑版导航按钮 */
.navigate-btn.compact {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    position: relative;
}

.navigate-btn.compact:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
    background: linear-gradient(135deg, #218838, #1dc3a0);
}

/* 紧凑版导航按钮的快速tooltip */
.navigate-btn.compact::after {
    content: attr(title);
    position: absolute;
    top: -36px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.05s ease;
    z-index: 15000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.navigate-btn.compact:hover::after {
    opacity: 1;
}

.route-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 12px;
}

.route-from-to {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.route-from,
.route-to {
    font-size: 12px;
    font-weight: 500;
}

.route-from {
    color: #e67e22;
}

.route-to {
    color: #8e44ad;
}

.route-arrow {
    font-size: 15px;
    color: #667eea;
    align-self: center;
    margin: 3px 0;
}

.route-distance {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 5px;
}

.distance-info,
.duration-info {
    font-size: 14px;
    color: #27ae60;
    font-weight: 600;
    background: rgba(39, 174, 96, 0.1);
    padding: 6px 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 谷歌地图按钮 */
.google-maps-btn {
    background: linear-gradient(135deg, #4285f4, #34a853);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    min-width: 60px;
    justify-content: center;
}

.google-maps-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
    background: linear-gradient(135deg, #3367d6, #2d8f40);
}

/* 路线控制器样式 */
.route-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 10px 0;
    padding: 12px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.travel-mode-selector,
.map-provider-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mode-label,
.provider-label {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    min-width: 60px;
}

.travel-mode-select {
    flex: 1;
    min-width: 120px;
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.travel-mode-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.map-buttons {
    display: flex;
    gap: 4px;
    flex: 1;
}

.map-btn {
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 45px;
}

.map-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
}

.map-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.navigate-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    align-self: flex-end;
    min-width: 70px;
}

.navigate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    background: linear-gradient(135deg, #218838, #1dc3a0);
}

.travel-item-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

.action-btn {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.action-btn:hover {
    background: #e74c3c;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(231, 76, 60, 0.3);
}

/* 统一的快速tooltip系统将在下方的通用系统中处理 */

.locate-btn {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.locate-btn:hover {
    background: #3498db;
    color: white;
}

.edit-btn {
    background: rgba(149, 165, 166, 0.1);
    color: #95a5a6;
}

.edit-btn:hover {
    background: #95a5a6;
    color: white;
}

/* 距离统计 */
.distance-summary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 15px;
    border-radius: 10px;
    color: white;
    text-align: center;
}

.distance-summary h4 {
    margin-bottom: 10px;
    font-size: 16px;
}

.total-distance,
.estimated-time {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}

.distance-source {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.35);
    font-size: 12px;
    font-weight: 600;
}

/* 路线校对台：用地图图例式的信息层级呈现建议，不在确认前改写行程。 */
#routeOptimizationModal {
    z-index: 12000;
}

#routeOptimizationModal .optimization-modal-content {
    --route-ink: #16324f;
    --route-teal: #0a7b83;
    --route-orange: #a33a28;
    --route-paper: #f2f7f5;
    --route-signal: #f7c948;
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(920px, 94vw);
    max-width: 920px;
    max-height: 90vh;
    margin: 0;
    padding: 28px;
    overflow-y: auto;
    transform: translate(-50%, -50%);
    color: var(--route-ink);
    border-radius: 18px;
    background: #fcfefd;
    box-shadow: 0 28px 90px rgba(13, 38, 59, 0.32);
    animation: settingsModalShow 0.25s ease-out;
}

.optimization-close {
    position: absolute;
    top: 18px;
    right: 20px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #d7e4e1;
    border-radius: 50%;
    background: white;
    color: var(--route-ink);
    font-size: 25px;
    line-height: 1;
}

.optimization-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-right: 44px;
    margin-bottom: 24px;
}

.optimization-eyebrow,
.route-option-label,
.optimization-method-badge,
.source-badge {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.optimization-eyebrow {
    color: var(--route-orange);
    font-size: 12px;
    font-weight: 800;
}

.optimization-heading h3 {
    margin: 3px 0 6px;
    color: var(--route-ink);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(26px, 4vw, 38px);
    line-height: 1.05;
}

.optimization-heading p {
    max-width: 610px;
    color: #587083;
    line-height: 1.55;
}

.optimization-method-badge,
.source-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #dcefeb;
    color: #075b61;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.optimization-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 18px;
    border: 1px solid #d9e5e2;
    border-radius: 14px;
    background: var(--route-paper);
}

.optimization-field {
    display: grid;
    gap: 7px;
    color: #496172;
    font-size: 12px;
    font-weight: 700;
}

.optimization-field select {
    width: 100%;
    min-height: 42px;
    padding: 9px 34px 9px 11px;
    border: 1px solid #bfd1cd;
    border-radius: 9px;
    background: white;
    color: var(--route-ink);
    font: inherit;
    font-size: 14px;
}

.optimization-toggle {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    gap: 9px;
    color: var(--route-ink);
    font-size: 14px;
    font-weight: 700;
}

.optimization-toggle input,
.locked-place-option input {
    accent-color: var(--route-teal);
}

.locked-place-fieldset {
    margin-top: 16px;
    padding: 16px 18px 18px;
    border: 1px solid #d9e5e2;
    border-radius: 14px;
}

.locked-place-fieldset legend {
    padding: 0 8px;
    color: var(--route-ink);
    font-weight: 800;
}

.locked-place-fieldset > p {
    margin: 0 0 12px;
    color: #526b7b;
    font-size: 12px;
}

.locked-place-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.locked-place-option {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 9px 11px;
    border-radius: 8px;
    background: #f5f8f7;
    color: #334f62;
    font-size: 14px;
}

.locked-place-option span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.optimization-status {
    min-height: 22px;
    margin-top: 13px;
    color: #526b7b;
    font-size: 14px;
}

.optimization-status.is-error {
    color: #a33a28;
}

.optimization-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.optimization-actions button {
    min-height: 42px;
    padding: 9px 18px;
    border-radius: 999px;
}

.optimization-actions .primary-btn {
    background: var(--route-teal);
}

.optimization-actions .text-btn {
    border: 0;
    background: transparent;
    color: #587083;
}

.comparison-source-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.source-badge.is-estimate {
    background: #fff0cf;
    color: #7d5010;
}

.budget-note {
    color: #6b7e89;
    font-size: 12px;
    text-align: right;
}

.comparison-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 122px minmax(0, 1fr);
    align-items: stretch;
    border: 1px solid #d9e5e2;
    border-radius: 16px;
    overflow: hidden;
    background: white;
}

.route-option {
    display: grid;
    align-content: center;
    gap: 7px;
    min-height: 150px;
    padding: 22px;
}

.route-option-original {
    background: #f4f7f8;
}

.route-option-suggestion {
    background: #e8f4f1;
}

.route-option-label {
    color: #667b88;
    font-size: 12px;
    font-weight: 800;
}

.route-option strong {
    color: var(--route-ink);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 700;
}

.route-option > span:last-child {
    color: #526b7b;
    font-weight: 700;
}

.savings-marker {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 3px;
    padding: 16px 8px;
    background: var(--route-signal);
    color: #3a3210;
    text-align: center;
    clip-path: polygon(0 0, 86% 0, 100% 50%, 86% 100%, 0 100%, 14% 50%);
}

.savings-marker span,
.savings-marker small {
    font-size: 12px;
    font-weight: 800;
}

.savings-marker strong {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 28px;
}

.order-difference-panel {
    margin-top: 16px;
    padding: 17px 18px;
    border: 1px solid #d9e5e2;
    border-radius: 14px;
}

.order-difference-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.order-difference-header h4 {
    color: var(--route-ink);
}

.order-difference-header span {
    color: #6a7f8b;
    font-size: 12px;
}

.order-difference-list {
    display: grid;
    gap: 7px;
    max-height: 190px;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.order-difference-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f5f8f7;
    color: #334f62;
    font-size: 14px;
}

.order-difference-item.is-moved {
    border-left: 3px solid var(--route-orange);
}

.order-number {
    color: var(--route-teal);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 800;
}

.order-move {
    color: #7b5260;
    font-size: 12px;
}

.optimization-caveat {
    margin-top: 14px;
    padding: 11px 13px;
    border-left: 3px solid var(--route-orange);
    background: #fff7f2;
    color: #6e554b;
    font-size: 12px;
    line-height: 1.5;
}

@media (max-width: 680px) {
    #routeOptimizationModal .optimization-modal-content {
        width: 96vw;
        max-height: 94vh;
        padding: 20px 16px;
        border-radius: 14px;
    }

    .optimization-heading {
        display: block;
        padding-right: 38px;
    }

    .optimization-method-badge {
        margin-top: 10px;
    }

    .optimization-fields,
    .locked-place-list {
        grid-template-columns: 1fr;
    }

    .comparison-board {
        grid-template-columns: 1fr;
    }

    .route-option {
        min-height: 105px;
    }

    .savings-marker {
        min-height: 86px;
        clip-path: polygon(0 12%, 42% 12%, 50% 0, 58% 12%, 100% 12%, 100% 88%, 58% 88%, 50% 100%, 42% 88%, 0 88%);
    }

    .optimization-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    #routeOptimizationModal .optimization-modal-content {
        animation: none;
    }
}

/* 地图容器 */
.map-container {
    flex: 1;
    width: 65%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    position: relative;
    min-height: 0;
}

.map {
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

/* 地图控制按钮 */
.map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
    /* 提高z-index确保在地图之上 */
}

.control-btn {
    padding: 10px;
    font-size: 12px;
    min-width: 100px;
    position: relative;
    z-index: 2001;
}

/* 快速悬停提示 */
.control-btn,
.action-btn {
    transition: all 0.1s ease;
}

.control-btn:hover,
.action-btn:hover {
    transform: translateY(-1px) scale(1.02);
}

/* 自定义悬停提示（快速显示） - 通用所有按钮类型 */
.control-btn[data-tooltip]::after,
.control-btn[title]::after,
.action-btn[data-tooltip]::after,
.action-btn[title]::after,
.activate-btn[data-tooltip]::after,
.activate-btn[title]::after,
.pending-btn[data-tooltip]::after,
.pending-btn[title]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 50%;
    right: 100%;
    margin-right: 10px;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.05s ease;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    max-width: 200px;
    text-align: center;
}

.control-btn[title]::after,
.action-btn[title]::after,
.activate-btn[title]::after,
.pending-btn[title]::after {
    content: attr(title);
}

.control-btn:hover[data-tooltip]::after,
.control-btn:hover[title]::after,
.action-btn:hover[data-tooltip]::after,
.action-btn:hover[title]::after,
.activate-btn:hover[data-tooltip]::after,
.activate-btn:hover[title]::after,
.pending-btn:hover[data-tooltip]::after,
.pending-btn:hover[title]::after {
    opacity: 1;
}

/* 城市过滤按钮强制显示样式 */
.city-filter-btn {
    display: block !important;
    z-index: 2002 !important;
}

.city-filter-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.city-filter-btn:disabled:hover {
    transform: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 显示/隐藏名称按钮样式 */
#toggleNamesBtn {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    transition: all 0.3s ease;
}

#toggleNamesBtn:hover {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
    transform: translateY(-2px);
}

/* 显示/隐藏待定点按钮样式 */
#togglePendingBtn {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    transition: all 0.3s ease;
}

#togglePendingBtn:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.4);
    transform: translateY(-2px);
}

/* 地图图例 */
.map-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    z-index: 1000;
    min-width: 200px;
}

.legend-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 12px;
    text-align: center;
    border-bottom: 1px solid rgba(108, 117, 125, 0.2);
    padding-bottom: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
}

.legend-item:last-child {
    margin-bottom: 12px;
}

.legend-marker {
    font-size: 16px;
}

.legend-tip {
    font-size: 12px;
    color: #6c757d;
    text-align: center;
    font-style: italic;
    padding-top: 8px;
    border-top: 1px solid rgba(108, 117, 125, 0.2);
    line-height: 1.4;
}

/* 底部 - 移除隐藏 */

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    isolation: isolate;
}

.modal::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.is-open {
    display: block;
}

.modal-content {
    position: relative;
    z-index: 1;
    background: white;
    margin: 15% auto;
    padding: 25px;
    border-radius: 15px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes settingsModalShow {
    from {
        transform: translate(-50%, -50%) scale(0.9);
    }

    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes largeModalShow {
    from {
        transform: translate(-50%, -50%) scale(0.95);
    }

    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

.close {
    color: #495057;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    background: transparent;
    border: 0;
    border-radius: 6px;
    min-width: 44px;
    min-height: 44px;
    padding: 4px;
}

.close:hover {
    color: #000;
}

#modalTitle {
    color: #2c3e50;
    margin-bottom: 15px;
}

#modalContent p {
    margin-bottom: 10px;
    color: #7f8c8d;
}

/* 储存方案模态框样式 */
.save-scheme-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 5px;
}

.saved-schemes h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1rem;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 8px;
}

#schemeNameInput {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 15px;
    outline: none;
    transition: border-color 0.3s ease;
}

#schemeNameInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.save-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

.save-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.save-btn:disabled:hover {
    background: #95a5a6;
    transform: none;
    box-shadow: none;
}

.save-scheme-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.scheme-name-warning {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 8px;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.2);
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
}

.schemes-list {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    padding: 10px;
}

.scheme-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px 18px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #fafbfc;
    transition: all 0.3s ease;
    min-height: 110px;
}

.scheme-item:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.scheme-info {
    flex: 1;
    margin-right: 15px;
}

.scheme-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 14px;
}

.scheme-date {
    font-size: 12px;
    color: #7f8c8d;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.scheme-time-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.created-time,
.modified-time {
    font-size: 12px;
    color: #95a5a6;
}

.modified-time {
    color: #e67e22;
}

.scheme-counts {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.places-info {
    font-size: 12px;
    color: #2c3e50;
    font-weight: 500;
}

.total-info {
    font-size: 12px;
    color: #7f8c8d;
}

/* 方案列表响应式样式 */
@media (max-width: 768px) {
    .scheme-item {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 15px;
        min-height: auto;
    }

    .scheme-info {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .scheme-actions {
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        margin-top: 0;
    }

    .scheme-time-info {
        margin-bottom: 6px;
    }

    .created-time,
    .modified-time {
        font-size: 12px;
    }

    .places-info {
        font-size: 12px;
    }

    .total-info {
        font-size: 12px;
    }

    .schemes-list {
        max-height: 300px;
    }
}

/* 确保方案信息的完整性 */
.scheme-date {
    line-height: 1.3;
}

.scheme-counts {
    padding-top: 2px;
    border-top: 1px solid rgba(236, 240, 241, 0.5);
    margin-top: 4px;
}

.empty-schemes {
    text-align: center;
    color: #95a5a6;
    padding: 30px 20px;
    font-style: italic;
}

.scheme-actions {
    display: flex;
    gap: 8px;
    flex-direction: column;
    align-items: flex-end;
    margin-top: 8px;
}

.scheme-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.load-scheme-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.load-scheme-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.4);
}

.delete-scheme-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.delete-scheme-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.4);
}

.overwrite-scheme-btn {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.overwrite-scheme-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(243, 156, 18, 0.4);
}

/* 当前方案样式 */
.scheme-item.current-scheme {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 2px solid #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.current-badge {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
    position: relative;
    z-index: 3;
    white-space: nowrap;
    flex-shrink: 0;
}

.current-scheme-btn {
    background: #95a5a6;
    color: white;
    cursor: default;
}

.current-scheme-btn:hover {
    background: #95a5a6;
    transform: none;
    box-shadow: none;
}

/* 导出模态框样式 */
.export-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 5px;
}

.export-option {
    width: 100%;
}

.export-card {
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: linear-gradient(135deg, #fafbfc 0%, #f8f9fa 100%);
}

.export-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.export-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.export-card h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.export-card p {
    color: #7f8c8d;
    margin-bottom: 20px;
    line-height: 1.5;
}

.export-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 14px;
}

.share-export {
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: white;
}

.share-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(230, 126, 34, 0.4);
}

.backup-export {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
}

.backup-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(155, 89, 182, 0.4);
}

.empty-schemes {
    text-align: center;
    color: #7f8c8d;
    padding: 30px;
    font-style: italic;
}

/* 导入模态框样式 */
.import-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 5px;
}

.import-area {
    margin-bottom: 20px;
}

.file-drop-zone {
    border: 3px dashed #667eea;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: #764ba2;
    background: linear-gradient(135deg, #f0f2ff 0%, #e8ebff 100%);
    transform: translateY(-2px);
}

.drop-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #667eea;
}

.file-drop-zone h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.file-drop-zone p {
    color: #7f8c8d;
    margin-bottom: 20px;
    line-height: 1.5;
}

.import-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 14px;
}

.import-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.import-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #667eea;
}

.import-info h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.import-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.import-info li {
    color: #7f8c8d;
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    line-height: 1.5;
}

.import-info li::before {
    content: '•';
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.file-processing {
    display: none;
    text-align: center;
    padding: 20px;
    color: #667eea;
}

.processing-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 编辑游玩点模态框样式 */
.edit-place-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
    max-height: 70vh;
    overflow-y: auto;
}

.edit-section {
    padding: 0;
}

.original-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #667eea;
}

.original-info h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-row {
    display: flex;
    margin-bottom: 12px;
    align-items: flex-start;
    gap: 10px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    color: #7f8c8d;
    font-weight: 600;
    min-width: 50px;
    flex-shrink: 0;
}

.info-value {
    color: #2c3e50;
    line-height: 1.4;
    word-break: break-word;
}

.custom-info {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 8px;
    padding: 20px;
    border: 2px solid #e9ecef;
}

.custom-info h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

.form-hint {
    display: block;
    color: #7f8c8d;
    font-size: 12px;
    margin-top: 5px;
    font-style: italic;
}

.edit-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.save-edit-btn,
.cancel-edit-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.save-edit-btn {
    background: linear-gradient(135deg, #27ae60, #219a52);
    color: white;
}

.save-edit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

.cancel-edit-btn {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

.cancel-edit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(149, 165, 166, 0.4);
}

/* 游玩点显示备注的样式 */
.travel-item-notes {
    margin-top: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border-left: 3px solid #ffc107;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    color: #856404;
    white-space: pre-wrap;
    word-break: break-word;
}

.travel-item-notes:empty {
    display: none;
}

/* 待定列表样式 */
.pending-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px dashed rgba(149, 165, 166, 0.3);
}

.pending-section h3 {
    color: #95a5a6;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pending-list {
    list-style: none;
    padding: 0;
    margin: 0;
    min-height: 60px;
}

.pending-item {
    background: linear-gradient(135deg, rgba(149, 165, 166, 0.05) 0%, rgba(127, 140, 141, 0.08) 100%);
    border: 2px dashed rgba(149, 165, 166, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    position: relative;
    opacity: 0.8;
}

.pending-item:hover {
    background: linear-gradient(135deg, rgba(149, 165, 166, 0.1) 0%, rgba(127, 140, 141, 0.15) 100%);
    border-color: rgba(149, 165, 166, 0.5);
    opacity: 1;
    transform: translateY(-1px);
}

.pending-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.pending-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.pending-item-name {
    font-weight: 600;
    color: #7f8c8d;
    flex: 1;
}

.pending-item-address {
    color: #95a5a6;
    font-size: 14px;
    margin-bottom: 8px;
}

.pending-item-notes {
    margin-top: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 3px solid #95a5a6;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    color: #6c757d;
    white-space: pre-wrap;
    word-break: break-word;
}

.pending-item-notes:empty {
    display: none;
}

.pending-item-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

.activate-btn {
    background: linear-gradient(135deg, #27ae60, #219a52);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.activate-btn:hover {
    background: linear-gradient(135deg, #219a52, #1e8449);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(39, 174, 96, 0.3);
}

.pending-btn {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pending-btn:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(243, 156, 18, 0.3);
}

.empty-pending {
    text-align: center;
    color: #95a5a6;
    padding: 20px;
    font-style: italic;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .sidebar {
        width: 35%;
        min-width: 300px;
        max-width: 450px;
    }

    .map-container {
        width: 65%;
    }

    .main-content {
        flex: 1;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 35%;
        min-width: 280px;
        max-width: 400px;
        padding: 18px;
        gap: 16px;
    }

    .map-container {
        width: 65%;
    }

    .main-content {
        padding: 15px;
        gap: 15px;
        flex: 1;
    }

    .route-card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .google-maps-btn {
        align-self: flex-end;
        min-width: 80px;
    }
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        padding: 10px;
        gap: 10px;
        overflow: hidden;
        flex: 1;
        box-sizing: border-box;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        max-width: none;
        flex: none;
        padding: 16px;
        border-radius: 8px;
        gap: 12px;
    }

    .map-container {
        width: 100%;
        flex: 1;
        min-height: 200px;
        border-radius: 8px;
    }

    header {
        padding: 12px 15px;
        flex-direction: column;
        gap: 15px;
    }

    .header-left {
        text-align: center;
    }

    .header-right {
        justify-content: center;
        flex-wrap: wrap;
    }

    .header-btn {
        font-size: 12px;
        padding: 8px 14px;
    }

    header h1 {
        font-size: 2rem;
    }

    .playlist-controls {
        flex-direction: column;
        gap: 8px;
    }

    .route-card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .google-maps-btn {
        align-self: flex-end;
        font-size: 12px;
        padding: 6px 10px;
    }

    .travel-list {
        min-height: 120px;
    }

    .map-legend {
        position: absolute;
        bottom: 10px;
        left: 10px;
        padding: 10px;
        font-size: 12px;
        min-width: 160px;
    }

    .legend-title {
        font-size: 12px;
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    .legend-item {
        margin-bottom: 6px;
        font-size: 12px;
    }

    .legend-item:last-child {
        margin-bottom: 8px;
    }

    .legend-tip {
        font-size: 12px;
        padding-top: 6px;
    }

    .route-controls {
        padding: 10px;
        gap: 10px;
    }

    .travel-mode-selector,
    .map-provider-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .mode-label,
    .provider-label {
        font-size: 12px;
        min-width: auto;
    }

    .travel-mode-select {
        min-width: auto;
        font-size: 12px;
        padding: 5px 8px;
    }

    .map-buttons {
        gap: 3px;
    }

    .map-btn {
        font-size: 12px;
        padding: 5px 8px;
        min-width: 40px;
    }

    .navigate-btn {
        font-size: 12px;
        padding: 6px 10px;
        min-width: 60px;
        align-self: stretch;
    }

    .travel-item-actions {
        position: relative;
        top: auto;
        right: auto;
        margin-top: 8px;
        max-width: 100%;
        justify-content: center;
    }

    .action-btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    .toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
        font-size: 12px;
    }

    /* 移动端设置模态框样式 */
    .setting-section h4 {
        font-size: 14px;
    }

    .setting-description {
        font-size: 12px;
    }

    .option-card {
        padding: 12px;
        gap: 12px;
    }

    .option-icon {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .option-info h5 {
        font-size: 14px;
    }

    .option-info p {
        font-size: 12px;
    }

    .settings-save-btn,
    .settings-cancel-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* 隐藏滚动条但保留滚动功能 */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: transparent;
}

::-webkit-scrollbar-thumb:hover {
    background: transparent;
}

/* 侧边栏专用滚动条样式 - 覆盖全局隐藏设置 */
.sidebar::-webkit-scrollbar {
    width: 8px;
    background: rgba(0, 0, 0, 0.05);
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    margin: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.4);
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.6);
}

/* 冲突列表滚动条样式 */
.conflict-list::-webkit-scrollbar {
    width: 8px;
}

.conflict-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.conflict-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.conflict-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4190);
}

/* 地图截图专用样式 - 移除可能影响截图的CSS属性 */
.map-container.screenshot-mode {
    overflow: visible !important;
    backdrop-filter: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    position: static !important;
    background: #ffffff !important;
}

.map-container.screenshot-mode .map {
    border-radius: 0 !important;
    overflow: visible !important;
}

/* 截图时隐藏地图控件 */
.map-container.screenshot-mode .map-controls,
.map-container.screenshot-mode .map-legend {
    display: none !important;
}

/* 设置模态框样式 */
.settings-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    max-width: 900px;
    width: 90vw;
    height: 650px;
    /* 固定高度，统一所有设置面板尺寸 */
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: settingsModalShow 0.3s ease-out;
}

/* 统一模态框样式（方案、导入、导出） */
.unified-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    max-width: 900px;
    width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: settingsModalShow 0.3s ease-out;
}

.settings-container {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* 左侧菜单样式 */
.settings-sidebar {
    width: 200px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-right: 2px solid #e9ecef;
    flex-shrink: 0;
}

.settings-menu {
    padding: 20px 0;
}

.settings-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    width: 100%;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    background: transparent;
    color: #2c3e50;
    font: inherit;
    text-align: left;
}

.settings-menu-item:hover {
    background: rgba(102, 126, 234, 0.1);
}

.settings-menu-item.active {
    background: rgba(102, 126, 234, 0.15);
    border-left-color: #667eea;
    color: #667eea;
    font-weight: 600;
}

.menu-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.menu-text {
    font-size: 14px;
    font-weight: 500;
}

/* 右侧内容面板样式 */
.settings-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.settings-panel {
    display: none;
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    height: 550px;
    /* 固定高度：总高度650px - 顶部间距和按钮区域约100px */
    max-height: 550px;
}

.settings-panel.active {
    display: flex;
    flex-direction: column;
}

.panel-header {
    margin-bottom: 20px;
}

.panel-header h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.panel-description {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.panel-content {
    flex: 1;
}

/* 地图API选择器样式 */
.map-api-selector {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.map-api-selector h5 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.selector-description {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.api-choice-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.api-choice-option {
    cursor: pointer;
    display: block;
    flex: 1;
    min-width: 160px;
}

.api-choice-option input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.choice-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
    text-align: center;
}

.choice-card:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.api-choice-option input[type="radio"]:checked+.choice-card {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}

.choice-icon {
    font-size: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.api-choice-option input[type="radio"]:checked+.choice-card .choice-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: scale(1.05);
}

.choice-info h6 {
    margin: 0 0 2px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.choice-info p {
    margin: 0;
    color: #666;
    font-size: 12px;
    line-height: 1.3;
}

.api-choice-option input[type="radio"]:checked+.choice-card .choice-info h6 {
    color: #667eea;
}

/* 原有设置样式保留供兼容 */
.setting-section {
    margin-bottom: 30px;
}

.setting-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setting-option {
    cursor: pointer;
    display: block;
}

.setting-option input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.option-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.option-card:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.setting-option input[type="radio"]:checked+.option-card {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}

.option-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.setting-option input[type="radio"]:checked+.option-card .option-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: scale(1.05);
}

.option-info {
    flex: 1;
}

.option-info h5 {
    margin: 0 0 4px 0;
    color: #333;
    font-size: 15px;
    font-weight: 600;
}

.option-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.setting-option input[type="radio"]:checked+.option-card .option-info h5 {
    color: #667eea;
}

.settings-save-btn,
.settings-cancel-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

.settings-save-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.settings-save-btn:hover {
    background: linear-gradient(135deg, #218838, #1dc3a0);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.settings-cancel-btn {
    background: #6c757d;
    color: white;
}

.settings-cancel-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* API密钥配置样式 */
.api-keys-config {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.api-key-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.api-key-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.api-key-group input[type="password"] {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

.api-key-group input[type="password"]:focus {
    border-color: #667eea;
    background: #ffffff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.api-hint {
    color: #6c757d;
    font-size: 12px;
    line-height: 1.4;
    margin-top: 4px;
}

.api-hint a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.api-hint a:hover {
    text-decoration: underline;
}

.api-security-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(102, 126, 234, 0.1));
    border: 2px solid rgba(52, 152, 219, 0.2);
    border-radius: 12px;
    margin-top: 8px;
}

.security-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.security-text {
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.5;
}

.security-text strong {
    color: #1e3a8a;
}

/* 导航偏好设置样式 */
.additional-settings {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.additional-settings h5 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.preference-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preference-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.preference-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

.preference-item input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.preference-item input[type="checkbox"]:checked+.checkmark {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
}

.preference-item input[type="checkbox"]:checked+.checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.preference-text {
    color: #2c3e50;
    font-size: 14px;
    font-weight: 500;
}

/* 设置操作按钮样式调整 */
.settings-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    flex-shrink: 0;
    margin-top: auto;
}

/* 移动端二级菜单样式覆盖 */
@media (max-width: 768px) {

    .settings-modal-content,
    .unified-modal-content {
        width: 95vw !important;
        height: 580px !important;
        /* 移动端固定高度，比桌面端稍小 */
        max-height: 90vh !important;
    }

    .settings-container {
        flex-direction: column !important;
    }

    .settings-sidebar {
        width: 100% !important;
        border-right: none !important;
        border-bottom: 2px solid #e9ecef !important;
    }

    .settings-menu {
        display: flex !important;
        flex-direction: row !important;
        padding: 10px !important;
        overflow-x: auto !important;
    }

    .settings-menu-item {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        padding: 10px 15px !important;
        border-left: none !important;
        border-bottom: 3px solid transparent !important;
    }

    .settings-menu-item.active {
        border-left: none !important;
        border-bottom-color: #667eea !important;
    }

    .menu-text {
        font-size: 12px !important;
    }

    .menu-icon {
        font-size: 16px !important;
    }

    .settings-panel {
        padding: 15px !important;
        height: 460px !important;
        /* 移动端固定高度：总高度580px - 导航和按钮区域约120px */
        max-height: 460px !important;
    }

    .panel-header h4 {
        font-size: 16px !important;
    }

    .panel-description {
        font-size: 12px !important;
    }

    .additional-settings h5 {
        font-size: 14px !important;
    }

    .preference-text {
        font-size: 12px !important;
    }

    .settings-actions {
        flex-direction: column !important;
        gap: 8px !important;
        padding: 15px 20px !important;
        margin-top: auto !important;
    }

    .settings-save-btn,
    .settings-cancel-btn {
        padding: 10px 16px !important;
        font-size: 14px !important;
    }
}

/* 页脚样式 */
.page-footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
    flex-shrink: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    min-height: 70px;
    box-sizing: border-box;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stats-counter {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #666;
}

.stats-counter span {
    white-space: nowrap;
}

.footer-link {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 20px;
    background: rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.footer-link:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.2);
}

/* 移动端页脚样式 */
@media (max-width: 768px) {
    .page-footer {
        min-height: auto;
        padding: 10px 15px;
    }

    .footer-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .footer-section {
        flex-direction: column;
        gap: 8px;
    }

    .stats-counter {
        flex-direction: column;
        gap: 5px;
        font-size: 12px;
    }

    .footer-link {
        padding: 8px 15px;
        font-size: 12px;
    }
}

/* 冲突解决模态框样式 */
.large-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    max-width: 1000px;
    width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    z-index: 2001;
    animation: largeModalShow 0.3s ease-out;
}

.conflict-resolution-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

.conflict-header {
    background: linear-gradient(135deg, #fef3cd, #fff3cd);
    border: 1px solid #faebcc;
    border-radius: 8px;
    padding: 15px;
    color: #8a6d3b;
    flex-shrink: 0;
}

.conflict-header p {
    margin: 0;
    font-weight: 500;
}

.conflict-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px 5px;
    max-height: calc(80vh - 200px);
    min-height: 0;
}

.conflict-item {
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.conflict-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.conflict-item .conflict-header {
    background: none;
    border: none;
    border-bottom: 1px solid #e9ecef;
    padding: 0 0 10px 0;
    margin-bottom: 15px;
}

.conflict-item .conflict-header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.conflict-type {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

/* 不同冲突类型的颜色 */
.conflict-type.version-newer {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
}

.conflict-type.version-older {
    background: linear-gradient(135deg, #fdcb6e, #e17055);
    color: white;
}

.conflict-type.version-identical {
    background: linear-gradient(135deg, #00b894, #00a085);
    color: white;
}

.conflict-type.name-conflict {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    color: #d68000;
}

.conflict-details {
    margin-bottom: 20px;
}

.scheme-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.scheme-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid transparent;
}

.scheme-info.existing {
    border-left-color: #17a2b8;
    background: linear-gradient(135deg, #e1f5fe, #e0f2f1);
}

.scheme-info.importing {
    border-left-color: #fd7e14;
    background: linear-gradient(135deg, #fff3e0, #ffeaa7);
}

.scheme-info h5 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.scheme-info p {
    margin: 5px 0;
    font-size: 14px;
    color: #6c757d;
}

.scheme-info strong {
    color: #495057;
}

.conflict-resolution {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.conflict-resolution h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.resolution-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.resolution-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.resolution-options label:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.resolution-options input[type="radio"]:checked+span {
    font-weight: 600;
    color: #667eea;
}

.resolution-options input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.rename-input {
    display: block;
    margin-top: 10px;
}

.rename-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.rename-label {
    color: #2c3e50;
    font-weight: 500;
    font-size: 14px;
}

.rename-warning {
    color: #e74c3c;
    font-size: 12px;
    font-weight: 500;
    background: rgba(231, 76, 60, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.rename-input input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.rename-input input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.conflict-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
}

.primary-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.secondary-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* 冲突解决模态框响应式设计 */
@media (max-width: 768px) {
    .large-modal {
        width: 95vw;
        max-height: 90vh;
    }

    .conflict-list {
        max-height: calc(75vh - 200px);
        padding: 8px 2px;
    }

    .scheme-comparison {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .resolution-options {
        gap: 8px;
    }

    .resolution-options label {
        padding: 8px;
        font-size: 14px;
    }

    .conflict-actions {
        flex-direction: column;
    }

    .primary-btn,
    .secondary-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .rename-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .rename-warning {
        font-size: 12px;
        padding: 1px 4px;
    }
}

/* 空白地点样式 */
.travel-item.blank-item {
    border-left-color: #667eea;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
}

.travel-item.blank-item:hover {
    background: linear-gradient(135deg, #e9ecff 0%, #e0e6ff 100%);
}

.travel-item.blank-item .travel-item-order {
    color: #667eea;
    font-weight: bold;
}

.travel-item.blank-item .travel-item-name {
    color: #667eea;
    font-style: italic;
}

.travel-item.blank-item .travel-item-address {
    color: #999;
    font-style: italic;
}

/* 版本详情样式 */
.version-info {
    padding: 20px 0;
}

.current-version {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
}

.current-version h5 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
}

.current-version p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.version-history h5 {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: #2c3e50;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.version-list {
    /* 移除独立滚动条，使用外层统一滚动 */
}

.version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.version-number {
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
}

.version-date {
    color: #7f8c8d;
    font-size: 14px;
}

.change-type {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.change-type.feature {
    background: #27ae60;
    color: white;
}

.change-type.fix {
    background: #e74c3c;
    color: white;
}

.change-type.optimize {
    background: #f39c12;
    color: white;
}

.change-text {
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.4;
}

/* 统一版本项样式 */
.version-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.version-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

/* 多项更新特殊样式 */
.version-item.multiple-updates {
    border-left: 4px solid #3498db;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.version-item.multiple-updates:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.update-indicator {
    background: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

/* 版本内容容器 */
.version-content {
    margin-top: 8px;
}

/* 统一的版本变更项样式 */
.version-changes {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.version-changes:last-child {
    margin-bottom: 0;
}

/* 版本详情响应式设计 */
@media (max-width: 768px) {
    .version-list {
        /* 移动端也使用外层统一滚动，无需独立滚动 */
    }

    .version-item {
        padding: 12px;
    }

    .version-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .version-number {
        font-size: 14px;
    }

    .version-date {
        font-size: 12px;
    }

    .change-text {
        font-size: 14px;
    }

    .update-indicator {
        font-size: 12px;
        padding: 2px 6px;
        margin-left: 4px;
    }

    .version-content {
        margin-top: 6px;
    }
}

/* WCAG 2.2 AA：统一键盘焦点、可选控件焦点和高对比交互状态。 */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid #0b57d0 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px #ffffff !important;
}

.api-choice-option input[type="radio"]:focus-visible + .choice-card,
.setting-option input[type="radio"]:focus-visible + .option-card,
.preference-item input[type="checkbox"]:focus-visible + .checkmark {
    outline: 3px solid #0b57d0;
    outline-offset: 3px;
    box-shadow: 0 0 0 5px #ffffff;
}

.settings-menu-item:focus-visible {
    position: relative;
    z-index: 1;
}

.reorder-controls {
    display: inline-flex;
    gap: 6px;
    margin-left: auto;
}

.reorder-btn {
    min-width: 36px;
    min-height: 36px;
    padding: 4px 8px;
    border: 2px solid #4054b2;
    border-radius: 6px;
    background: #ffffff;
    color: #293878;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.reorder-btn:hover:not(:disabled) {
    background: #e9ecff;
}

.reorder-btn:disabled {
    border-color: #a7adb8;
    color: #6f7782;
    cursor: not-allowed;
    opacity: 1;
}

/* 白字按钮使用至少 4.5:1 的实色/渐变端点。 */
.header-btn,
.search-box button:not(.reset-search-btn),
.control-btn,
.add-blank-btn,
.add-btn,
.primary-btn,
.export-btn {
    background: linear-gradient(135deg, #4054b2, #5d2f82);
}

.clear-btn {
    background: #b42318;
    color: #ffffff;
}

.optimize-btn,
.show-route-btn,
.save-btn,
.settings-save-btn,
.navigate-btn {
    background: linear-gradient(135deg, #176b36, #0b5f4f);
    color: #ffffff;
}

.city-filter-btn {
    background: #98400b;
    color: #ffffff;
}

.search-result-address,
.travel-item-address,
.pending-item-address,
.empty-schemes,
.import-info li,
#modalContent p,
.panel-description,
.choice-info p,
.option-info p,
.form-hint {
    color: #586466;
}

.api-choice-option input[type="radio"]:checked + .choice-card .choice-info h6,
.setting-option input[type="radio"]:checked + .option-card .option-info h5,
.resolution-options input[type="radio"]:checked + span {
    color: #4054b2;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 天地图 T.Label 外层只负责定位，卡片视觉由内部内容提供。 */
.travel-map-label {
    position: absolute;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    line-height: normal;
    white-space: nowrap;
    pointer-events: none;
}

.travel-map-label::before,
.travel-map-label::after {
    display: none;
    content: none;
}
/* P0 XSS 治理：由 DOM/地图安全渲染器创建的固定结构样式 */
.api-banner-config-btn {
    margin-left: 15px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.api-banner-config-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.api-banner-dismiss-btn {
    margin-left: 10px;
    padding: 4px 8px;
    background: none;
    border: 0;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.demo-map-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #666;
    flex-direction: column;
}

.demo-map-settings-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background: #4054b2;
    color: white;
    border: 0;
    border-radius: 5px;
    cursor: pointer;
}

.search-status {
    padding: 10px;
    text-align: center;
    color: #666;
}

.search-status--error {
    color: #ff4d4f;
}

.search-status--empty {
    font-size: 12px;
}

.search-status--configuration,
.search-status--demo {
    padding: 12px;
    border: 1px solid #f0c36a;
    border-radius: 10px;
    background: #fff9e8;
    color: #704d00;
    text-align: left;
    margin-bottom: 8px;
}

.search-status--configuration p {
    margin: 0 0 10px;
}

.search-configure-btn {
    padding: 8px 12px;
    border: 0;
    border-radius: 18px;
    background: #667eea;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}

.search-result-demo-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 7px;
    border-radius: 10px;
    background: #fff1bd;
    color: #785800;
    font-size: 12px;
    font-weight: 700;
}

.empty-active {
    text-align: center;
    color: #666;
    padding: 20px;
}

.google-map-label-number,
.map-sdk-label__number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    margin-right: 4px;
}

.map-sdk-marker {
    position: relative;
    width: 40px;
    height: 50px;
    cursor: pointer;
}

.map-sdk-label {
    position: absolute;
    border-radius: 8px;
    padding: 6px 10px;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    min-width: 60px;
    text-align: center;
    cursor: default;
    user-select: none;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.map-sdk-label--active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.97) 100%);
    border: 1px solid rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.map-sdk-label--pending {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.95) 0%, rgba(255, 235, 59, 0.97) 100%);
    border: 1px solid rgba(255, 193, 7, 0.9);
    color: #8b5a00;
    z-index: 600;
}

.map-sdk-current-location {
    width: 24px;
    height: 24px;
    background: #27ae60;
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.map-sdk-current-location > span {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* 响应式应用框架：视口负责兜底，内容高度由文档流和弹性轨道共同决定。 */
header,
.system-messages,
.main-content,
.page-footer {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
}

header {
    padding-top: max(15px, env(safe-area-inset-top));
}

.header-left,
.header-right,
.main-content > *,
.footer-content {
    min-width: 0;
}

.main-content {
    display: grid;
    grid-template-columns: minmax(280px, clamp(280px, 35vw, 500px)) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    flex: 1 1 auto;
    min-height: 0;
}

.sidebar {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 0;
}

.map-container {
    width: 100%;
    min-width: 0;
    min-height: 0;
}

.system-messages:empty {
    display: none;
}

.system-messages {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.95);
}

.api-config-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    width: min(100%, 72rem);
    margin: 0 auto;
    padding: 10px 0;
    color: #704000;
    font-size: 14px;
    font-weight: 600;
}

.api-banner-message {
    flex: 1 1 18rem;
    min-width: 0;
    text-align: center;
    overflow-wrap: anywhere;
}

.api-banner-config-btn,
.api-banner-dismiss-btn {
    min-width: 44px;
    min-height: 44px;
    margin-left: 0;
    color: #704000;
    border-color: rgba(112, 64, 0, 0.35);
}

.api-banner-config-btn {
    background: #fff4d6;
    font-size: 14px;
}

.api-banner-dismiss-btn {
    color: #704000;
}

.header-btn,
.control-btn {
    font-size: 14px;
}

.distance-source {
    font-size: 12px;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

button:not(.action-btn):not(.activate-btn):not(.pending-btn):not(.compact):not(.reorder-btn),
[role="button"]:not(button) {
    min-width: 44px;
    min-height: 44px;
    font-size: 14px !important;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
    min-height: 44px;
    min-width: 0;
    font-size: 14px;
}

small,
.route-info .distance-info,
.route-info .duration-info,
.control-btn[data-tooltip]::after,
.control-btn[title]::after,
.action-btn[data-tooltip]::after,
.action-btn[title]::after,
.activate-btn[data-tooltip]::after,
.activate-btn[title]::after,
.pending-btn[data-tooltip]::after,
.pending-btn[title]::after,
.mode-label,
.provider-label,
.optimization-eyebrow,
.optimization-method-badge,
.route-option-label,
.savings-marker span,
.savings-marker small,
.order-move,
.legend-tip,
.created-time,
.modified-time,
.total-info,
.choice-info p,
.rename-warning,
.update-indicator,
.search-result-demo-badge,
.map-sdk-label {
    font-size: 12px;
}

.option-info h5,
.security-text,
.change-text {
    font-size: 14px;
}

.mobile-primary-nav {
    display: none;
}

@media (min-width: 769px) {
    .main-content {
        flex: 0 0 auto;
        height: calc(100vh - var(--app-chrome-height, 0px));
        height: calc(100dvh - var(--app-chrome-height, 0px));
    }
}

.modal {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-content {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y: auto;
}

@media (max-width: 768px) {
    body {
        min-width: 0;
        padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
    }

    .container {
        min-width: 0;
    }

    header,
    .system-messages,
    .main-content,
    .page-footer {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }

    header {
        align-items: flex-start;
        padding-top: max(12px, env(safe-area-inset-top));
        padding-bottom: 12px;
        gap: 6px;
    }

    .header-left {
        width: 100%;
        text-align: left;
    }

    .header-right {
        display: none;
    }

    header h1 {
        margin-bottom: 2px;
        font-size: 1.35rem;
        line-height: 1.25;
    }

    header p {
        font-size: 14px;
    }

    .system-messages {
        padding-top: 0;
        padding-bottom: 0;
    }

    .api-config-banner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        align-items: center;
        padding: 10px 0;
    }

    .api-banner-message {
        text-align: left;
    }

    .main-content {
        display: block;
        min-height: 0;
        padding-top: 12px;
        padding-bottom: 12px;
        overflow: visible;
    }

    .container[data-mobile-view="itinerary"] .map-container,
    .container[data-mobile-view="map"] .sidebar,
    .container:not([data-mobile-view]) .map-container {
        display: none;
    }

    .sidebar {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        min-height: 0;
        padding: 16px;
        overflow: visible;
        scroll-behavior: auto;
    }

    .map-container,
    .map {
        width: 100%;
        height: max(26rem, calc(100dvh - var(--mobile-nav-height) - env(safe-area-inset-bottom) - 24px));
        min-height: 26rem;
    }

    .search-box {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        align-items: stretch;
    }

    .search-box input {
        width: 100%;
        min-width: 0;
    }

    .playlist-controls {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .playlist-controls button {
        width: 100%;
    }

    .map-controls {
        top: max(10px, env(safe-area-inset-top));
        left: max(10px, env(safe-area-inset-left));
        right: max(10px, env(safe-area-inset-right));
        flex-direction: row;
        gap: 8px;
        max-width: none;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
        scroll-snap-type: inline proximity;
    }

    .map-controls .control-btn {
        flex: 0 0 auto;
        min-width: 96px;
        scroll-snap-align: start;
    }

    .map-legend {
        left: max(10px, env(safe-area-inset-left));
        bottom: 10px;
    }

    .page-footer {
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .footer-content {
        width: 100%;
    }

    .footer-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        font-size: 12px;
    }

    .mobile-primary-nav {
        position: fixed;
        z-index: 1900;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 4px;
        min-height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
        padding: 6px max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
        border-top: 1px solid rgba(64, 84, 178, 0.2);
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 -8px 28px rgba(31, 42, 78, 0.14);
        backdrop-filter: blur(16px);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-width: 0;
        min-height: 52px;
        padding: 4px;
        border: 0;
        border-radius: 12px;
        background: transparent;
        color: #586466;
        font-size: 12px;
        font-weight: 700;
        line-height: 1.1;
    }

    .mobile-nav-item > span[aria-hidden="true"] {
        font-size: 18px;
        line-height: 1;
    }

    .mobile-nav-item.is-active {
        color: #ffffff;
        background: var(--secondary-gradient);
        box-shadow: 0 4px 12px rgba(64, 84, 178, 0.28);
    }

    .modal {
        padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    }

    .modal-content,
    .settings-modal-content,
    .unified-modal-content,
    .large-modal,
    #routeOptimizationModal .optimization-modal-content {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        max-height: calc(100vh - 24px) !important;
        max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
        margin: 0 auto !important;
        overflow-y: auto;
    }

    .settings-modal-content,
    .large-modal,
    #routeOptimizationModal .optimization-modal-content {
        top: auto;
        left: auto;
        transform: none;
    }

    .settings-panel {
        height: auto !important;
        min-height: 0;
        max-height: none !important;
    }
}
