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

:root {
    --primary: #4f6ef7;
    --primary-hover: #3b5de7;
    --accent: #f7724f;
    --bg: #f5f6fa;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-secondary: #7f8c8d;
    --border: #e1e4e8;
    --danger: #e74c3c;
    --success: #27ae60;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 60px;
}
/* 导航靠右，主题按钮跟在导航后面；没有导航的页面按钮自己靠右 */
.header-inner > .nav { margin-left: auto; margin-right: 10px; }
.header-inner > .nav + .theme-toggle { margin-left: 0; }
.header-inner > .logo + .theme-toggle { margin-left: auto; }

.logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

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

.nav-link {
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.nav-link:hover { background: var(--bg); }
.nav-link.active { color: var(--primary); font-weight: 600; }

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

.nav-logout { color: var(--danger) !important; }

.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    font-family: inherit;
    line-height: 1.5;
}

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

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #e0653f; }

.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-block { display: block; width: 100%; }

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

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
}

.btn-sm:hover { background: var(--bg); }

.hero {
    text-align: center;
    padding: 60px 20px 40px;
}

.hero h1 { font-size: 36px; margin-bottom: 12px; }
.hero-desc { color: var(--text-secondary); font-size: 17px; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }

.code-lookup { max-width: 460px; margin: 0 auto; }
.storage-usage + .code-lookup { margin-top: 18px; }
.code-form { display: flex; gap: 10px; }
.code-input { flex: 1; text-align: center; font-family: monospace; font-size: 18px; letter-spacing: 2px; text-transform: uppercase; }
.code-error { color: var(--danger); font-size: 13px; margin-top: 8px; }

