* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c2c2c;
    --secondary-color: #6b6b6b;
    --accent-gold: #d4af37;
    --accent-rose: #c9a88a;
    --bg-light: #f8f8f8;
    --bg-white: #ffffff;
    --border-light: #e8e8e8;
    --text-primary: #2c2c2c;
    --text-secondary: #6b6b6b;
    --text-light: #999999;
    --card-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    --hover-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
    --gold-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}

body {
    font-family: 'Helvetica Neue', 'Arial', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    color: var(--text-primary);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(201, 168, 138, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: var(--bg-white);
    min-height: 100vh;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1;
}

header {
    background: var(--primary-color);
    color: var(--bg-white);
    padding: 0 48px;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
    position: relative;
    border-bottom: 2px solid var(--accent-gold);
}

header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-gold), transparent);
    animation: slideRight 3s ease-in-out infinite;
}

@keyframes slideRight {
    0%, 100% {
        transform: translateX(0);
        opacity: 1;
    }
    50% {
        transform: translateX(calc(100vw - 200px));
        opacity: 0.5;
    }
}

header h1 {
    font-size: 22px;
    font-weight: 300;
    letter-spacing: 3px;
    position: relative;
    z-index: 1;
    text-transform: uppercase;
}

header h1::before {
    content: '◆';
    margin-right: 12px;
    color: var(--accent-gold);
    font-size: 16px;
}

.section {
    padding: 40px 48px;
}

#loginSection {
    background: transparent;
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 登录界面 */
.login-box {
    width: 460px;
    padding: 60px 50px;
    background: var(--bg-white);
    border-radius: 2px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-light);
    border-top: 3px solid var(--accent-gold);
    position: relative;
    animation: fadeInUp 0.6s ease-out;
}

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

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent-gold);
    box-shadow: var(--gold-shadow);
}

.login-box h2 {
    margin-bottom: 40px;
    color: var(--primary-color);
    font-size: 26px;
    font-weight: 300;
    text-align: center;
    position: relative;
    z-index: 1;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.login-box h2::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background: var(--accent-gold);
    margin: 20px auto 0;
}

.login-box input {
    width: 100%;
    padding: 16px 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
    border-radius: 0;
    font-size: 15px;
    transition: all 0.3s ease;
    background: var(--bg-white);
    position: relative;
    z-index: 1;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.login-box input:hover {
    border-color: var(--accent-rose);
}

.login-box input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 1px var(--accent-gold);
}

.login-box .btn {
    width: 100%;
    height: 50px;
    font-size: 15px;
    font-weight: 300;
    letter-spacing: 2px;
}

/* 按钮样式 */
.btn {
    padding: 0 28px;
    height: 42px;
    border: 1px solid transparent;
    border-radius: 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.3s ease;
    line-height: 42px;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.3s ease;
}

.btn:hover::after {
    width: 100%;
}

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

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

.btn-primary {
    background: var(--primary-color);
    color: var(--bg-white);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    box-shadow: var(--gold-shadow);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-secondary);
    border-color: var(--border-light);
}

.btn-secondary:hover {
    border-color: var(--accent-rose);
    color: var(--accent-rose);
}

.btn-success {
    background: var(--accent-rose);
    color: var(--bg-white);
    border-color: var(--accent-rose);
}

.btn-success:hover {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    box-shadow: var(--gold-shadow);
}

.btn-danger {
    background: #8b7355;
    color: var(--bg-white);
    border-color: #8b7355;
}

.btn-danger:hover {
    background: #6b5345;
    border-color: #6b5345;
}

.btn-info {
    background: var(--bg-white);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    padding: 0 20px;
    height: 36px;
    line-height: 36px;
    font-size: 12px;
}

.btn-info:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
    padding: 32px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--accent-gold);
    flex-wrap: wrap;
    gap: 20px;
    box-shadow: var(--card-shadow);
}

.search-box {
    display: flex;
    gap: 12px;
    flex: 1;
    min-width: 300px;
}

