/* ═══════════════════════════════════════════════
   蒋文超摄影图片交付后台 —— 全局样式 v2
   移动端优先，桌面端增强
   ═══════════════════════════════════════════════ */

/* ── 无障碍：跳转链接 ── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    padding: 8px 20px;
    border-radius: 0 0 8px 8px;
    z-index: 10000;
    font-size: 14px;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0;
}

:root {
    --primary: #4a90d9;
    --primary-dark: #3a7bc8;
    --success: #52c41a;
    --danger: #ff4d4f;
    --warning: #faad14;
    --text: #1a1a1a;
    --text-light: #888;
    --bg: #f0f2f5;
    --card: #fff;
    --border: #e8e8e8;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
}

/* ── 暗色模式 ── */
body.dark-mode {
    --primary: #5b9fe8;
    --primary-dark: #4a8fd8;
    --text: #e0e0e0;
    --text-light: #8890a0;
    --bg: #1a1a2e;
    --card: #16213e;
    --border: #2a2a4a;
    --shadow: 0 2px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.45);
    background: var(--bg);
    color: var(--text);
}
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
    background: #1e2a45;
    color: var(--text);
    border-color: var(--border);
}
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #556;
}
body.dark-mode a { color: var(--primary); }
body.dark-mode .nav-bar { background: #0f1a2e; border-color: #1a2a4a; }
body.dark-mode .album-card,
body.dark-mode .wm-field,
body.dark-mode .settings-section,
body.dark-mode .admin-stat-card,
body.dark-mode .pm-card,
body.dark-mode .review-session-card,
body.dark-mode .notification-item {
    background: var(--card);
    border-color: var(--border);
}
body.dark-mode .album-card:hover { background: #1c2b50; }
body.dark-mode .pm-card:hover { background: #1c2b50; }
body.dark-mode .empty-state { color: var(--text-light); }
body.dark-mode .toast-stack .toast { background: var(--card); color: var(--text); }
body.dark-mode table th { background: #1a2848; }
body.dark-mode table td { border-color: var(--border); }
body.dark-mode table tr:hover td { background: #1a2848; }
body.dark-mode .modal-overlay .modal-content { background: var(--card); }
body.dark-mode .password-page { background: var(--bg); }
body.dark-mode .login-wrapper { background: linear-gradient(135deg, #0a0a1a, #1a1a3e, #0f0f2e); }
body.dark-mode .login-card { background: var(--card); }
body.dark-mode .login-header h2 { color: var(--text); }
body.dark-mode .input-group input { background: #1e2a45; color: var(--text); border-color: var(--border); }
body.dark-mode .customer-workflow-banner { background: #1a2848; }

/* ── 通用工具类（替代内联样式） ── */
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { display: flex; flex-wrap: wrap; }
.gap-4  { gap: 4px; }  .gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }  .gap-10 { gap: 10px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.mt-4  { margin-top: 4px; }  .mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }  .mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.p-12 { padding: 12px; } .p-16 { padding: 16px; }
.p-20 { padding: 20px; } .p-24 { padding: 24px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

/* ── 导航栏 ────────────────────────────────── */

.navbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

.nav-brand {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

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

/* ── 容器 ──────────────────────────────────── */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h2 { font-size: 22px; font-weight: 600; }

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

/* ── 按钮 ──────────────────────────────────── */

.btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn:hover { background: #f5f5f5; }
.btn-sm { padding: 5px 12px; font-size: 13px; }

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

.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { opacity: 0.9; }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { opacity: 0.9; }

.btn-outline { background: transparent; color: var(--text-light); }
.btn-outline:hover { background: #f5f5f5; color: var(--text); }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    background: #f0f0f0;
    color: var(--text-light);
    font-size: 12px;
}

.badge-on { background: #e8f5e9; color: #2e7d32; }
.badge-off { background: #f5f5f5; color: #999; }

/* ── 表单 ──────────────────────────────────── */

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

.form-group label {
    display: block;
    font-size: 14px;
    color: #555;
    margin-bottom: 4px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.form-group textarea { resize: vertical; }

.form-group input:focus,
.form-group textarea:focus { border-color: var(--primary); }

.form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.create-form {
    background: var(--card);
    padding: 20px 24px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ── Toast 提示 ────────────────────────────── */

.toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
}

.toast-success { background: #f6ffed; border: 1px solid #b7eb8f; color: #389e0d; }
.toast-error { background: #fff2f0; border: 1px solid #ffccc7; color: #cf1322; }
.toast-stack {
    position: fixed;
    top: 76px;
    right: 24px;
    z-index: 1100;
    display: grid;
    gap: 8px;
    width: min(360px, calc(100vw - 32px));
}
.toast-dismiss {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.toast-dismiss:hover { background: rgba(0, 0, 0, 0.08); }
.toast-leaving { opacity: 0; transform: translateX(16px); transition: opacity .18s ease, transform .18s ease; }

.toast-float {
    position: fixed;
    top: 72px;
    right: 24px;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease;
}

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

/* ── 相册网格（后台管理） ─────────────────── */

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.album-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.album-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.album-cover {
    display: block;
    aspect-ratio: 16 / 10;
    background: #f5f5f5;
    overflow: hidden;
    text-decoration: none;
}

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

.album-card:hover .album-cover img { transform: scale(1.03); }

.album-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 14px;
}

.album-info { padding: 14px 16px; }

.album-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.album-internal-id,
.field-internal-id {
    display: block;
    margin: -2px 0 8px;
    color: var(--text-light);
    font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .02em;
    user-select: text;
}

.field-internal-id { margin: 5px 0 0; }

.album-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.album-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.album-actions form { display: inline !important; }

.album-card-link { text-decoration: none; color: inherit; }

/* ── 相册编辑头部 ─────────────────────────── */

.album-edit-header {
    background: var(--card);
    padding: 20px 24px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.album-meta-form .form-row { align-items: flex-end; }

.album-meta-form .form-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

.album-meta-form .form-group label {
    margin-bottom: 0;
    white-space: nowrap;
}

.share-link-box {
    margin-top: 14px;
    padding: 10px 14px;
    background: #f6f8fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.share-link-box code {
    flex: 1;
    padding: 4px 10px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-label { color: var(--text-light); white-space: nowrap; }

/* ── 水印设置面板 ─────────────────────────── */

.watermark-panel {
    background: var(--card);
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.watermark-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.watermark-header:hover { background: #fafafa; }
.watermark-header-static { cursor: default; }
.watermark-header-static:hover { background: transparent; }

.watermark-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}

.watermark-title svg { opacity: 0.6; }

.watermark-toggle-arrow {
    color: var(--text-light);
    font-size: 14px;
    transition: transform 0.2s;
}

.watermark-body {
    padding: 0 24px 20px;
    border-top: 1px solid var(--border);
}

.wm-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.wm-field label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
    font-weight: 500;
}

.wm-field input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.wm-field input[type="text"]:focus,
.wm-field input[type="password"]:focus { border-color: var(--primary); }

/* 统一弹窗内所有输入框样式 */
.settings-modal-content .wm-field input,
.settings-modal-content .wm-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #dde3ee;
    border-radius: 8px;
    font-size: 15px;
    background: #f8f9fc;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
    appearance: auto;
}
.settings-modal-content .wm-field input:focus,
.settings-modal-content .wm-field select:focus {
    border-color: #4a90d9;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(74,144,217,0.12);
    outline: none;
}
.settings-modal-content .wm-field select {
    cursor: pointer;
    height: 42px;
}

.wm-field input[type="range"] {
    width: 100%;
    margin-top: 4px;
    accent-color: var(--primary);
}

.wm-switch {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

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

.wm-switch-label {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--text) !important;
}

.wm-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ── 上传区域 ──────────────────────────────── */

.upload-zone {
    background: var(--card);
    border: 2px dashed #d9d9d9;
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary);
    background: #f0f7ff;
}

.upload-icon { font-size: 40px; margin-bottom: 12px; }

.upload-text {
    font-size: 16px;
    color: var(--text);
    margin-bottom: 6px;
}

.upload-hint { font-size: 13px; color: var(--text-light); }

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

.progress-bar {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.4s ease-out;
    width: 0%;
}

.progress-text {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 8px;
}

/* ── 照片网格（后台管理） ─────────────────── */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.photo-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
    cursor: pointer;
}

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

.photo-card:hover img { transform: scale(1.05); }

.photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

.photo-card:hover .photo-overlay { opacity: 1; }

.photo-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.photo-btn:hover { transform: scale(1.15); }

.btn-cover { background: rgba(255,255,255,0.9); color: #faad14; }
.btn-delete { background: rgba(255,77,79,0.9); color: white; }

/* ── 空状态 ────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
    font-size: 15px;
}

.empty-state svg { margin-bottom: 16px; }

/* ════════════════════════════════════════════
   分享页面（手机端为主）
   ════════════════════════════════════════════ */

.share-page { background: #fafafa; }

/* ── 首页 Hero ─────────────────────────────── */

.index-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 48px 24px 40px;
    text-align: center;
}

.index-hero h1 {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.index-hero p {
    color: rgba(255,255,255,0.8);
    font-size: 15px;
}

.share-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* ── 相册封面 Hero ─────────────────────────── */

.album-hero {
    position: relative;
    overflow: hidden;
    max-height: 50vh;
}

.hero-bg {
    width: 100%;
    display: block;
    object-fit: cover;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}

/* ── 相册信息栏 ── */
.album-info-bar {
    user-select: none;
    -webkit-user-select: none;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px 12px;
    color: #222;
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.album-info-title {
    font-size: 24px;
    font-weight: 700;
    color: inherit;
    margin-bottom: 6px;
    line-height: 1.3;
}

.album-info-desc {
    color: inherit;
    opacity: 0.7;
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.6;
    white-space: pre-line;
}

.album-info-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
    margin-bottom: 4px;
}

.album-info-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    color: inherit;
    opacity: 0.8;
    font-size: 13px;
}

.album-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 16px;
    background: rgba(0,0,0,0.08);
    color: inherit;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid rgba(0,0,0,0.12);
    transition: background 0.2s;
}
.album-download-btn:hover {
    background: rgba(0,0,0,0.15);
}
.album-info-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.album-download-btn.album-download-primary {
    min-width: 0;
    min-height: 34px;
    padding: 5px 10px;
    gap: 5px;
    justify-content: center;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}
.album-download-primary svg {
    width: 16px;
    height: 16px;
}

.album-info-stat svg { opacity: 0.8; }

.album-info-share-extra {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
    font-size: 12px;
    opacity: 0.75;
}
.album-info-share-extra span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.album-info-share-extra svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* ── 分组筛选标签栏 ── */
.gallery-filter-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-filter-tabs::-webkit-scrollbar {
    display: none;
}

.gallery-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 500;
    color: inherit;
    opacity: 0.6;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.gallery-filter-tab:hover {
    opacity: 0.85;
}

.gallery-filter-tab.active {
    opacity: 1;
    border-bottom-color: currentColor;
}

.filter-count {
    font-size: 12px;
    opacity: 0.7;
}

/* ── 悬浮返回按钮 ── */
.fab-back-btn {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 900;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px 10px 14px;
    border-radius: 28px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
}
.fab-back-btn:hover {
    background: rgba(0,0,0,0.7);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.fab-back-btn:active {
    transform: scale(0.96);
}
.fab-back-btn.dragging {
    cursor: grabbing;
    opacity: 0.85;
    transform: scale(1.05);
    transition: none;
}
.fab-back-label {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── 照片画廊（展示页） ───────────────────── */

.album-gallery {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

.gallery-masonry {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
}

.gallery-cell {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #eee;
    aspect-ratio: 3 / 2;
}

.gallery-cell:focus-visible {
    outline: 3px solid #1677ff;
    outline-offset: 2px;
}

.review-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,0.65);
    border-radius: 50%;
    background: rgba(20,20,20,0.5);
    color: #fff;
    cursor: pointer;
    z-index: 3;
    backdrop-filter: blur(8px);
}

.review-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; }
.review-btn.selected { background: #d9363e; border-color: #d9363e; }
.review-btn.selected svg { fill: currentColor; }
.review-btn:disabled { opacity: 0.55; cursor: wait; }
.review-btn.review-locked,
.review-note-btn[aria-disabled="true"] { cursor: not-allowed; opacity: .72; }

.review-status {
    display: inline-flex;
    align-items: center;
    margin-top: 10px;
    padding: 6px 10px;
    border: 1px solid currentColor;
    border-radius: 6px;
    font-size: 13px;
    opacity: 0.78;
}

.review-settings { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-settings input[type="number"] { width: 76px; }
.field-suffix { color: var(--text-light); font-size: 12px; }
.review-summary-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-left: 3px solid #1677ff;
    background: var(--card);
}
.review-summary-bar span { margin-left: 8px; color: var(--text-light); font-size: 13px; }
.review-count { color: #b4232d; font-weight: 600; }

/* Workflow and proofing workspace */
.album-workflow-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    margin: 12px 0 0;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
}
.workflow-state { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.save-state { color: var(--text-light); font-size: 11px; white-space: nowrap; }
.save-state.dirty { color: #9a6200; }
.delivery-status-control { position: relative; }
.delivery-status-control select { width: 100%; }
.delivery-status-hint {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 120;
    display: none;
    width: 280px;
    padding: 10px 12px;
    color: #26312d;
    background: #fff;
    border: 1px solid #cbd3cf;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,.16);
    font-size: 12px;
    line-height: 1.55;
}
.delivery-status-hint::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 18px;
    width: 8px;
    height: 8px;
    background: inherit;
    border-left: 1px solid #cbd3cf;
    border-top: 1px solid #cbd3cf;
    transform: rotate(45deg);
}
.delivery-status-hint strong { display: block; margin-bottom: 2px; color: #176b5b; font-size: 13px; }
.delivery-status-control:hover .delivery-status-hint,
.delivery-status-control:focus-within .delivery-status-hint { display: block; }
body.dark-mode .delivery-status-hint {
    color: #d8dfdc;
    background: #262a28;
    border-color: #4b5551;
    box-shadow: 0 10px 28px rgba(0,0,0,.45);
}
body.dark-mode .delivery-status-hint::before { border-color: #4b5551; }
.album-workspace-tabs {
    position: sticky;
    top: 56px;
    scroll-margin-top: 56px;
    z-index: 80;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 8px 0;
    margin-bottom: 8px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
}
.album-workspace-tabs a {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-bottom: 2px solid transparent;
    color: var(--text-light);
    font-size: 13px;
    text-decoration: none;
}
.album-workspace-tabs a:hover { color: var(--primary-color); border-color: var(--primary-color); }
.album-workspace-tabs a.active {
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
}
.workspace-section[hidden] { display: none !important; }
.workspace-section { scroll-margin-top: 112px; }
.visual-style-sections { display: flex; flex-direction: column; }
.splash-settings-form {
    display: grid;
    grid-template-columns: minmax(220px, 288px) minmax(360px, 1fr);
    gap: 24px;
    align-items: start;
    padding-top: 16px;
}
.splash-settings-media {
    display: grid;
    gap: 10px;
    width: min(100%, 288px);
}
.splash-settings-preview,
.splash-settings-empty {
    width: 100%;
    aspect-ratio: 9 / 16;
    border: 1px solid var(--border);
    border-radius: 6px;
}
.splash-settings-preview { display: block; object-fit: cover; }
.splash-settings-empty {
    display: grid;
    place-items: center;
    color: var(--text-light);
    background: rgba(127, 127, 127, .06);
}
.splash-file-btn { width: fit-content; cursor: pointer; }
.splash-file-btn input { display: none; }
.splash-settings-controls { display: grid; gap: 16px; }
.splash-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 12px 18px;
}
.splash-settings-grid > label {
    display: grid;
    gap: 7px;
    color: var(--text-light);
    font-size: 13px;
}
.splash-settings-grid > label:last-child { grid-column: 1 / -1; }
.splash-settings-grid label > span { display: flex; align-items: center; gap: 8px; color: var(--text); }
.splash-settings-grid input[type="number"] { width: 76px; }
.splash-settings-grid input[type="range"] { flex: 1; min-width: 140px; }
.splash-setting-switches { display: flex; gap: 20px; flex-wrap: wrap; }
.splash-clear-form { margin-top: 12px; }
@media (max-width: 768px) {
    .splash-settings-form { grid-template-columns: 1fr; gap: 16px; }
    .splash-settings-media { width: min(100%, 320px); }
    .splash-settings-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .splash-settings-grid { grid-template-columns: 1fr; }
    .splash-settings-grid > label:last-child { grid-column: auto; }
}
.review-workspace {
    display: block;
    margin: 16px 0;
    padding: 0;
    border: 0;
    background: transparent;
}
.review-workspace-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.review-workspace-head > div:first-child { display: flex; align-items: baseline; gap: 10px; }
.review-workspace-head > div:first-child span { margin: 0; }
.review-workspace-actions { display: flex; gap: 8px; margin-left: auto; }
.review-summary-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
}
.review-summary-toggle svg {
    width: 18px;
    height: 18px;
    color: var(--text-light);
    transition: transform .18s ease;
}
.review-workspace:not(.is-collapsed) .review-summary-toggle svg { transform: rotate(180deg); }
.review-unread-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(212, 61, 77, .16);
    color: #ff6b78 !important;
    font-size: 12px !important;
    font-weight: 700;
}
.review-read-all-btn {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: transparent;
    color: var(--text-light);
    font: inherit;
    font-size: 12px !important;
    cursor: pointer;
}
.review-read-all-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}
.review-workspace.is-collapsed .review-session-list { display: none; }
.review-workspace-actions .review-clear-btn,
body.dark-mode .review-workspace-actions .review-clear-btn {
    background: var(--danger) !important;
    border-color: var(--danger) !important;
    color: #fff !important;
}
.review-workspace-actions .review-clear-btn:hover:not(:disabled),
body.dark-mode .review-workspace-actions .review-clear-btn:hover:not(:disabled) {
    background: #a9303d !important;
    border-color: #a9303d !important;
}
.review-session-list { display: grid; gap: 8px; width: 100%; margin-top: 12px; }
.review-session-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
}
.review-session-card.is-new-review {
    border-color: rgba(212, 61, 77, .62);
    background: rgba(212, 61, 77, .08);
    box-shadow: inset 3px 0 0 #d43d4d;
}
.review-session-main { min-width: 0; flex: 1; }
.review-session-heading { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.review-session-heading > span { color: var(--text-light); font-size: 12px; }
.review-session-heading .proof-status { margin-left: 2px; }
.review-session-time { color: var(--text-light); font-size: 11px; opacity: 0.7; }
.review-new-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #d43d4d;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 700;
}
.review-session-note { margin: 5px 0 0; font-size: 13px; color: var(--text-light); }
.review-session-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.review-session-count { color: var(--text-light); font-size: 12px; white-space: nowrap; }
.review-thumbnail-strip { display: flex; align-items: center; gap: 8px; margin-top: 10px; overflow-x: auto; padding: 2px 2px 3px; }
.review-thumbnail {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: 88px;
    height: 66px;
}
.review-thumbnail-link {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}
.review-thumbnail-link img { display: block; width: 100%; height: 100%; object-fit: cover; }
.review-thumbnail-large {
    position: absolute;
    z-index: 20;
    bottom: calc(100% + 8px);
    left: 0;
    display: none;
    width: 260px;
    padding: 4px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
}
.review-thumbnail-large img { display: block; width: 100%; max-height: 220px; object-fit: contain; }
.review-thumbnail-link:hover + .review-thumbnail-large,
.review-thumbnail-link:focus-visible + .review-thumbnail-large { display: block; }
.review-thumbnail-note {
    position: absolute;
    right: 5px;
    bottom: 5px;
    display: inline-grid;
    width: 24px;
    height: 24px;
    padding: 0;
    place-items: center;
    color: #1f2933;
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(255, 255, 255, .98);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .36);
    cursor: pointer;
}
.review-thumbnail-note svg {
    width: 14px;
    height: 14px;
}
.review-thumbnail-note:hover,
.review-thumbnail-note:focus-visible {
    color: #0f766e;
    background: #fff;
    outline: 2px solid rgba(20, 184, 166, .72);
    outline-offset: 1px;
}
.review-thumbnail-note-popover {
    position: absolute;
    z-index: 21;
    right: 0;
    bottom: calc(100% + 6px);
    display: none;
    width: max-content;
    max-width: 230px;
    padding: 6px 8px;
    color: var(--text);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: var(--shadow);
    font-size: 12px;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
}
.review-thumbnail-note:hover .review-thumbnail-note-popover,
.review-thumbnail-note:focus .review-thumbnail-note-popover { display: block; }
.pm-download-selected-form { display: contents; }
.pm-card-review-detail {
    display: grid;
    gap: 2px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 12px;
    line-height: 1.4;
}
.pm-card-review-detail strong { color: var(--text); font-weight: 600; }
.pm-card-review-detail p { margin: 0; overflow-wrap: anywhere; }
}
.review-thumbnail-more {
    flex: 0 0 auto;
    color: var(--text-light);
    font-size: 12px;
}
.proof-status { padding: 3px 7px; border-radius: 4px; }
.proof-status-submitted { color: #176b4d !important; background: #e8f7f0; }
.proof-status-reopened { color: #8a5a00 !important; background: #fff4d6; }
.review-empty { padding: 18px; color: var(--text-light); text-align: center; }
.review-pagination {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    justify-content: center; margin: 14px 0 4px; padding-top: 10px;
    border-top: 1px solid var(--border-color, #eee);
}
.review-pagination .page-btn {
    min-width: 34px; text-align: center; padding: 5px 10px;
    border: 1px solid var(--border-color, #ddd); border-radius: 6px;
    background: #fff; color: var(--text-primary, #333); font-size: 13px;
    text-decoration: none; cursor: pointer; transition: all .15s;
}
.review-pagination .page-btn:hover:not(.disabled):not(.current) {
    border-color: #7c5cff; color: #7c5cff;
}
.review-pagination .page-btn.current {
    background: #7c5cff; border-color: #7c5cff; color: #fff; cursor: default;
}
.review-pagination .page-btn.disabled {
    color: #bbb; background: #f9f9f9; cursor: not-allowed;
}
@media (max-width: 760px) {
    .review-workspace-head > div:first-child { width: 100%; }
    .review-workspace-actions { width: 100%; margin-left: 0; overflow-x: auto; }
    .review-session-card { align-items: flex-start; flex-direction: column; }
    .review-session-meta { width: 100%; justify-content: flex-start; }
}

.proofing-submit-panel {
    position: sticky;
    bottom: 12px;
    z-index: 50;
    display: grid;
    grid-template-columns: minmax(160px, .7fr) minmax(280px, 1.8fr) auto;
    align-items: center;
    gap: 14px;
    width: min(1100px, calc(100% - 32px));
    margin: 20px auto;
    padding: 14px;
    color: #18201d;
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(0,0,0,.14);
    box-shadow: 0 8px 28px rgba(0,0,0,.18);
    backdrop-filter: blur(12px);
}
.proofing-submit-copy { display: flex; flex-direction: column; gap: 4px; }
.proofing-submit-copy span { color: #66706b; font-size: 12px; }
.proofing-submission-details { margin-top: 10px; }
.proofing-submission-details summary {
    width: fit-content;
    color: #176b5b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.proofing-submission-details[open] summary { margin-bottom: 10px; }
.proofing-fields { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 8px; }
.proofing-fields input, .proofing-fields textarea {
    width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #ccd2cf;
    border-radius: 4px; background: #fff; color: #18201d; resize: vertical;
}
.proofing-submit-btn {
    min-height: 40px; padding: 0 16px; border: 0; border-radius: 4px;
    color: #fff; background: #176b5b; font-weight: 600; cursor: pointer;
}
.album-download-btn { font: inherit; cursor: pointer; }
.album-download-btn:disabled { opacity: .65; cursor: wait; }
.proofing-locked-badge { margin-left: 8px; color: #176b5b; font-size: 12px; }
.customer-workflow-banner {
    display: flex; align-items: center; gap: 8px; width: fit-content;
    margin: 10px 0; padding: 7px 10px; border-left: 3px solid currentColor; font-size: 12px;
}
.customer-workflow-banner strong { font-size: 13px; }
.customer-workflow-review { color: #8a5a00; background: rgba(255,196,66,.1); }
.customer-workflow-delivered { color: #24856f; background: rgba(36,133,111,.1); }
.review-note-btn {
    position: absolute; right: 12px; bottom: 12px; display: none; width: 34px; height: 34px;
    align-items: center; justify-content: center; padding: 0; color: #fff;
    border: 1px solid rgba(255,255,255,.7); border-radius: 50%; background: rgba(0,0,0,.62);
}
.review-note-btn.visible { display: flex; }
.review-note-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.upload-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.upload-file-queue { display: grid; gap: 5px; max-height: 220px; overflow-y: auto; margin-top: 8px; }
.upload-file-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center;
    gap: 8px; padding: 7px 9px; border: 1px solid var(--border-color); font-size: 12px;
}
.upload-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-file-state { color: var(--text-light); }
.upload-file-row.success .upload-file-state { color: #176b4d; }
.upload-file-row.failed .upload-file-state { color: #b4232d; }
.upload-retry-btn { border: 0; background: transparent; color: var(--primary-color); cursor: pointer; }
.workflow-overview {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px;
}
.workflow-overview button {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 4px;
    background: var(--card-bg); color: var(--text-color); cursor: pointer;
}
.workflow-overview button.active { border-color: var(--primary-color); box-shadow: inset 0 -2px var(--primary-color); }
.workflow-overview strong { font-size: 18px; }
.workflow-overview span { color: var(--text-light); font-size: 13px; }
.notification-panel { margin: 12px 0 18px; border: 1px solid var(--border-color); background: var(--card-bg); }
.notification-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border-color); }
.notification-toggle { display: inline-flex; align-items: center; min-width: 0; gap: 7px; padding: 0; border: 0; color: var(--text); background: none; cursor: pointer; text-align: left; }
.notification-toggle strong { white-space: nowrap; }
.notification-toggle strong span { color: #b4232d; font-size: 12px; }
.notification-toggle svg { width: 16px; height: 16px; color: var(--text-light); transition: transform .16s ease; }
.notification-read-summary { display: none; color: var(--text-light); font-size: 12px; }
.notification-read-btn { border: 0; padding: 0; background: none; color: var(--primary-color); cursor: pointer; }
.notification-panel.is-collapsed .notification-panel-head { border-bottom: 0; }
.notification-panel.is-collapsed .notification-list { display: none; }
.notification-panel.is-collapsed .notification-read-summary { display: inline; }
.notification-panel.is-collapsed .notification-toggle svg { transform: rotate(-90deg); }
.notification-list { display: grid; }
.notification-item {
    display: grid; grid-template-columns: minmax(130px, .6fr) minmax(180px, 1fr) auto;
    gap: 12px; padding: 10px 12px; color: inherit; text-decoration: none;
    border-bottom: 1px solid var(--border-color); font-size: 13px;
}
.notification-item:last-child { border-bottom: 0; }
.notification-item.unread { background: rgba(23,107,91,.07); }
.notification-item span, .notification-item time { color: var(--text-light); }

@media (max-width: 760px) {
    .admin-page .container { width: 100%; padding: 0 12px 84px; overflow-x: hidden; }
    .admin-page .nav-inner { padding: 8px 12px; }
    .admin-page .nav-user { display: none; }
    .album-meta-form .form-row { display: grid; grid-template-columns: 1fr; }
    .album-meta-form .form-group, .album-meta-form .flex-1, .album-meta-form .flex-2 { width: 100%; }
    .delivery-status-hint {
        position: static;
        display: block;
        width: 100%;
        margin-top: 6px;
        box-shadow: none;
    }
    .delivery-status-hint::before { display: none; }
    .album-workflow-bar { align-items: flex-start; }
    .album-workspace-tabs {
        top: 56px;
        scroll-margin-top: 56px;
        margin-left: -12px;
        margin-right: -12px;
        padding-left: 12px;
    }
    .pm-toolbar { display: grid; grid-template-columns: 1fr; gap: 8px; }
    .pm-sort-box { justify-content: flex-end; }
    .pm-actions {
        position: sticky; bottom: 8px; z-index: 70; display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px;
        padding: 8px; background: rgba(255,255,255,.96); border: 1px solid var(--border-color);
        box-shadow: 0 8px 24px rgba(0,0,0,.16); overflow: visible;
    }
    .pm-actions-spacer { display: none; }
    .pm-action-btn { justify-content: center; min-width: 0; padding: 8px 5px; }
    .pm-group-select { grid-column: span 2; width: 100%; }
    .pm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .pm-card { min-width: 0; }
    .pm-card-meta-item { overflow-wrap: anywhere; }
    .review-session-card { align-items: flex-start; flex-direction: column; }
    .review-session-meta { justify-content: flex-start; }
    .review-workspace-actions { width: 100%; margin-left: 0; }
    .proofing-submit-panel {
        position: relative; bottom: auto; grid-template-columns: 1fr;
        width: calc(100% - 24px); margin: 14px 12px; padding: 12px;
    }
    .proofing-fields { grid-template-columns: 1fr; }
    .proofing-submit-btn { width: 100%; }
    .workflow-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .notification-item { grid-template-columns: 1fr; gap: 3px; }
    .album-gallery { padding-left: 16px; padding-right: 16px; }
    .gallery-masonry { columns: 2; column-gap: 8px; }
}

@media (min-width: 1100px) {
    .album-gallery { width: min(1400px, calc(100% - 48px)); max-width: none; }
    .gallery-masonry { columns: 4; column-gap: 14px; }
}

.gallery-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.gallery-cell:active img {
    transform: scale(0.96);
}

/* ════════════════════════════════════════════
   灯箱 (Lightbox)
   ════════════════════════════════════════════ */

.lightbox {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

/* 顶部栏 */
.lb-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 8px;
    padding-top: max(8px, env(safe-area-inset-top));
    background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);
}

.lb-topbtn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.lb-topbtn:hover { background: rgba(255,255,255,0.25); }

.lb-counter {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.lb-spacer { width: 40px; }

/* 照片展示区 */
.lb-stage {
    flex: 1;
    position: relative;
    padding: 60px 16px 80px;
    overflow: hidden;
}

.lb-transform {
    position: absolute;
    inset: 0;
    transform-origin: center center;
    will-change: transform;
}

.lb-stage img {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    user-select: none;
    will-change: auto;
}
.lb-photo {
    opacity: 0;
    transition: opacity 0.25s ease;
    -webkit-user-drag: auto;
    -webkit-touch-callout: default;
    -webkit-user-select: auto;
    user-select: auto;
}

/* 原图模式保持单一、普通的 img 命中面，避免微信保存合成后的灯箱画面。 */
.lightbox.is-original-mode .lb-stage {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox.is-original-mode .lb-transform {
    position: relative;
    inset: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    will-change: auto;
}

.lightbox.is-original-mode .lb-stage img {
    position: static;
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 140px);
    margin: 0;
    border-radius: 0;
    transition: none;
    will-change: auto;
    -webkit-user-drag: auto;
    -webkit-touch-callout: default;
    -webkit-user-select: auto;
    user-select: auto;
    flex: none;
}

.lb-spinner {
    position: absolute;
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: rgba(255,255,255,0.8);
    border-radius: 50%;
    animation: lb-spin 0.7s linear infinite;
    display: none;
}
.lb-spinner.visible { display: block; }
@keyframes lb-spin {
    to { transform: rotate(360deg); }
}

/* 底部导航 */
.lb-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(0,0,0,0.4) 0%, transparent 100%);
}

.lb-nav-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.lb-nav-btn:hover { background: rgba(255,255,255,0.3); }
.lb-nav-btn:active { transform: scale(0.92); }

/* 微信保存原图提示：原图加载后出现在底部工具栏上方 */
.lb-save-hint {
    position: absolute;
    bottom: 78px;
    left: 12px;
    right: 12px;
    z-index: 11;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 8px;
    text-align: center;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.lb-save-hint b { color: #ffd54f; font-weight: 600; }

.lb-prev-btn {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 11;
}

.lb-next-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 11;
}

.lb-prev-btn:active { transform: translateY(-50%) scale(0.92); }
.lb-next-btn:active { transform: translateY(-50%) scale(0.92); }

.lb-dots {
    display: flex;
    gap: 5px;
    align-items: center;
}

.lb-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transition: all 0.2s;
}

.lb-dot.active {
    background: #fff;
    width: 8px;
    height: 8px;
}

/* ════════════════════════════════════════════
   响应式 —— 平板
   ════════════════════════════════════════════ */

@media (min-width: 481px) {
    .gallery-masonry {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .album-info-title { font-size: 26px; }
    .album-info-desc { font-size: 14px; }

    .album-gallery { padding: 24px; }
}

@media (min-width: 769px) {
    .gallery-masonry {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .album-info-bar { padding: 28px 24px 10px; }
    .album-info-title { font-size: 30px; }

    .lb-nav-btn { width: 52px; height: 52px; }

    .wm-form-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* ════════════════════════════════════════════
   响应式 —— 手机适配
   ════════════════════════════════════════════ */

@media (max-width: 480px) {
    .container { padding: 16px; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .page-header-actions { width: 100%; }
    .page-header-actions .btn { flex: 1; text-align: center; }
    .form-row { flex-direction: column; gap: 12px; }
    .album-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
    .photo-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .share-link-box { flex-wrap: wrap; }
    .upload-zone { padding: 32px 16px; }

    /* 水印面板移动端 */
    .watermark-header { padding: 14px 16px; }
    .watermark-body { padding: 0 16px 16px; }
    .wm-form-grid { grid-template-columns: 1fr; gap: 12px; }

    /* 相册信息栏 移动端 */
    .album-info-bar { padding: 16px 16px 6px; }
    .album-info-title { font-size: 20px; }
    .album-info-desc { font-size: 13px; }
    .album-info-stats { gap: 12px; }
    .album-info-stat { font-size: 12px; }

    /* 首页 Hero */
    .index-hero { padding: 36px 16px 32px; }
    .index-hero h1 { font-size: 24px; }
    .share-content { padding: 16px; }

    /* 相册编辑 */
    .album-edit-header { padding: 16px; }
    .album-meta-form .form-row { flex-direction: column; }

    /* 导航栏 */
    .navbar { padding: 0 16px; }
    .nav-inner { height: 50px; }
    .nav-brand { font-size: 16px; }
    .album-workspace-tabs { top: 50px; scroll-margin-top: 50px; }
    .workspace-section { scroll-margin-top: 100px; }
}

/* ── 登录页 ────────────────────────────────── */

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.login-wrapper::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74,144,217,0.15) 0%, transparent 70%);
    top: -200px; right: -100px;
    pointer-events: none;
}
.login-wrapper::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(118,75,162,0.12) 0%, transparent 70%);
    bottom: -150px; left: -80px;
    pointer-events: none;
}

.login-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 48px 36px 40px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.1);
    position: relative;
    z-index: 1;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}
.login-icon-ring {
    width: 64px; height: 64px;
    margin: 0 auto 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    box-shadow: 0 4px 15px rgba(74,144,217,0.4);
}
.login-logo-img {
    max-height: 56px;
    margin-bottom: 12px;
    object-fit: contain;
}
.login-card h2 {
    text-align: center;
    margin-bottom: 4px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.5px;
}
.login-card .login-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 0;
    letter-spacing: 2px;
}

.login-form {
    margin-top: 28px;
}
.input-group {
    position: relative;
    margin-bottom: 14px;
}
.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    pointer-events: none;
    transition: color 0.2s;
}
.input-group input {
    width: 100%;
    padding: 13px 16px 13px 44px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    background: #fafbfc;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    color: var(--text);
}
.input-group input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(74,144,217,0.1);
}
.input-group input:focus + .input-icon,
.input-group input:focus ~ .input-icon {
    color: var(--primary);
}
.input-group input::placeholder {
    color: #bbb;
}

/* 密码显示切换按钮 */
.input-group-password .password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}
.input-group-password .password-toggle:hover {
    color: var(--primary);
    background: rgba(74,144,217,0.08);
}
.input-group-password input {
    padding-right: 44px;
}

.login-card .login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, #5a7fd4 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    margin-top: 6px;
    letter-spacing: 4px;
    box-shadow: 0 4px 15px rgba(74,144,217,0.35);
}
.login-card .login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(74,144,217,0.45);
}
.login-card .login-btn:active {
    transform: translateY(0);
}

.login-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #cf1322;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ── 错误页 ────────────────────────────────── */

.error-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.error-code {
    font-size: 72px;
    font-weight: 700;
    color: #999;
    line-height: 1;
    margin-bottom: 8px;
}

.error-message {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 24px;
}

/* ════════════════════════════════════════════
   v3 合集管理样式
   ════════════════════════════════════════════ */

/* ── 封面上传区 ────────────────────────────── */

.cover-upload-box {
    margin-top: 14px;
    padding: 10px 14px;
    background: #f6f8fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    flex-wrap: wrap;
}

.cover-preview {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.cover-none {
    color: var(--text-light);
    font-size: 13px;
}

.cover-upload-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.cover-upload-form input[type="file"] {
    font-size: 13px;
    max-width: 180px;
}

/* ── 所属合集标签 ──────────────────────────── */

.in-collections-box {
    margin-top: 10px;
    padding: 8px 14px;
    background: #f0f7ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    flex-wrap: wrap;
}

/* ── 添加相册栏 ────────────────────────────── */

.section-header {
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
}

.add-album-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.add-album-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.add-album-form select {
    flex: 1;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: var(--card);
    min-width: 160px;
}

.add-album-form select:focus { border-color: var(--primary); }

/* ── 合集内相册列表 ────────────────────────── */

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

.coll-album-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card);
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: var(--shadow);
    transition: transform 0.15s;
}

.coll-album-item:hover {
    transform: translateX(2px);
}

.coll-album-cover {
    width: 72px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
    flex-shrink: 0;
}

.coll-album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.coll-album-info {
    flex: 1;
    min-width: 0;
}

.coll-album-info h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coll-album-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.coll-album-actions form { display: inline !important; }

.reorder-btns {
    display: flex;
    gap: 2px;
    margin-left: 4px;
}

.reorder-btns .btn {
    padding: 4px 8px;
    font-size: 14px;
    line-height: 1;
}

/* ── 合集展示页：相册分组 ──────────────────── */

.album-section {
    margin-bottom: 24px;
}

.album-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.album-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

/* ── 灯箱：相册名称 ────────────────────────── */

.lb-album-name {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    max-width: 40%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ── v3 移动端适配 ─────────────────────────── */

@media (max-width: 480px) {
    .coll-album-item {
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 10px;
    }

    .coll-album-cover {
        width: 56px;
        height: 38px;
    }

    .coll-album-actions {
        width: 100%;
        justify-content: flex-start;
        padding-top: 4px;
        border-top: 1px solid #f0f0f0;
    }

    .add-album-bar { flex-direction: column; align-items: stretch; }
    .add-album-form { flex-direction: column; }
    .add-album-form select { min-width: unset; width: 100%; }

    .cover-upload-box { flex-direction: column; align-items: flex-start; }
    .cover-upload-form { margin-left: 0; width: 100%; }

    .album-section-title { font-size: 16px; }

    .lb-album-name { display: none; }
}

/* ════════════════════════════════════════════
   v4 工作台分区 + 相册子链接 + 配色
   ════════════════════════════════════════════ */

/* ── 工作台分区标题 ──────────────────────────── */

.section-title-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 28px 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

.section-title-bar h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.section-count {
    font-size: 13px;
    color: var(--text-light);
    background: #f0f0f0;
    padding: 2px 10px;
    border-radius: 10px;
}

/* ── 合集内相册子链接卡片 ────────────────────── */

.album-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.album-sub-card {
    display: block;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.album-sub-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.album-sub-cover {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #f0f0f0;
    overflow: hidden;
}

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

.album-sub-card:hover .album-sub-cover img {
    transform: scale(1.05);
}

.album-sub-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    backdrop-filter: blur(4px);
}

.album-sub-info {
    padding: 12px 14px;
}

.album-sub-info h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.album-sub-info p {
    font-size: 13px;
    color: var(--text-light);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.album-sub-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.5);
    color: rgba(255,255,255,0.8);
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    backdrop-filter: blur(4px);
}

/* ── 置顶按钮 ───────────────────────────────── */

.btn-pin {
    background: rgba(255,255,255,0.9);
    color: #666;
}

.btn-pin.pinned {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(74,144,217,0.3);
}

/* ── 置顶标记（分享页） ─────────────────────── */

.pin-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 16px;
    background: rgba(255,255,255,0.85);
    padding: 2px 5px;
    border-radius: 6px;
    line-height: 1;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* ── 颜色选择器 ─────────────────────────────── */

.color-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-picker-row input[type="color"] {
    width: 40px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
    background: none;
}

.color-picker-row input[type="text"] {
    flex: 1;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: monospace;
    outline: none;
}

.color-picker-row input[type="text"]:focus {
    border-color: var(--primary);
}

/* ── v4 移动端适配 ──────────────────────────── */

@media (max-width: 480px) {
    .section-title-bar {
        margin: 20px 0 12px;
    }

    .section-title-bar h3 {
        font-size: 16px;
    }

    .album-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .album-sub-info {
        padding: 8px 10px;
    }

    .album-sub-info h3 {
        font-size: 13px;
    }

    .album-sub-info p {
        font-size: 12px;
    }

    .color-picker-row {
        flex-wrap: wrap;
    }
}

/* ═══════════════════════════════════════════════
   设置页面 & 用户管理样式
   ═══════════════════════════════════════════════ */

/* 导航栏用户名 */
.nav-user {
    font-size: 13px;
    color: var(--text-light);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 8px;
}

/* 角色徽章 */
.badge-superadmin {
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 4px;
}
.badge-admin {
    background: var(--success);
    color: #fff;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 4px;
}

/* 设置区块 */
.settings-form-section {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.settings-section-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.settings-form-block {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.settings-form-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* 用户管理表格 */
.settings-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    font-size: 14px;
}
.settings-table th,
.settings-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.settings-table th {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-light);
    background: #fafafa;
}
.settings-table td {
    vertical-align: middle;
}
.settings-table .btn {
    margin-right: 4px;
}

/* 新建用户内联表单 */
.settings-inline-form {
    background: #fafbfc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}
.settings-inline-form h4 {
    font-size: 14px;
    margin-bottom: 10px;
}
.settings-user-fields {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.settings-user-fields input,
.settings-user-fields select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    flex: 1;
    min-width: 120px;
}

/* 编辑用户弹窗 */
.settings-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.settings-modal-content {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    width: 90%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
}
.settings-modal-content h3 {
    font-size: 17px;
    margin-bottom: 16px;
}
.settings-modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    justify-content: flex-end;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .settings-table,
    .settings-table tbody,
    .settings-table tr,
    .settings-table td {
        display: block;
        width: 100%;
    }
    .settings-table thead {
        display: none;
    }
    .settings-table tr {
        margin-bottom: 12px;
        padding: 10px 12px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--card);
    }
    .settings-table td {
        display: grid;
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 10px;
        align-items: center;
        min-height: 36px;
        padding: 7px 0;
        border-bottom: 1px solid var(--border);
        font-size: 13px;
        overflow-wrap: anywhere;
    }
    .settings-table td:last-child {
        border-bottom: 0;
    }
    .settings-table td::before {
        content: attr(data-label);
        color: var(--text-light);
        font-size: 12px;
        font-weight: 600;
    }
    .settings-table .badge {
        justify-self: start;
    }
    .settings-user-fields {
        flex-direction: column;
    }
    .settings-user-fields input,
    .settings-user-fields select {
        min-width: 100%;
    }
    .nav-user {
        font-size: 12px;
        margin-right: 4px;
    }
}

/* ── 配额显示条 ── */
.quota-bar {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: #f0f4ff;
    border: 1px solid #d0d9f0;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #445;
}
.quota-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.quota-unlimited {
    color: #999;
    font-style: italic;
    font-size: 13px;
}

/* ── 卡片上显示创建者 ── */
.album-owner {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #7a8ba8;
    margin: 2px 0 4px;
}
.album-owner svg {
    flex-shrink: 0;
}

/* ── 编辑弹窗配额区域 ── */
.quota-divider {
    font-size: 13px;
    font-weight: 600;
    color: #4a90d9;
    margin: 18px 0 12px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
    border-radius: 8px;
    border-left: 3px solid #4a90d9;
    letter-spacing: 0.5px;
}
.quota-hint {
    font-weight: 400;
    font-size: 11px;
    color: #8899aa;
    margin-left: 6px;
}
.quota-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    padding: 4px 0;
}
.quota-fields .wm-field {
    margin-bottom: 0;
}
.quota-fields .wm-field label {
    font-size: 12px;
    font-weight: 500;
    color: #556;
    margin-bottom: 6px;
    display: block;
}
.quota-fields .wm-field input {
    font-size: 15px;
    font-weight: 500;
    padding: 10px 12px;
    border: 1.5px solid #dde3ee;
    border-radius: 8px;
    background: #f8f9fc;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    width: 100%;
    box-sizing: border-box;
}
.quota-fields .wm-field input:focus {
    border-color: #4a90d9;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(74,144,217,0.12);
    outline: none;
}

/* ── 设置表格横向滚动（移动端） ── */
@media (max-width: 768px) {
    .quota-bar {
        flex-direction: column;
        gap: 6px;
    }
    .quota-fields {
        grid-template-columns: 1fr;
    }
    .settings-table th,
    .settings-table td {
        padding: 6px 8px;
        font-size: 12px;
    }
}

/* ── 置顶按钮 ─ */
.btn-pin {
    background: rgba(255,255,255,0.85);
    color: #888;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    backdrop-filter: blur(4px);
}
.btn-pin:hover {
    background: #fff;
    color: #4a90d9;
    transform: scale(1.1);
}
.btn-pin.pinned {
    background: #4a90d9;
    color: #fff;
    box-shadow: 0 2px 8px rgba(74,144,217,0.4);
}
.btn-pin.pinned:hover {
    background: #e74c3c;
    color: #fff;
    box-shadow: 0 2px 8px rgba(231,76,60,0.4);
}

/* 置顶照片卡片高亮边框 */
.photo-card.pinned-card {
    border: 2px solid #4a90d9;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(74,144,217,0.2);
}

/* ── 观看数据设置面板 ──────────────────────── */

/* 新增 badge 颜色 */
.badge-promo { background: #fff3e0; color: #e65100; }
.badge-custom { background: #e8eaf6; color: #283593; }

/* 展示模式单选卡片网格 */
.view-mode-radios {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 6px;
}

.radio-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--card);
    text-align: center;
    user-select: none;
}

.radio-card:hover {
    border-color: var(--primary);
    background: #f8faff;
}

.radio-card input[type="radio"] {
    display: none;
}

.radio-card.active {
    border-color: var(--primary);
    background: #eef4ff;
    box-shadow: 0 0 0 1px var(--primary) inset;
}

.radio-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.radio-card-desc {
    font-size: 11px;
    color: var(--text-light);
}

/* 数字输入行（+/- 按钮 + 输入框 + 单位） */
.number-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.num-btn {
    min-width: 36px;
    padding: 4px 8px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.4;
}

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

.num-btn:active {
    transform: scale(0.95);
}

.num-input {
    width: 70px;
    text-align: center;
    padding: 6px 8px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}

.num-input::-webkit-outer-spin-button,
.num-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.num-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(74,144,217,0.15);
}

.num-unit {
    font-size: 13px;
    color: var(--text-light);
    white-space: nowrap;
    margin-left: 2px;
}

/* 移动端适配 */
@media (max-width: 600px) {
    .view-mode-radios {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .radio-card {
        padding: 10px 6px;
    }
    .radio-card-title {
        font-size: 13px;
    }
    .radio-card-desc {
        font-size: 10px;
    }
    .number-input-row {
        gap: 4px;
    }
    .num-btn {
        min-width: 32px;
        padding: 4px 6px;
        font-size: 12px;
    }
    .num-input {
        width: 60px;
        font-size: 13px;
    }
}

/* ── 图片水印面板 ──────────────────────── */

.wm-upload-section {
    margin-bottom: 16px;
}

.wm-upload-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* 上传区域 */
.wm-upload-area {
    flex: 1;
    min-height: 140px;
    border: 2px dashed var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafbfc;
    overflow: hidden;
    position: relative;
}

.wm-upload-area:hover {
    border-color: var(--primary);
    background: #f0f5ff;
}

.wm-upload-area.wm-drag-over {
    border-color: var(--primary);
    background: #e8f0fe;
    transform: scale(1.01);
}

.wm-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
}

.wm-upload-hint {
    font-size: 11px;
    color: #aaa;
}

/* 水印预览 */
.wm-preview-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 140px;
    padding: 12px;
}

.wm-preview-img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
    border-radius: 6px;
}

.wm-preview-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.9);
    color: #fff;
    font-size: 16px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
}

.wm-preview-remove:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* 位置选择区 */
.wm-position-section {
    flex-shrink: 0;
}

.wm-section-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.wm-position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    width: 120px;
}

.wm-pos-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--card);
    font-size: 10px;
    color: var(--text-light);
    user-select: none;
}

