/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS变量定义，方便统一管理颜色主题 */
:root {
    --primary-gradient: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --secondary-gradient: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    --accent-color: #4cc9f0;
    --text-color: #2b2d42;
    --text-light: #6c757d;
    --background-color: #f8f9fa;
    --card-bg: rgba(255, 255, 255, 0.95);
    --border-color: #e9ecef;
    --success-color: #4cc9f0;
    --success-background: #e6f7ff;
    --success-text: #0066cc;
    --warning-color: #ffd166;
    --danger-color: #ef476f;
    --error-color: #ef476f;
    --error-background: #ffe6e6;
    --error-text: #cc0000;
    --info-color: #4361ee;
    --info-background: #f0f4ff;
    --info-text: #1a365d;
    --cancel-color: #f0f0f0;
    --scrollbar-track: #f1f1f1;
    --scrollbar-thumb: #c1c1c1;
    --scrollbar-thumb-hover: #a8a8a8;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--background-color);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 现代导航栏设计 */
.modern-nav {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
    color: white;
    padding: 0;
    margin-bottom: 30px;
    border-radius: 0;
    position: relative;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.15);
    animation: navBreathing 6s ease-in-out infinite;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 9999; /* 设置导航栏的z-index，确保在页面内容之上 */
}

.modern-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 8s ease-in-out infinite;
}

@keyframes navBreathing {
    0%, 100% {
        box-shadow: 0 4px 25px rgba(102, 126, 234, 0.3);
        transform: translateY(0);
    }
    50% {
        box-shadow: 0 6px 35px rgba(102, 126, 234, 0.4);
        transform: translateY(-1px);
    }
}

@keyframes shimmer {
    0%, 100% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 90px;
    gap: 40px;
}

.nav-brand {
    flex-shrink: 0;
    padding: 0;
    min-width: 200px;
}

.nav-brand h1 {
    font-size: 1.6rem;
    margin: 0;
    font-weight: 700;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
    position: relative;
    padding-right: 20px;
    line-height: 1.2;
}

.nav-brand h1::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 30px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.5), transparent);
}

.nav-brand:hover h1 {
    transform: scale(1.02);
    text-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.nav-content {
    display: flex;
    align-items: center;
    gap: 30px;
    flex: 1;
    justify-content: space-between;
    min-width: 0;
}

.nav-menu {
    display: flex;
    gap: 0;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 6px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    min-width: 0;
    order: 1;
}

.nav-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
    min-width: 0;
    order: 2;
}

.user-info-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 6px 8px 6px 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.user-info-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.user-info-container:hover::before {
    left: 100%;
}

.welcome-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    margin: 0;
}

.user-divider {
    width: 1px;
    height: 20px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.3), transparent);
    flex-shrink: 0;
}

.logout-btn {
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.logout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.2), transparent);
    transition: left 0.6s ease;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

.logout-btn:hover::before {
    left: 100%;
}

.nav-menu {
    display: flex;
    gap: 0;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 6px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    min-width: 0;
}

