/* ==================== 变量定义 ==================== */
:root {
    /* 亮色主题 */
    --bg-primary: rgba(255, 255, 255, 0.92);
    --bg-secondary: rgba(248, 250, 252, 0.95);
    --bg-card: rgba(255, 255, 255, 0.98);
    --text-primary: #1a1a2e;
    --text-secondary: #4a5568;
    --text-hint: #718096;
    --border-color: rgba(226, 232, 240, 0.8);
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: rgba(99, 102, 241, 0.1);
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --glass-blur: blur(20px);
}

[data-theme="dark"] {
    /* 暗色主题 */
    --bg-primary: rgba(17, 24, 39, 0.92);
    --bg-secondary: rgba(31, 41, 55, 0.95);
    --bg-card: rgba(31, 41, 55, 0.98);
    --text-primary: #f3f4f6;
    --text-secondary: #d1d5db;
    --text-hint: #9ca3af;
    --border-color: rgba(75, 85, 99, 0.6);
    --accent-color: #818cf8;
    --accent-hover: #6366f1;
    --accent-light: rgba(129, 140, 248, 0.15);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==================== 背景 ==================== */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
    transition: opacity 0.8s ease;
    /* 默认渐变背景（当图片未加载时显示） */
    background-color: #667eea;
    background-image: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

[data-theme="dark"] .background {
    background-color: #1a1a2e;
    background-image: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(99, 102, 241, 0.1) 0%, 
        rgba(168, 85, 247, 0.05) 50%,
        rgba(236, 72, 153, 0.1) 100%);
    z-index: -1;
}

[data-theme="dark"] .overlay {
    background: linear-gradient(135deg, 
        rgba(17, 24, 39, 0.7) 0%, 
        rgba(31, 41, 55, 0.6) 50%,
        rgba(17, 24, 39, 0.7) 100%);
}

/* ==================== 容器 ==================== */
.container {
    max-width: 580px;
    margin: 0 auto;
    padding: 30px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== 头部 ==================== */
header {
    text-align: center;
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-color), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.theme-toggle {
    position: absolute;
    right: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

/* ==================== 标签页 ==================== */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    backdrop-filter: var(--glass-blur);
}

.tab:hover {
    background: var(--accent-light);
    color: var(--accent-color);
}

.tab.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: var(--shadow-md);
}

/* ==================== 面板 ==================== */
.panel {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    backdrop-filter: var(--glass-blur);
    flex: 1;
}

.hidden {
    display: none !important;
}

/* ==================== 上传类型切换 ==================== */
.upload-type-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--bg-secondary);
    padding: 5px;
    border-radius: 12px;
}

.type-tab {
    flex: 1;
    padding: 10px 15px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.type-tab:hover {
    color: var(--accent-color);
}

.type-tab.active {
    background: var(--bg-card);
    color: var(--accent-color);
    box-shadow: var(--shadow-sm);
}

/* ==================== 拖放区域 ==================== */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent-color);
    background: var(--accent-light);
}

.drop-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.drop-zone p {
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.drop-zone .hint {
    font-size: 0.85rem;
    color: var(--text-hint);
}

/* ==================== 文件列表 ==================== */
.file-list {
    margin-top: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: var(--bg-secondary);
    border-radius: 10px;
    margin-bottom: 8px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    overflow: hidden;
}

.file-name {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-hint);
    white-space: nowrap;
}

.file-remove {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.file-remove:hover {
    transform: scale(1.1);
}

/* ==================== 文本输入 ==================== */
#textInput {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    resize: vertical;
    font-family: inherit;
}

#textInput:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* ==================== 保存时间选择 ==================== */
.retention-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.retention-section label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.retention-section select {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

.retention-section select:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* ==================== 进度条 ==================== */
.progress-section {
    margin: 20px 0;
}

.progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-color), #a855f7);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ==================== 按钮 ==================== */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn.primary {
    background: linear-gradient(135deg, var(--accent-color), #a855f7);
    color: white;
    width: 100%;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

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

.btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    width: 100%;
}