.wm-pos-cell:hover {
    border-color: var(--primary);
    background: #f0f5ff;
    color: var(--primary);
}

.wm-pos-cell.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

/* 参数滑块区域 */
.wm-sliders-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 8px;
}

.wm-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wm-slider-row > label {
    flex-shrink: 0;
    width: 70px;
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
}

.wm-slider-control {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wm-slider-control input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #e0e0e0;
    border-radius: 2px;
    outline: none;
}

.wm-slider-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.wm-slider-control input[type="number"] {
    width: 56px;
    text-align: center;
    padding: 4px 6px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    color: var(--text);
    outline: none;
    -moz-appearance: textfield;
}

.wm-slider-control input[type="number"]::-webkit-outer-spin-button,
.wm-slider-control input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wm-slider-control input[type="number"]:focus {
    border-color: var(--primary);
}

.wm-slider-unit {
    font-size: 12px;
    color: var(--text-light);
    flex-shrink: 0;
    width: 20px;
}

/* 水印面板移动端适配 */
@media (max-width: 600px) {
    .wm-upload-row {
        flex-direction: column;
        gap: 16px;
    }
    .wm-upload-area {
        min-height: 120px;
    }
    .wm-position-grid {
        width: 108px;
    }
    .wm-slider-row {
        flex-wrap: wrap;
        gap: 6px;
    }
    .wm-slider-row > label {
        width: 60px;
        font-size: 12px;
    }
    .wm-slider-control input[type="number"] {
        width: 48px;
        font-size: 12px;
    }
}