.nav-item {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
    margin: 0 1px;
    white-space: nowrap;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-item:hover::before {
    left: 100%;
}

/* 当前页面高亮效果 */
.nav-item.active {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-weight: 600;
}

.nav-item.logout {
    margin-left: 5px;
}

.nav-item.logout:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* 为其他页面的返回按钮保留样式 */
.back-btn {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* 悬停效果 */
.logout-btn:hover, .history-btn:hover, .back-btn:hover, .calculator-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* 点击效果 */
.logout-btn:active, .history-btn:active, .back-btn:active, .calculator-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* 中等屏幕响应式设计 */
@media (max-width: 1100px) {
    .nav-container {
        padding: 0 30px;
        gap: 30px;
        min-height: 80px;
    }
    
    .nav-brand h1 {
        font-size: 1.4rem;
        padding-right: 15px;
    }
    
    .nav-content {
        gap: 25px;
    }
    
    .nav-item {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .user-info-container {
        padding: 5px 6px 5px 10px;
    }
    
    .welcome-text {
        font-size: 0.8rem;
    }
    
    .logout-btn {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
}

/* 小屏幕响应式设计 - 移动端优化 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 10px;
        min-height: auto;
        padding: 12px 10px;
    }
    
    .nav-brand {
        min-width: auto;
        text-align: center;
        order: 1;
    }
    
    .nav-brand h1 {
        font-size: 1.2rem;
        justify-content: center;
        text-align: center;
        padding-right: 0;
        margin-bottom: 3px;
    }
    
    .nav-brand h1::after {
        content: none;
    }
    
    .nav-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        width: 100%;
        order: 2;
    }
    
    .nav-user-info {
        justify-content: center;
        width: 100%;
        order: 1;
    }
    
    .user-info-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        padding: 6px 15px;
        width: auto;
        max-width: 320px;
        margin: 0 auto;
        min-width: 200px;
    }
    
    .welcome-text {
        flex: 1;
        min-width: 0;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .logout-btn {
        flex-shrink: 0;
        min-width: 70px;
        white-space: nowrap;
    }
    
    .user-divider {
        width: 1px;
        height: 20px;
        background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.3), transparent);
    }
    
    .nav-menu {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 1px;
        width: 100%;
        order: 2;
        margin-top: 8px;
        overflow-x: auto;
        padding: 4px 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .nav-menu::-webkit-scrollbar {
        display: none;
    }
    
    .nav-item {
        padding: 5px 6px;
        font-size: 0.75rem;
        margin: 0;
        text-align: center;
        min-width: auto;
        flex: 0 0 auto;
        white-space: nowrap;
        position: relative;
    }
    
    .nav-item:not(:last-child)::after {
        content: '';
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 1px;
        height: 70%;
        background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.4), transparent);
    }
    
    .nav-menu::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 1px;
        height: 70%;
        background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.4), transparent);
    }
    
    .welcome-text {
        font-size: 0.85rem;
    }
    
    .logout-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    /* 超小屏幕优化 */
    @media (max-width: 480px) {
        .nav-container {
            padding: 15px 10px;
            gap: 15px;
        }
        
        .nav-brand h1 {
            font-size: 1.2rem;
        }
        
        .user-info-container {
            padding: 6px 12px;
            gap: 8px;
        }
        
        .nav-menu {
            gap: 1px;
        }
        
        .nav-item {
            padding: 5px 6px;
            font-size: 0.75rem;
            min-width: auto;
        }
        
        .welcome-text {
            font-size: 0.8rem;
        }
        
        .logout-btn {
            padding: 5px 10px;
            font-size: 0.8rem;
        }
    }
}

/* 主内容区域 */
main {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

/* 防止内容过度滚动的容器 */
.content-wrapper {
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    position: relative;
    scroll-snap-type: y mandatory;
}

.content-wrapper > div {
    scroll-snap-align: start;
}

/* 禁止滚动超出内容范围 */
.content-wrapper {
    scrollbar-gutter: stable;
}

/* 自定义滚动条样式 */
.content-wrapper::-webkit-scrollbar {
    width: 6px;
}

.content-wrapper::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

.content-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 3px;
}

.content-wrapper::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
}

/* 手机端增强滚动体验 */
@media (max-width: 768px) {
    body {
        -webkit-overflow-scrolling: touch;
    }
    
    .content-wrapper {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}

main:hover {
    box-shadow: var(--shadow-hover);
}

/* 业务单上传区域 */
.upload-section {
    margin-bottom: 35px;
    text-align: center;
}

.upload-container {
    background: linear-gradient(145deg, #ffffff 0%, #f5f5f5 100%);
    padding: 30px;
    border-radius: 20px;
    border: 2px dashed var(--primary-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.upload-container:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.15);
    transform: translateY(-2px);
}

.upload-container h3 {
    margin-bottom: 20px;
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 600;
}

.upload-area {
    background: white;
    border: 2px dashed var(--border-color);
    border-radius: 15px;
    padding: 40px 20px;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #f7fafc;
    transform: scale(1.02);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(67, 97, 238, 0.05);
    transform: scale(1.05);
}

/* 上传区域增强样式 */
.upload-icon {
    font-size: 5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
    100% { transform: scale(1); opacity: 1; }
}

.camera-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 15px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 上传进度条样式 */
.progress-container {
    margin-top: 20px;
    height: 12px;
    width: 100%;
    background: rgba(67, 97, 238, 0.1);
    border-radius: 10px;
    overflow: hidden;
    display: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progress 1.5s infinite;
}

@keyframes progress {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 响应式设计：PC端隐藏拍照按钮 */
@media (min-width: 768px) {
    .camera-btn {
        display: none !important;
    }
}

.camera-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
}

/* 输入框与按钮组合样式 */
.input-with-btn {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-with-btn input {
    flex: 1;
}

/* OCR填入按钮样式 */
.ocr-fill-btn, .camera-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 14px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    min-width: 120px;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.ocr-fill-btn::before, .camera-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.5s;
}

.ocr-fill-btn:hover::before, .camera-btn:hover::before {
    left: 100%;
}

.ocr-fill-btn:hover, .camera-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.4);
}

/* OCR结果区域样式 */
.ocr-result-section {
    margin: 25px 0;
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.ocr-result-section:hover {
    box-shadow: var(--shadow-hover);
}

.ocr-result-section h3 {
    margin-bottom: 15px;
    color: var(--text-color);
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ocr-text-content {
    background: #fafbfc;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    min-height: 220px;
    max-height: 450px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.8;
    font-family: 'Segoe UI', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1rem;
    color: var(--text-color);
    user-select: text;
    margin-bottom: 20px;
    position: relative;
    background-image: linear-gradient(rgba(67, 97, 238, 0.02) 1px, transparent 1px);
    background-size: 100% 28px;
}

/* 滚动条美化 */
.ocr-text-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.ocr-text-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.ocr-text-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
    opacity: 0.6;
    transition: var(--transition);
}

.ocr-text-content::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
    opacity: 0.8;
}

/* 表单字段高亮样式 */
.ocr-char.highlight-name {
    background-color: rgba(255, 236, 179, 0.8) !important;
    color: #e65100;
    border: 1px solid #ffb74d;
    border-radius: 4px;
    padding: 2px 4px;
    transition: var(--transition);
}

.ocr-char.highlight-name:hover {
    background-color: #ffecb3 !important;
    transform: scale(1.05);
}

.ocr-char.highlight-phone {
    background-color: rgba(200, 230, 201, 0.8) !important;
    color: #2e7d32;
    border: 1px solid #81c784;
    border-radius: 4px;
    padding: 2px 4px;
    transition: var(--transition);
}

.ocr-char.highlight-phone:hover {
    background-color: #c8e6c9 !important;
    transform: scale(1.05);
}

.ocr-char.highlight-id {
    background-color: rgba(225, 190, 231, 0.8) !important;
    color: #4a148c;
    border: 1px solid #ba68c8;
    border-radius: 4px;
    padding: 2px 4px;
    transition: var(--transition);
}

.ocr-char.highlight-id:hover {
    background-color: #e1bee7 !important;
    transform: scale(1.05);
}

.ocr-char.highlight-address {
    background-color: rgba(248, 187, 208, 0.8) !important;
    color: #c2185b;
    border: 1px solid #f48fb1;
    border-radius: 4px;
    padding: 2px 4px;
    transition: var(--transition);
}

.ocr-char.highlight-address:hover {
    background-color: #f8bbd0 !important;
    transform: scale(1.05);
}

.ocr-char.highlight-account {
    background-color: rgba(209, 196, 233, 0.8) !important;
    color: #512da8;
    border: 1px solid #b39ddb;
    border-radius: 4px;
    padding: 2px 4px;
    transition: var(--transition);
}

.ocr-char.highlight-account:hover {
    background-color: #d1c4e9 !important;
    transform: scale(1.05);
}

.ocr-char.highlight-other {
    background-color: rgba(245, 245, 245, 0.8) !important;
    color: #212121;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 2px 4px;
    transition: var(--transition);
}

.ocr-char.highlight-other:hover {
    background-color: #f5f5f5 !important;
    transform: scale(1.05);
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
    transition: var(--transition);
}

.form-group:hover {
    transform: translateX(2px);
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: white;
    color: var(--text-color);
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="date"]:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
    transform: translateY(-1px);
}

.form-group input[type="text"]::placeholder,
.form-group input[type="password"]::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

/* 单选按钮样式 */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 8px;
}

