* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body, html {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    user-select: none;
    touch-action: manipulation;
    position: fixed; /* 防止移动设备上的地址栏滚动 */
}

.container {
    position: relative;
    width: 100%;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f0f2f5; /* 给页面添加一个轻微的背景色 */
}

.iframe-container {
    position: relative;
    width: 100%;
    max-width: 750px;
    height: 100%;
    margin: 0 auto;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 0 1px rgba(0, 0, 0, 0.08);
    background-color: #fff;
    transition: all 0.3s ease;
    border-radius: 0;
}

/* 当屏幕尺寸大于750px时，给iframe容器添加一些额外的美化效果 */
@media screen and (min-width: 751px) {
    .iframe-container {
        height: calc(100% - 24px);
        border-radius: 12px;
        border: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    /* 添加顶部状态栏设计，模拟手机应用的外观 */
    .iframe-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 16px;
        background-color: #f8f8f8;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        border-radius: 12px 12px 0 0;
        z-index: 2;
    }
    
    /* 页面加载时的淡入效果 */
    .iframe-container {
        animation: fadeInScale 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    }
    
    @keyframes fadeInScale {
        from {
            opacity: 0;
            transform: scale(0.98);
        }
        to {
            opacity: 1;
            transform: scale(1);
        }
    }
}

#main-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* 针对小屏幕的额外样式，确保在小屏幕上没有多余的边距 */
@media screen and (max-width: 750px) {
    .container {
        background-color: #fff; /* 在小屏幕上移除背景色 */
        padding: 0;
    }
    
    .iframe-container {
        box-shadow: none;
        border-radius: 0;
    }
}

/* 为大屏幕设备调整背景样式 */
@media screen and (min-width: 1200px) {
    .container {
        background-color: #ebeff5; /* 更柔和的背景色 */
        background-image: 
            linear-gradient(45deg, rgba(255,255,255,.3) 25%, transparent 25%, transparent 50%, 
            rgba(255,255,255,.3) 50%, rgba(255,255,255,.3) 75%, transparent 75%, transparent);
        background-size: 100px 100px; /* 创建一个精致的背景图案 */
    }
}

/* 可拖拽圆形按钮样式 - 美化版 */
.draggable-button {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    box-shadow: 0 6px 16px rgba(0, 162, 255, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    z-index: 1000;
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.draggable-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), transparent 65%);
    opacity: 0.8;
}

.button-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    line-height: 1;
    position: relative;
    z-index: 2;
}

.button-icon {
    font-size: 24px;
    margin-bottom: 3px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.button-text {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 按钮的激活状态 */
.draggable-button:active {
    transform: scale(0.92);
    box-shadow: 0 3px 8px rgba(0, 162, 255, 0.3);
    background: linear-gradient(135deg, #3a98fd 0%, #00d8e4 100%);
}

/* 按钮拖动时的样式 */
.draggable-button.dragging {
    opacity: 0.85;
    transform: scale(0.95);
    box-shadow: 0 8px 20px rgba(0, 162, 255, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

/* 记住按钮需要靠左或靠右贴边 */
.draggable-button.snap-left {
    left: 20px;
    right: auto;
    background: linear-gradient(135deg, #5e90ff 0%, #3689ff 100%);
}

.draggable-button.snap-right {
    right: 20px;
    left: auto;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* 遮罩层样式 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.overlay.show {
    display: block;
    opacity: 1;
}

/* 线路选择面板样式 */
.line-selector-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.98);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15), 0 -1px 0 rgba(255, 255, 255, 0.8);
    z-index: 1001;
    display: none;
    overflow: hidden;
    max-height: 70vh;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.2, 1, 0.3, 1);
}

.line-selector-panel.show {
    display: block;
    transform: translateY(0);
}

.panel-header {
    padding: 16px 20px;
    background: linear-gradient(to bottom, rgba(250, 250, 250, 0.9), rgba(255, 255, 255, 0.95));
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 2;
}

.panel-header h3 {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    color: #2c3e50;
    letter-spacing: -0.3px;
}

.close-btn {
    font-size: 28px;
    background: none;
    border: none;
    color: #606060;
    cursor: pointer;
    padding: 8px 12px;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    margin-right: -8px;
    transition: all 0.2s;
}

.close-btn:active {
    background-color: rgba(0, 0, 0, 0.06);
    color: #333;
}

.panel-body {
    padding: 8px 0 16px;
    max-height: calc(70vh - 68px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* 面板提示文本样式 */
.panel-tip {
    padding: 10px 20px;
    margin: 8px 20px 4px;
    color: #7f8c8d;
    font-size: 14px;
    text-align: center;
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.02);
}

.line-list {
    list-style: none;
    padding: 4px 8px;
}

.line-list li {
    margin: 8px 12px;
    padding: 16px 20px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    display: flex;
    align-items: center;
    position: relative;
    min-height: 44px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    flex-direction: column;
    align-items: flex-start;
}

.line-list li .line-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.line-list li .line-info {
    font-size: 12px;
    color: #666;
    opacity: 0.8;
}

/* 加载状态样式 */
.line-list li.loading {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    background: transparent;
    box-shadow: none;
    border: 1px dashed rgba(0, 0, 0, 0.1);
    color: #666;
    font-size: 14px;
}

.spinner {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 离线线路样式 */
.line-list li.offline {
    opacity: 0.6;
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.line-list li.offline .line-name {
    text-decoration: line-through;
}

.line-list li.offline::after {
    content: "离线";
    position: absolute;
    right: 20px;
    color: #e74c3c;
    font-weight: normal;
    font-size: 12px;
}

/* 添加指示器，类似iOS的下拉指示器 */
.panel-header:before {
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}