/* ── 照片管理区 ──────────────────────── */

.photo-manager {
    margin-top: 24px;
}

/* 筛选标签 */
.pm-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.pm-tab {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pm-tab:hover {
    color: var(--primary);
}

.pm-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.pm-tab-count {
    font-size: 12px;
    background: #f0f0f0;
    color: var(--text-light);
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.pm-tab.active .pm-tab-count {
    background: var(--primary);
    color: #fff;
}

/* 搜索 + 排序栏 */
.pm-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.pm-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
    flex: 1;
    min-width: 200px;
}

.pm-search-box svg {
    flex-shrink: 0;
    color: var(--text-light);
}

.pm-search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 13px;
    background: transparent;
    color: var(--text);
    min-width: 0;
}

.pm-search-btn {
    flex-shrink: 0;
    padding: 4px 12px;
    font-size: 12px;
    border: 1px solid var(--primary);
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    transition: all 0.15s;
}

.pm-search-btn:hover {
    opacity: 0.85;
}

.pm-sort-box {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-light);
}

.pm-sort-box select {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    color: var(--text);
    outline: none;
    cursor: pointer;
}

.pm-sort-box select:focus {
    border-color: var(--primary);
}

.pm-sort-dir-btn {
    padding: 5px 10px;
    font-size: 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
}

