/* ===== 图床系统样式 ===== */

:root {
    --primary: #4f6ef7;
    --primary-dark: #3b5bdb;
    --success: #2fb344;
    --info: #3298dc;
    --warning: #f5a623;
    --danger: #e3342f;
    --bg: #f0f2f5;
    --card-bg: #ffffff;
    --text: #2d3436;
    --text-muted: #8898aa;
    --border: #e9ecef;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --sidebar-width: 240px;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    min-height: 100vh;
    display: flex;
}

/* ===== 左侧菜单栏 ===== */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e2a4a 0%, #162040 100%);
    color: #c8d0e0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}
.sidebar-logo {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-logo .logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.sidebar-logo .logo-text {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}
.sidebar-nav {
    flex: 1;
    padding: 12px 0;
}
.sidebar-section {
    padding: 12px 20px 6px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #5a6a8a;
}
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    color: #8e9cb8;
    border-left: 3px solid transparent;
    text-decoration: none;
}
.sidebar-item:hover {
    background: rgba(255,255,255,0.05);
    color: #cdd6e8;
}
.sidebar-item.active {
    background: rgba(79,110,247,0.2);
    color: #fff;
    border-left-color: var(--primary);
}
.sidebar-item i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}
.sidebar-sub {
    display: none;
}
.sidebar-sub.open {
    display: block;
}
.sidebar-sub .sidebar-item {
    padding-left: 52px;
    font-size: 0.82rem;
}
.sidebar-item.has-sub::after {
    content: "\f282";
    font-family: "bootstrap-icons";
    margin-left: auto;
    transition: transform 0.2s;
    font-size: 0.7rem;
}
.sidebar-item.has-sub.open::after {
    transform: rotate(90deg);
}
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #8e9cb8;
    transition: color 0.2s;
    text-decoration: none;
}
.sidebar-footer:hover {
    color: #ef5350;
}
.sidebar-footer i {
    font-size: 1rem;
}

/* ===== 主内容区 ===== */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== 顶部导航 ===== */
.top-nav {
    background: var(--card-bg);
    padding: 14px 28px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.top-nav .breadcrumb-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}
.top-nav .breadcrumb-custom span {
    color: var(--text-muted);
}
.top-nav .breadcrumb-custom .current {
    color: var(--text);
    font-weight: 600;
}
.top-nav .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.top-nav .user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== 内容区 ===== */
.content-area {
    padding: 24px 28px;
    flex: 1;
}

/* ===== 统计卡片行 ===== */
.stat-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

/* ===== 认证页面 ===== */
.auth-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-wrapper {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px 35px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
}

.auth-header h2 {
    font-weight: 700;
    margin-bottom: 4px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 14px;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ===== 导航栏 ===== */
.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
}

/* ===== 统计卡片 ===== */
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: white;
    flex-shrink: 0;
}

.stat-primary .stat-icon { background: var(--primary); }
.stat-success .stat-icon { background: var(--success); }
.stat-info .stat-icon { background: var(--info); }
.stat-warning .stat-icon { background: var(--warning); }

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

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

/* ===== 上传区域 ===== */
.upload-zone-wrapper {
    position: relative;
}

.upload-zone {
    background: var(--card-bg);
    border: 3px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(79, 110, 247, 0.04);
}

.upload-zone.dragover {
    transform: scale(1.01);
}

.upload-icon {
    font-size: 56px;
    color: var(--primary);
    margin-bottom: 12px;
}

.upload-zone h5 {
    margin-bottom: 8px;
}

.upload-progress {
    margin-top: 16px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--info));
    border-radius: 4px;
    transition: width 0.3s;
    width: 0%;
}

/* ===== 图片卡片 ===== */
.image-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.image-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.image-thumb {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f8f9fa;
    cursor: pointer;
    position: relative;
}

.image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.image-card:hover .image-thumb img {
    transform: scale(1.08);
}

.image-info {
    padding: 10px 12px;
    flex: 1;
}

.image-name {
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.image-meta {
    display: flex;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.image-actions {
    display: flex;
    gap: 4px;
    padding: 0 12px 12px;
}

.image-actions .btn {
    flex: 1;
    padding: 4px 0;
    font-size: 0.8125rem;
}

/* ===== 空状态 ===== */
.empty-state {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ===== 详情弹窗 ===== */
.detail-preview {
    text-align: center;
    margin-bottom: 20px;
}

.detail-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.detail-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
}

.detail-info table {
    margin: 0;
}

.detail-info td {
    padding: 6px 0;
    font-size: 0.875rem;
}

.detail-info td:first-child {
    color: var(--text-muted);
    width: 100px;
}

.url-copy-group {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.url-copy-group input {
    flex: 1;
}

/* ===== Toast 通知 ===== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

.toast-msg {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 12px 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    animation: slideIn 0.3s ease;
    min-width: 200px;
}

.toast-msg.success {
    border-left: 4px solid var(--success);
}

.toast-msg.error {
    border-left: 4px solid var(--danger);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        min-width: 60px;
    }
    .sidebar .sidebar-item span,
    .sidebar .logo-text,
    .sidebar .sidebar-section,
    .sidebar .sidebar-sub .sidebar-item span {
        display: none;
    }
    .sidebar .sidebar-item {
        justify-content: center;
        padding: 11px 0;
    }
    .main-wrapper {
        margin-left: 60px;
    }
    .stat-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .content-area {
        padding: 16px;
    }
    .top-nav {
        padding: 10px 16px;
    }
    .stat-card {
        padding: 14px;
    }
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    .stat-value {
        font-size: 1.1rem;
    }
    .upload-zone {
        padding: 32px 16px;
    }
    .upload-icon {
        font-size: 40px;
    }
}

/* ===== 分页 ===== */
.pagination .page-link {
    border: none;
    color: var(--primary);
    margin: 0 2px;
    border-radius: 6px !important;
    min-width: 38px;
    text-align: center;
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    color: white;
}

/* ===== 区块标题 ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.section-header h4 {
    font-weight: 700;
    margin: 0;
    font-size: 1.1rem;
}

/* ===== 密码修改表单 ===== */
.password-form {
    max-width: 460px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
}
.password-form h5 {
    margin-bottom: 24px;
    font-weight: 700;
}

/* ===== 网站设置页面 ===== */
.settings-page {
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.settings-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}
.settings-card h5 {
    font-weight: 700;
    margin-bottom: 8px;
}
.settings-desc {
    font-size: 0.82rem;
    margin-bottom: 20px;
}
.logo-preview-wrapper {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.logo-preview {
    width: 100px;
    height: 100px;
    border-radius: 16px;
    border: 3px dashed var(--border);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    transition: all 0.2s;
    flex-shrink: 0;
}
.logo-preview:hover {
    border-color: var(--primary);
    background: rgba(79, 110, 247, 0.04);
}
.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.logo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.75rem;
}
.logo-placeholder i {
    font-size: 28px;
}
.logo-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.settings-form .input-group-text {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text-muted);
}

/* logo-img 侧边栏 */
.sidebar-logo .logo-img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}
