/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 防止所有设备横向滚动 */
html {
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    color: #2c3e50;
    line-height: 1.6;
    height: 100vh; /* 固定高度 */
    background: linear-gradient(180deg, #FFF9E6 0%, #FFE4B3 20%, #B8E6F6 50%, #7DD3E8 75%, #4FC3E8 100%);
    background-attachment: fixed;
    position: relative;
    overflow: hidden; /* 禁止body滚动 */
    max-width: 100%;
    width: 100%;
}

/* 波浪背景 */
body::before,
body::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 300px;
    bottom: 0;
    left: -50%;
    z-index: 0;
}

body::before {
    background: rgba(100, 200, 230, 0.3);
    border-radius: 45% 55% 50% 50%;
    animation: wave 18s ease-in-out infinite;
    bottom: -80px;
}

body::after {
    background: rgba(79, 195, 232, 0.2);
    border-radius: 55% 45% 50% 50%;
    animation: wave 25s ease-in-out infinite reverse;
    bottom: -120px;
}

@keyframes wave {
    0%, 100% {
        transform: translateX(0) translateY(0);
    }
    50% {
        transform: translateX(-25%) translateY(-30px);
    }
}

/* 主容器 */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh; /* 固定高度 */
    position: relative;
    z-index: 1;
    overflow: hidden; /* 禁止容器滚动 */
    max-width: 100%;
    width: 100%;
}

/* 顶部标题栏 - 透明毛玻璃效果 */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(31, 38, 135, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.app-title {
    font-size: 28px;
    font-weight: 700;
    color: #1565c0;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-check-task {
    color: #1565c0;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(31, 38, 135, 0.1);
    cursor: pointer;
}

.btn-check-task:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(31, 38, 135, 0.15);
}

.admin-link {
    color: #1565c0;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(31, 38, 135, 0.1);
    cursor: pointer;
}

.admin-link:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(31, 38, 135, 0.15);
}

/* 主内容区 - 左右两栏 */
.app-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    overflow: hidden; /* 禁止主内容区滚动 */
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
    height: calc(100vh - 88px); /* 固定高度 */
}

/* 平板及以下改为单列 */
@media (max-width: 992px) {
    body {
        height: auto; /* 移动端允许高度自适应 */
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto; /* 允许整体滚动 */
    }
    
    .app-container {
        height: auto; /* 自适应高度 */
        min-height: 100vh;
        overflow: visible;
    }
    
    .app-main {
        grid-template-columns: 1fr; /* 单列 */
        height: auto; /* 自适应高度 */
        min-height: calc(100vh - 88px);
        overflow: visible; /* 允许内容溢出 */
        flex: none;
    }
    
    .left-panel,
    .right-panel {
        height: auto; /* 自适应内容高度 */
        min-height: 400px;
        overflow: visible; /* 不需要内部滚动 */
    }
    
    .card {
        height: auto; /* 自适应内容高度 */
    }
}