.pm-sort-dir-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* 操作工具栏 */
.pm-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.pm-select-all {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    user-select: none;
    margin-right: 4px;
}

.pm-select-all input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.pm-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.pm-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0f5ff;
}

.pm-action-btn svg {
    flex-shrink: 0;
}

.pm-action-danger {
    color: #e74c3c;
    border-color: #f5c6cb;
}

.pm-action-danger:hover {
    background: #fdf0ef;
    border-color: #e74c3c;
    color: #c0392b;
}

.pm-action-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pm-action-primary:hover {
    opacity: 0.85;
    background: var(--primary);
    color: #fff;
}

.pm-actions-spacer {
    flex: 1;
}

/* 上传进度条 */
.pm-upload-progress {
    margin-bottom: 12px;
    padding: 10px 16px;
    background: #f0f5ff;
    border-radius: 8px;
    border: 1px solid #d0dff5;
}

.pm-upload-progress .progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

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

.pm-upload-progress .progress-text {
    font-size: 12px;
    color: var(--text-light);
    margin: 0;
}

/* 照片网格 */
.pm-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.pm-card {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    overflow: hidden;
    transition: all 0.2s;
}

.pm-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(74, 144, 217, 0.12);
}

.pm-card.pm-selected {
    border-color: var(--primary);
    background: rgba(74, 144, 217, 0.04);
}