.search-box input {
    flex: 1;
    padding: 0 20px;
    height: 42px;
    border: 1px solid var(--border-light);
    border-radius: 0;
    font-size: 14px;
    transition: all 0.3s ease;
    background: var(--bg-white);
    font-weight: 300;
    letter-spacing: 0.5px;
}

.search-box input:hover {
    border-color: var(--accent-rose);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 1px var(--accent-gold);
}

.search-box input::placeholder {
    color: var(--text-light);
    font-weight: 300;
}

.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* KV 列表 */
.kv-list {
    min-height: 400px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.loading {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 300;
    letter-spacing: 2px;
}

.loading::after {
    content: '';
    display: block;
    width: 30px;
    height: 30px;
    margin: 24px auto 0;
    border: 2px solid var(--border-light);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-light);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    opacity: 0.2;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 15px;
    font-weight: 300;
    letter-spacing: 1px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table th,
table td {
    padding: 20px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

table th {
    background: var(--bg-light);
    font-weight: 400;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 12px;
}

table th input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent-gold);
}

table td input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent-gold);
}

table tbody tr {
    transition: all 0.3s ease;
    background: var(--bg-white);
}

table tbody tr:hover {
    background: var(--bg-light);
    border-left: 3px solid var(--accent-gold);
}

table tbody tr:last-child td {
    border-bottom: none;
}

.value-preview {
    max-width: 500px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: var(--bg-light);
    border-left: 2px solid var(--accent-rose);
    font-weight: 300;
}

.actions {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 44, 44, 0.85);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-white);
    margin: 80px auto;
    padding: 48px;
    border-radius: 0;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border-top: 3px solid var(--accent-gold);
    position: relative;
    animation: slideIn 0.4s ease-out;
}

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

.close {
    position: absolute;
    right: 24px;
    top: 24px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 200;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.close:hover {
    color: var(--accent-gold);
    transform: rotate(90deg);
    border-color: var(--accent-gold);
}

.modal-content h2 {
    margin-bottom: 32px;
    color: var(--primary-color);
    font-size: 22px;
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.modal-content h2::before {
    content: '◆';
    margin-right: 12px;
    color: var(--accent-gold);
    font-size: 14px;
}

.modal-content form label {
    display: block;
    margin-top: 24px;
    margin-bottom: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.modal-content form input,
.modal-content form textarea,
.modal-content form select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-light);
    border-radius: 0;
    font-size: 14px;
    transition: all 0.3s ease;
    background: var(--bg-white);
    font-weight: 300;
}

.modal-content form input:hover,
.modal-content form textarea:hover,
.modal-content form select:hover {
    border-color: var(--accent-rose);
}

.modal-content form input:focus,
.modal-content form textarea:focus,
.modal-content form select:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 1px var(--accent-gold);
}

.modal-content form button {
    margin-top: 32px;
    width: 100%;
    height: 50px;
    font-size: 15px;
    font-weight: 300;
}

#viewContent {
    background: var(--bg-light);
    padding: 24px;
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--accent-rose);
    max-height: 450px;
    overflow-y: auto;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.8;
    margin-bottom: 24px;
    color: var(--text-primary);
    font-weight: 300;
}

#batchFileList {
    background: var(--bg-light);
    padding: 20px;
    border: 1px solid var(--border-light);
    max-height: 400px;
    overflow-y: auto;
}

#batchFileList ul {
    margin: 8px 0;
}

#batchFileList li {
    padding: 4px 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.file-item:hover {
    border-color: var(--accent-rose);
    border-left: 3px solid var(--accent-gold);
    padding-left: 14px;
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-item-checkbox {
    flex-shrink: 0;
}

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

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

.file-item-name {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
}

.file-item-size {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 300;
}

.file-item-size.oversized {
    color: #8b7355;
    font-weight: 400;
}

.file-item-key {
    flex: 2;
    min-width: 0;
}

.file-item-key input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border-light);
    border-radius: 0;
    font-size: 13px;
    transition: all 0.3s ease;
    font-weight: 300;
}

.file-item-key input:hover {
    border-color: var(--accent-rose);
}

.file-item-key input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 1px var(--accent-gold);
}