.radio-group label {
    display: flex;
    align-items: center;
    font-weight: 400;
    cursor: pointer;
    gap: 6px;
    margin-bottom: 0;
}

.radio-group input[type="radio"] {
    width: auto;
    height: 18px;
    width: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* 备注区域样式 */
.remark-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* 单选区域样式 - 用于包裹标题和选项组 */
.radio-section {
    margin-bottom: 15px;
}

.radio-section:last-child {
    margin-bottom: 0;
}

/* 单选标题样式 */
.radio-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
    display: block;
}

/* 模板按钮样式 */
.template-options {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.template-btn {
    padding: 12px 24px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.template-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.template-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.template-btn.active:hover {
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.4);
}

/* 提交按钮样式 */
.submit-btn, .sync-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    font-family: inherit;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.submit-btn {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.5s;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.4);
}

.sync-btn {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.sync-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* FTTR模板类型选项在手机端显示为2列 */
    #fttr-form .radio-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    #fttr-form .radio-group label {
        margin: 0;
        padding: 10px;
        background: #f8f9fa;
        border-radius: 8px;
        text-align: center;
        border: 2px solid transparent;
        transition: all 0.3s ease;
    }
    
    #fttr-form .radio-group label:hover {
        background: #e9ecef;
        border-color: #667eea;
    }
    
    #fttr-form .radio-group input[type="radio"] {
        margin-right: 5px;
    }
    .container {
        padding: 10px;
    }
    
    main {
        padding: 20px;
        border-radius: 15px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-icon {
        font-size: 4rem;
    }
    
    /* 移动设备上优化输入框与按钮的布局 */
    .input-with-btn {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .ocr-fill-btn, .submit-btn, .sync-btn {
        width: 100%;
        min-width: auto;
    }
    
    /* OCR结果区域优化 */
    .ocr-text-content {
        max-height: 300px;
        font-size: 0.95rem;
    }
    
    /* 模板选择按钮响应式 */
    .template-options {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .template-btn {
        width: 100%;
        max-width: 300px;
        padding: 12px 20px;
    }
    
    /* 表单按钮组响应式 */
    form > div:last-child,
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
}

/* 表单操作区域样式 */
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

/* 上传选择弹窗按钮样式 */
.camera-btn, .album-btn, .cancel-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    font-family: inherit;
}

.camera-btn {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
    min-width: 120px;
}

.camera-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.4);
}