.pm-card.pm-selected .pm-card-thumb {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.pm-card.pm-pinned {
    border-color: #f0ad4e;
}

/* 卡片左上角 checkbox — 始终显示 */
.pm-card-check {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
}

.pm-card-cb {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
    border-radius: 4px;
}

/* 右上角可见性切换 — 始终显示 */
.pm-card-vis {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.15s;
}

.pm-card-vis:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.pm-card-vis svg {
    color: var(--text);
}

/* 审片筛选保留勾选下载，隐藏照片库编辑操作。 */
.pm-review-mode .pm-toolbar,
.pm-review-mode .pm-upload-progress,
.pm-review-mode #fileInput,
.pm-review-mode .group-bar,
.pm-review-mode .group-assign,
.pm-review-mode .pm-management-only,
.pm-review-mode .pm-card-vis,
.pm-review-mode .pm-card-actions {
    display: none;
}
.pm-review-mode .pm-card-filename {
    pointer-events: none;
}

.pm-vis-hidden {
    color: #e74c3c !important;
    opacity: 0.7;
}

/* 置顶角标 — 在checkbox下方，避免重叠 */
.pm-card-pin-badge {
    position: absolute;
    top: 34px;
    left: 8px;
    z-index: 2;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0ad4e;
    color: #fff;
    border-radius: 50%;
}

/* 缩略图 */
.pm-card-thumb {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f5f5f5;
    cursor: default;
    user-select: none;
}

.pm-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 卡片信息 */
.pm-card-info {
    padding: 8px 10px;
}

.pm-card-filename {
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
    cursor: pointer;
}
.pm-card-filename:hover {
    color: #4a90d9;
}
.pm-rename-input {
    font-size: 12px;
    font-weight: 500;
    padding: 2px 4px;
    border: 1px solid #4a90d9;
    border-radius: 3px;
    outline: none;
    background: var(--card);
    color: var(--text);
}

.pm-card-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pm-card-meta-item {
    font-size: 11px;
    color: var(--text-light);
}

/* 卡片底部操作 — 始终显示 */
.pm-card-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 8px 8px;
}

.pm-card-act-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.15s;
}

.pm-card-act-btn:hover {
    background: #f0f0f0;
    color: var(--primary);
}

.pm-card-act-danger:hover {
    background: #fdf0ef;
    color: #e74c3c;
}

/* ── 分组标签栏 ── */
.group-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    padding: 0;
}

.group-bar-label {
    font-size: 12px;
    color: var(--text-light, #999);
    white-space: nowrap;
}

.group-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    padding: 6px 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    white-space: nowrap;
    transition: all 0.15s;
}

.group-tag:hover {
    background: var(--bg);
}