.btn.secondary:hover {
    background: var(--accent-light);
    color: var(--accent-color);
}

.btn.small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn.danger {
    background: var(--danger-color);
    color: white;
}

/* ==================== 结果区域 ==================== */
.result-section {
    margin-top: 20px;
}

.result-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
}

.result-card h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--success-color);
}

.result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.result-item label {
    font-size: 0.85rem;
    color: var(--text-hint);
    min-width: 70px;
}

.result-item .code {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    letter-spacing: 2px;
}

.result-item .link {
    font-size: 0.85rem;
    color: var(--accent-color);
    word-break: break-all;
    flex: 1;
}

.copy-btn {
    padding: 6px 12px;
    border: none;
    background: var(--accent-color);
    color: white;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: var(--accent-hover);
}

/* ==================== 提取区域 ==================== */
.pickup-section {
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: 3px;
    text-transform: lowercase;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.input-group .btn {
    width: auto;
    white-space: nowrap;
}

/* ==================== 文本内容显示 ==================== */
.text-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.95rem;
    line-height: 1.8;
}

.download-btn {
    margin-top: 15px;
}

/* ==================== 页脚 ==================== */
footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
}

footer a {
    color: var(--text-hint);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--accent-color);
}

/* ==================== 提示框 ==================== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

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

/* ==================== 后台管理样式 ==================== */
.admin-body {
    background: var(--bg-primary);
}

.admin-container {
    min-height: 100vh;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.admin-header h1 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--accent-color), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-header .logo-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

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

/* 登录面板 */
.login-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 10px;
}

.login-hint {
    text-align: center;
    color: var(--text-hint);
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.input-group.vertical {
    flex-direction: column;
    gap: 15px;
}

.input-group.vertical input {
    text-align: left;
    letter-spacing: normal;
}

/* 管理内容区 */
.admin-content {
    display: flex;
    min-height: calc(100vh - 80px);
}

.admin-nav {
    width: 220px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 20px 10px;
    flex-shrink: 0;
}

.nav-item {
    width: 100%;
    padding: 14px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    text-align: left;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    margin-bottom: 5px;
}

.nav-item:hover {
    background: var(--accent-light);
    color: var(--accent-color);
}

.nav-item.active {
    background: var(--accent-color);
    color: white;
}

.admin-main {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.section {
    max-width: 1000px;
}

.section h2 {
    margin-bottom: 25px;
    font-size: 1.4rem;
}

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

.stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    font-size: 2rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-hint);
}

/* 流量控制 */
.traffic-controls {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.traffic-controls h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.control-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.control-group:last-child {
    border-bottom: none;
}

.control-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.control-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-color);
}

/* 文件表格 */
.file-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.file-table-wrapper {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.file-table {
    width: 100%;
    border-collapse: collapse;
}

.file-table th,
.file-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.file-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-hint);
}

.file-table td {
    font-size: 0.9rem;
}

.file-table tr:hover {
    background: var(--accent-light);
}

.file-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-color);
}

/* 设置表单 */
.settings-form {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid var(--border-color);
}

.settings-form h3 {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
}

.setting-item input,
.setting-item select {
    width: 100%;
    max-width: 300px;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.setting-item input:focus,
.setting-item select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.setting-item .hint {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-hint);
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    
    header h1 {
        font-size: 1.4rem;
    }
    
    .panel {
        padding: 20px 15px;
    }
    
    .admin-content {
        flex-direction: column;
    }
    
    .admin-nav {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        padding: 10px;
        gap: 5px;
    }
    
    .nav-item {
        flex: 1;
        min-width: 100px;
        text-align: center;
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .admin-main {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .file-table-wrapper {
        overflow-x: auto;
    }
    
    .file-table {
        min-width: 700px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group .btn {
        width: 100%;
    }
}


