/* ==========================================
   01. 设计系统变量与全局重置（高级质感调调优）
   ========================================== */
:root {
    --primary-color: #0078D4;
    --primary-hover: #106ebe;
    --primary-light: rgba(0, 120, 212, 0.06);
    --primary-light-hover: rgba(0, 120, 212, 0.12);
    --danger-color: #f31260;
    --danger-hover: #e11d48;
    --danger-light: rgba(243, 18, 96, 0.06);
    --danger-light-hover: rgba(243, 18, 96, 0.12);
    
    --bg-main: #f6f8fa; 
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 10px 10px -5px rgba(15, 23, 42, 0.03);
    
    --curve-main: cubic-bezier(0.34, 1.56, 0.64, 1);
    --curve-fast: cubic-bezier(0.22, 1, 0.36, 1);
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

[v-cloak] { display: none !important; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ==========================================
   02. 核心首屏加载层
   ========================================== */
.first-load-shimmer-overlay {
    position: fixed; inset: 0;
    background-color: var(--bg-main); 
    z-index: 999999; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    transition: opacity 0.4s var(--curve-fast), visibility 0.4s;
}
.first-load-shimmer-overlay.fade-out-complete {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
.quantum-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: quantum-spin 0.8s linear infinite;
}
.shimmer-loading-text {
    color: var(--text-muted); font-size: 0.85rem; font-weight: 500; margin-top: 18px;
    letter-spacing: 1px; animation: pulse-text 1.8s infinite ease-in-out;
}
@keyframes quantum-spin { to { transform: rotate(360deg); } }
@keyframes pulse-text { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* ==========================================
   03. 顶部导航栏
   ========================================== */
.system-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: var(--shadow-sm);
}
.header-container {
    width: 1280px; max-width: 100%; margin: 0 auto; padding: 0 24px; height: 64px; 
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.site-branding { 
    display: flex; align-items: center; gap: 10px; cursor: pointer; 
    transition: opacity 0.2s; flex-shrink: 0; 
}
.site-branding:hover { opacity: 0.85; }
.site-logo { height: 32px; width: auto; object-fit: contain; border-radius: 6px; }

/* 彻底抹除兜底图章可能产生的异色方块阴影 */
.logo-fallback-icon { 
    font-size: 1.3rem; 
    line-height: 1; 
    background: none !important; 
    border: none !important; 
    box-shadow: none !important; 
}

/* ✅ 终极质感版：速度恢复舒缓、无残留、带呼吸停顿感的完美流光 */
.branding-title { 
    font-size: 1.1rem; 
    font-weight: 700; 
    letter-spacing: -0.3px; 
    position: relative;
    
    background: linear-gradient(
        110deg, 
        #1e293b 0%, 
        #1e293b 35%, 
        #ffffff 50%, 
        #1e293b 65%, 
        #1e293b 100%
    );
    background-size: 300% 100%;
    background-position: 150% 0;
    
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    
    animation: logoShine 5s ease-in-out infinite;
    transition: opacity 0.2s;
}

/* 确保网站名字完美继承流光效果 */
.branding-title span {
    color: inherit !important;
}

.header-search-box { 
    position: relative; 
    flex: 0 1 320px; 
    margin-left: auto; 
}
.search-lens { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.9rem; }
.header-search-box input {
    width: 100%; padding: 8px 14px 8px 36px; border-radius: 50px; border: 1px solid transparent;
    background: #f1f5f9; font-size: 0.85rem; transition: all 0.25s var(--curve-fast); color: var(--text-main);
}
.header-search-box input:focus { 
    outline: none; border-color: rgba(0, 120, 212, 0.4); background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1), var(--shadow-sm);
}

.header-action-group { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.admin-logged-trigger { display: flex; align-items: center; gap: 10px; position: relative; }

/* ==========================================
   04. 按钮组件基础
   ========================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 16px; font-size: 0.85rem; font-weight: 600; border-radius: var(--radius-sm);
    border: 1px solid transparent; cursor: pointer; transition: all 0.2s var(--curve-fast); white-space: nowrap;
    user-select: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn-primary { background: var(--primary-color); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #fff; border-color: var(--border-color); color: #475569; }
.btn-secondary:hover { background: #f8fafc; color: var(--text-main); border-color: #cbd5e1; }
.btn-danger { background: var(--danger-color); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }

.btn-primary-light { background: var(--primary-light); color: var(--primary-color); }
.btn-primary-light:hover { background: var(--primary-color); color: #fff; }
.btn-danger-light { background: var(--danger-light); color: var(--danger-color); }
.btn-danger-light:hover { background: var(--danger-color); color: #fff; }

.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: var(--radius-sm); position: relative; }
.btn-block { width: 100%; padding: 10px; font-size: 0.9rem; border-radius: var(--radius-md); }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; border-radius: 6px; }

/* ==========================================
   05. 主容器工作空间布局
   ========================================== */
.main-workspace {
    width: 1280px; max-width: 100%; margin: 0 auto; padding: 24px;
    display: flex; flex-direction: column; gap: 24px; min-height: calc(100vh - 140px);
}

.top-category-bar { width: 100%; overflow-x: auto; padding-bottom: 4px; }
.top-category-bar::-webkit-scrollbar { display: none; }
.category-menu-horizontal { display: flex; gap: 8px; width: max-content; padding: 2px; }

/* 去掉数字后，重组分类按钮的纯净内边距，保证绝对居中圆润 */
.category-tab {
    padding: 8px 20px; background: #e2e8f0; border-radius: 50px;
    font-size: 0.85rem; font-weight: 600; color: #475569; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: all 0.25s var(--curve-fast);
}
.category-tab:hover:not(.active) { background: #cbd5e1; color: var(--text-main); }
.category-tab.active { background: var(--primary-color); color: #fff; box-shadow: 0 4px 10px rgba(0, 120, 212, 0.25); }

/* ==========================================
   06. 核心画廊网格流
   ========================================== */
.content-display-hub { display: flex; flex-direction: column; gap: 28px; }
.gallery-section-box { background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 24px; box-shadow: var(--shadow-sm); }
.section-title-banner { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; border-bottom: 1px solid var(--border-light); padding-bottom: 12px; }
.banner-txt { font-size: 1rem; font-weight: 700; color: var(--text-main); display: flex; align-items: center; }
.banner-sub { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }

.image-gallery-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.image-card { 
    background: var(--bg-card); border-radius: var(--radius-md); overflow: hidden; 
    border: 1px solid var(--border-color); transition: all 0.3s var(--curve-fast); 
}
.image-card:hover { 
    transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(0, 120, 212, 0.3); 
}

.image-wrapper { width: 100%; height: 150px; background: #f8fafc; cursor: pointer; overflow: hidden; position: relative; }
.image-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--curve-fast); }
.image-card:hover .image-wrapper img { transform: scale(1.05); }

.image-info { padding: 12px; }
.image-title { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-main); }
.image-meta { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; font-weight: 500; }
.image-actions { display: flex; gap: 6px; margin-top: 10px; border-top: 1px solid var(--border-light); padding-top: 8px; }
.image-actions .btn { flex: 1; padding: 5px 8px; font-size: 0.78rem; }

.empty-state-card { text-align: center; padding: 48px; color: var(--text-muted); font-size: 0.85rem; }
.load-more-container { display: flex; justify-content: center; margin-top: 16px; }

/* ==========================================
   07. 汉堡按钮与下拉菜单
   ========================================== */
.dropdown-menu-wrapper { position: relative; display: inline-block; }
.hamburger-lines { position: relative; width: 14px; height: 2px; background: #475569; display: inline-block; vertical-align: middle; transition: background 0.2s; }
.hamburger-lines::before, .hamburger-lines::after { content: ''; position: absolute; width: 14px; height: 2px; background: #475569; left: 0; transition: all 0.2s; }
.hamburger-lines::before { top: -4px; }
.hamburger-lines::after { top: 4px; }

.dropdown-panel {
    position: absolute; right: 0; top: 38px; background: #fff; border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: 4px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; min-width: 140px; z-index: 110;
    transform-origin: top right;
}
.dropdown-item { padding: 8px 12px; font-size: 0.82rem; font-weight: 600; text-align: left; cursor: pointer; color: #475569; display: flex; align-items: center; gap: 8px; transition: all 0.15s; }
.dropdown-item:hover { background: var(--primary-light); color: var(--primary-color); border-radius: 6px; }
.dropdown-item.divider { border-top: 1px solid var(--border-light); margin-top: 4px; padding-top: 8px; color: var(--danger-color); }
.dropdown-item.divider:hover { background: var(--danger-light); color: var(--danger-color); }

/* ==========================================
   08. 弹窗重构层
   ========================================== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-box {
    background: #fff; border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-lg);
    width: 90%; max-width: 480px; display: flex; flex-direction: column;
    border: 1px solid rgba(255,255,255,0.7);
}
.modal-box.style-login { max-width: 360px; }
.modal-box.style-admin { max-width: 860px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-header h3 { font-size: 1.05rem; font-weight: 700; color: var(--text-main); }
.close-x-btn { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text-muted); transition: color 0.2s; }
.close-x-btn:hover { color: var(--text-main); }

.form-group { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.8rem; font-weight: 700; color: #475569; }
.form-control { 
    padding: 8px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); 
    font-size: 0.88rem; outline: none; transition: all 0.2s; width: 100%; background: #f8fafc;
}
.form-control:focus { border-color: var(--primary-color); background: #fff; box-shadow: 0 0 0 3px rgba(0,120,212,0.1); }
select.form-control { cursor: pointer; }
.form-control-with-btn { display: flex; gap: 8px; width: 100%; align-items: center; }
.form-control-with-btn .form-control { flex: 1; }

.captcha-container { display: flex; gap: 10px; align-items: center; }
.captcha-img { height: 38px; border-radius: var(--radius-sm); cursor: pointer; transition: opacity 0.2s; border: 1px solid var(--border-color); }
.captcha-img:hover { opacity: 0.8; }
.uploading-status { color: var(--primary-color); font-weight: 700; font-size: 0.8rem; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }

.admin-tab-headers { display: flex; gap: 4px; border-bottom: 1px solid var(--border-light); margin-bottom: 16px; }
.tab-title { padding: 6px 14px; font-size: 0.85rem; font-weight: 600; cursor: pointer; color: var(--text-muted); border-radius: 6px 6px 0 0; transition: all 0.2s; }
.tab-title:hover { color: var(--text-main); }
.tab-title.active { color: var(--primary-color); background: var(--primary-light); }
.scrollable-body { max-height: 55vh; overflow-y: auto; padding-right: 4px; }
.table-action-bar { display: flex; gap: 8px; margin-bottom: 14px; }
.table-action-bar .form-control { max-width: 200px; background: #fff; }
.table-responsive { width: 100%; overflow-x: auto; border: 1px solid var(--border-light); border-radius: var(--radius-sm); }
.admin-data-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; text-align: left; }
.admin-data-table th, .admin-data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border-light); }
.admin-data-table th { background: #f8fafc; font-weight: 700; color: #475569; }
.admin-data-table tr:hover td { background: #f8fafc; }

/* 灯箱 */
.style-lightbox { background: rgba(15, 23, 42, 0.9); }
.lightbox-content { text-align: center; max-width: 90vw; animation: zoomIn 0.25s var(--curve-fast); position: relative; }
.lightbox-content img { max-width: 100%; max-height: 75vh; border-radius: var(--radius-md); box-shadow: 0 0 40px rgba(0,0,0,0.3); }
.lightbox-caption { color: #fff; margin-top: 12px; font-weight: 500; font-size: 0.9rem; }
.lightbox-close { position: absolute; top: -40px; right: 0; color: #fff; font-size: 2rem; background: none; border: none; cursor: pointer; }

.style-confirm .modal-box { max-width: 340px; padding: 20px; text-align: center; }
.confirm-message { font-weight: 600; font-size: 0.9rem; padding: 12px 0; color: var(--text-main); }
.style-confirm .modal-footer { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }

/* ==========================================
   09. 全局通知纯净 Toast
   ========================================== */
.toast-wrapper { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 100000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast-item { 
    background: #1e293b; color: #fff; padding: 8px 18px; border-radius: 50px; 
    font-size: 0.82rem; font-weight: 600; box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 6px; border: 1px solid rgba(255,255,255,0.1);
}

.system-footer { text-align: center; padding: 24px; font-size: 0.78rem; color: var(--text-muted); border-top: 1px solid var(--border-light); }

/* ==========================================
   10. Iconfont 间距与垂直居中对齐规范修正
   ========================================== */
.iconfont { 
    display: inline-flex; align-items: center; justify-content: center; 
    vertical-align: -0.125em; 
}
.iconfont + * { margin-left: 6px; }

/* ==========================================
   11. Vue 动画钩子
   ========================================== */
.toast-fade-enter-active { animation: toastIn 0.3s var(--curve-main); }
.toast-fade-leave-active { animation: toastOut 0.2s var(--curve-fast); }
@keyframes toastIn {
    0% { opacity: 0; transform: translateY(-20px) scale(0.9); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}

.dropdown-fade-enter-active, .dropdown-fade-leave-active { transition: all 0.2s var(--curve-fast); }
.dropdown-fade-enter-from, .dropdown-fade-leave-to { opacity: 0; transform: scale(0.95) translateY(-6px); }

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ✅ 核心修正：优化关键帧占比（将20%拉长到35%），速度恢复舒缓柔和，且彻底滑出无色差 */
@keyframes logoShine {
    0% { background-position: 150% 0; }
    35% { background-position: -50% 0; }   /* 延长划过时间占比，物理速度完美减慢 */
    100% { background-position: -50% 0; }  /* 剩余时间静止恢复，保留呼吸空隙感 */
}

/* ==========================================
   12. 响应式深度断点精细化修改（已深度调优手机移动端）
   ========================================== */
.mobile-search { display: none; }
.desktop-search { display: block; }

@media (max-width: 1320px) {
    .header-container { width: 100%; padding: 0 24px; }
    .main-workspace { width: 100%; padding: 24px; }
    .image-gallery-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}

@media (max-width: 960px) {
    .image-gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
    .desktop-search { display: none; }
    .mobile-search { display: block; flex: none; width: 100%; margin-bottom: 4px; }
    .mobile-search input { background: #fff; border: 1px solid var(--border-color); padding: 9px 14px 9px 36px; box-shadow: var(--shadow-sm); }
}

/* 📱 手机端深度质感调优断点 */
@media (max-width: 640px) {
    /* 1. 基础视口容器规整，防止页面手势滑出白色右侧边距 */
    .header-container { height: 56px; padding: 0 14px; }
    .site-logo { height: 26px; }
    .branding-title { font-size: 0.95rem; letter-spacing: -0.2px; }
    
    .main-workspace { 
        min-height: calc(100vh - 110px); 
        gap: 14px; 
        padding: 12px; 
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* 2. 横向分类滑动轨道无界化优化 */
    .top-category-bar {
        padding-bottom: 6px;
        margin: 0 -12px; /* 运用负外边距，让滚动直达屏幕两侧边缘不穿帮 */
        padding-left: 12px;
        padding-right: 12px;
        -webkit-overflow-scrolling: touch; /* 注入 iOS 原生硬件弹性滑动加速 */
    }
    .category-tab {
        padding: 6px 16px;
        font-size: 0.8rem;
    }

    /* 3. 网格画廊重构（引入动态 aspect-ratio，彻底根治全机型图片拉伸问题） */
    .gallery-section-box { 
        padding: 14px; 
        border-radius: var(--radius-md); 
        border: none; /* 移除手机端边框，带来现代无界视觉感 */
        box-shadow: var(--shadow-sm);
    }
    .section-title-banner { margin-bottom: 14px; padding-bottom: 10px; }
    .banner-txt { font-size: 0.95rem; }
    .banner-sub { font-size: 0.75rem; }

    .image-gallery-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 10px; /* 紧凑精致的移动网格间距 */
    }
    .image-wrapper { 
        height: auto; 
        aspect-ratio: 4 / 3; /* 抛弃死板的 110px，自适应黄金比例 */
    }
    .image-info { padding: 8px 10px 10px 10px; }
    .image-title { font-size: 0.8rem; }
    .image-meta { font-size: 0.7rem; margin-top: 4px; }
    .image-actions { margin-top: 8px; padding-top: 6px; gap: 4px; }
    .image-actions .btn { padding: 6px 4px; font-size: 0.75rem; }

    /* 4. 移动端 UI 控件大面积指尖触控优化 */
    .btn { padding: 8px 14px; font-size: 0.82rem; }
    .btn-sm { padding: 5px 10px; font-size: 0.78rem; }
    .form-control { padding: 8px 12px; font-size: 0.85rem; }
    
    /* 5. 弹窗与表单适配防溢出 */
    .modal-overlay { padding: 16px; }
    .modal-box { 
        padding: 18px; 
        border-radius: var(--radius-md); 
        width: 100%;
        max-height: 85vh;
    }
    .modal-header { margin-bottom: 14px; }
    .modal-header h3 { font-size: 0.98rem; }
    .scrollable-body { max-height: 50vh; }
    
    /* 6. 灯箱视口空间放大调整 */
    .lightbox-content img { max-height: 65vh; }
    .lightbox-close { top: -36px; font-size: 1.8rem; }
}