.group-tag-name {
    cursor: default;
    color: var(--text, #333);
}

.group-tag-count {
    font-size: 11px;
    color: var(--text-light, #999);
    margin-left: 1px;
}

.group-tag-del {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-light, #999);
    font-size: 14px;
    line-height: 1;
    padding: 0;
    transition: all 0.15s;
    margin-left: 2px;
}

.group-tag-del:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.group-tag-add {
    cursor: pointer;
    color: var(--primary, #4a90d9);
    font-size: 13px;
    padding: 6px 12px;
    background: transparent;
    border: 1px dashed var(--primary, #4a90d9);
    border-radius: 6px;
    opacity: 0.7;
    transition: all 0.15s;
}

.group-tag-add:hover {
    opacity: 1;
    background: rgba(74, 144, 217, 0.08);
}

.pm-group-select {
    padding: 5px 10px;
    font-size: 13px;
    border: 1px solid var(--border, #e0e0e0);
    border-radius: 8px;
    outline: none;
    background: var(--card, #fff);
    color: var(--text, #333);
    max-width: 140px;
}

.pm-group-select:focus {
    border-color: var(--primary, #4a90d9);
}

.group-assign {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 10px 12px;
    background: #f0f5ff;
    border-radius: 8px;
    border: 1px solid #d0dff5;
    flex-wrap: wrap;
}

.group-assign-label {
    font-size: 13px;
    color: var(--text, #333);
    white-space: nowrap;
}

.group-assign select {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid var(--border, #e0e0e0);
    border-radius: 6px;
    outline: none;
    flex: 1;
    min-width: 120px;
}

.pm-card-group-badge {
    padding: 2px 8px;
    font-size: 11px;
    color: var(--primary, #4a90d9);
    background: #f0f5ff;
    border-radius: 4px;
    text-align: center;
    margin: 0 8px 6px;
}

/* 分页 */
.pm-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.pm-page-link {
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.15s;
    background: var(--card);
}

.pm-page-link:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0f5ff;
}

.pm-page-current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
}

.pm-page-current:hover {
    background: var(--primary);
    color: #fff;
}

.pm-page-dots {
    padding: 6px 4px;
    font-size: 13px;
    color: var(--text-light);
}

.pm-page-info {
    margin-left: 12px;
    font-size: 12px;
    color: var(--text-light);
}

/* 空状态 */
.photo-manager .empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-light);
    font-size: 14px;
}

/* 照片管理区移动端适配 */
@media (max-width: 768px) {
    .pm-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .pm-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .pm-search-box {
        min-width: 0;
    }
    .pm-sort-box {
        justify-content: flex-end;
    }
    .pm-actions {
        gap: 6px;
    }
    .pm-action-btn {
        padding: 5px 8px;
        font-size: 12px;
    }
    .pm-actions-spacer {
        display: none;
    }
    .pm-card-actions {
        opacity: 1;
    }
    .pm-card-check {
        opacity: 1;
    }
    .pm-card-vis {
        opacity: 1;
    }
    .pm-page-info {
        width: 100%;
        text-align: center;
        margin-left: 0;
        margin-top: 8px;
    }
}

@media (max-width: 480px) {
    .pm-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .pm-tab {
        padding: 6px 10px;
        font-size: 13px;
    }
    .pm-card-info {
        padding: 6px 8px;
    }
    .pm-card-filename {
        font-size: 11px;
    }
}

/* ══════════════════════════════════════════════════════════════
   暗色模式（仅由后台开关 body.dark-mode 类控制）
   ══════════════════════════════════════════════════════════════ */

/* 暗色模式 CSS 变量覆盖 + 基础样式 — 仅由 body.dark-mode 类控制（后台开关） */
body.dark-mode {
    --text: #e0e0e0 !important;
    --text-light: #999 !important;
    --bg: #1a1a1a !important;
    --card: #2a2a2a !important;
    --border: #3a3a3a !important;
    background: #1a1a1a !important;
    color: #e0e0e0 !important;
}

/* ── 手动暗色模式类（body.dark-mode）的完整样式覆盖 ── */
body.dark-mode.admin-page,
body.dark-mode.share-page {
    background: #1a1a1a !important;
}
body.dark-mode .navbar {
    background: #242424 !important;
    border-bottom-color: #333 !important;
}
body.dark-mode .nav-brand {
    color: #e0e0e0 !important;
}
body.dark-mode .nav-user {
    color: #bbb !important;
}
body.dark-mode .album-card,
body.dark-mode .album-sub-card,
body.dark-mode .watermark-panel,
body.dark-mode .collection-card {
    background: #2a2a2a !important;
    border-color: #3a3a3a !important;
}
body.dark-mode .album-title,
body.dark-mode .album-sub-info h3 {
    color: #e0e0e0 !important;
}
body.dark-mode .album-meta,
body.dark-mode .album-sub-count {
    color: #999 !important;
}
body.dark-mode input[type="text"],
body.dark-mode input[type="password"],
body.dark-mode input[type="number"],
body.dark-mode input[type="email"],
body.dark-mode input[type="url"],
body.dark-mode textarea,
body.dark-mode select {
    background: #2a2a2a !important;
    border-color: #444 !important;
    color: #e0e0e0 !important;
}
body.dark-mode label {
    color: #ccc !important;
}
body.dark-mode .btn {
    background: #3a3a3a !important;
    color: #e0e0e0 !important;
    border-color: #4a4a4a !important;
}
body.dark-mode .btn:hover {
    background: #4a4a4a !important;
}
body.dark-mode .btn-primary {
    background: #4a90d9 !important;
    border-color: #4a90d9 !important;
}
body.dark-mode .btn-outline {
    background: transparent !important;
    border-color: #555 !important;
    color: #ccc !important;
}
body.dark-mode .btn-outline:hover {
    background: #333 !important;
}
body.dark-mode .album-info-bar {
    background: rgba(26, 26, 26, 0.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
body.dark-mode .album-info-title {
    color: #e0e0e0;
}
body.dark-mode .album-info-desc {
    color: #aaa;
}
body.dark-mode .album-info-stat {
    color: #bbb;
}
body.dark-mode .lightbox {
    background: rgba(0, 0, 0, 0.95) !important;
}
body.dark-mode .lb-filename {
    color: #e0e0e0 !important;
}
body.dark-mode .toast {
    background: #333 !important;
    color: #e0e0e0 !important;
}
body.dark-mode .toast-success {
    background: #1a4731 !important;
    color: #6ee7a0 !important;
}
body.dark-mode .toast-error {
    background: #4a1c1c !important;
    color: #f87171 !important;
}
body.dark-mode .login-wrapper {
    background: #1a1a1a !important;
}
body.dark-mode .login-card {
    background: #242424 !important;
}
body.dark-mode .login-card h2 {
    color: #e0e0e0 !important;
}
body.dark-mode .login-subtitle {
    color: #999 !important;
}
body.dark-mode .input-group input {
    background: #2a2a2a !important;
    border-color: #444 !important;
    color: #e0e0e0 !important;
}
body.dark-mode .login-btn {
    background: #4a90d9 !important;
}
body.dark-mode .share-link-box {
    background: #2a2a2a !important;
    border-color: #3a3a3a !important;
}
body.dark-mode .share-link-box code {
    color: #7ab8f5 !important;
}
body.dark-mode .share-label {
    color: #aaa !important;
}
body.dark-mode .empty-state {
    color: #666 !important;
}
body.dark-mode .album-empty {
    background: #333 !important;
    color: #666 !important;
}
body.dark-mode table {
    border-color: #333 !important;
}
body.dark-mode th {
    background: #2a2a2a !important;
    color: #ccc !important;
    border-bottom-color: #444 !important;
}
body.dark-mode td {
    border-bottom-color: #333 !important;
    color: #ddd !important;
}
body.dark-mode tr:hover {
    background: #2a2a2a !important;
}
body.dark-mode .settings-section {
    background: #242424 !important;
    border-color: #333 !important;
}
body.dark-mode .settings-section h3 {
    color: #e0e0e0 !important;
}
body.dark-mode .index-hero {
    background: #242424 !important;
    color: #e0e0e0 !important;
}
body.dark-mode .index-hero h1 {
    color: #e0e0e0 !important;
}
body.dark-mode .index-hero p {
    color: #999 !important;
}
body.dark-mode .album-info h3 {
    color: #e0e0e0 !important;
}
body.dark-mode .album-info .album-meta {
    color: #999 !important;
}
body.dark-mode .password-page {
    background: #1a1a1a !important;
}
body.dark-mode .password-card {
    background: #242424 !important;
}
body.dark-mode .password-card h2 {
    color: #e0e0e0 !important;
}
body.dark-mode .password-card p {
    color: #999 !important;
}
body.dark-mode .password-input-group input {
    background: #2a2a2a !important;
    border-color: #444 !important;
    color: #e0e0e0 !important;
}
body.dark-mode .pw-change-page {
    background: #1a1a1a !important;
}
body.dark-mode .pw-change-card {
    background: #242424 !important;
}
body.dark-mode .pw-change-card h2 {
    color: #e0e0e0 !important;
}
body.dark-mode .pw-change-card .subtitle {
    color: #999 !important;
}
body.dark-mode .pw-change-card label {
    color: #ccc !important;
}
body.dark-mode .pw-change-card input[type="password"] {
    background: #2a2a2a !important;
    border-color: #444 !important;
    color: #e0e0e0 !important;
}
body.dark-mode .album-edit-header {
    background: #242424 !important;
    border-color: #333 !important;
}
body.dark-mode .album-meta-form label {
    color: #ccc !important;
}
body.dark-mode ::-webkit-scrollbar-track {
    background: #1a1a1a !important;
}
body.dark-mode ::-webkit-scrollbar-thumb {
    background: #444 !important;
}
body.dark-mode .group-tag-name {
    color: #e0e0e0 !important;
}
body.dark-mode .group-tag-count {
    color: #999 !important;
}
body.dark-mode .group-tag-del {
    color: #999 !important;
}
body.dark-mode .gallery-filter-tab {
    color: inherit !important;
}
body.dark-mode .filter-count {
    color: #999 !important;
}
body.dark-mode .pm-action-btn {
    background: #2a2a2a !important;
    border-color: #444 !important;
    color: #e0e0e0 !important;
}
body.dark-mode .pm-action-btn:hover {
    background: #3a3a3a !important;
    border-color: #555 !important;
}
body.dark-mode .pm-action-danger {
    color: #f87171 !important;
    border-color: #5a2a2a !important;
}
body.dark-mode .pm-action-danger:hover {
    background: #3a1c1c !important;
}
body.dark-mode .pm-action-primary {
    background: #1a3a5c !important;
    border-color: #4a90d9 !important;
    color: #7ab8f5 !important;
}
body.dark-mode .pm-action-primary:hover {
    background: #1e4470 !important;
}
body.dark-mode .pm-group-select {
    background: #2a2a2a !important;
    border-color: #444 !important;
    color: #e0e0e0 !important;
}
body.dark-mode .pm-upload-progress {
    background: #1e3a1e !important;
    border-color: #2a5a2a !important;
    color: #6ee7a0 !important;
}
body.dark-mode .group-assign {
    background: #2a2a2a !important;
    border-color: #444 !important;
    color: #e0e0e0 !important;
}
body.dark-mode .pm-card-group-badge {
    background: #1a3a5c !important;
    color: #7ab8f5 !important;
}
body.dark-mode .pm-page-link:hover {
    background: #2a2a2a !important;
}
body.dark-mode .pm-select-all {
    color: #ccc !important;
}
body.dark-mode .in-collections-box {
    background: #1a2a3a !important;
    border-color: #2a4a6a !important;
}
body.dark-mode .wm-upload-area {
    background: #2a2a2a !important;
}
body.dark-mode .wm-upload-area:hover {
    background: #333 !important;
}
body.dark-mode .wm-pos-cell:hover {
    background: #2a2a2a !important;
}
body.dark-mode .album-download-btn {
    background: rgba(255,255,255,0.1) !important;
    border-color: rgba(255,255,255,0.15) !important;
}
body.dark-mode .album-download-btn:hover {
    background: rgba(255,255,255,0.18) !important;
}
body.dark-mode .settings-form-section {
    background: #242424 !important;
    border-color: #333 !important;
}
body.dark-mode .settings-form-section h3 {
    color: #e0e0e0 !important;
}
body.dark-mode .settings-form-block {
    background: #2a2a2a !important;
    border-color: #3a3a3a !important;
}
body.dark-mode .settings-inline-form {
    background: #2a2a2a !important;
    border-color: #3a3a3a !important;
}
body.dark-mode .settings-inline-form h4 {
    color: #e0e0e0 !important;
}
body.dark-mode .settings-user-fields input,
body.dark-mode .settings-user-fields select {
    background: #1a1a1a !important;
    color: #e0e0e0 !important;
    border-color: #3a3a3a !important;
}
body.dark-mode .wm-field label {
    color: #ccc !important;
}
body.dark-mode .wm-hint {
    color: #888 !important;
}
body.dark-mode .wm-switch-label {
    color: #e0e0e0 !important;
}
body.dark-mode .quota-bar {
    background: #2a2a2a !important;
    border-color: #3a3a3a !important;
}
body.dark-mode .group-bar-label {
    color: #999 !important;
}
body.dark-mode .cover-upload-box {
    background: #2a2a2a !important;
}
body.dark-mode .share-link-box code {
    background: #2a2a2a !important;
}
body.dark-mode .upload-zone {
    background: #2a2a2a !important;
    border-color: #444 !important;
}
body.dark-mode .upload-zone:hover,
body.dark-mode .upload-zone.drag-over {
    border-color: #5b9bd5 !important;
    background: #1e2a3a !important;
}
body.dark-mode .progress-bar {
    background: #333 !important;
}
body.dark-mode .progress-fill {
    background: #5b9bd5 !important;
}
body.dark-mode .radio-card {
    background: #2a2a2a !important;
    border-color: #444 !important;
}
body.dark-mode .radio-card:hover {
    border-color: #5b9bd5 !important;
    background: #1e2a3a !important;
}
body.dark-mode .radio-card.active {
    border-color: #5b9bd5 !important;
    background: #1a2636 !important;
}
body.dark-mode .radio-card-title {
    color: #e0e0e0 !important;
}
body.dark-mode .radio-card-desc {
    color: #999 !important;
}
body.dark-mode .settings-modal-content {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
}
body.dark-mode .settings-modal-content h3 {
    color: #e0e0e0 !important;
}
body.dark-mode .badge {
    background: #333 !important;
    color: #ccc !important;
}
body.dark-mode .badge-on {
    background: #1b3a1b !important;
    color: #6fcf6f !important;
}
body.dark-mode .badge-off {
    background: #333 !important;
    color: #888 !important;
}
body.dark-mode .badge-superadmin {
    background: #3a2a00 !important;
    color: #ffc107 !important;
}
body.dark-mode .badge-admin {
    background: #1a2636 !important;
    color: #5b9bd5 !important;
}
body.dark-mode .collapsible-header {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border-color: #444 !important;
}
body.dark-mode .collapsible-body {
    background: #1e1e1e !important;
    border-color: #333 !important;
}
body.dark-mode .text-light {
    color: #999 !important;
}
body.dark-mode .qr-modal {
    background: #2a2a2a !important;
}
body.dark-mode .qr-modal h4 {
    color: #e0e0e0 !important;
}
body.dark-mode .qr-modal-close {
    background: #333 !important;
    border-color: #444 !important;
    color: #ccc !important;
}
body.dark-mode .confirm-dialog {
    background: #2a2a2a !important;
}
body.dark-mode .confirm-dialog-icon {
    background: #3a1c1c !important;
}
body.dark-mode .confirm-dialog h4 {
    color: #e0e0e0 !important;
}
body.dark-mode .confirm-dialog-cancel {
    background: #333 !important;
    color: #ccc !important;
    border-color: #444 !important;
}
body.dark-mode .stat-card {
    background: #2a2a2a !important;
    border-color: #3a3a3a !important;
}
body.dark-mode .admin-search-bar input {
    background: #2a2a2a !important;
    border-color: #444 !important;
    color: #e0e0e0 !important;
}
body.dark-mode .wm-preview-box {
    background: #333 !important;
    border-color: #444 !important;
}

/* ══════════════════════════════════════════════
   开屏动画
   ═══════════════════════════════════════════════ */
.splash-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #000;
    opacity: 1;
    transition: opacity 0.6s ease-out;
    overflow: hidden;
    isolation: isolate;
}
.splash-overlay.splash-fade-out {
    opacity: 0;
    pointer-events: none;
}
.splash-overlay img.splash-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
    animation: splash-image-drift 8s ease-out both;
}
.splash-shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(0, 0, 0, var(--splash-overlay, .35));
}
.splash-content {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 72px 24px max(12vh, 76px);
    color: #fff;
    text-align: center;
}
.splash-content h1 {
    max-width: 720px;
    margin: 0 0 24px;
    color: #fff;
    font-size: 40px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .45);
}
@media (max-width: 600px) {
    .splash-content { padding: 64px 20px max(10vh, 64px); }
    .splash-content h1 { font-size: 28px; }
}
.splash-progress {
    width: min(360px, 72vw);
    height: 3px;
    overflow: hidden;
    background: rgba(255, 255, 255, .28);
}
.splash-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: #fff;
    transition: width .25s ease;
}
.splash-content p {
    min-height: 20px;
    margin: 10px 0 18px;
    color: rgba(255, 255, 255, .82);
    font-size: 13px;
}
.splash-enter-btn {
    min-width: 132px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 4px;
    background: rgba(0, 0, 0, .24);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background .2s, border-color .2s;
}
.splash-enter-btn[hidden] { display: none; }
.splash-enter-btn:hover,
.splash-enter-btn:focus-visible { background: rgba(0, 0, 0, .5); border-color: #fff; }
.splash-skip-btn {
    position: absolute;
    top: max(env(safe-area-inset-top, 0px), 16px);
    right: max(env(safe-area-inset-right, 0px), 16px);
    z-index: 3;
    min-height: 36px;
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 4px;
    background: rgba(0, 0, 0, .26);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: background .2s;
    user-select: none;
}
.splash-skip-btn:hover,
.splash-skip-btn:focus-visible { background: rgba(0, 0, 0, .52); }
@keyframes splash-image-drift {
    from { transform: scale(1.035); }
    to { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .splash-overlay img.splash-img { animation: none; }
    .splash-overlay, .splash-progress span { transition: none; }
}
/* 开屏期间禁止页面滚动 */
body.splash-active {
    overflow: hidden;
}

/* ══════════════════════════════════════════════
   二维码弹窗
   ══════════════════════════════════════════════ */
.qr-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 90000;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
}
.qr-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.qr-modal {
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px 24px 20px;
    max-width: 300px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: transform 0.25s;
}
.qr-modal-overlay.active .qr-modal {
    transform: scale(1);
}
.qr-modal h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}
.qr-modal canvas, .qr-modal img {
    width: 200px;
    height: 200px;
    margin: 0 auto 12px;
    display: block;
}
.qr-modal-url {
    font-size: 12px;
    color: var(--text-light);
    word-break: break-all;
    line-height: 1.5;
    max-height: 60px;
    overflow: hidden;
}
.qr-modal-close {
    margin-top: 14px;
    padding: 8px 24px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
}

/* ══════════════════════════════════════════════
   自定义删除确认对话框
   ══════════════════════════════════════════════ */
.confirm-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 95000;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.confirm-dialog-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.confirm-dialog {
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px 24px 20px;
    max-width: 360px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.confirm-dialog-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    background: #fff0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.confirm-dialog-icon svg {
    width: 24px;
    height: 24px;
    stroke: #ff4d4f;
}
.confirm-dialog h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}
.confirm-dialog p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.5;
}
.confirm-dialog-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.confirm-dialog-btns button {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.15s;
}
.confirm-dialog-cancel {
    background: var(--card);
    color: var(--text);
}
.confirm-dialog-cancel:hover {
    background: var(--bg);
}
.confirm-dialog-ok {
    background: #ff4d4f;
    color: #fff;
    border-color: #ff4d4f !important;
}
.confirm-dialog-ok:hover {
    background: #e04042;
}

/* ══════════════════════════════════════════════
   拖拽排序
   ══════════════════════════════════════════════ */
.draggable-item {
    cursor: grab;
    transition: transform 0.15s, box-shadow 0.15s;
}
.draggable-item:active {
    cursor: grabbing;
}
.draggable-item.dragging {
    opacity: 0.5;
    transform: scale(0.96);
    box-shadow: var(--shadow-lg);
}
.draggable-item.drag-over {
    border: 2px dashed var(--primary);
    background: rgba(74, 144, 217, 0.06);
}
.drag-handle {
    cursor: grab;
    color: var(--text-light);
    padding: 4px;
    display: flex;
    align-items: center;
}
.drag-handle:active {
    cursor: grabbing;
}

/* ══════════════════════════════════════════════
   后台统计卡片
   ══════════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
@media (min-width: 768px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}
.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}
.stat-card-label {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ══════════════════════════════════════════════
   搜索筛选栏
   ══════════════════════════════════════════════ */
.admin-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
}
.admin-search-bar input {
    flex: 1;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--card);
    color: var(--text);
    outline: none;
}
.admin-search-bar input:focus {
    border-color: var(--primary);
}
.admin-search-bar .search-clear {
    padding: 8px 12px;
    border: none;
    background: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 13px;
}