/* 左侧面板 */
.left-panel {
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* 只禁止横向滚动 */
    overflow-y: auto;   /* 允许纵向滚动 */
    min-width: 0;
    max-width: 100%;
    height: 100%;
    /* 移动端触摸滚动优化 */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* 右侧面板 */
.right-panel {
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* 只禁止横向滚动 */
    overflow-y: auto;   /* 允许纵向滚动 */
    min-width: 0;
    max-width: 100%;
    height: 100%;
    /* 移动端触摸滚动优化 */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* 卡片 - 透明毛玻璃风格 */
.card {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    animation: slideUp 0.5s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-x: hidden; /* 只禁止横向滚动 */
    min-width: 0;
    max-width: 100%;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 卡片头部 */
.card-header {
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px 20px 0 0;
}

.card-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1565c0;
    margin: 0;
}

.badge {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.btn-icon {
    background: transparent;
    border: none;
    color: #78909c;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #1565c0;
}

/* 卡片主体 */
.card-body {
    padding: 35px 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
    /* 移动端触摸滚动优化 */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* 右侧卡片样式 */
.right-panel .card {
    display: flex;
    flex-direction: column;
}

.right-panel .card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: center; /* 垂直居中 */
}

/* 表单样式 */
.form-group {
    margin-bottom: 22px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 8px;
}

.required {
    color: #e74c3c;
}

.optional {
    color: #90a4ae;
    font-weight: normal;
    font-size: 11px;
}

.form-input,
.form-textarea {
    width: 100%;
    max-width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    color: #2c3e50;
    box-sizing: border-box;
    min-width: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
}

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

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: rgba(30, 136, 229, 0.6);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

.input-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.input-hint {
    padding: 6px 12px;
    background: rgba(25, 118, 210, 0.1);
    border: 1px solid rgba(25, 118, 210, 0.3);
    border-radius: 8px;
    color: #1976d2;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #1976d2;
    font-weight: 500;
    transition: color 0.3s ease;
}

/* 单选按钮 */
.radio-group-inline {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}

.radio-label-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-label-inline input[type="radio"] {
    cursor: pointer;
    accent-color: #1e88e5;
}

.radio-label-inline span {
    font-size: 14px;
    color: #34495e;
}

/* 按钮 */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 136, 229, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* 禁用状态的按钮 */
.btn-primary:disabled,
.btn-primary.btn-disabled {
    background: rgba(236, 239, 241, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #90a4ae;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-primary:disabled:hover,
.btn-primary.btn-disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: rgba(236, 239, 241, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #546e7a;
}

.btn-secondary:hover {
    background: rgba(207, 216, 220, 0.6);
}

/* 灰色禁用状态（用于已完成的Test IMAP按钮）*/
.btn-secondary:disabled,
.btn-secondary.btn-disabled {
    background: rgba(189, 189, 189, 0.3);
    color: #90a4ae;
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-secondary:disabled:hover,
.btn-secondary.btn-disabled:hover {
    background: rgba(189, 189, 189, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 欢迎状态 */
.welcome-status {
    text-align: center;
    padding: 40px 20px;
    /* 确保在卡片中居中 */
    margin: auto 0;
}

.welcome-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.welcome-status h3 {
    font-size: 22px;
    color: #1565c0;
    margin-bottom: 10px;
}

.welcome-status p {
    color: #546e7a;
    margin-bottom: 30px;
    font-size: 14px;
}

.features-list {
    text-align: left;
    max-width: 350px;
    margin: 0 auto;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    color: #37474f;
    font-size: 14px;
}

.check-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

/* 进度状态 */
#progressStatus {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 任务信息 */
.task-info {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 15px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.info-label {
    color: #546e7a;
    font-weight: 500;
}

.task-info code {
    font-family: 'Courier New', monospace;
    background: rgba(227, 242, 253, 0.6);
    backdrop-filter: blur(5px);
    padding: 3px 8px;
    border-radius: 5px;
    color: #1565c0;
    font-size: 12px;
}

.status-badge {
    color: #1e88e5;
    background: rgba(227, 242, 253, 0.6);
    backdrop-filter: blur(5px);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
}

/* 进度条样式已移除 - 不再需要 */

/* 日志容器 */
.log-container {
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    max-height: 400px;
    overflow: hidden;
}

.log-header {
    padding: 10px 15px;
    background: #37474f;
    color: white;
    font-size: 13px;
    font-weight: 600;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.log-content {
    padding: 10px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    border-radius: 0 0 12px 12px;
    overflow-y: auto;
    flex: 1;
    max-height: 350px;
}

.log-entry {
    padding: 6px 10px;
    margin-bottom: 3px;
    border-radius: 5px;
    display: flex;
    gap: 10px;
    animation: logSlideIn 0.3s ease;
}

@keyframes logSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.log-time {
    color: #90a4ae;
    min-width: 65px;
    flex-shrink: 0;
}

.log-message {
    flex: 1;
    word-break: break-word;
    overflow-wrap: break-word; /* 强制长单词换行 */
    max-width: 100%;
}

.log-info {
    background: rgba(227, 242, 253, 0.4);
    backdrop-filter: blur(5px);
    color: #0d47a1;
    border-left: 3px solid #1e88e5;
}

.log-success {
    background: rgba(232, 245, 233, 0.4);
    backdrop-filter: blur(5px);
    color: #2e7d32;
    border-left: 3px solid #4caf50;
}

.log-warning {
    background: rgba(255, 243, 224, 0.4);
    backdrop-filter: blur(5px);
    color: #e65100;
    border-left: 3px solid #ff9800;
}

.log-error {
    background: rgba(255, 235, 238, 0.4);
    backdrop-filter: blur(5px);
    color: #c62828;
    border-left: 3px solid #f44336;
}

/* 短信验证 */
.sms-section {
    margin: 20px 0;
    padding: 20px;
    background: rgba(255, 193, 7, 0.15);
    border: 2px solid rgba(255, 193, 7, 0.5);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sms-alert {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.sms-icon {
    font-size: 32px;
    flex-shrink: 0;
    animation: pulse 2s ease-in-out infinite;
}

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

.sms-text strong {
    display: block;
    font-size: 16px;
    color: #f57c00;
    margin-bottom: 5px;
}

.sms-text p {
    margin: 0;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.7);
}

.sms-input-group {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.sms-code-input {
    flex: 1;
    height: 48px;
    padding: 0 16px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 8px;
    text-align: center;
    border: 2px solid rgba(255, 152, 0, 0.5);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: #e65100;
    transition: all 0.3s ease;
}

.sms-code-input:focus {
    outline: none;
    border-color: #ff9800;
    box-shadow: 0 0 0 4px rgba(255, 152, 0, 0.2);
    background: #fff;
}

.sms-code-input::placeholder {
    color: rgba(230, 81, 0, 0.3);
    letter-spacing: 6px;
}

#submitSmsBtn {
    height: 48px;
    padding: 0 24px;
    white-space: nowrap;
    font-weight: 600;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}

#submitSmsBtn:hover {
    background: linear-gradient(135deg, #fb8c00 0%, #ef6c00 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 152, 0, 0.5);
}

#submitSmsBtn:active {
    transform: translateY(0);
}

/* 废弃的 alert-box 样式（已用 sms-alert 代替）*/
.alert-box {
    display: none;
}

/* 结果显示 */
#resultDisplay {
    padding: 15px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    margin-top: 15px;
    flex-shrink: 0;
}

#resultDisplay.success {
    background: rgba(232, 245, 233, 0.5);
    border: 1px solid rgba(129, 199, 132, 0.6);
}

#resultDisplay.error {
    background: rgba(255, 235, 238, 0.5);
    border: 1px solid rgba(229, 115, 115, 0.6);
}

#resultDisplay h3 {
    font-size: 18px;
    margin: 0;
    color: #2e7d32;
}

#resultDisplay.error h3 {
    color: #c62828;
}

#resultDisplay p {
    margin: 8px 0;
    font-size: 13px;
}

#resultDisplay code {
    background: rgba(0, 0, 0, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* 操作按钮 */
.action-buttons {
    text-align: center;
}

/* 清除配置按钮 */
.btn-clear-config {
    background: transparent;
    border: none;
    color: #78909c;
    font-size: 12px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
}

.btn-clear-config:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #f44336;
}

/* 折叠区域 */
.collapsible-section {
    margin-bottom: 22px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.15);
}

.collapsible-header:hover {
    background: rgba(255, 255, 255, 0.25);
}

.collapsible-title {
    font-size: 14px;
    font-weight: 600;
    color: #1565c0;
}

.collapse-icon {
    transition: transform 0.3s ease;
    color: #1565c0;
}

.collapsible-header.active .collapse-icon {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.collapsible-content.active {
    max-height: 1000px;
    padding: 20px 18px;
}

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

.imap-hints {
    padding: 8px 18px 0;
    opacity: 0.8;
}

/* 滚动条样式已移除 - 不允许滚动 */

/* ==================== 响应式设计 ==================== */

/* 大屏幕优化 (1400px以下) */
@media (max-width: 1400px) {
    .app-main {
        gap: 15px;
        padding: 15px 30px;
    }
}

/* 平板横屏 (1200px以下) */
@media (max-width: 1200px) {
    .app-main {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .left-panel,
    .right-panel {
        flex: none;
        width: 100%;
        height: auto;
        max-height: none;
    }

    .card {
        height: auto;
        min-height: auto;
    }

    .card-body {
        padding: 30px;
    }
    
    /* 移动端优化已在 992px 断点处理 */
}

/* 平板竖屏和手机 (768px以下) */
@media (max-width: 768px) {
    .app-header {
        padding: 15px 20px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .app-title {
        font-size: 22px;
    }
    
    /* 查询任务按钮优化 */
    .btn-check-task {
        font-size: 13px;
        padding: 10px 16px;
        white-space: nowrap;
    }

    .app-main {
        display: flex; /* 改为 flex 布局 */
        flex-direction: column-reverse; /* 日志在上，表单在下 */
        padding: 15px;
        gap: 15px;
    }

    .left-panel,
    .right-panel {
        flex: none;
        width: 100%;
        height: auto; /* 自适应高度 */
        min-height: 350px;
        max-height: none;
        overflow: visible; /* 不需要内部滚动 */
    }
    
    .card {
        height: auto; /* 自适应高度 */
    }
    
    .card-body {
        max-height: none; /* 移除最大高度限制 */
        overflow: visible; /* 允许内容完整显示 */
    }
    
    /* 日志容器在移动端自适应高度 */
    .log-container {
        max-height: none;
    }
    
    .log-content {
        max-height: 500px; /* 移动端限制日志高度 */
        overflow-y: auto;
    }

    .card-header {
        padding: 18px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .card-header h2 {
        font-size: 18px;
    }

    .card-body {
        padding: 20px;
    }

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

    /* 输入框组优化 */
    .input-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .input-group input {
        width: 100% !important;
        flex: 1 !important;
    }

    /* 单选按钮组保持横向 */
    .radio-group-inline {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
    }

    /* 按钮优化 */
    .form-actions {
        flex-direction: column;
        gap: 12px;
    }

    .btn {
        width: 100%;
        padding: 13px 20px;
        font-size: 15px;
        min-height: 48px; /* 触摸友好 */
    }
    
    .btn-primary {
        font-weight: 600;
    }

    /* 日志区域 */
    .log-content {
        height: 200px;
        font-size: 12px;
    }

    /* 欢迎页面 */
    .welcome-icon {
        font-size: 48px;
    }

    .welcome-status {
        padding: 25px 20px;
    }

    .welcome-status h3 {
        font-size: 20px;
    }
    
    .welcome-status p {
        font-size: 14px;
    }

    .features-list {
        max-width: 100%;
        gap: 12px;
    }
    
    .feature-item {
        font-size: 14px;
    }

    /* 任务信息 */
    .task-info {
        padding: 12px;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .status-badge {
        align-self: flex-start;
    }

    /* 结果显示 */
    #resultDisplay {
        padding: 15px;
    }

    #resultDisplay .detail-item {
        flex-direction: column;
        gap: 5px;
    }

    #resultDisplay .detail-item strong {
        min-width: auto;
    }
    
    /* 验证码输入优化 */
    .sms-section {
        padding: 18px;
    }
    
    .sms-input-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .sms-code-input {
        font-size: 18px;
        padding: 14px;
        text-align: center;
    }
}

/* 小屏手机 (480px以下) */
@media (max-width: 480px) {
    .app-header {
        padding: 12px 15px;
    }

    .app-title {
        font-size: 18px;
        font-weight: 600;
    }
    
    /* 头部按钮 */
    .btn-check-task {
        font-size: 12px;
        padding: 8px 12px;
    }

    .app-main {
        padding: 12px;
        gap: 12px;
    }
    
    .left-panel,
    .right-panel {
        min-height: 300px;
    }

    .card-header {
        padding: 15px;
    }
    
    .card-header h2 {
        font-size: 16px;
    }

    .card-body {
        padding: 18px 15px;
    }

    .form-group {
        margin-bottom: 16px;
    }
    
    .form-label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .form-hint {
        font-size: 11px;
    }

    .form-input,
    .query-input {
        padding: 12px 14px;
        font-size: 14px;
        min-height: 44px; /* 触摸友好 */
    }

    .btn {
        padding: 12px 18px;
        font-size: 14px;
        min-height: 44px;
    }
    
    /* 清除配置按钮 */
    .btn-clear-config {
        font-size: 12px;
        padding: 8px 12px;
    }

    /* 日志区域优化 */
    .log-content {
        height: 180px;
        font-size: 11px;
    }
    
    .log-time {
        font-size: 10px;
    }
    
    .log-message {
        font-size: 11px;
    }
    
    /* 欢迎界面 */
    .welcome-icon {
        font-size: 42px;
    }
    
    .welcome-status h3 {
        font-size: 18px;
    }
    
    .welcome-status p {
        font-size: 13px;
    }
    
    .feature-item {
        font-size: 13px;
    }
    
    /* 折叠区域提示 */
    .imap-hints {
        font-size: 10px;
    }
    
    /* 验证码输入 */
    .sms-section {
        padding: 15px;
    }
    
    .sms-alert {
        gap: 10px;
    }
    
    .sms-icon {
        font-size: 32px;
    }
    
    .sms-text strong {
        font-size: 14px;
    }
    
    .sms-text p {
        font-size: 12px;
    }
    
    .sms-code-input {
        font-size: 20px;
        padding: 16px;
        letter-spacing: 8px;
    }
}

/* ==================== 横屏模式优化 ==================== */
@media (max-height: 600px) and (orientation: landscape) {
    .app-container {
        height: 100vh; /* 固定高度 */
    }
    
    body {
        overflow: hidden; /* 横屏模式禁止滚动 */
    }
    
    .app-header {
        padding: 10px 20px;
    }
    
    .app-title {
        font-size: 18px;
    }
    
    .btn-check-task {
        font-size: 12px;
        padding: 8px 14px;
    }
    
    .app-main {
        display: grid;
        grid-template-columns: 1fr 1fr; /* 横屏时左右布局 */
        padding: 12px;
        gap: 12px;
        height: calc(100vh - 56px); /* 固定高度 */
        overflow: hidden; /* 禁止滚动 */
    }
    
    .left-panel,
    .right-panel {
        height: 100%;
        overflow-y: auto; /* 内部可滚动 */
        overflow-x: hidden;
    }
    
    .card {
        height: 100%;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .log-content {
        max-height: calc(100vh - 240px);
    }
    
    .welcome-status {
        padding: 20px;
    }
    
    .log-content {
        height: 250px;
    }
}

/* ==================== 触摸设备优化 ==================== */
@media (hover: none) and (pointer: coarse) {
    /* 增大触摸目标 */
    .btn,
    .form-input,
    .query-input,
    .sms-code-input {
        min-height: 48px;
    }
    
    .btn-check-task,
    .btn-icon {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* 移除 hover 效果 */
    .btn:hover,
    .form-input:hover,
    .card:hover {
        transform: none;
    }
    
    /* 保留 active 效果 */
    .btn:active {
        transform: scale(0.97);
        transition: transform 0.1s;
    }
}

/* ==================== iPad Pro 优化 ==================== */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: portrait) {
    .app-main {
        flex-direction: column;
        gap: 20px;
        padding: 20px 30px;
    }
    
    .card-body {
        padding: 35px;
    }
}

/* 美化滚动条样式 */
/* Webkit浏览器 (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.35);
}

/* 为卡片内部滚动条添加更细腻的样式 */
.card-body::-webkit-scrollbar,
.log-content::-webkit-scrollbar {
    width: 6px;
    }

.card-body::-webkit-scrollbar-track,
.log-content::-webkit-scrollbar-track {
    background: transparent;
    }

.card-body::-webkit-scrollbar-thumb,
.log-content::-webkit-scrollbar-thumb {
    background: rgba(100, 181, 246, 0.3);
        border-radius: 10px;
    }

.card-body::-webkit-scrollbar-thumb:hover,
.log-content::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 181, 246, 0.6);
    }

/* Firefox浏览器 */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.05);
    }

.card-body,
.log-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 181, 246, 0.3) transparent;
    }

/* 查询结果状态徽章 */
.result-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.result-status-badge.success {
    background: rgba(76, 175, 80, 0.2);
    color: #2e7d32;
    border: 1px solid rgba(76, 175, 80, 0.5);
}

.result-status-badge.pending {
    background: rgba(255, 152, 0, 0.2);
    color: #e65100;
    border: 1px solid rgba(255, 152, 0, 0.5);
}

.result-status-badge.running {
    background: rgba(33, 150, 243, 0.2);
    color: #1565c0;
    border: 1px solid rgba(33, 150, 243, 0.5);
    animation: pulse-running 2s ease-in-out infinite;
}

@keyframes pulse-running {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

