/* =========================================
   Gallery Page Design System
   Theme: Dark Glassmorphism + Skeuomorphism
   匹配 Admin/Editor 设计风格
   ========================================= */

:root {
    /* 品牌色 */
    --primary-color: #3b70fc;
    --primary-gradient: linear-gradient(135deg, #3b70fc 0%, #667eea 100%);
    --primary-glow: rgba(59, 112, 252, 0.5);

    /* 玻璃质感 */
    --glass-bg: rgba(30, 60, 114, 0.65);
    --glass-bg-light: rgba(255, 255, 255, 0.08);
    --glass-border: 1px solid rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    --nav-control-bg: rgba(255, 255, 255, 0.08);
    --nav-control-bg-hover: rgba(255, 255, 255, 0.13);
    --nav-control-border: rgba(255, 255, 255, 0.12);
    --nav-control-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);

    /* 文字 */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);

    /* 状态色 */
    --success: #10b981;
    --warning: #fbbf24;
    --danger: #ef4444;

    /* 动画曲线 */
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    background-color: #0a1628;
}

[v-cloak] {
    display: none;
}

/* =========================================
   App Container
   ========================================= */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =========================================
   登录界面
   ========================================= */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: var(--glass-border);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: cardFloat 0.6s var(--ease-spring);
}

@keyframes cardFloat {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-icon-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
}

.login-icon {
    font-size: 3rem;
    color: var(--primary-color);
    filter: drop-shadow(0 0 20px var(--primary-glow));
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.icon-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    opacity: 0.5;
    animation: breathingGlow 4s ease-in-out infinite;
}

@keyframes breathingGlow {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.8;
    }
}

.login-title {
    margin: 0 0 8px;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    margin: 0 0 32px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-input-area {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.login-input-area input {
    flex: 1;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.login-input-area input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.login-input-area input::placeholder {
    color: var(--text-muted);
}

.login-btn {
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.checkbox-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

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

.error-toast {
    margin-top: 20px;
    padding: 12px 20px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: #fca5a5;
    font-size: 0.9rem;
    animation: shake 0.5s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

/* =========================================
   顶部导航
   ========================================= */
.glass-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(10, 20, 40, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-primary);
}

.gallery-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: 'Inter', -apple-system, sans-serif;
    user-select: none;
}

.gallery-logo-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(59, 112, 252, 0.4) 0%, rgba(59, 112, 252, 0.1) 100%);
    border: 1px solid rgba(106, 156, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.gallery-logo-icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: logoShine 3s infinite;
}

@keyframes logoShine {
    0% {
        left: -100%;
    }

    20% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

.gallery-logo-main {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.gallery-logo-sub {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    margin-left: -4px;
}

.gallery-logo-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.08);
    color: rgba(226, 232, 240, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.32);
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1;
    margin-left: 4px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.gallery-logo-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    opacity: 0.78;
}

.gallery-logo-badge.is-user {
    background: rgba(59, 112, 252, 0.08);
    color: #8fb1ff;
    border-color: rgba(106, 156, 255, 0.44);
}

.gallery-logo-badge.is-admin {
    background: rgba(251, 191, 36, 0.08);
    color: #ffd67a;
    border-color: rgba(251, 191, 36, 0.44);
}

.gallery-logo-badge.is-visitor {
    background: rgba(148, 163, 184, 0.08);
    color: rgba(226, 232, 240, 0.9);
    border-color: rgba(148, 163, 184, 0.32);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.image-count {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    background: var(--nav-control-bg);
    border: 1px solid var(--nav-control-border);
    box-shadow: var(--nav-control-shadow);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.2px;
    white-space: nowrap;
    transition: all 0.3s var(--ease-out-expo);
}

.image-count i {
    margin-right: 6px;
    color: var(--primary-color);
    transition: color 0.3s var(--ease-out-expo);
}

.image-count:hover {
    background: var(--nav-control-bg-hover);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.18);
}

.image-count:hover i {
    color: #6a9cff;
}

.nav-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--nav-control-bg);
    border: 1px solid var(--nav-control-border);
    box-shadow: var(--nav-control-shadow);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
}