.album-btn {
    background: var(--secondary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.3);
    min-width: 120px;
}

.album-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(118, 75, 162, 0.4);
}

.cancel-btn {
    background: var(--cancel-color);
    color: var(--text-color);
    box-shadow: 0 4px 10px rgba(203, 203, 203, 0.3);
    padding: 10px 30px;
}

.cancel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(203, 203, 203, 0.4);
}

/* 选择器和下拉框增强样式 */
select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.5em 1.5em;
    padding-right: 3rem;
}

/* 焦点状态增强 */
input:focus, select:focus, textarea:focus {
    outline: 3px solid rgba(67, 97, 238, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* 自定义复选框和单选框 */
input[type="checkbox"], input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    background-color: white;
    cursor: pointer;
    position: relative;
    margin-right: 8px;
    vertical-align: middle;
    transition: var(--transition);
}

input[type="checkbox"]:checked, input[type="radio"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

input[type="checkbox"]:checked::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

input[type="radio"] {
    border-radius: 50%;
}

input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: white;
}

/* 滚动条美化增强 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* 加载动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    border: 3px solid rgba(67, 97, 238, 0.1);
    border-radius: 50%;
    border-top: 3px solid var(--primary-color);
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-left: 10px;
}

/* 成功/错误提示样式 */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    background: #4CAF50;
    color: white;
    border: none;
}

.notification.error {
    background: var(--error-background);
    color: var(--error-text);
    border-left: 5px solid var(--error-color);
}

.notification.info {
    background: var(--info-background);
    color: var(--info-text);
    border-left: 5px solid var(--info-color);
}

