:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #1abc9c;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --danger: #e74c3c;
    --success: #2ecc71;
    --warning: #f39c12;
    --gray: #95a5a6;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-color: #ecf0f1;
    --text-secondary: #95a5a6;
    --input-bg: rgba(255, 255, 255, 0.07);
    --input-border: rgba(255, 255, 255, 0.1);
}

.light-theme {
    --primary: #f8f9fa;
    --secondary: #007bff;
    --accent: #17a2b8;
    --light: #343a40;
    --dark: #f8f9fa;
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-border: rgba(0, 0, 0, 0.08);
    --text-color: #343a40;
    --text-secondary: #6c757d;
    --input-bg: rgba(0, 0, 0, 0.03);
    --input-border: rgba(0, 0, 0, 0.1);
    background: #f8f9fa;
    color: #343a40;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    background: linear-gradient(135deg, #1a2530, #2c3e50);
    color: var(--text-color);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.light-theme body {
    background: linear-gradient(135deg, #e9ecef, #f8f9fa);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo i {
    font-size: 2.5rem;
    color: var(--accent);
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.logo span {
    color: var(--accent);
}

.header-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--secondary);
    color: var(--secondary);
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.breadcrumb-container {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.breadcrumb {
    font-size: 0.95rem;
    color: var(--gray);
}

.breadcrumb-item {
    cursor: pointer;
    transition: color 0.3s ease;
}

.breadcrumb-item:hover {
    color: var(--accent);
    text-decoration: underline;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 25px;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.light-theme .card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.card-title {
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-controls {
    display: flex;
    gap: 10px;
}

.search-box {
    display: flex;
    margin-bottom: 20px;
    background: var(--input-bg);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--input-border);
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 15px;
    color: var(--text-color);
    outline: none;
}

.search-box button {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-box button:hover {
    background: #2980b9;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab {
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.light-theme .tab {
    background: rgba(0, 0, 0, 0.05);
}

.tab.active {
    background: var(--secondary);
}

.tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.2);
}

.light-theme .tab:hover:not(.active) {
    background: rgba(0, 0, 0, 0.1);
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 5px;
}

.file-list::-webkit-scrollbar {
    width: 8px;
}

.file-list::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
}

.file-list::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 4px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.light-theme .file-item {
    background: rgba(0, 0, 0, 0.03);
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
}

.file-item.active {
    background: rgba(26, 188, 156, 0.15);
    border-left: 3px solid var(--accent);
}

.file-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 188, 156, 0.2);
    border-radius: 8px;
    margin-right: 15px;
}

.file-icon i {
    color: var(--accent);
    font-size: 1.2rem;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 500;
    margin-bottom: 5px;
}

.file-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--gray);
}

.preview-content {
    min-height: 500px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 20px;
    overflow: auto;
}

.light-theme .preview-content {
    background: rgba(0, 0, 0, 0.05);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-secondary);
    padding: 30px;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.2);
}

.light-theme .empty-state i {
    color: rgba(0, 0, 0, 0.1);
}

.file-preview {
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    padding: 25px;
    border-radius: 10px;
    height: 100%;
    font-family: 'Courier New', monospace;
    overflow: auto;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

.light-theme .file-preview {
    background: white;
}

.file-info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.info-item {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.info-label {
    font-size: 0.85rem;
    color: #777;
}

.info-value {
    font-weight: 500;
    color: var(--dark);
}

.code {
    background: #f8f8f8;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    border-left: 3px solid var(--accent);
}

.code pre {
    white-space: pre-wrap;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.image-container {
    margin-top: 20px;
    text-align: center;
    max-height: 500px;
    overflow: auto;
    background: #f8f8f8;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.image-preview {
    max-width: 100%;
    max-height: 100%;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    object-fit: contain;
}

.actions-bar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.light-theme footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.cloudflare-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    padding: 5px 15px;
    border-radius: 50px;
    margin-top: 10px;
    font-size: 0.85rem;
}

.light-theme .cloudflare-badge {
    background: rgba(0, 0, 0, 0.05);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1001;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    color: var(--dark);
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    font-size: 1.5rem;
    color: var(--primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
}

.modal-body {
    margin-bottom: 25px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.form-control:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.2);
}

.loader {
    display: none;
    text-align: center;
    padding: 30px;
}

.loader i {
    font-size: 2.5rem;
    color: var(--accent);
    animation: spin 1.5s linear infinite;
}

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

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    background: var(--success);
    color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transform: translateY(-100px);
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.error {
    background: var(--danger);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .header-controls {
        width: 100%;
        justify-content: center;
    }
    
    .logo {
        justify-content: center;
        width: 100%;
    }
    
    .tabs {
        justify-content: center;
    }
    
    .actions-bar {
        flex-direction: column;
        align-items: flex-end;
    }
    
    .file-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .file-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .file-actions {
        margin-top: 10px;
        width: 100%;
        justify-content: flex-end;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    .info-item {
        min-width: 100%;
    }
    
    .image-container {
        max-height: 300px;
    }
}

/* 桌面端优化 */
@media (min-width: 992px) {
    .main-content {
        grid-template-columns: 1fr 2fr;
        gap: 25px;
    }
    
    .file-manager {
        display: grid;
        grid-template-columns: 1fr;
    }
    
    .file-list {
        max-height: 600px;
    }
    
    .preview-content {
        min-height: 700px;
    }
    
    .card-header {
        flex-direction: row;
        align-items: center;
    }
    
    .file-item {
        flex-direction: row;
        align-items: center;
    }
    
    .file-icon {
        margin-right: 15px;
        margin-bottom: 0;
    }
    
    .file-meta {
        flex-direction: row;
        gap: 15px;
    }
    
    .actions-bar {
        flex-direction: row;
        justify-content: flex-end;
    }
}

/* 平板设备优化 */
@media (min-width: 768px) and (max-width: 991px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .file-list {
        max-height: 500px;
    }
    
    .preview-content {
        min-height: 500px;
    }
}

/* 小屏幕设备优化 */
@media (max-width: 767px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-controls {
        width: 100%;
        justify-content: space-between;
        margin-top: 15px;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .file-list {
        max-height: 400px;
    }
    
    .preview-content {
        min-height: 400px;
    }
    
    .card {
        padding: 15px;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .file-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .file-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .actions-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .actions-bar .btn {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
    }
}