.progress-bar {
    width: 100%;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #6c8cff);
    width: 0%;
    border-radius: 12px;
    transition: width 0.2s;
}
.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.error-page {
    text-align: center;
    padding: 80px 20px;
}
.error-page .error-code {
    font-size: 96px;
    font-weight: 800;
    color: var(--border);
    line-height: 1;
    margin-bottom: 12px;
}
.error-page .error-msg {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.section { margin: 40px 0; }
.section-title { font-size: 22px; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid var(--border); }

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

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

.image-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.image-card-thumb {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: #e1e4e8;
}

.image-card-info {
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.image-card-code {
    font-family: monospace;
    color: var(--primary);
    font-weight: 600;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.badge-public { background: #d4edda; color: #155724; }
.badge-private { background: #f8d7da; color: #721c24; }
.badge-lock { background: #fff3cd; color: #856404; }

.upload-form {
    max-width: 500px;
    margin: 30px auto;
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.form-group { margin-bottom: 20px; }
.form-label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px; }

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
}

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

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
}

.drop-zone:hover { border-color: var(--primary); background: rgba(79,110,247,0.03); }
.drop-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.drop-hint { color: var(--text-secondary); font-size: 14px; }
.drop-preview { color: var(--primary); font-weight: 500; margin-top: 8px; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }

/* 广告显示位置多选：两列自适应，窄屏自动变一列 */
.position-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 8px 14px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafbfe;
}

/* 登录页「或」分隔线 */
.oauth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--text-secondary);
    font-size: 13px;
}
.oauth-divider::before,
.oauth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-success { background: #d4f5df; color: #14532d; border: 1px solid #b7ecc8; }
html.dark .alert-error { background: rgba(255,69,58,.16); color: #ff9a92; border-color: rgba(255,69,58,.32); }
html.dark .alert-success { background: rgba(48,209,88,.16); color: #7ee2a0; border-color: rgba(48,209,88,.32); }

/* 个人中心 */
.account-section { max-width: 960px; margin: 0 auto; }
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.account-card {
    background: var(--card-bg);
    border: var(--glass-line, 1px solid var(--border));
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 22px;
}
.account-facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 18px; font-size: 14px; }
.account-facts dt { color: var(--text-secondary); }
.account-facts dd { margin: 0; color: var(--text); word-break: break-all; }
.account-subtitle { font-size: 15px; margin: 0 0 14px; }
.storage-block { margin-top: 6px; }
.storage-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.account-hint { font-size: 12.5px; color: var(--text-secondary); line-height: 1.7; margin: 14px 0 0; }
.bind-row {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid rgba(16,24,40,.07);
}
.bind-row:last-of-type { border-bottom: none; }
html.dark .bind-row { border-bottom-color: rgba(255,255,255,.09); }
.bind-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.bind-name { font-weight: 600; }
.bind-state { font-size: 12px; color: var(--text-secondary); }
.bind-on { color: var(--success); }
.bind-id { font-size: 12px; color: var(--text-secondary); }
.bind-actions form { margin: 0; }
.muted { color: var(--text-secondary); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
@media (max-width: 760px) {
    .account-grid { grid-template-columns: 1fr; }
}

.result-card {
    max-width: 500px;
    margin: 30px auto;
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.result-card h2 { color: var(--success); margin-bottom: 16px; }
.result-info { text-align: left; margin-bottom: 20px; }
.result-info p { margin-bottom: 8px; font-size: 14px; }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.code-display {
    font-family: monospace;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 2px;
    background: var(--bg);
    padding: 4px 12px;
    border-radius: 4px;
}

.view-page { max-width: 900px; margin: 30px auto; }

.view-info-bar {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.image-container { text-align: center; margin: 20px 0; }
.view-image { max-width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); }

.view-actions { text-align: center; margin: 20px 0; }

.download-disabled-hint {
    color: var(--danger);
    font-size: 14px;
    padding: 10px;
    background: #f8d7da;
    border-radius: var(--radius);
    display: inline-block;
}

.view-meta {
    background: var(--card-bg);
    padding: 16px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: 14px;
}

.view-meta p { margin-bottom: 6px; }

.image-viewer {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
    margin: 0 auto;
    text-align: center;
    cursor: default;
}
.image-viewer img {
    display: block;
    max-width: 100%;
    height: auto;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}
.watermark-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}
.watermark-overlay span {
    position: absolute;
    color: rgba(255,255,255,0.25);
    font-size: 16px;
    font-weight: bold;
    white-space: nowrap;
    transform: rotate(-30deg);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    max-width: 700px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
}

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

.lottery-image { max-width: 100%; border-radius: var(--radius); margin-bottom: 16px; }
.lottery-info { text-align: left; font-size: 14px; }
.lottery-info p { margin-bottom: 6px; }

.admin-login {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.admin-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 400px;
    width: 100%;
}

.admin-card h1 { font-size: 24px; margin-bottom: 24px; text-align: center; }

.admin-header { background: #2c3e50; }
.admin-header .logo { color: #fff; }
.admin-header .nav-link { color: rgba(255,255,255,0.85); }
.admin-header .nav-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.admin-header .nav-link.active { color: #fff; }
.admin-header .nav-user { color: rgba(255,255,255,0.6); }
.admin-header .nav-logout { color: #e74c3c !important; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.stat-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-value { font-size: 36px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

.admin-table {
    width: 100%;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-collapse: collapse;
    font-size: 13px;
    margin: 16px 0;
}

.admin-table th {
    background: var(--bg);
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
}

.admin-table td {
    padding: 8px 10px;
    border-top: 1px solid var(--border);
    vertical-align: middle;
}

.admin-thumb {
    width: 60px;
    height: 45px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    background-color: var(--border);
}

.admin-actions { display: flex; gap: 4px; flex-wrap: wrap; }

.pagination { display: flex; gap: 6px; justify-content: center; margin: 24px 0; }
.page-link, .page-current { padding: 6px 12px; border-radius: 4px; font-size: 14px; text-decoration: none; }
.page-link { border: 1px solid var(--border); color: var(--text); }
.page-link:hover { background: var(--bg); }
.page-current { background: var(--primary); color: #fff; }

.footer {
    margin-top: auto;
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.empty-state { text-align: center; padding: 80px 20px; }
.empty-state h1 { font-size: 72px; color: var(--border); }
.empty-state p { color: var(--text-secondary); margin: 16px 0 24px; }

/* ===== 广告位 ===== */
.ad-slot { margin: 16px 0; }
.ad-slot:empty { display: none; }
.ad-item { display: flex; justify-content: center; }
.ad-item img { max-width: 100%; height: auto; }

/* ===== 浮层 / 吸附条 / 弹窗广告（由 assets/js/ads.js 控制显示时机） ===== */
.ad-overlay { position: fixed; z-index: 900; }
.ad-overlay[hidden] { display: none !important; }
.ad-overlay .ad-box {
    position: relative; background: var(--card-bg); border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .18); overflow: hidden;
}
.ad-overlay.is-visible { animation: adFadeIn .22s ease-out; }
@keyframes adFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ad-close {
    position: absolute; top: 6px; right: 8px; z-index: 2;
    width: 26px; height: 26px; border: 0; border-radius: 50%; cursor: pointer;
    background: rgba(0, 0, 0, .45); color: #fff; font-size: 16px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.ad-close:hover { background: rgba(0, 0, 0, .65); }
.ad-mode-floating { right: 18px; bottom: 18px; }
.ad-mode-floating .ad-box { padding: 10px; max-width: min(92vw, 420px); }
.ad-mode-sticky { left: 0; right: 0; bottom: 0; }
.ad-mode-sticky .ad-box { max-width: 100%; border-radius: 0; padding: 8px 44px 8px 12px; }
.ad-mode-modal {
    inset: 0; display: flex; align-items: center; justify-content: center;
}
.ad-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); }
.ad-mode-modal .ad-box {
    position: relative; z-index: 1; padding: 16px;
    max-width: min(92vw, 560px); max-height: 86vh; overflow: auto;
}
body.ad-modal-open { overflow: hidden; }

/* ===== 批量上传缩略图 ===== */
.batch-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.batch-thumb { width: 120px; text-align: center; margin: 0; }
.batch-thumb-img {
    display: block; width: 100%; height: 90px; border-radius: 6px;
    background-size: cover; background-position: center; background-color: var(--border);
    border: 1px solid var(--border);
}
.batch-thumb figcaption {
    margin-top: 4px; font-size: 11px; color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ===== 图片组缩略图条 ===== */
.thumb-strip { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0; margin: 6px 0 16px; }
.thumb-item {
    flex: 0 0 auto; width: 72px; height: 72px;
    border: 2px solid transparent; border-radius: 6px; overflow: hidden;
}
.thumb-item.active { border-color: var(--primary); }
.thumb-img {
    display: block; width: 100%; height: 100%;
    background-size: cover; background-position: center; background-color: var(--border);
}

/* ===== 查看页（图片组） ===== */
.view-counter { color: var(--text-secondary); font-size: 13px; margin: 8px 0; }
.batch-file-list { margin-top: 8px; border-top: 1px solid var(--border); }
.batch-file-row {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px;
    cursor: pointer;
}
.batch-file-row:hover { background: #f7f8fc; }
.batch-file-row.active { background: #f0f3ff; }
.batch-file-index {
    width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%;
    background: var(--border); color: var(--text); font-size: 11px;
    display: flex; align-items: center; justify-content: center;
}
.batch-file-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-file-size { color: var(--text-secondary); font-size: 12px; }
.batch-file-row a { font-size: 12px; color: var(--primary); text-decoration: none; }
.batch-file-row a:hover { text-decoration: underline; }

/* ===== 弹窗表单（后台） ===== */
.modal-title { margin: 0 0 16px; font-size: 18px; }
.modal-body { max-height: 60vh; overflow-y: auto; }
.modal-form .form-input, .modal-form textarea, .modal-form select { width: 100%; }
.modal-form textarea.form-input { resize: vertical; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.form-row { display: flex; gap: 10px; }
.form-row > * { flex: 1 1 0; min-width: 0; }
.admin-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.admin-toolbar h1 { margin: 0; }

/* 广告模板预览 */
.ad-preview-wrap { margin-top: 4px; }
.ad-preview-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
#ad-preview {
    display: block; width: 100%; height: 150px;
    border: 1px dashed var(--border); border-radius: 8px; background: #fff;
}

/* ===== 抽奖结果（整组） ===== */
.lottery-head { text-align: center; }
.lottery-head p { margin: 6px 0; }
.lottery-sub { color: var(--text-secondary); font-size: 13px; }
.lottery-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px; margin: 14px 0; max-height: 46vh; overflow-y: auto;
}
.lottery-thumb {
    position: relative; display: block; border-radius: 6px; overflow: hidden;
    border: 1px solid var(--border); background: var(--bg);
}
.lottery-thumb img { display: block; width: 100%; height: 110px; object-fit: cover; }
.lottery-thumb-index {
    position: absolute; left: 4px; top: 4px; background: rgba(0, 0, 0, .55);
    color: #fff; font-size: 11px; padding: 1px 5px; border-radius: 8px;
}
.lottery-downloads { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.lottery-info { text-align: center; }
.lottery-info .btn { margin: 4px; }
.nav-user { font-size: 13px; color: var(--text-secondary); }

@media (max-width: 600px) {
    .hero h1 { font-size: 24px; }
    .header-inner { height: 50px; }
    .logo { font-size: 18px; }
    .nav-link { font-size: 13px; padding: 4px 8px; }
    .image-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .image-card-thumb { height: 130px; }
    .admin-table { font-size: 11px; }
    .admin-table th, .admin-table td { padding: 6px 4px; }
    .form-row { flex-direction: column; gap: 0; }
    .batch-thumb { width: 90px; }
    .batch-thumb-img { height: 68px; }
    .lottery-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
    .lottery-thumb img { height: 84px; }
}

/* ===================== Liquid Glass 主题（覆盖在上，基于导航站设计语言） ===================== */
:root {
    --primary: #0a84ff;
    --primary-dark: #0066d6;
    --accent: #bf5af2;
    --bg: #eef2fa;
    --card-bg: rgba(255, 255, 255, 0.62);
    --text: #1d1d1f;
    --text-secondary: #6e6e73;
    --border: rgba(255, 255, 255, 0.7);
    --danger: #ff453a;
    --success: #30d158;
    --radius: 20px;
    --shadow: 0 10px 34px rgba(23, 35, 64, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.75);
    --glass-blur: blur(28px) saturate(180%);
    --glass-line: 1px solid rgba(255, 255, 255, 0.7);
    --glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

html { -webkit-tap-highlight-color: transparent; }

body {
    background:
        radial-gradient(900px 620px at 6% -12%, rgba(10, 132, 255, 0.24), transparent 62%),
        radial-gradient(820px 540px at 102% -4%, rgba(191, 90, 242, 0.22), transparent 58%),
        radial-gradient(760px 640px at 52% 112%, rgba(255, 159, 10, 0.16), transparent 62%),
        linear-gradient(180deg, rgba(247, 249, 253, 0.78) 0%, rgba(238, 242, 250, 0.84) 46%, rgba(244, 240, 251, 0.8) 100%),
        url('/assets/img/site-bg.jpg') center center / cover no-repeat;
    background-attachment: fixed;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* 顶栏 */
.header {
    position: sticky; top: 0; z-index: 60;
    background: rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04), 0 8px 24px rgba(23, 35, 64, 0.05);
}
.header-inner { height: 62px; }
.logo {
    font-weight: 700; letter-spacing: -0.02em; color: var(--text);
    background: linear-gradient(120deg, #0a84ff, #5e5ce6 45%, #bf5af2);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-link {
    border-radius: 999px; padding: 6px 12px; transition: background .25s ease, color .25s ease;
    color: #3a3a3c;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.75); color: var(--primary-dark); }
.nav-link.active { background: rgba(10, 132, 255, 0.12); color: var(--primary-dark); }

/* 通用玻璃卡片 */
.hero, .section, .image-card, .result-card, .admin-card, .view-info-bar,
.view-actions, .view-meta, .modal-content, .admin-login .admin-card,
.image-container, .upload-form, .thumb-strip, .batch-file-list {
    background: var(--card-bg);
    border: var(--glass-line);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}
.hero { padding: 40px 28px; }
/* 只给大块容器用 backdrop-filter；小操作条改半透明实色，避免按钮 hover 闪烁 */
.admin-card, .modal-content, .image-container {
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
}
/* 内含按钮/拖拽区的容器用更实的底色，避免 hover 重绘时抖动 */
.hero, .section, .upload-form {
    background: rgba(255, 255, 255, 0.72);
}
html.dark .hero, html.dark .section, html.dark .upload-form {
    background: rgba(28, 28, 32, 0.72);
}
.view-actions, .view-info-bar, .view-meta, .thumb-strip, .batch-file-list {
    background: rgba(255, 255, 255, 0.78);
}
html.dark .view-actions, html.dark .view-info-bar, html.dark .view-meta,
html.dark .thumb-strip, html.dark .batch-file-list {
    background: rgba(30, 30, 34, 0.8);
}
.image-card, .result-card { overflow: hidden; transition: transform .3s cubic-bezier(.25,.1,.25,1), box-shadow .3s ease; }
.image-card:hover, .result-card:hover { transform: translateY(-3px); box-shadow: 0 18px 44px rgba(23, 35, 64, 0.16), var(--glass-hi); }
.view-info-bar, .view-actions, .view-meta { padding: 18px 20px; }
.section { padding: 24px; margin: 22px 0; }
.section-title { font-weight: 650; letter-spacing: -0.01em; }
.footer { color: var(--text-secondary); }

/* 按钮 */
.btn {
    border-radius: 999px; font-weight: 600; letter-spacing: 0.01em;
    transition: transform .2s ease, box-shadow .25s ease, background .25s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
    background: linear-gradient(135deg, #0a84ff, #5e5ce6);
    border: none; color: #fff;
    box-shadow: 0 8px 22px rgba(10, 132, 255, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:hover { background: linear-gradient(135deg, #2b95ff, #706ef2); box-shadow: 0 12px 28px rgba(10, 132, 255, 0.38); }
.btn-accent {
    background: linear-gradient(135deg, #bf5af2, #ff375f);
    border: none; color: #fff;
    box-shadow: 0 8px 22px rgba(191, 90, 242, 0.3);
}
/* hover 用同色系渐变过渡，避免 base 渐变 → 纯色跳变造成的“闪一下” */
.btn-accent:hover {
    background: linear-gradient(135deg, #c96cf5, #ff5273);
    box-shadow: 0 12px 28px rgba(191, 90, 242, 0.38);
}
.btn-outline {
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.9);
    color: #2c2c2e;
    box-shadow: 0 4px 14px rgba(23, 35, 64, 0.08), var(--glass-hi);
}
.btn-outline:hover { background: rgba(255, 255, 255, 0.95); border-color: rgba(10, 132, 255, 0.35); color: #2c2c2e; }
.btn-danger {
    background: rgba(255, 69, 58, 0.12); color: #d70015;
    border: 1px solid rgba(255, 69, 58, 0.28);
}
.btn-danger:hover { background: rgba(255, 69, 58, 0.18); }

/* 表单 */
.form-label { font-weight: 550; color: #3a3a3c; }
.form-input, .code-input, textarea.form-input, select.form-input {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 14px;
    box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.05), 0 2px 8px rgba(23, 35, 64, 0.04);
    color: var(--text);
    transition: box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.form-input:focus, .code-input:focus, textarea.form-input:focus, select.form-input:focus {
    outline: none;
    background: #fff;
    border-color: rgba(10, 132, 255, 0.55);
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.14), inset 0 1px 2px rgba(16, 24, 40, 0.04);
}
.form-help { display: block; margin-top: 6px; color: var(--text-secondary); font-size: 12px; line-height: 1.5; }

/* 图片网格与缩略 */
.image-card-thumb { background-color: rgba(255, 255, 255, 0.4); }
.image-card-code { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.badge { border-radius: 999px; padding: 3px 10px; font-weight: 600; }
.badge-public { background: rgba(48, 209, 88, 0.14); color: #1f8a3b; }
.badge-private { background: rgba(142, 142, 147, 0.16); color: #55555a; }
.badge-lock { background: rgba(255, 159, 10, 0.16); color: #a05a00; }
.thumb-strip { padding: 10px; gap: 10px; }
.thumb-item { border-radius: 14px; border: 2px solid transparent; overflow: hidden; transition: border-color .2s ease, transform .2s ease; }
.thumb-item.active { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(10, 132, 255, 0.25); }
.thumb-img { border-radius: 10px; }
.batch-file-row { border-radius: 12px; }
.batch-file-row:hover, .batch-file-row.active { background: rgba(10, 132, 255, 0.08); }
.image-container { padding: 14px; }
.view-image { border-radius: 14px; }

/* 后台 */
.admin-header {
    background: rgba(28, 28, 32, 0.72);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.admin-header .logo { -webkit-text-fill-color: #fff; background: none; color: #fff; }
.admin-header .nav-link { color: rgba(255, 255, 255, 0.82); }
.admin-header .nav-link:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.admin-header .nav-link.active { background: rgba(255, 255, 255, 0.18); color: #fff; }
.admin-table, .admin-card { border-radius: var(--radius); }
.admin-table { background: rgba(255, 255, 255, 0.62); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: var(--glass-line); }
.admin-table th { background: rgba(255, 255, 255, 0.55); color: #3a3a3c; }
.admin-table th, .admin-table td { border-bottom: 1px solid rgba(16, 24, 40, 0.06); }
.admin-table tr:hover td { background: rgba(10, 132, 255, 0.05); }
.stat-card {
    background: rgba(255, 255, 255, 0.62); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    border: var(--glass-line); box-shadow: var(--shadow); border-radius: var(--radius);
}
.stat-value { background: linear-gradient(120deg, #0a84ff, #5e5ce6); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.admin-toolbar { align-items: center; }
.pagination .page-link, .page-current {
    border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.66); padding: 6px 12px;
}
.page-current { background: var(--primary); color: #fff; border-color: transparent; }

/* 系统设置分组 */
.settings-group { margin: 26px 0; }
.settings-group-title {
    font-size: 15px; font-weight: 650; letter-spacing: 0.02em; color: var(--text-secondary);
    margin: 0 0 12px; padding-left: 12px; border-left: 3px solid var(--primary);
}
.settings-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px;
    background: var(--card-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    border: var(--glass-line); box-shadow: var(--shadow); border-radius: var(--radius); padding: 20px;
}
.settings-item { margin: 0; }
.settings-grid .form-input { width: 100%; }

/* 弹窗与广告浮层 */
.modal-content { border-radius: 24px; }
.modal-overlay { background: rgba(16, 20, 30, 0.32); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ad-slot .ad-item { background: rgba(255, 255, 255, 0.6); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: var(--glass-line); border-radius: 16px; }
.ad-box { border-radius: 20px; }

/* 代码/兑换码展示 */
.code-display {
    background: rgba(255, 255, 255, 0.75); border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 14px; letter-spacing: 0.12em;
}
.progress-bar { background: rgba(120, 120, 128, 0.16); border-radius: 999px; overflow: hidden; }
.progress-fill { background: linear-gradient(90deg, #0a84ff, #bf5af2); }
.alert { border-radius: 14px; }
.drop-zone {
    background: rgba(255, 255, 255, 0.5); border: 1.5px dashed rgba(10, 132, 255, 0.35); border-radius: 18px;
}
.drop-zone.dragover { background: rgba(10, 132, 255, 0.1); border-color: var(--primary); }


html.dark {
        --bg: #000;
        --card-bg: rgba(30, 30, 34, 0.62);
        --text: #f5f5f7;
        --text-secondary: #98989d;
        --border: rgba(255, 255, 255, 0.14);
        --shadow: 0 12px 36px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
        --glass-line: 1px solid rgba(255, 255, 255, 0.14);
        --glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }
html.dark body {
        background:
            radial-gradient(900px 620px at 6% -12%, rgba(10, 132, 255, 0.3), transparent 62%),
            radial-gradient(820px 540px at 102% -4%, rgba(191, 90, 242, 0.28), transparent 58%),
            radial-gradient(760px 640px at 52% 112%, rgba(255, 159, 10, 0.14), transparent 62%),
            linear-gradient(180deg, rgba(6, 7, 10, 0.76) 0%, rgba(10, 10, 14, 0.8) 50%, rgba(8, 6, 16, 0.78) 100%),
            url('/assets/img/site-bg.jpg') center center / cover no-repeat;
        background-attachment: fixed;
        color: var(--text);
    }
    html.dark .header { background: rgba(20, 20, 24, 0.62); border-bottom-color: rgba(255, 255, 255, 0.08); }
    html.dark .logo { color: #fff; }
    html.dark .nav-link { color: rgba(255, 255, 255, 0.8); }
    html.dark .nav-link:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
    html.dark .btn-outline { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.16); color: #f5f5f7; }
    html.dark .btn-outline:hover { background: rgba(255, 255, 255, 0.18); }
html.dark .form-input, html.dark .code-input, html.dark textarea.form-input, html.dark select.form-input, html.dark .code-display {
        background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.14); color: #f5f5f7;
    }
    html.dark .form-input:focus, html.dark .code-input:focus { background: rgba(255, 255, 255, 0.14); }
    html.dark .admin-table { background: rgba(28, 28, 32, 0.7); }
    html.dark .admin-table th { background: rgba(255, 255, 255, 0.06); color: #d1d1d6; }
    html.dark .admin-table th, html.dark .admin-table td { border-bottom-color: rgba(255, 255, 255, 0.08); }
    html.dark .admin-table tr:hover td { background: rgba(255, 255, 255, 0.05); }
    html.dark .drop-zone { background: rgba(255, 255, 255, 0.05); }
    html.dark .badge-public { background: rgba(48, 209, 88, 0.2); color: #6ee7a0; }
    html.dark .badge-private { background: rgba(255, 255, 255, 0.12); color: #d1d1d6; }
    html.dark .settings-grid { background: rgba(28, 28, 32, 0.6); }
    html.dark .batch-file-row:hover, html.dark .batch-file-row.active { background: rgba(10, 132, 255, 0.16); }

/* ===== 首页特性卡片 + 标题渐变 ===== */
.hero h1 {
    background: linear-gradient(120deg, #0a84ff 0%, #5e5ce6 46%, #bf5af2 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}
.hero-actions { margin-top: 6px; }
.feature-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px; margin: 22px 0;
}
.feature-card {
    background: var(--card-bg);
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    border: var(--glass-line); box-shadow: var(--shadow);
    border-radius: var(--radius); padding: 22px 20px;
    transition: transform .28s cubic-bezier(.25,.1,.25,1), box-shadow .28s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 18px 44px rgba(23, 35, 64, 0.16), var(--glass-hi); }
.feature-ico { font-size: 26px; line-height: 1; display: inline-block; margin-bottom: 10px; }
.feature-card h3 { font-size: 16px; font-weight: 650; margin: 0 0 6px; letter-spacing: -0.01em; }
.feature-card p { margin: 0; color: var(--text-secondary); font-size: 13.5px; line-height: 1.6; }
@media (max-width: 600px) { .feature-card { padding: 18px 16px; } }
/* ===== 三档亮度模式：切换按钮 + 过渡 ===== */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
    transition: background-color .38s ease, color .3s ease, border-color .3s ease,
                box-shadow .3s ease, fill .3s ease, stroke .3s ease !important;
}
.theme-toggle {
    width: 38px; height: 38px; flex: 0 0 auto; margin-left: 4px;
    display: inline-flex; align-items: center; justify-content: center;
    border: var(--glass-line); border-radius: 50%;
    background: rgba(255, 255, 255, 0.6); color: var(--text);
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    box-shadow: 0 2px 10px rgba(23, 35, 64, 0.1), var(--glass-hi);
    cursor: pointer; padding: 0; transition: transform .2s ease, background .2s ease;
}
.theme-toggle:hover { transform: translateY(-1px) scale(1.04); background: rgba(255, 255, 255, 0.9); }
.theme-toggle:active { transform: scale(0.96); }
.theme-toggle .theme-icon { display: inline-flex; }
.theme-toggle svg { display: block; }
html.dark .theme-toggle { background: rgba(255, 255, 255, 0.1); color: #f5f5f7; }
html.dark .theme-toggle:hover { background: rgba(255, 255, 255, 0.18); }
@media (max-width: 600px) {
    .theme-toggle { width: 34px; height: 34px; }
}
/* 后台深色头部里的主题按钮 */
.admin-header .theme-toggle { margin-left: 10px; border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.12); color: #fff; }
.admin-header .theme-toggle:hover { background: rgba(255,255,255,0.22); }
/* ===== 主内容与顶栏留白 ===== */
main.container { padding-top: 26px; }
@media (max-width: 600px) { main.container { padding-top: 16px; } }
/* ===== 输入框 + 右侧按钮（如 OAuth 回调地址复制） ===== */
.input-with-button { display: flex; align-items: center; gap: 8px; }
.input-with-button .form-input { flex: 1 1 auto; min-width: 0; }
.input-with-button .btn-copy {
    flex: 0 0 auto; white-space: nowrap;
    height: 44px; padding: 0 18px; font-size: 14px;
}
@media (max-width: 600px) {
    .input-with-button { flex-wrap: wrap; }
    .input-with-button .btn-copy { width: 100%; }
}
/* 深色模式：危险按钮文字提亮，避免暗底红字糊成一团 */
html.dark .btn-danger { color: #ff8b86; border-color: rgba(255, 105, 97, 0.4); }
html.dark .btn-danger:hover { background: rgba(255, 69, 58, 0.26); }
/* 系统设置：OAuth scope 勾选列表 */
.scope-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.scope-list li { margin: 0; }
.scope-list .checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); line-height: 20px; }
.scope-list code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--primary); background: rgba(10, 132, 255, 0.1); padding: 1px 6px; border-radius: 6px; }
html.dark .scope-list code { background: rgba(10, 132, 255, 0.18); color: #7fb8ff; }
.scope-help { color: var(--text-secondary); }
/* ===== 上传：已选图片缩略图网格 ===== */
.drop-zone { padding: 14px; }
.drop-zone.is-dragover {
    border-color: var(--primary);
    background: rgba(10, 132, 255, 0.08);
}
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 10px;
    text-align: left;
}
.file-tile {
    position: relative;
    margin: 0;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    border: var(--glass-line);
    background: rgba(255, 255, 255, 0.6);
}
.file-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-remove {
    position: absolute; top: 4px; right: 4px;
    width: 22px; height: 22px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border: none; border-radius: 50%;
    background: rgba(0, 0, 0, 0.55); color: #fff;
    font-size: 15px; line-height: 1; cursor: pointer;
    transition: background 0.2s ease;
}
.file-remove:hover { background: rgba(214, 48, 49, 0.85); }
.file-tile figcaption {
    position: absolute; left: 0; right: 0; bottom: 0;
    display: flex; justify-content: space-between; gap: 4px;
    padding: 12px 6px 4px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    color: #fff; font-size: 10px; line-height: 1.3;
}
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { flex: 0 0 auto; opacity: 0.85; }
.file-add {
    aspect-ratio: 1 / 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    border: 2px dashed var(--border); border-radius: 12px;
    background: transparent; color: var(--text-secondary);
    cursor: pointer; font: inherit;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.file-add:hover { border-color: var(--primary); color: var(--primary); background: rgba(10, 132, 255, 0.06); }
.file-add-plus { font-size: 26px; line-height: 1; font-weight: 300; }
.file-add-text { font-size: 11px; text-align: center; }
.file-add-text span { display: block; font-size: 10px; opacity: 0.7; }
html.dark .file-tile { background: rgba(30, 30, 34, 0.6); }
html.dark .file-add { border-color: rgba(255, 255, 255, 0.22); }
@media (max-width: 600px) {
    .file-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
    .file-tile figcaption { font-size: 9px; }
}

/* ===== 上传结果卡片：三个主按钮一行，继续上传降级成文字链接 ===== */
.result-actions .btn {
    flex: 0 0 auto;
    min-width: 126px;
}

/* 三颗按钮一行，「继续上传一组」落在中间那颗按钮的列里，两边与中间按钮对齐 */
.result-actions {
    display: grid;
    grid-template-columns: repeat(3, auto);
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.result-actions .result-again {
    grid-column: 2;
    display: block;
    text-align: center;
    margin: 2px 0 0;
    font-size: 13px;
    line-height: 20px;
    color: var(--text-secondary);
    text-decoration: underline dashed;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    border-bottom: none;
}
.result-actions .result-again:hover { color: var(--primary); }

/* ===== 图片页：文件列表排版 ===== */
.batch-file-list { padding: 2px 14px; border-top: none; }
.batch-file-row { padding: 9px 6px; border-bottom: 1px solid rgba(16, 24, 40, 0.07); }
.batch-file-row:last-child { border-bottom: none; }
.batch-file-name { flex: 1 1 0; min-width: 0; }
.batch-file-size { flex: 0 0 auto; }
.batch-file-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; }
.batch-file-actions a { font-size: 12px; white-space: nowrap; }
.batch-file-index { background: rgba(10, 132, 255, 0.12); color: var(--primary); font-weight: 600; }
.batch-file-row.active .batch-file-index { background: var(--primary); color: #fff; }
.batch-file-row.active .batch-file-name { color: var(--primary); font-weight: 600; }
html.dark .batch-file-row { border-bottom-color: rgba(255, 255, 255, 0.08); }
html.dark .batch-file-index { background: rgba(10, 132, 255, 0.22); color: #7fb8ff; }
html.dark .batch-file-row.active .batch-file-index { background: var(--primary); color: #fff; }

/* 文件列表融进外层卡片，避免"卡中卡" */
.batch-file-list {
    background: transparent; box-shadow: none; border: none;
    border-top: 1px solid rgba(16, 24, 40, 0.07); border-radius: 0;
    margin-top: 10px; padding: 2px 2px 0;
}
html.dark .batch-file-list { background: transparent; border-top-color: rgba(255, 255, 255, 0.09); }

/* ===== 按钮统一几何：描边按钮不再比实心按钮高 2px ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    line-height: 1.2;
}
.btn-primary, .btn-accent, .btn-danger { border: 1px solid transparent; }
.btn-outline { border-width: 1px; }

/* 结果页「继续上传一组」跟随按钮行居中 */
/* 禁止下载时也用同一张玻璃卡包住图片（和上传者视角一致） */
.image-viewer img.view-image { border-radius: 14px; box-shadow: none; }
.image-container .image-viewer { display: block; }

/* 原图文件缺失时的占位提示 */
.missing-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 260px;
    padding: 40px 20px;
    border-radius: 14px;
    background: rgba(16, 24, 40, 0.04);
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
}

.missing-image span {
    font-size: 12px;
    opacity: 0.75;
    word-break: break-all;
}

html.dark .missing-image { background: rgba(255, 255, 255, 0.05); }

/* 个人中心：登录密码弹窗 */

.modal .account-form { display: grid; grid-template-columns: 1fr; gap: 12px; }
.modal .account-form .form-group { margin: 0; }
.modal .account-form .form-help { margin: 4px 0 0; font-size: 12px; color: var(--text-secondary); }
.modal .account-form .modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* 图片页：返回入口（按钮外观复用 .btn，避免与全站不一致） */
.view-back { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.view-back-sub { font-size: 13px; color: var(--text-secondary); text-decoration: none; }
.view-back-sub:hover { color: var(--primary); text-decoration: underline; }

/* 表格圆角：collapse 下 thead 背景会画出直角，改 separate 并给角单元格圆角 */
.admin-table {
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}
.admin-table th:first-child { border-top-left-radius: var(--radius); }
.admin-table th:last-child { border-top-right-radius: var(--radius); }
.admin-table tr:last-child td:first-child { border-bottom-left-radius: var(--radius); }
.admin-table tr:last-child td:last-child { border-bottom-right-radius: var(--radius); }

/* 中性徽标：已绑定/附加登录方式 */
.badge-soft { background: rgba(120, 120, 128, 0.14); color: #55555c; }
html.dark .badge-soft { background: rgba(255, 255, 255, 0.1); color: #d1d1d6; }

/* 深色模式：表单标签继承亮色，避免深底深字（后台设置页曾出现"字发虚/看不见"） */
html.dark .form-label { color: #d1d1d6; }

/* 内层面板不再用 backdrop-filter：Chrome 在圆角处会露出方形底，看着像"圆角外多一个直角" */
.admin-table, .settings-grid, .stat-card, .ad-slot .ad-item, .feature-card {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

/* 后台表格容器：圆角裁剪在包裹层完成，表格负责横向滚动（列宽不被压缩） */
.table-wrap {
    margin: 16px 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden auto;
    max-height: none;
    background: var(--card-bg);
}
.admin-table { margin: 0; border-radius: 0; box-shadow: none; min-width: 900px; }
.table-wrap .admin-table th:first-child { border-top-left-radius: 0; }
.table-wrap .admin-table th:last-child { border-top-right-radius: 0; }
.table-wrap .admin-table tr:last-child td:first-child { border-bottom-left-radius: 0; }
.table-wrap .admin-table tr:last-child td:last-child { border-bottom-right-radius: 0; }
html.dark .table-wrap { background: rgba(28, 28, 32, 0.7); }

/* 后台表格排版：单元格不换行、配额控件固定宽度，避免列被压成竖排 */
.table-wrap .admin-table { min-width: 1080px; }
.admin-table th, .admin-table td { white-space: nowrap; }
.admin-table .admin-actions { white-space: nowrap; }
.admin-table input[name="quota_num"] { width: 64px; }
.admin-table select[name="quota_unit"] { width: 64px; }

/* 后台容器与表格容器：不允许横向撑破页面，表格在自身容器内滚动 */
main { max-width: 100%; }
.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overflow-y: hidden; }

/* body 是 flex 容器，main 作为 flex item 默认 min-width:auto 会被表格撑宽；置 0 让内部容器自己滚动 */
main { min-width: 0; }
.table-wrap { min-width: 0; }

/* 覆盖 flex 列布局下 main 的 fit-content 宽度，强制铺满容器，表格内部滚动 */
main { width: 100%; }

/* 后台表格内的小控件（配额输入/单位选择）在浅色下也要有可见边界 */
.admin-table input[type="number"], .admin-table input[type="text"], .admin-table select {
    background: #fff; border: 1px solid var(--border); border-radius: 8px;
    padding: 3px 6px; height: 30px; color: var(--text); font-size: 12px;
}
html.dark .admin-table input[type="number"], html.dark .admin-table input[type="text"], html.dark .admin-table select {
    background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.16); color: #f2f2f7;
}
.admin-actions { display: inline-flex; gap: 6px; align-items: center; }

/* 配额小控件（后台用户管理） */
.admin-table .quota-input, .admin-table .quota-unit {
    height: 30px; padding: 2px 6px; font-size: 12px; color: var(--text);
    background: #fff; border: 1px solid rgba(16, 24, 40, 0.16); border-radius: 6px;
}
.admin-table .quota-input { width: 58px; }
.admin-table .quota-unit { width: 58px; }
html.dark .admin-table .quota-input, html.dark .admin-table .quota-unit {
    background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.18); color: #f2f2f7;
}
.admin-actions form { display: inline; }
.admin-actions > * + * { margin-left: 6px; }

/* 提高优先级：覆盖表格内 input[type=number] 的白色描边 */
.admin-table input.quota-input, .admin-table select.quota-unit {
    border: 1px solid rgba(16, 24, 40, 0.2); background: #fff; color: var(--text);
}
html.dark .admin-table input.quota-input, html.dark .admin-table select.quota-unit {
    border-color: rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.08); color: #f2f2f7;
}

/* 用户管理表格：压缩横向占用，保证 11 列在 1100px 容器内完整显示 */
.admin-table th, .admin-table td { padding-left: 8px; padding-right: 8px; }
.admin-table .quota-input, .admin-table .quota-unit { width: 50px; }
.admin-table .btn-sm { padding: 4px 8px; }

/* 操作列给足宽度，避免按钮被单元格裁掉 */
.admin-table th:last-child, .admin-table td:last-child { min-width: 96px; }

/* 标签颜色统一跟随主题变量，避免硬编码色与卡片底色错配（深色下出现白底白字） */
.form-label { color: var(--text); }
html.dark .form-label { color: var(--text); }
html.dark { color-scheme: dark; }
html:not(.dark) { color-scheme: light; }

/* 兜底：深色下主要卡片显式给深底，避免个别浏览器因变量块缺失出现"浅底白字" */
html.dark .settings-grid,
html.dark .admin-card,
html.dark .table-wrap,
html.dark .stat-card,
html.dark .feature-card {
    background: rgba(28, 28, 32, 0.88);
}
html.dark .settings-grid,
html.dark .admin-card,
html.dark .table-wrap { color: var(--text); }

/* 深色兜底（强）：不管上层规则怎么叠，深色下卡片、表格、表单控件一律深底浅字 */
html.dark .settings-grid,
html.dark .admin-card,
html.dark .table-wrap,
html.dark .stat-card,
html.dark .feature-card,
html.dark .modal-content {
    background: #1c1c20 !important;
    color: #e5e5ea !important;
}
html.dark .form-label,
html.dark .settings-group-title,
html.dark .scope-list .checkbox-label,
html.dark .form-help,
html.dark .settings-item label {
    color: #e5e5ea !important;
}
html.dark .admin-table { background: #1c1c20 !important; }
html.dark .admin-table th { background: #26262b !important; color: #e5e5ea !important; }
html.dark .admin-table td { color: #e8e8ed !important; }
html.dark input:not([type="checkbox"]):not([type="radio"]),
html.dark select,
html.dark textarea {
    background: #26262b !important;
    color: #f2f2f7 !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
}

/* 图库广场 + 图片页标题（SEO 用真实 h1） */
.view-h1 {
    font-size: 20px; font-weight: 650; line-height: 1.35; margin: 0 0 12px;
    color: var(--text); word-break: break-word;
}
.explore-head { margin-bottom: 18px; }
.explore-sub { color: var(--text-secondary); font-size: 14px; margin: 6px 0 0; }
.image-card-meta { font-size: 12px; color: var(--text-secondary); padding: 0 14px 12px; }
.explore-pagination { margin-top: 22px; }
.footer-links { font-size: 12px; color: var(--text-secondary); margin-top: 6px; }
.footer-links a { color: var(--text-secondary); text-decoration: underline dashed; text-underline-offset: 3px; }
html.dark .view-h1 { color: #e5e5ea; }

/* ===== 深色模式：把遗留的浅色底统一压成深色 ===== */
html.dark .position-checkboxes {
    background: #26262b; border-color: rgba(255, 255, 255, 0.16); color: #e5e5ea;
}
html.dark .position-checkboxes .checkbox-label { color: #e5e5ea; }
html.dark #ad-preview { background: #1c1c20; border-color: rgba(255, 255, 255, 0.18); }
html.dark .batch-file-row:hover { background: rgba(255, 255, 255, 0.06); }
html.dark .batch-file-row.active { background: rgba(10, 132, 255, 0.18); }
html.dark .form-input:focus, html.dark .code-input:focus,
html.dark textarea.form-input:focus, html.dark select.form-input:focus {
    background: #26262b;
}

/* 深色模式：补充徽标与提示的深色底（避免浅黄/浅灰底在暗色下刺眼） */
html.dark .badge-lock { background: rgba(255, 204, 0, 0.22); color: #ffd76a; }
html.dark .badge-private { background: rgba(255, 69, 58, 0.22); color: #ff9c96; }
html.dark .badge-public { background: rgba(48, 209, 88, 0.22); color: #7ee2a3; }
html.dark .ad-preview-wrap .ad-preview-label { color: #b9b9c0; }

/* 展示方式非内嵌时，位置勾选区灰掉并禁用（JS 会加 .is-muted 并 disabled） */
#ad-position-group.is-muted .position-checkboxes { opacity: .45; }
#ad-position-group.is-muted .ad-position-cb { cursor: not-allowed; }
.ad-self { position: relative; z-index: 900; }
/* 浮层内容为空时不要留下一个孤零零的关闭按钮 */
.ad-overlay.is-visible .ad-box:empty { display: none; }
