/* 鲲云个人云盘 - 样式表 */

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

:root {
    --primary-color: #1e90ff;
    --primary-dark: #1678d9;
    --bg-dark: #0a0e27;
    --bg-darker: #050812;
    --bg-card: #1a1f3a;
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0a0;
    --border-color: #2a2f4a;
    --danger-color: #ff4444;
    --success-color: #44dd44;
    --warning-color: #ffaa00;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ============ 登录页面 ============ */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.login-title {
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color), #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 14px;
}

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

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(30, 144, 255, 0.3);
}

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

.login-message {
    text-align: center;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    display: none;
}

.login-message.error {
    display: block;
    background: rgba(255, 68, 68, 0.1);
    color: #ff6b6b;
    border: 1px solid rgba(255, 68, 68, 0.3);
}

.login-message.success {
    display: block;
    background: rgba(68, 221, 68, 0.1);
    color: #68dd68;
    border: 1px solid rgba(68, 221, 68, 0.3);
}

/* ============ 后台管理界面 ============ */
.admin-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

.header-left h1 {
    font-size: 24px;
    background: linear-gradient(135deg, var(--primary-color), #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.username {
    color: var(--text-secondary);
    font-size: 14px;
}

.btn-logout {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(255, 68, 68, 0.1);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.admin-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.admin-sidebar {
    width: 200px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    overflow-y: auto;
}

.admin-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(30, 144, 255, 0.1);
    color: var(--primary-color);
}

.nav-item.active {
    background: rgba(30, 144, 255, 0.15);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
    padding-left: 17px;
}

.nav-item .icon {
    font-size: 18px;
}

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    margin-bottom: 20px;
    font-size: 24px;
}

/* ============ 文件管理 ============ */
.files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.files-actions {
    display: flex;
    gap: 12px;
}

.btn-upload {
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
}

.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 144, 255, 0.3);
}

/* ============ 硬盘空间 ============ */
.disk-space-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.disk-space-container h3 {
    margin-bottom: 16px;
    font-size: 16px;
}

.disk-space-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-darker);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.disk-space-used {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #00d4ff);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.disk-space-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============ 文件列表 ============ */
.files-list-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.files-list-container h3 {
    margin-bottom: 16px;
    font-size: 16px;
}

.files-list {
    display: grid;
    gap: 12px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-item:hover {
    background: rgba(30, 144, 255, 0.1);
    border-color: var(--primary-color);
}

.file-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.file-icon {
    font-size: 24px;
    min-width: 30px;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    margin-bottom: 4px;
    word-break: break-all;
}

.file-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

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

.btn-small {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.btn-small:hover {
    background: rgba(30, 144, 255, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* ============ 模态框 ============ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

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

.modal-close {
    position: absolute;
    right: 16px;
    top: 16px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 20px;
}

/* ============ 文件预览 ============ */
.file-preview {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.file-preview img,
.file-preview video {
    max-width: 100%;
    max-height: 400px;
    border-radius: 6px;
}

.file-preview audio {
    width: 100%;
}

.file-preview .preview-placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.file-preview .preview-placeholder .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* ============ 文件信息 ============ */
.file-info {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.info-value {
    color: var(--text-primary);
    font-weight: 600;
    word-break: break-all;
}

/* ============ 文件操作 ============ */
.file-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.action-group {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
}

.action-group h3 {
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

.action-form {
    display: flex;
    gap: 8px;
}

.action-form input {
    flex: 1;
    padding: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
}

.action-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.share-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.share-options .form-group {
    margin-bottom: 0;
}

.share-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    cursor: pointer;
}

.share-options input[type="checkbox"] {
    cursor: pointer;
}

.shares-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.share-link-info {
    flex: 1;
}

.share-link-url {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--primary-color);
    word-break: break-all;
    margin-bottom: 4px;
}

.share-link-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

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

/* ============ 按钮 ============ */
.btn-primary {
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 144, 255, 0.3);
}

.btn-secondary {
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
}

.btn-secondary:hover {
    background: rgba(30, 144, 255, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-danger {
    padding: 10px 16px;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid var(--danger-color);
    border-radius: 6px;
    color: var(--danger-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
}

.btn-danger:hover {
    background: rgba(255, 68, 68, 0.2);
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.2);
}

/* ============ 系统设置 ============ */
.settings-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    max-width: 500px;
}

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

.settings-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.settings-form input {
    width: 100%;
    padding: 10px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
}

.settings-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.1);
}

.settings-form input[readonly] {
    background: var(--bg-card);
    cursor: not-allowed;
}

/* ============ 分享预览页面 ============ */
.share-password-form {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.share-password-form p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.share-password-form input {
    width: 100%;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.share-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.share-actions a,
.share-actions button {
    flex: 1;
    padding: 10px;
    text-align: center;
    text-decoration: none;
}

/* ============ 响应式设计 ============ */
@media (max-width: 768px) {
    .admin-content {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 0;
        display: flex;
        overflow-x: auto;
    }

    .admin-nav {
        flex-direction: row;
        width: 100%;
    }

    .nav-item {
        flex: 1;
        justify-content: center;
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 12px;
    }

    .nav-item.active {
        border-left: none;
        border-bottom: 3px solid var(--primary-color);
    }

    .admin-main {
        padding: 16px;
    }

    .files-header {
        flex-direction: column;
        gap: 12px;
    }

    .files-actions {
        width: 100%;
    }

    .btn-upload {
        width: 100%;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .file-actions-btn {
        width: 100%;
        margin-top: 12px;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .login-box {
        margin: 20px;
    }

    .header-right {
        gap: 12px;
    }

    .username {
        display: none;
    }
}

@media (max-width: 480px) {
    .admin-header {
        padding: 12px 16px;
    }

    .header-left h1 {
        font-size: 20px;
    }

    .admin-main {
        padding: 12px;
    }

    .tab-content h2 {
        font-size: 18px;
    }

    .modal-content {
        padding: 16px;
    }

    .file-preview {
        min-height: 150px;
    }

    .file-preview img,
    .file-preview video {
        max-height: 300px;
    }

    .action-form {
        flex-direction: column;
    }

    .action-form input {
        width: 100%;
    }

    .share-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .share-item-actions {
        width: 100%;
        margin-top: 8px;
    }
}
