/* ========================================
   表5工资表自动生成系统 - 专业版样式
   ======================================== */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调 */
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #818cf8;
    --success-color: #10b981;
    --success-hover: #059669;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    
    /* 背景和文字 */
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    
    /* 阴影效果 */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* 渐变效果 */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
}

/* 页面主体 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 背景装饰 */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

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

/* ========================================
   头部样式
   ======================================== */
.header {
    text-align: center;
    padding: 50px 20px;
    color: white;
}

.header-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: -1px;
    animation: titleFloat 3s ease-in-out infinite;
}

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

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ========================================
   主要内容区
   ======================================== */
.main-content {
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 50px;
    box-shadow: var(--shadow-xl);
    min-height: 500px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.main-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ========================================
   上传卡片
   ======================================== */
.upload-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.upload-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.upload-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.upload-card:hover::before {
    left: 100%;
}

.upload-icon {
    font-size: 5rem;
    margin-bottom: 25px;
    animation: bounce 2s ease-in-out infinite;
    display: inline-block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

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

.upload-card h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.upload-desc {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.05rem;
}

/* ========================================
   上传区域
   ======================================== */
.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 16px;
    padding: 70px 50px;
    margin: 35px 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.8) 0%, rgba(241, 245, 249, 0.8) 100%);
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(129, 140, 248, 0.05) 100%);
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.15);
}

.upload-area:hover::before {
    width: 300px;
    height: 300px;
}

.upload-label {
    cursor: pointer;
    display: block;
}

.upload-text {
    display: block;
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.upload-hint {
    display: block;
    color: var(--text-secondary);
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

/* ========================================
   文件信息
   ======================================== */
.file-info {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(129, 140, 248, 0.05) 100%);
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    text-align: left;
    border: 1px solid rgba(99, 102, 241, 0.2);
    animation: slideIn 0.4s ease;
}

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

.file-name {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1.15rem;
}

.file-size {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ========================================
   按钮样式
   ======================================== */
.btn {
    padding: 16px 40px;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 12px 6px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

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

.btn:active {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-color) 100%);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--success-hover) 0%, var(--success-color) 100%);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--text-secondary) 0%, #475569 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.3);
}

/* ========================================
   进度区域
   ======================================== */
.progress-section {
    margin-top: 30px;
}

.progress-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: slideIn 0.4s ease;
}

.progress-card h3 {
    margin-bottom: 25px;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.progress-bar {
    width: 100%;
    height: 36px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 100%;
    border-radius: 18px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    animation: progressShimmer 2s linear infinite;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressGlow 1.5s ease-in-out infinite;
}

@keyframes progressShimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

@keyframes progressGlow {
    0% { left: -100%; }
    100% { left: 200%; }
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 15px;
    font-weight: 500;
}

/* ========================================
   日志容器
   ======================================== */
.log-container {
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-color);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    line-height: 1.8;
}

.log-entry {
    padding: 5px 0;
    color: var(--text-secondary);
}

.log-entry.success {
    color: var(--success-color);
}

.log-entry.error {
    color: var(--danger-color);
}

.log-entry.warning {
    color: var(--warning-color);
}

/* ========================================
   结果区域
   ======================================== */
.result-section {
    animation: fadeIn 0.5s ease;
}

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

.result-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 50px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.result-header h2 {
    background: var(--gradient-success);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* ========================================
   统计网格
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.8) 0%, rgba(241, 245, 249, 0.8) 100%);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.stat-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(129, 140, 248, 0.05) 100%);
}

.stat-item:hover::before {
    transform: scaleX(1);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

/* ========================================
   表格预览
   ======================================== */
.table-preview {
    margin: 30px 0;
}

.table-preview h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    font-size: 0.9rem;
}

.table-wrapper th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: 14px 18px;
    text-align: left;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.table-wrapper td {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
}

.table-wrapper tr:hover {
    background: var(--bg-color);
}

/* ========================================
   错误区域
   ======================================== */
.error-section {
    animation: fadeIn 0.5s ease;
}

.error-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--danger-color);
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.error-card h3 {
    color: var(--danger-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    color: var(--danger-color);
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ========================================
   页脚
   ======================================== */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: white;
    margin-top: 30px;
}

.footer p {
    margin: 5px 0;
    opacity: 0.9;
}

.footer-note {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 768px) {
    .header-content h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .main-content {
        padding: 30px 20px;
    }

    .upload-card {
        padding: 30px 20px;
    }

    .upload-area {
        padding: 50px 30px;
    }

    .result-header {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        width: 100%;
    }
}

/* ========================================
   滚动条样式
   ======================================== */
.log-container::-webkit-scrollbar,
.table-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.log-container::-webkit-scrollbar-track,
.table-wrapper::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb,
.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb:hover,
.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--text-primary);
}