/* 2026 visual refresh: quieter workspace, stronger hierarchy, fewer decorative effects */
:root {
    --primary: #176b63;
    --primary-dark: #10534d;
    --success: #2f7d4a;
    --danger: #c43d4b;
    --warning: #a66a16;
    --text: #202522;
    --text-light: #69716c;
    --bg: #f3f5f4;
    --card: #ffffff;
    --border: #dfe4e1;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(20, 32, 27, 0.08);
    --shadow-lg: 0 10px 28px rgba(20, 32, 27, 0.14);
}

.admin-page .navbar { box-shadow: none; border-bottom-color: #d7ddda; }
.admin-page .container { max-width: 1320px; }
.admin-page .page-header { margin-bottom: 16px; }
.admin-page .page-header h2 { font-size: 20px; }
.admin-page .album-card,
.admin-page .stat-card,
.admin-page .create-form,
.album-edit-header,
.watermark-panel,
.photo-manager { box-shadow: var(--shadow); border: 1px solid var(--border); border-radius: 8px; }
.admin-page .album-card:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(20,32,27,0.11); }
.admin-page .stat-card { padding: 14px 16px; }
.admin-page .stat-card-value { font-size: 24px; color: var(--text); }
.admin-page .section-title-bar { margin-top: 24px; }
.btn { border-radius: 6px; font-weight: 500; }
.badge { border-radius: 999px; }