@media (max-width: 480px) {
    header {
        padding: 15px 15px;
        flex-direction: column;
        gap: 15px;
        border-radius: 15px;
    }
    
    header h1 {
        font-size: 1.6rem;
    }
    
    header h1::before {
        font-size: 1.3rem;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        justify-content: center;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-group input, .form-group select {
        font-size: 0.9rem;
        padding: 10px 14px;
        border-radius: 10px;
    }
    
    .ocr-text-content {
        max-height: 250px;
        padding: 15px;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

/* 动画和过渡效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.upload-section,
.template-selector,
.template-form.active {
    animation: fadeIn 0.5s ease-out;
}

.template-form {
    display: none;
}

.template-form.active {
    display: block;
}

/* 模态框样式 */
.modal {
    /* 默认隐藏模态框 */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease;
    opacity: 0;
    visibility: hidden;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 当模态框显示时 */
.modal.active {
    opacity: 1;
    visibility: visible;
}

/* 模态框内容基础样式 */
.modal-content {
    background: white;
    padding: 25px;
    border-radius: 24px;
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 当模态框显示时的内容样式 */
.modal.active .modal-content {
    opacity: 1;
}

/* 增强关闭按钮的点击区域和样式 */
.modal .close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: var(--text-light);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    z-index: 10;
}

/* 手机端关闭按钮优化 */
@media (max-width: 768px) {
    .modal .close {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
        font-size: 28px;
        background: rgba(0, 0, 0, 0.1);
    }}


.modal .close:hover {
    color: var(--text-color);
    transform: rotate(90deg);
}

.modal h3 {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 700;
}

/* 模板预览样式 */
.template-preview {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    min-height: 250px;
    max-height: 50vh;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Segoe UI', 'Microsoft YaHei', monospace;
    margin-bottom: 24px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.6;
}

.template-preview:hover {
    border-color: var(--primary-color);
    background-color: #ffffff;
}

/* 模态框按钮容器 */
.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
}

/* 模态框按钮 */
.copy-btn, .save-btn, .confirm-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: inherit;
    flex-shrink: 0;
}

.copy-btn {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.4);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .modal-content {
        padding: 20px;
        max-height: 90vh;
    }
    
    .template-preview {
        padding: 16px;
        min-height: 200px;
        font-size: 0.9rem;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .copy-btn, .save-btn, .confirm-btn {
        width: 100%;
        padding: 14px 20px;
    }
    
    /* 模板记录页面按钮 - 手机端样式统一 */
    .template-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .template-actions .view-btn, 
    .template-actions .copy-btn, 
    .template-actions .delete-btn {
        width: 100%;
        padding: 12px 20px;
        min-width: auto;
        font-size: 1rem;
    }
}

.save-btn {
    background: var(--success-color);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 201, 240, 0.3);
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(76, 201, 240, 0.4);
}

/* 保存至个人待办按钮样式 */
.save-todo-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.save-todo-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.save-todo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.4);
}

/* 手机端保存按钮样式 */
@media (max-width: 768px) {
    .save-todo-section {
        margin-top: 20px;
        padding-top: 15px;
    }
    
    .save-todo-btn {
        width: 100%;
        padding: 16px 20px;
        font-size: 1rem;
    }
}

.confirm-btn {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.4);
}

/* 模板选择器 */
.template-selector {
    margin-bottom: 40px;
    text-align: center;
    position: relative;
}

.template-selector h2 {
    margin-bottom: 30px;
    color: var(--text-color);
    font-size: 1.8rem;
    font-weight: 700;
    position: relative;
    display: inline-block;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding: 0 10px;
}

.template-selector h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.template-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.template-btn {
    padding: 16px 32px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 160px;
    position: relative;
    overflow: hidden;
}

.template-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.5s;
}

.template-btn:hover::before {
    left: 100%;
}

.template-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.template-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    border-color: #5a6fd8;
}

/* 副卡按钮容器样式 */
.sub-phone-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.add-sub-phone, .remove-sub-phone {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 50px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.add-sub-phone:hover, .remove-sub-phone:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 确保副卡输入框与其他字段大小一致 */
.sub-phone-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sub-phone-item .input-with-btn {
    flex: 1;
}

/* 表单样式 */
.template-form {
    display: none;
    max-width: 800px;
    margin: 0 auto;
}

.template-form.active {
    display: block;
}

.template-form h3 {
    margin-bottom: 30px;
    text-align: center;
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 15px;
}

.template-form h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #4a5568;
    font-size: 1rem;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.radio-group input[type="radio"] {
    width: auto;
}

/* 复选框对齐样式 */
.form-group label[for="sync_fuka"],
.form-group label[for="sync_zhuka"],
.form-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
    padding: 8px 0;
}

