/* 全局样式 - 明亮简洁风格 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 页面加载指示器 */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top: 3px solid #4285f4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* 页面头部 - 明亮简洁设计 */
.site-header {
    background-color: #ffffff;
    color: #4285f4;
    padding: 25px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

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

.header-content h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.header-subtitle {
    font-size: 1rem;
    color: #666;
    margin: 0;
}

/* 主要内容区 */
main {
    padding: 10px 0 30px;
}

section {
    margin-bottom: 25px;
    animation: fadeInUp 0.4s ease;
}

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

/* 卡片样式 - 明亮简洁 */
.card {
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.3s ease;
    background-color: white;
    margin-bottom: 25px;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.card-header {
    background-color: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    padding: 16px 20px;
}

.card-title {
    font-size: 1.25rem;
    margin: 0;
    color: #333;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* 随机码区域 */
.code-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.random-code {
    flex: 1;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: #4285f4;
    background-color: #f8f9ff;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #e8f0fe;
    text-align: center;
    font-family: 'Courier New', Courier, monospace;
}

#copy-code-btn {
    white-space: nowrap;
}

.code-hint {
    color: #666;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 15px;
}

#generate-code-btn {
    width: 100%;
    padding: 10px 16px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

/* 上传区域 - 简洁明了 */
.upload-area {
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    padding: 30px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #fafafa;
}

.upload-area:hover {
    border-color: #4285f4;
    background-color: #f8f9ff;
}

.upload-area.drag-over {
    border-color: #4285f4;
    background-color: #f0f4ff;
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: #4285f4;
}

.upload-area h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.upload-area p {
    color: #666;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.upload-hint {
    font-size: 0.85rem;
    color: #888;
    margin-top: 8px;
}

.file-input {
    display: none;
}

/* 进度条 */
.progress-container {
    margin-top: 15px;
}

.progress {
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    background-color: #f0f0f0;
    margin-bottom: 6px;
}

.progress-bar {
    background-color: #4285f4;
    transition: width 0.3s ease;
    height: 100%;
}

.progress-text {
    font-size: 0.85rem;
    color: #666;
    text-align: center;
    margin: 0;
}

/* 文件列表 - 整洁清晰 */
.loading-indicator {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px 0;
}

.file-list {
    max-height: 400px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s ease;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background-color: #fafafa;
}

.file-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.file-icon {
    font-size: 1.5rem;
    margin-right: 12px;
    color: #4285f4;
}

.file-details {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 1rem;
    font-weight: 500;
    margin: 0 0 3px 0;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #666;
}

.file-actions {
    display: flex;
    gap: 8px;
}

.file-actions .btn {
    min-width: 70px;
    font-size: 0.85rem;
    padding: 6px 12px;
}

.no-files {
    text-align: center;
    color: #666;
    padding: 40px 0;
    font-size: 1rem;
}

.error-message {
    text-align: center;
    color: #ea4335;
    padding: 30px 0;
    font-size: 1rem;
}

/* 通知消息 - 简洁醒目 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transform: translateY(-15px);
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s forwards;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-success {
    background-color: #34a853;
}

.notification-error {
    background-color: #ea4335;
}

.notification-warning {
    background-color: #fbbc05;
    color: #333;
}

.notification-info {
    background-color: #4285f4;
}

/* 页脚 - 简洁清爽 */
.site-footer {
    background-color: #fafafa;
    color: #666;
    padding: 15px 0;
    margin-top: 40px;
    border-top: 1px solid #f0f0f0;
}

.site-footer .container {
    text-align: center;
}

.site-footer p {
    margin: 0;
    font-size: 0.85rem;
}

/* 表单样式 - 简洁现代 */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: white;
}

.form-control:focus {
    border-color: #4285f4;
    outline: none;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.1);
}

/* 按钮样式 - 明亮简洁 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
    text-decoration: none;
}

.btn-primary {
    background-color: #4285f4;
    color: white;
}

.btn-primary:hover {
    background-color: #3367d6;
}

.btn-success {
    background-color: #34a853;
    color: white;
}

.btn-success:hover {
    background-color: #2d8f45;
}

.btn-danger {
    background-color: #ea4335;
    color: white;
}

.btn-danger:hover {
    background-color: #d93025;
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #555;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn:active {
    opacity: 0.9;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }
    
    .header-content h1 {
        font-size: 1.75rem;
    }
    
    .card-header,
    .card-body {
        padding: 15px;
    }
    
    .card-title {
        font-size: 1.15rem;
    }
    
    .random-code {
        font-size: 1.3rem;
        padding: 10px 12px;
    }
    
    .code-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    #copy-code-btn {
        width: 100%;
        margin-top: 8px;
    }
    
    .file-item {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 15px;
    }
    
    .file-info {
        justify-content: center;
        margin-bottom: 12px;
    }
    
    .file-actions {
        justify-content: center;
    }
    
    .file-meta {
        flex-direction: column;
        gap: 4px;
        align-items: center;
    }
    
    .upload-area {
        padding: 25px 12px;
    }
    
    .upload-icon {
        font-size: 2rem;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        width: auto;
        max-width: calc(100% - 20px);
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 1.5rem;
    }
    
    .random-code {
        font-size: 1.1rem;
        letter-spacing: 0.5px;
    }
    
    .file-actions {
        flex-direction: column;
    }
    
    .file-actions .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .file-actions .btn:last-child {
        margin-bottom: 0;
    }
}

/* 打印样式 */
@media print {
    header, footer, .btn, .file-actions {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* 暗色模式支持 - 保留但不默认启用 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .site-header {
        background-color: #222;
        border-bottom-color: #333;
    }
    
    .card {
        background-color: #222;
        border-color: #333;
    }
    
    .card-header {
        background-color: #2a2a2a;
        border-bottom-color: #333;
    }
    
    .form-control {
        background-color: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .upload-area {
        border-color: #444;
        background-color: #2a2a2a;
    }
    
    .file-item {
        border-color: #333;
    }
    
    .file-item:hover {
        background-color: #2a2a2a;
    }
    
    .site-footer {
        background-color: #222;
        border-top-color: #333;
    }
    
    .random-code {
        background-color: #2a2a2a;
        border-color: #444;
    }
    
    .progress {
        background-color: #333;
    }
}