.login-wrapper { background: #18211f; }
.login-wrapper::before,
.login-wrapper::after { display: none; }
.login-card { max-width: 440px; border-radius: 8px; padding: 40px 34px 34px; box-shadow: 0 18px 45px rgba(0,0,0,0.28); }
.login-icon-ring { border-radius: 8px; background: #176b63; box-shadow: none; }
.login-card .login-btn { border-radius: 6px; background: #176b63; box-shadow: none; letter-spacing: 2px; }
.login-card .login-btn:hover { background: #10534d; box-shadow: none; }
.input-group input { border-radius: 6px; background: #fff; }

.delivery-badge {
    display: inline-flex;
    align-items: center;
    margin: 2px 0 5px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #edf0ee;
    color: #59615d;
    font-size: 11px;
    font-weight: 600;
}
.delivery-review { background: #fff4d8; color: #835510; }
.delivery-delivered { background: #e4f3e9; color: #23643b; }
.delivery-uploading { background: #e6f1f5; color: #1e6074; }
.delivery-archived { background: #ecebea; color: #615f5c; }

.watermark-header:focus-visible,
.btn:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(23,107,99,0.28);
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .admin-page .page-header { align-items: flex-start; gap: 12px; }
    .admin-page .page-header-actions { width: 100%; overflow-x: auto; padding-bottom: 4px; }
    .review-summary-bar { align-items: flex-start; }
    .login-card { padding: 32px 22px 26px; }
}

/* Authentication surfaces */
.auth-page {
    min-width: 320px;
    background: #eef1ef;
}
.auth-shell {
    min-height: 100svh;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    background:
        linear-gradient(#d9dfdc 1px, transparent 1px),
        linear-gradient(90deg, #d9dfdc 1px, transparent 1px),
        #eef1ef;
    background-size: 72px 72px;
    color: #202522;
    overflow: hidden;
}
.auth-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(238, 241, 239, 0.84);
    pointer-events: none;
}
.auth-brandbar,
.auth-main,
.auth-footer {
    position: relative;
    z-index: 1;
}
.auth-brandbar {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 32px;
    border-bottom: 1px solid rgba(32, 37, 34, 0.14);
}
.auth-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    color: #202522;
    font-size: 14px;
    font-weight: 650;
}
.auth-brand > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.auth-brand-mark {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    background: #202522;
    color: #fff;
    border-radius: 6px;
}
.auth-brand-mark svg {
    width: 18px;
    height: 18px;
}
.auth-brand-logo {
    display: block;
    width: auto;
    max-width: 120px;
    height: 32px;
    object-fit: contain;
}
.auth-area-label {
    color: #717975;
    font-size: 12px;
    line-height: 1;
}
.auth-main {
    width: 100%;
    display: grid;
    place-items: center;
    padding: 48px 24px;
}
.login-wrapper {
    padding: 0;
    background-color: #eef1ef;
}
.login-wrapper::after {
    display: block;
    width: 5px;
    height: auto;
    inset: 76px auto 49px 0;
    border-radius: 0;
    background: #b53b46;
    opacity: 1;
}
.login-card,
.password-card {
    width: 100%;
    position: relative;
    z-index: 1;
    background: #fff;
    border: 1px solid #d8ddda;
    border-radius: 8px;
    box-shadow: 0 18px 54px rgba(20, 32, 27, 0.13);
}
.login-card {
    max-width: 430px;
    padding: 38px 38px 30px;
}
.login-header {
    margin-bottom: 28px;
    text-align: left;
}
.login-icon-ring,
.password-icon {
    display: grid;
    place-items: center;
    background: #e8efec;
    border: 1px solid #d7e2dd;
    color: #176b63;
    border-radius: 6px;
    box-shadow: none;
}
.login-icon-ring {
    width: 44px;
    height: 44px;
    margin: 0 0 24px;
}
.login-icon-ring svg {
    width: 22px;
    height: 22px;
}
.auth-eyebrow {
    margin: 0 0 6px;
    color: #176b63;
    font-size: 10px;
    font-weight: 750;
    line-height: 1.3;
    letter-spacing: 1.4px;
}
.login-card h1,
.password-card h1 {
    color: #202522;
    font-weight: 680;
    letter-spacing: 0;
}
.login-card h1 {
    margin: 0 0 5px;
    font-size: 25px;
    line-height: 1.3;
}
.login-card .login-subtitle {
    margin: 0;
    color: #717975;
    font-size: 13px;
    letter-spacing: 0;
    text-align: left;
}
.login-form {
    margin-top: 0;
}
.login-card .input-group {
    margin-bottom: 17px;
}
.login-card .input-group label,
.password-form > label {
    display: block;
    margin-bottom: 7px;
    color: #3f4642;
    font-size: 12px;
    font-weight: 600;
}
.auth-input-wrap,
.password-field {
    position: relative;
}
.login-card .input-icon,
.password-field-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: #8a928e;
    pointer-events: none;
}
.password-field-icon {
    width: 18px;
    height: 18px;
}
.login-card .input-group input,
.password-field input,
.captcha-input {
    width: 100%;
    border: 1px solid #cfd5d2;
    border-radius: 6px;
    outline: none;
    background: #fff;
    color: #202522;
    font-size: 14px;
    transition: border-color 0.16s, box-shadow 0.16s;
}
.login-card .input-group input {
    height: 48px;
    padding: 0 46px 0 43px;
}
.login-card .input-group input:focus,
.password-field input:focus,
.captcha-input:focus {
    border-color: #176b63;
    box-shadow: 0 0 0 3px rgba(23, 107, 99, 0.12);
}
.login-card .input-group input::placeholder,
.password-field input::placeholder,
.captcha-input::placeholder {
    color: #a1a8a4;
}
.login-card input:-webkit-autofill,
.login-card input:-webkit-autofill:hover,
.login-card input:-webkit-autofill:focus {
    -webkit-text-fill-color: #202522;
    box-shadow: 0 0 0 100px #fff inset;
    transition: background-color 9999s ease-out;
}
.input-group-password .password-toggle,
.password-visibility-toggle {
    width: 36px;
    height: 36px;
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #7d8581;
    cursor: pointer;
}
.input-group-password .password-toggle:hover,
.password-visibility-toggle:hover {
    background: #edf1ef;
    color: #202522;
}
.input-group-password .password-toggle svg,
.password-visibility-toggle svg {
    width: 18px;
    height: 18px;
}
.login-card .login-btn,
.password-submit-btn {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 16px 0 18px;
    border: 0;
    border-radius: 6px;
    background: #176b63;
    color: #fff;
    font-size: 14px;
    font-weight: 650;
    letter-spacing: 0;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.16s, transform 0.16s;
}
.login-card .login-btn {
    margin-top: 7px;
    justify-content: center;
    padding: 0 18px;
}
.login-card .login-btn:hover,
.password-submit-btn:hover {
    background: #10534d;
    box-shadow: none;
    transform: translateY(-1px);
}
.login-error,
.password-error {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    margin: 0 0 18px;
    padding: 10px 12px;
    border: 1px solid #e8c8cb;
    border-radius: 6px;
    background: #fbf0f1;
    color: #9f303a;
    font-size: 12px;
    line-height: 1.5;
    text-align: left;
}
.login-error svg,
.password-error svg {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
}
.auth-card-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 22px 0 0;
    color: #8a928e;
    font-size: 11px;
}
.auth-card-note svg {
    width: 14px;
    height: 14px;
}
.auth-icp {
    text-transform: none;
    letter-spacing: 0;
}
.auth-icp a {
    color: inherit;
    text-decoration: none;
}
.auth-icp a:hover {
    text-decoration: underline;
}
.auth-footer {
    min-height: 49px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 32px;
    border-top: 1px solid rgba(32, 37, 34, 0.12);
    color: #7a827e;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.password-page {
    display: block;
    padding: 0;
    background: #eef1ef;
}
.password-shell::after {
    content: "";
    position: fixed;
    top: 76px;
    right: 0;
    bottom: 49px;
    width: 5px;
    background: #b9873b;
}
.password-card {
    max-width: 480px;
    padding: 34px 36px 28px;
    text-align: left;
}
.password-card-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 22px;
}
.password-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    margin: 0;
}
.password-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}
.protected-type {
    display: block;
    margin: 0 0 4px;
    color: #176b63;
    font-size: 11px;
    font-weight: 700;
}
.password-card h1 {
    margin: 0;
    font-size: 21px;
    line-height: 1.35;
}
.protected-item {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 12px;
    align-items: baseline;
    margin-bottom: 9px;
    padding: 12px 14px;
    border-left: 3px solid #b9873b;
    background: #f5f6f5;
}
.protected-item span {
    color: #8a928e;
    font-size: 11px;
}
.protected-item strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #303632;
    font-size: 13px;
    font-weight: 650;
}
.password-card .password-intro {
    margin: 0 0 22px;
    color: #7b837f;
    font-size: 12px;
}
.password-form > label:not(:first-of-type) {
    margin-top: 16px;
}
.password-field input {
    height: 48px;
    padding: 0 46px 0 43px;
}
.captcha-group {
    display: grid;
    grid-template-columns: 178px minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
    margin: 0;
}
.captcha-img-wrap {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 6px;
    align-items: stretch;
}
.captcha-img {
    width: 100%;
    height: 46px;
    display: block;
    object-fit: contain;
    border: 1px solid #cfd5d2;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}
.captcha-refresh {
    width: 38px;
    height: 46px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid #cfd5d2;
    border-radius: 6px;
    background: #fff;
    color: #6f7773;
    cursor: pointer;
}
.captcha-refresh:hover {
    border-color: #9da5a1;
    background: #f3f5f4;
    color: #202522;
}
.captcha-refresh svg {
    width: 17px;
    height: 17px;
}
.captcha-input {
    min-width: 0;
    height: 46px;
    padding: 0 10px;
    text-align: center;
    letter-spacing: 2px;
}
.captcha-input::placeholder {
    letter-spacing: 0;
}
.password-submit-btn {
    margin-top: 22px;
    justify-content: center;
    padding: 0 18px;
}

body.dark-mode .auth-shell {
    background:
        linear-gradient(#313735 1px, transparent 1px),
        linear-gradient(90deg, #313735 1px, transparent 1px),
        #1d2220 !important;
    background-size: 72px 72px;
    color: #e8ecea;
}
body.dark-mode .auth-shell::before {
    background: rgba(29, 34, 32, 0.86);
}
body.dark-mode .auth-brandbar,
body.dark-mode .auth-footer {
    border-color: rgba(232, 236, 234, 0.14);
}
body.dark-mode .auth-brand,
body.dark-mode .login-card h1,
body.dark-mode .password-card h1 {
    color: #eef1ef !important;
}
body.dark-mode .auth-brand-mark {
    background: #eef1ef;
    color: #202522;
}
body.dark-mode .login-card,
body.dark-mode .password-card {
    background: #252a28 !important;
    border-color: #3a413e;
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.3);
}
body.dark-mode .login-icon-ring,
body.dark-mode .password-icon {
    background: #293b36;
    border-color: #345148;
}
body.dark-mode .login-card .input-group label,
body.dark-mode .password-form > label,
body.dark-mode .protected-item strong {
    color: #dce1de;
}
body.dark-mode .login-card .input-group input,
body.dark-mode .password-field input,
body.dark-mode .captcha-input {
    background: #1e2321 !important;
    border-color: #444c48 !important;
    color: #eef1ef !important;
}
body.dark-mode .login-card input:-webkit-autofill,
body.dark-mode .login-card input:-webkit-autofill:hover,
body.dark-mode .login-card input:-webkit-autofill:focus {
    -webkit-text-fill-color: #eef1ef;
    box-shadow: 0 0 0 100px #1e2321 inset;
}
body.dark-mode .login-card .login-btn {
    background: #176b63 !important;
}
body.dark-mode .login-card .login-btn:hover {
    background: #10534d !important;
}
body.dark-mode .protected-item {
    background: #202522;
}
body.dark-mode .captcha-refresh {
    background: #1e2321;
    border-color: #444c48;
}

@media (max-width: 600px) {
    .auth-brandbar {
        min-height: 64px;
        padding: 14px 18px;
    }
    .auth-main {
        align-items: start;
        padding: 28px 16px;
    }
    .login-wrapper::after,
    .password-shell::after {
        top: 64px;
        bottom: 45px;
        width: 3px;
    }
    .login-card,
    .password-card {
        max-width: none;
        padding: 28px 22px 24px;
    }
    .login-icon-ring {
        margin-bottom: 20px;
    }
    .auth-footer {
        min-height: 45px;
        padding: 12px 18px;
    }
}

@media (max-width: 430px) {
    .auth-area-label,
    .auth-footer span:last-child {
        display: none;
    }
    .password-card-header {
        gap: 12px;
    }
    .captcha-group {
        grid-template-columns: 1fr;
    }
    .captcha-img-wrap {
        grid-template-columns: minmax(0, 1fr) 44px;
    }
    .captcha-refresh {
        width: 44px;
    }
    .captcha-input {
        height: 48px;
    }
}

/* Share-page copyright protection */
.content-protected {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.content-protected img,
.content-protected video,
.content-protected canvas {
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
/* Keep the native long-press target off the actual media in iOS and WeChat.
   Events still bubble from these transparent hit surfaces to the gallery/lightbox. */
.content-protected .gallery-cell::after,
.content-protected .album-sub-cover::after,
.content-protected .lb-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.content-protected .album-sub-cover {
    position: relative;
}
.content-protected .review-btn,
.content-protected .review-note-btn {
    z-index: 3;
}
.content-protected .lb-photo,
.content-protected .lightbox.is-original-mode .lb-stage img {
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.copyright-watermark-layer {
    position: fixed;
    inset: 0;
    z-index: 10020;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
    contain: strict;
}
.copyright-watermark-layer span {
    --mark-column: 0;
    --mark-row: 0;
    position: absolute;
    left: calc((var(--mark-column) * 42%) - 12%);
    top: calc((var(--mark-row) * 31%) - 6%);
    width: 360px;
    color: rgba(255, 255, 255, 0.12);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
    transform: rotate(-22deg);
    transform-origin: center;
    white-space: nowrap;
}
.content-privacy-shield {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #161a18;
    color: #fff;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.08s linear, visibility 0.08s linear;
}
.content-is-shielded .content-privacy-shield {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.content-privacy-shield-inner {
    display: grid;
    justify-items: center;
    gap: 9px;
    text-align: center;
}
.content-privacy-shield-inner svg {
    width: 38px;
    height: 38px;
    margin-bottom: 4px;
    color: #5e9f91;
}
.content-privacy-shield-inner strong {
    font-size: 16px;
    font-weight: 650;
}
.content-privacy-shield-inner span {
    color: #9ca39f;
    font-size: 12px;
}
@media (max-width: 600px) {
    .copyright-watermark-layer span {
        left: calc((var(--mark-column) * 58%) - 34%);
        top: calc((var(--mark-row) * 31%) - 5%);
        width: 320px;
        font-size: 10px;
    }
}
@media print {
    body.content-protected > * {
        display: none !important;
    }
    body.content-protected::before {
        content: "此图片受保护，不支持打印";
        display: block;
        padding: 48px;
        color: #111;
        font-size: 16px;
        text-align: center;
    }
}

/* ══════════════════════════════════════════════
   分享有效期倒计时
   ══════════════════════════════════════════════ */
.share-countdown {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(255, 77, 79, 0.1);
    color: #ff4d4f;
    font-size: 12px;
    font-weight: 500;
}
.share-countdown.safe {
    background: rgba(82, 196, 26, 0.1);
    color: #52c41a;
}
.share-countdown.warning {
    background: rgba(250, 173, 20, 0.1);
    color: #faad14;
}

/* ══════════════════════════════════════════════
   Toast 复制成功提示
   ══════════════════════════════════════════════ */
.toast-copy {
    background: #1a4731 !important;
    color: #6ee7a0 !important;
}

/* ══════════════════════════════════════════════
   灯箱全屏按钮
   ══════════════════════════════════════════════ */
.lb-fullscreen-btn {
    position: absolute;
    top: 12px;
    right: 56px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 6px;
    z-index: 10;
    transition: color 0.2s;
}
.lb-fullscreen-btn:hover {
    color: #fff;
}

/* ══════════════════════════════════════════════
   水印实时预览
   ══════════════════════════════════════════════ */
.wm-preview-box {
    position: relative;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 3/2;
    background: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    margin: 12px auto;
    border: 1px solid var(--border);
}
.wm-preview-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.wm-preview-watermark {
    position: absolute;
    pointer-events: none;
    width: auto;
    height: auto;
    object-fit: contain;
}
.wm-preview-watermark[hidden] { display: none; }
.wm-preview-empty {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--text-light);
    font-size: 13px;
}

/* ── 加载指示器 ── */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}
.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.btn-loading .btn-text { visibility: hidden; }

.tab-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(var(--card-rgb, 255,255,255), 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 12px;
}