.form-group label:has(input[type="checkbox"]) input[type="checkbox"] {
    width: auto;
    margin: 0;
    transform: scale(1.2);
}

/* 副卡号码容器 */
.sub-phone-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.sub-phone-item input {
    flex: 1;
}

.add-sub-phone {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.add-sub-phone:hover {
    background: #218838;
}

.remove-sub-phone {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.remove-sub-phone:hover {
    background: #c82333;
}

/* 提交按钮 */
.submit-btn {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.3s;
    margin-top: 20px;
}

/* 同步按钮 */
.sync-btn {
    flex: 0 0 auto;
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.3s;
    margin-top: 20px;
    min-width: 100px;
}

.sync-btn:hover {
    transform: translateY(-2px);
}

.submit-btn:hover {
    transform: translateY(-2px);
}

/* 同步模态框样式增强 */
#sync-modal.modal-content {
    max-width: 500px;
}

#preview-modal.modal-content {
    max-width: 700px;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #333;
}

.template-preview {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    line-height: 1.8;
}

.save-btn {
    padding: 10px 20px;
    margin: 5px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.save-btn {
    background: #28a745;
    color: white;
}

.save-btn:hover {
    background: #218838;
}

/* 模态框中的复制按钮样式 */
.modal .copy-btn {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 80px;
}

.modal .copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* 同步选项弹窗样式 */
#sync-modal h3 {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 20px;
    text-align: center;
}