.nav-btn:hover {
    background: var(--nav-control-bg-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

/* =========================================
   主内容区
   ========================================= */
.gallery-main {
    flex: 1;
    padding: 24px;
    position: relative;
}

/* 拖拽上传区域 */
.drop-zone {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
    transition: all 0.3s;
}

.drop-zone.active {
    background: rgba(59, 112, 252, 0.15);
    backdrop-filter: blur(10px);
    pointer-events: auto;
}

.drop-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    animation: pulse 1.5s ease-in-out infinite;
}

.drop-hint i {
    font-size: 5rem;
    color: var(--primary-color);
    filter: drop-shadow(0 0 30px var(--primary-glow));
}

.drop-hint p {
    margin-top: 16px;
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

@keyframes pulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* =========================================
   瀑布流布局（JS 列式 + Flexbox，列数由 JS 动态控制）
   ========================================= */
.masonry-columns {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.masonry-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* 防止列宽溢出 */
    min-width: 0;
}

@media (max-width: 600px) {
    .gallery-main {
        padding: 16px;
    }
}

.masonry-item {
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: var(--glass-bg-light);
    transition: transform 0.3s, box-shadow 0.3s;
}

.masonry-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.masonry-item img {
    width: 100%;
    display: block;
    cursor: pointer;
    transition: transform 0.3s;
}

.masonry-item:hover img {
    transform: scale(1.02);
}

.masonry-item img.lazy-image {
    filter: blur(14px);
    transform: scale(1.03);
    transition: filter 0.35s ease, transform 0.35s ease;
    /* 骨架屏：在占位图 + 缩略图加载期间显示 shimmer，避免空白闪烁 */
    min-height: 80px;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.04) 0%,
            rgba(255, 255, 255, 0.10) 40%,
            rgba(255, 255, 255, 0.04) 80%);
    background-size: 200% 100%;
    animation: shimmer 1.6s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.masonry-item img.lazy-image.is-loaded {
    filter: blur(0);
    transform: scale(1);
    /* 允许加载完成后停止 shimmer 动画 */
    animation: none;
    background: none;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
}

.masonry-item:hover .image-overlay {
    opacity: 1;
    transform: translateY(0);
}

.image-name {
    display: block;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.action-btn {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.action-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

/* =========================================
   空状态 & 加载状态
   ========================================= */
.empty-state,
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    color: var(--text-muted);
}

.empty-state i,
.loading-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 0 0 8px;
    color: var(--text-secondary);
    font-size: 1.25rem;
}

.empty-state p {
    margin: 0;
    font-size: 0.9rem;
}

.loading-state i {
    color: var(--primary-color);
}

/* =========================================
   悬浮上传按钮 (FAB)
   ========================================= */
.fab-upload {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 8px 32px var(--primary-glow);
    transition: all 0.3s;
    z-index: 100;
}

.fab-upload:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 12px 40px var(--primary-glow);
}

.fab-upload:active {
    transform: scale(1.05) rotate(90deg);
}

/* =========================================
   上传进度遮罩
   ========================================= */
.upload-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 10, 30, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.upload-modal {
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    border: var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.upload-icon {
    margin-bottom: 20px;
}

.upload-icon i {
    font-size: 4rem;
    color: var(--primary-color);
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.upload-modal h3 {
    margin: 0 0 12px;
    font-size: 1.25rem;
}

.upload-filename {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
    word-break: break-all;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* =========================================
   上传额度提示
   ========================================= */
.upload-quota-hint {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px 16px;
    margin-bottom: 16px;
    background: rgba(59, 112, 252, 0.1);
    border: 1px solid rgba(59, 112, 252, 0.25);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.upload-quota-hint i {
    color: var(--primary-color);
    flex-shrink: 0;
    position: relative;
    top: 1px;
}

.upload-quota-hint strong {
    color: var(--text-primary);
    font-weight: 600;
}

.upload-quota-hint .quota-warning {
    color: var(--warning);
    font-weight: 500;
}

.upload-quota-hint.quota-exceeded {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
}

.upload-quota-hint.quota-exceeded i {
    color: #ef4444;
}

.upload-quota-hint .quota-exceeded-text {
    color: #ef4444;
    font-weight: 600;
}

/* =========================================
   文件预览 - 每张图片独立标题编辑
   ========================================= */
.file-preview-item .file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-title-input {
    width: 100%;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.2s;
}

.file-title-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 112, 252, 0.2);
}

.file-title-input::placeholder {
    color: var(--text-muted);
}

.file-name-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================================
   内联标签输入框
   ========================================= */
.tags-inline-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    min-height: 42px;
    transition: border-color 0.2s;
}

.tags-inline-input:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 112, 252, 0.2);
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.tag-pill button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 0;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.tag-pill button:hover {
    color: white;
}