.file-item-key input:disabled {
    background: var(--bg-light);
    color: var(--text-light);
    cursor: not-allowed;
    border-color: var(--border-light);
}

.batch-file-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.batch-file-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.batch-file-header-left input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent-gold);
}

.batch-file-header-left label {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.batch-file-stats {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 300;
}

details summary {
    padding: 12px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 2px;
    margin-bottom: 12px;
    cursor: pointer;
    font-weight: 400;
    color: #1890ff;
    transition: all 0.3s;
}

details summary:hover {
    color: #40a9ff;
    border-color: #40a9ff;
}

details[open] summary {
    margin-bottom: 16px;
}

/* 批量上传进度 */
#batchUploadProgress {
    background: var(--bg-light);
    padding: 24px;
    border: 1px solid var(--border-light);
    max-height: 300px;
    overflow-y: auto;
}

#batchUploadProgress h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.progress-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-white);
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.progress-item:hover {
    border-left: 3px solid var(--accent-gold);
    padding-left: 13px;
}

.progress-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.progress-filename {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 12px;
    font-weight: 300;
}

.progress-status {
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    padding: 4px 12px;
    border: 1px solid transparent;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.progress-status.uploading {
    color: var(--text-secondary);
    border-color: var(--border-light);
}

.progress-status.success {
    color: var(--accent-rose);
    border-color: var(--accent-rose);
}

.progress-status.failed {
    color: #8b7355;
    border-color: #8b7355;
}

.upload-summary {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 300;
}

/* 错误消息 */
.error-msg {
    color: #8b7355;
    margin-top: 16px;
    font-size: 13px;
    padding: 12px 16px;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-left: 3px solid #8b7355;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* 响应式 */
@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
    }
    
    .search-box {
        width: 100%;
    }
    
    .action-buttons {
        width: 100%;
        flex-wrap: wrap;
    }
    
    table {
        font-size: 12px;
    }
    
    table th,
    table td {
        padding: 8px;
    }
}

/* 自定义弹窗 */
.custom-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 44, 44, 0.9);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

.custom-modal-content {
    background: var(--bg-white);
    margin: 15% auto;
    padding: 0;
    border-radius: 0;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideIn 0.4s ease-out;
    overflow: hidden;
    border-top: 3px solid var(--accent-gold);
}

.custom-modal-icon {
    width: 80px;
    height: 80px;
    margin: 48px auto 24px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    border: 2px solid var(--accent-gold);
    position: relative;
}

.custom-modal-icon::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 1px solid var(--accent-gold);
}

.custom-modal-icon.warning {
    background: #8b7355;
    border-color: var(--accent-rose);
}

.custom-modal-icon.warning::before {
    border-color: var(--accent-rose);
}

.custom-modal-icon svg {
    width: 40px;
    height: 40px;
    color: var(--bg-white);
    stroke-width: 1.5;
}

.custom-modal-body {
    padding: 0 48px 32px;
    text-align: center;
}

.custom-modal-body h3 {
    font-size: 22px;
    font-weight: 300;
    margin-bottom: 20px;
    color: var(--primary-color);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.custom-modal-body p {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
    font-weight: 300;
}

.custom-modal-footer {
    display: flex;
    gap: 16px;
    padding: 24px 48px 48px;
    justify-content: center;
}

.custom-modal-footer .btn {
    min-width: 120px;
    height: 48px;
    line-height: 48px;
    font-size: 14px;
}

/* 分页样式 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 32px 16px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-light);
}

.pagination-btn {
    min-width: 100px;
    height: 42px;
    line-height: 42px;
    font-weight: 300;
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.pagination-info {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 300;
    padding: 10px 24px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    letter-spacing: 1px;
}

.pagination-jump {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 1px;
}

.pagination-jump input {
    width: 70px;
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: 0;
    text-align: center;
    font-size: 14px;
    font-weight: 300;
    transition: all 0.3s ease;
}

.pagination-jump input:hover {
    border-color: var(--accent-rose);
}

.pagination-jump input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 1px var(--accent-gold);
}

@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .pagination-jump {
        width: 100%;
        justify-content: center;
    }
}