.sync-options {
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.sync-option {
    margin-bottom: 15px;
    padding: 12px;
    background-color: white;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.sync-option:hover {
    border-color: #667eea;
    background-color: #f0f4ff;
    transform: translateX(5px);
}

.sync-option input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.sync-option label {
    cursor: pointer;
    font-size: 1rem;
    color: #555;
    display: flex;
    align-items: center;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    margin-top: 25px;
    gap: 10px;
}

.confirm-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 确认模态框样式 */
.confirm-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.confirm-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.confirm-modal h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.confirm-modal p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.confirm-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-btn-primary {
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    color: white;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.confirm-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.confirm-btn-secondary {
    padding: 10px 25px;
    border: 2px solid #6c757d;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    color: #6c757d;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.confirm-btn-secondary:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.2);
}

/* 登录页面样式 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-form {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
}

.login-form h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
}

.login-form h2 {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1.2rem;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.login-btn:hover {
    transform: translateY(-2px);
}

.login-info {
    margin-top: 20px;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

.login-info p {
    margin-bottom: 5px;
}

/* 历史记录页面样式 */
.history-header {
    margin-bottom: 35px;
    text-align: center;
}

.history-header h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.history-header h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.filter-form {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 25px;
    padding: 25px;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-group label {
    font-weight: 600;
    color: #4a5568;
    min-width: 60px;
}

.filter-group select,
.filter-group .search-input {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    transition: all 0.3s ease;
}

.filter-group select:focus,
.filter-group .search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.filter-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.stats {
    text-align: center;
    margin: 25px 0;
    padding: 25px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.stat-items {
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 12px;
    min-width: 140px;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-3px);
}

.stat-number {
    display: block;
    font-size: 2.8rem;
    font-weight: 700;
    color: #667eea;
    text-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
    margin-bottom: 5px;
}

.stat-label {
    color: #718096;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.template-list {
    display: grid;
    gap: 20px;
}

.template-item {
    background: rgba(255, 255, 255, 0.9);
    padding: 25px;
    border-radius: 12px;
    border-left: 5px solid #667eea;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.template-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.template-header h4 {
    color: #333;
}

.template-time {
    color: #666;
    font-size: 0.9rem;
}

.template-content p {
    margin-bottom: 8px;
}

.template-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.batch-actions {
    margin-bottom: 25px;
    text-align: center;
}

.view-btn, .copy-btn, .delete-btn, .delete-all-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 80px;
}

.view-btn {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.view-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.copy-btn {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.delete-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.delete-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.delete-all-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    font-size: 1rem;
    padding: 10px 20px;
    min-width: 160px;
}

.delete-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.template-detail {
    max-height: 400px;
    overflow-y: auto;
}

.detail-section p {
    margin-bottom: 12px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
}

/* 响应式设计 */
@media (min-width: 769px) {
    /* 大屏幕下的样式 */
    .filter-form {
        display: flex;
        align-items: center;
        gap: 20px;
        margin-bottom: 20px;
    }
    
    .filter-group {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .filter-group label {
        font-weight: 500;
        color: #555;
        min-width: 60px;
    }
    
    .filter-form select {
        padding: 8px 12px;
        border: 1px solid #ddd;
        border-radius: 6px;
        font-size: 0.95rem;
        background-color: white;
        min-width: 120px;
    }
    
    /* 搜索区域样式 */
    .search-wrapper {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-left: auto;
    }
    
    .search-input {
        padding: 10px 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        font-size: 0.95rem;
        width: 250px;
        transition: all 0.3s ease;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
    
    .search-input:focus {
        outline: none;
        border-color: #666;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .filter-btn {
        padding: 10px 20px;
        border: none;
        border-radius: 8px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        font-size: 0.95rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        min-width: 100px;
    }
    
    .filter-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    /* 手机导航栏优化 */
    .nav-container {
        padding: 0 10px;
    }
    
    .nav-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-menu {
        width: 100%;
        justify-content: center;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 4px 10px;
    }
    
    .nav-menu::-webkit-scrollbar {
        display: none;
    }
    
    .nav-item {
        padding: 6px 12px;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .welcome-text {
        font-size: 0.9rem;
        text-align: center;
        width: 100%;
    }
    
    .template-options {
        flex-direction: column;
        align-items: center;
    }
    
    .template-btn {
        width: 100%;
        max-width: 300px;
    }
    
    main {
        padding: 20px;
    }
    
    .filter-form {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .filter-group label {
        font-weight: 500;
        color: #555;
    }
    
    .filter-form select {
        padding: 10px 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        font-size: 0.95rem;
        background-color: white;
        width: 100%;
    }
    
    .stat-items {
        gap: 20px;
    }
    
    /* 模态框样式优化 */
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 20px;
        max-height: 90vh;
    }
    
    /* 上传方式弹窗按钮优化 - 移动设备上移，确保在可视区域顶部 */
#upload-choice-modal {
    align-items: flex-start !important;
    justify-content: center !important;
}

#upload-choice-modal .modal-content {
    width: 90%;
    max-width: 320px;
    margin: 10vh auto 0 !important;
    transform: translateY(0) !important;
    top: 0 !important;
}

#upload-choice-modal.active {
    align-items: flex-start !important;
    justify-content: center !important;
}

#upload-choice-modal.active .modal-content {
    transform: translateY(0) !important;
}
    
    #upload-choice-modal .modal-content > div:first-of-type:not(.close) {
        flex-direction: column;
        gap: 10px !important;
    }
    
    .camera-btn, .album-btn, .cancel-btn {
        width: 100%;
        min-width: auto;
        padding: 12px 16px;
        margin: 0;
    }
    
    #upload-choice-modal .cancel-btn {
        margin-top: 15px !important;
        padding: 10px 16px;
    }
    
    .login-form {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .user-info {
        justify-content: center;
    }
    
    /* 小屏幕下筛选和搜索区域样式 */
    .filter-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .search-wrapper {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .search-input {
        padding: 10px 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        font-size: 0.95rem;
        width: 100%;
        transition: all 0.3s ease;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
    
    .search-input:focus {
        outline: none;
        border-color: #666;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .filter-btn {
        padding: 10px 20px;
        border: none;
        border-radius: 8px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        font-size: 0.95rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        width: 100%;
    }
    
    .filter-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }
}



/* 备注部分样式 */
.remark-section {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    background-color: #f9f9f9;
}

.remark-section .radio-group {
    margin-bottom: 15px;
}

.remark-section .radio-group:last-child {
    margin-bottom: 0;
}

/* 移除首个选项的特殊字体处理，保持所有选项一致 */
.remark-section .radio-group label {
  font-weight: 400;
  color: #555;
  min-width: 80px;
}

.remark-section .radio-group label {
    margin-bottom: 5px;
}