.tag-inline-field {
    flex: 1;
    min-width: 120px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    padding: 4px 0;
}

.tag-inline-field::placeholder {
    color: var(--text-muted);
}



/* =========================================
   Toast 提示 (toast-module.js 组件需要)
   ========================================= */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--glass-bg, rgba(40, 44, 52, 0.85));
    backdrop-filter: blur(20px);
    border: var(--glass-border, 1px solid rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateX(0);
    opacity: 1;
    animation: toastEnter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.toast-exit {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast.success .toast-icon {
    color: #10b981;
}

.toast.error .toast-icon {
    color: #ef4444;
}

.toast.warning .toast-icon {
    color: #f59e0b;
}

.toast.info .toast-icon {
    color: #3b82f6;
}

.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.toast-message {
    font-weight: 500;
}

.toast-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: color 0.2s;
    margin-left: 8px;
}

.toast-close:hover {
    color: white;
}

@keyframes toastEnter {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* =========================================
   Fancybox 自定义样式
   ========================================= */
.fancybox__caption {
    font-size: 0.9rem !important;
}

/* =========================================
   分类菜单栏 - 悬浮胶囊
   ========================================= */
.category-bar {
    position: fixed;
    top: 48px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(3px, 0.5vw, 6px);
    padding: clamp(4px, 0.6vw, 8px) clamp(6px, 1vw, 12px);
    background: rgba(10, 20, 40, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, opacity 0.3s ease;
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: calc(100vw - 32px);
    scrollbar-width: none;
}

.category-bar::-webkit-scrollbar {
    display: none;
}

.category-bar.is-hidden {
    transform: translateX(-50%) translateY(-200%);
    opacity: 0;
    pointer-events: none;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: clamp(3px, 0.4vw, 6px);
    padding: clamp(5px, 0.6vw, 8px) clamp(8px, 1.2vw, 16px);
    background: transparent;
    border: none;
    border-radius: 25px;
    color: var(--text-secondary);
    font-size: clamp(0.7rem, 1.1vw, 0.85rem);
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.category-btn.active {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 2px 12px var(--primary-glow);
}

.category-btn i {
    font-size: clamp(0.7rem, 1vw, 0.9rem);
}

.category-count {
    background: rgba(255, 255, 255, 0.15);
    padding: clamp(1px, 0.2vw, 2px) clamp(4px, 0.6vw, 8px);
    border-radius: 10px;
    font-size: clamp(0.55rem, 0.8vw, 0.7rem);
    font-weight: 600;
}

.category-btn.active .category-count {
    background: rgba(255, 255, 255, 0.25);
}

@media (max-width: 600px) {
    .category-bar {
        left: 12px;
        right: 12px;
        transform: none;
        max-width: none;
        justify-content: flex-start;
        top: 60px;
    }

    .category-bar.is-hidden {
        transform: translateY(-200%);
    }
}

/* =========================================
   上传弹窗
   ========================================= */
.upload-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 10, 30, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

.upload-modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    border: var(--glass-border);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s var(--ease-spring);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.upload-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.upload-modal-header h3 i {
    color: var(--primary-color);
}

.close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.upload-modal-body {
    padding: 24px;
}

/* 文件拖放区域 */
.file-drop-area {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 24px;
}

.file-drop-area:hover {
    border-color: var(--primary-color);
    background: rgba(59, 112, 252, 0.05);
}

.file-drop-area.has-file {
    padding: 16px;
    border-style: solid;
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.05);
}

.file-drop-area>i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 12px;
    display: block;
}

.file-drop-area p {
    margin: 0 0 8px;
    color: var(--text-secondary);
}

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

/* 文件预览列表 */
.file-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.file-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}

.file-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview-item .file-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px;
    background: rgba(0, 0, 0, 0.7);
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remove-file {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.8);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 0.7rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.file-preview-item:hover .remove-file {
    opacity: 1;
}

.add-more {
    color: var(--primary-color);
    font-size: 0.9rem;
    cursor: pointer;
    margin: 0;
}

.add-more:hover {
    text-decoration: underline;
}

/* 表单组 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-group label i {
    margin-right: 8px;
    color: var(--primary-color);
}

/* 分类选择按钮组 */
.category-select {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-option {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.category-option.selected {
    background: var(--primary-gradient);
    border-color: var(--primary-color);
    color: #fff;
}

/* 弹窗底部 */
.upload-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.btn-secondary,
.btn-primary {
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

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

/* =========================================
   表单元素 & 弹窗增强
   ========================================= */

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

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

/* 标签输入区域 */
.tags-input-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 32px;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(59, 112, 252, 0.2);
    border: 1px solid rgba(59, 112, 252, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
    color: #93c5fd;
}

.tag-item button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    display: flex;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.tag-item button:hover {
    opacity: 1;
}

.tag-input {
    margin-top: 4px;
}

/* 编辑预览 */
.edit-preview {
    margin-bottom: 20px;
    text-align: center;
}

.edit-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 12px;
}

/* 管理模式样式 */
.masonry-item.admin-mode {
    outline: 2px dashed rgba(59, 112, 252, 0.3);
}

.masonry-item.admin-mode .image-overlay {
    opacity: 1;
    transform: translateY(0);
}

.action-btn.edit-btn:hover {
    background: rgba(59, 112, 252, 0.5);
}

.action-btn.delete-btn:hover {
    background: rgba(239, 68, 68, 0.5);
}

.nav-btn.active {
    background: var(--primary-gradient);
    color: #fff;
}

/* 错误文本 */
.error-text {
    color: #fca5a5;
    font-size: 0.9rem;
    margin: 0;
}

/* 管理员提示 */
.admin-hint {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0 0 16px;
    text-align: center;
}

/* 统一弹窗类 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 10, 30, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    border: var(--glass-border);
    border-radius: 20px;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s var(--ease-spring);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: var(--primary-color);
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

/* 图片卡片标签 */
.image-title {
    display: block;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.image-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.image-tags .tag {
    padding: 2px 8px;
    background: rgba(59, 112, 252, 0.2);
    border-radius: 12px;
    font-size: 0.7rem;
    color: #93c5fd;
}

.image-tags .tag.more {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

/* =========================================
   管理员控制中心
   ========================================= */
.admin-panel {
    max-width: 720px;
    width: 95%;
}

.admin-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-tabs button {
    flex: 1;
    padding: 14px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.admin-tabs button:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.admin-tabs button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.admin-panel-body {
    max-height: 55vh;
    overflow-y: auto;
    padding: 0 !important;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.admin-table thead th {
    padding: 12px 16px;
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    background: rgba(10, 20, 40, 0.95);
    z-index: 1;
}

.admin-table tbody td {
    padding: 12px 16px;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.role-badge.admin {
    background: rgba(59, 112, 252, 0.2);
    color: #7cb3ff;
    border: 1px solid rgba(59, 112, 252, 0.3);
}

.role-badge.user {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.status-dot.active {
    background: var(--success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-dot.disabled {
    background: var(--danger);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.action-cell {
    display: flex;
    gap: 6px;
}

.mini-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mini-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    transform: scale(1.05);
}

.mini-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

.mini-btn.success:hover {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.3);
}

.invite-toolbar {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.invite-create {
    display: flex;
    align-items: center;
    gap: 12px;
}

.invite-create label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    white-space: nowrap;
}

.invite-create .form-input {
    padding: 8px 12px;
    font-size: 0.85rem;
}

.invite-create .btn-primary {
    white-space: nowrap;
    padding: 8px 16px;
    font-size: 0.85rem;
}

.invite-code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-color);
    background: rgba(59, 112, 252, 0.1);
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 1px;
}

/* =========================================
   移动端适配 (Mobile Responsive)
   ========================================= */

/* 小屏幕手机 (<= 480px) */
@media (max-width: 480px) {

    /* 导航栏优化 */
    .glass-nav {
        padding: 12px 16px;
    }

    .logo-text {
        font-size: 1rem;
        letter-spacing: 1px;
    }

    .gallery-logo-main,
    .gallery-logo-sub {
        font-size: 1rem;
    }

    .gallery-logo-badge {
        display: none;
    }

    .gallery-logo-icon {
        width: 30px;
        height: 30px;
        font-size: 0.88rem;
    }

    .nav-right {
        gap: 8px;
    }

    .nav-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .image-count {
        display: none;
    }

    /* 主内容区 */
    .gallery-main {
        padding: 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    /* 瀑布流间距调整 */
    .masonry-columns {
        gap: 12px;
    }

    .masonry-column {
        gap: 12px;
    }

    .masonry-item {
        border-radius: 12px;
    }

    /* 图片覆盖层 - 默认隐藏，长按显示 */
    .image-overlay {
        opacity: 0;
        transform: translateY(10px);
        padding: 12px;
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    }

    .masonry-item.overlay-active .image-overlay {
        opacity: 1;
        transform: translateY(0);
    }

    .image-title,
    .image-name {
        font-size: 0.8rem;
        margin-bottom: 6px;
    }

    .image-tags {
        margin-bottom: 8px;
    }

    .image-tags .tag {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    .action-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    /* FAB 按钮优化 */
    .fab-upload {
        bottom: calc(20px + env(safe-area-inset-bottom));
        right: 20px;
        width: 56px;
        height: 56px;
        font-size: 1.25rem;
    }

    /* 弹窗全屏适配 */
    .modal-content {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        animation: none;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-header h3 {
        font-size: 1rem;
    }

    .modal-body {
        padding: 16px 20px;
        max-height: calc(100vh - 140px);
    }

    .modal-footer {
        padding: 12px 20px;
    }

    /* 上传弹窗特殊处理 */
    .file-drop-area {
        padding: 30px 16px;
    }

    .file-drop-area>i {
        font-size: 2.5rem;
    }

    .file-preview-item {
        width: 70px;
        height: 70px;
    }

    /* 表单优化 */
    .form-group {
        margin-bottom: 16px;
    }

    .form-group label {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }

    .form-input {
        padding: 10px 14px;
        font-size: 16px;
        /* 防止 iOS 缩放 */
    }

    /* 分类选择 */
    .category-select {
        gap: 8px;
    }

    .category-option {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    /* 标签输入 */
    .tag-item {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    /* 按钮优化 */
    .btn-primary,
    .btn-secondary {
        padding: 12px 20px;
        font-size: 0.9rem;
        flex: 1;
        justify-content: center;
    }

    /* 上传进度 */
    .upload-modal {
        padding: 30px 20px;
        max-width: 90%;
    }

    .upload-icon i {
        font-size: 3rem;
    }

    /* Toast 提示 */
    .toast {
        top: 110px;
        bottom: auto;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        padding: 10px 20px;
        font-size: 0.875rem;
        border-radius: 50px;
        white-space: nowrap;
    }

    /* 空状态 */
    .empty-state,
    .loading-state {
        min-height: 40vh;
    }

    .empty-state i,
    .loading-state i {
        font-size: 3rem;
    }

    /* 管理员面板 */
    .admin-panel {
        max-width: 100%;
    }

    .admin-tabs button {
        padding: 12px 16px;
        font-size: 0.85rem;
    }

    .admin-panel-body {
        max-height: calc(100vh - 180px);
    }

    .admin-table {
        font-size: 0.75rem;
    }

    .admin-table thead th,
    .admin-table tbody td {
        padding: 10px 6px;
    }

    .mini-btn {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .invite-create {
        flex-wrap: wrap;
        gap: 10px;
    }

    .invite-create label {
        font-size: 0.8rem;
    }

    .invite-create .form-input {
        width: 70px;
    }

    /* 拖拽提示 */
    .drop-hint i {
        font-size: 3.5rem;
    }

    .drop-hint p {
        font-size: 1.1rem;
    }
}

/* 中等屏幕手机 (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .glass-nav {
        padding: 14px 20px;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .gallery-logo {
        font-size: 1.4rem;
    }

    .category-bar {
        padding: 12px 16px;
        gap: 8px;
    }

    .category-btn {
        padding: 10px 16px;
        font-size: 0.88rem;
    }

    .gallery-main {
        padding: 16px;
    }

    .masonry-columns {
        gap: 14px;
    }

    .masonry-column {
        gap: 14px;
    }

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

    .fab-upload {
        bottom: 24px;
        right: 24px;
        width: 58px;
        height: 58px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .image-overlay {
        opacity: 0;
        transform: translateY(10px);
    }

    .masonry-item.overlay-active .image-overlay {
        opacity: 1;
        transform: translateY(0);
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    }

    /* 增大触摸目标 */
    .action-btn {
        min-height: 36px;
        min-width: 36px;
    }

    .nav-btn {
        min-height: 40px;
        min-width: 40px;
    }

    .category-btn {
        min-height: 40px;
    }

    /* 移除悬停效果 */
    .masonry-item:hover {
        transform: none;
    }

    .masonry-item:hover img {
        transform: none;
    }

    .nav-btn:hover {
        transform: none;
    }

    .category-btn:hover {
        transform: none;
    }

    .fab-upload:hover {
        transform: none;
    }

    .action-btn:hover {
        transform: none;
    }
}

/* =========================================
   Auth Tabs (Skeuomorphic Segmented Control)
   ========================================= */
.auth-tabs-header {
    justify-content: center;
    position: relative;
    padding: 24px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-tabs-header .close-btn {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 32px;
    height: 32px;
}

.auth-tabs {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    /* 新增，为了给内部的滑块定位 */
    isolation: isolate;
}

.auth-tab-slider {
    position: absolute;
    top: 6px;
    bottom: 6px;
    width: calc(50% - 6px);
    border-radius: 50px;
    background: rgba(59, 112, 252, 0.25);
    border: 1px solid rgba(59, 112, 252, 0.3);
    box-shadow: 0 2px 10px rgba(59, 112, 252, 0.15);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 0;
}

/* 动态控制滑块位置 */
.auth-tabs.mode-login .auth-tab-slider {
    transform: translateX(0);
}

.auth-tabs.mode-register .auth-tab-slider {
    transform: translateX(100%);
}

.auth-tab-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 8px 32px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
    width: 130px;
    /* 增加宽度，防止换行 */
    text-align: center;
    white-space: nowrap;
    /* 强制不换行 */
}

.auth-tab-btn.active {
    color: white;
    /* 去掉原本写在 .active 里的背景和边框，交由 slider 来表现 */
}

.auth-tab-btn:hover:not(.active) {
    color: rgba(255, 255, 255, 0.85);
}

/* 登录/注册表单区域的新增动画过渡 */
/* 此处的 slide-fade 会配合 VDOM 切换工作 */
.slide-fade-enter-active {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.slide-fade-leave-active {
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: absolute;
    /* 让当前元素脱离文档流，高度立刻塌陷至新元素所需高度 */
    /* 避免 100% 碰到 padding 撑大 */
    left: 24px;
    right: 24px;
}

.slide-fade-enter-from {
    opacity: 0;
    transform: translateX(10px);
}

.slide-fade-leave-to {
    opacity: 0;
    transform: translateX(-10px);
}

/* 给 modal-body 加相对定位以包裹 absolute 的 leave-active 元素 */
.modal-body.relative-body {
    position: relative;
    /* 直接固定最小高度，以容纳带邀请码的注册表单高度。
       假设三个 input 每个高度加 padding 约 80px，3个+报错预留 = ~250px 足够 */
    min-height: 250px;
    overflow: hidden;
    /* 防止内容滑动时出现滚动条 */
}

/* 横屏模式优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-content {
        max-height: 95vh;
    }

    .modal-body {
        max-height: calc(100vh - 120px);
    }

    .admin-panel-body {
        max-height: calc(100vh - 160px);
    }

    .upload-modal {
        padding: 20px;
    }

    .upload-icon i {
        font-size: 2.5rem;
    }
}

/* 安全区域适配 (iPhone X+) */
@supports (padding: max(0px)) {
    .glass-nav {
        padding-top: max(16px, env(safe-area-inset-top));
        padding-left: max(24px, env(safe-area-inset-left));
        padding-right: max(24px, env(safe-area-inset-right));
    }

    .category-bar {
        top: max(48px, env(safe-area-inset-top) + 28px);
    }

    .fab-upload {
        bottom: max(32px, env(safe-area-inset-bottom) + 16px);
        right: max(32px, env(safe-area-inset-right) + 16px);
    }

    @media (max-width: 480px) {
        .glass-nav {
            padding-top: max(12px, env(safe-area-inset-top));
            padding-left: max(16px, env(safe-area-inset-left));
            padding-right: max(16px, env(safe-area-inset-right));
        }

        .category-bar {
            top: max(64px, env(safe-area-inset-top) + 44px);
        }

        .fab-upload {
            bottom: max(20px, env(safe-area-inset-bottom) + 12px);
            right: max(20px, env(safe-area-inset-right) + 12px);
        }

        .gallery-main {
            padding-bottom: max(12px, env(safe-area-inset-bottom));
        }
    }
}