/* ============================================================
   闲鱼头像修改系统 · 前端设计系统
   风格参考团队官网（OneUI）：紫色渐变 + 柔和阴影 + 卡片悬浮
   ============================================================ */

:root {
    --grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --grad-soft: linear-gradient(135deg, rgba(102, 126, 234, 0.12), rgba(118, 75, 162, 0.12));
    --accent: #667eea;
    --accent-2: #764ba2;
    --accent-rgb: 102, 126, 234;

    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #ffffff;
    --surface-muted: #f8fafc;
    --text: #1e293b;
    --text-strong: #0f172a;
    --muted: #64748b;
    --border: rgba(15, 23, 42, 0.08);
    --border-strong: rgba(15, 23, 42, 0.14);
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --shadow-hover: 0 14px 36px rgba(15, 23, 42, 0.14);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);

    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.1);
    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.1);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.12);
    --info: #0891b2;
    --info-bg: rgba(8, 145, 178, 0.1);

    --radius: 1rem;
    --radius-lg: 1.25rem;
    --radius-sm: 0.625rem;
    --header-h: 4rem;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

html.dark {
    --bg: #151b24;
    --surface: #19222d;
    --surface-2: #1f2937;
    --surface-muted: #202b38;
    --text: #dde2e9;
    --text-strong: #f1f5f9;
    --muted: #99a8bd;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 14px 36px rgba(0, 0, 0, 0.45);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --success-bg: rgba(5, 150, 105, 0.18);
    --danger-bg: rgba(220, 38, 38, 0.18);
    --warning-bg: rgba(217, 119, 6, 0.2);
    --info-bg: rgba(8, 145, 178, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s, color 0.3s;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { color: var(--text-strong); margin: 0; }

::selection { background: rgba(var(--accent-rgb), 0.2); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb), 0.25); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(var(--accent-rgb), 0.4); }

/* ── 布局容器 ── */
.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.section { padding: 4rem 0; position: relative; }
.section-tight { padding: 2.5rem 0; }

.section-header { text-align: center; margin-bottom: 2.5rem; }
.section-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
    padding: 0.28rem 0.8rem;
    border-radius: 2rem;
    margin-bottom: 0.85rem;
}
.section-heading {
    position: relative;
    display: inline-block;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
}
.section-heading::after {
    content: '';
    display: block;
    width: 42px;
    height: 3px;
    background: var(--grad);
    margin: 0.65rem auto 0;
    border-radius: 3px;
}
.section-desc {
    font-size: 1rem;
    color: var(--muted);
    max-width: 480px;
    margin: 0.85rem auto 0;
}

/* ── 顶部导航 ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    display: flex;
    align-items: center;
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid var(--border);
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-strong);
    letter-spacing: 0.01em;
}
.brand:hover { color: var(--text-strong); }
.brand-logo {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.65rem;
    background: var(--grad);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.35);
}
.header-actions { display: flex; align-items: center; gap: 0.5rem; }

/* 图标圆钮（暗色切换等） */
.icon-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.7rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}
.icon-btn:hover { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.4); transform: translateY(-1px); }

/* ── 按钮 ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.925rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.7rem 1.35rem;
    border-radius: 0.7rem;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.18s, box-shadow 0.18s, background 0.18s, color 0.18s, border-color 0.18s;
    white-space: nowrap;
    user-select: none;
}
.btn:disabled, .btn.disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
    background: var(--grad);
    color: #fff;
    box-shadow: 0 6px 18px rgba(var(--accent-rgb), 0.35);
}
.btn-primary:not(:disabled):hover { color: #fff; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.45); }
.btn-outline {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: rgba(var(--accent-rgb), 0.08); color: var(--accent); }
.btn-light {
    background: #fff;
    color: var(--accent-2);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
}
.btn-light:hover { color: var(--accent-2); transform: translateY(-2px); }
.btn-white-outline { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.55); color: #fff; }
.btn-white-outline:hover { color: #fff; background: rgba(255,255,255,0.18); }
.btn-danger { background: transparent; border-color: rgba(220,38,38,0.4); color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-success {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    box-shadow: 0 6px 18px rgba(5, 150, 105, 0.32);
}
.btn-success:not(:disabled):hover { color: #fff; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(5, 150, 105, 0.42); }
.btn-sm { padding: 0.5rem 0.95rem; font-size: 0.83rem; border-radius: 0.6rem; }
.btn-lg { padding: 0.85rem 1.8rem; font-size: 1.02rem; border-radius: 0.8rem; }
.btn-block { width: 100%; }

/* ── 徽章 ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.28rem 0.65rem;
    border-radius: 2rem;
    line-height: 1;
}
.badge-accent { background: rgba(var(--accent-rgb), 0.12); color: var(--accent); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: var(--surface-muted); color: var(--muted); border: 1px solid var(--border); }

/* ── 卡片 ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-body { padding: 1.5rem; }
.card-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.35rem; }

/* ── 栅格 ── */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ============================================================
   首页 index.php
   ============================================================ */
.hero {
    position: relative;
    min-height: calc(86vh - var(--header-h));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    color: #fff;
    background: var(--grad);
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(255,255,255,0.22), transparent 55%),
        radial-gradient(ellipse at 80% 80%, rgba(118,75,162,0.5), transparent 55%);
    pointer-events: none;
}
/* 漂浮光斑 */
.hero-orb { position: absolute; border-radius: 50%; filter: blur(50px); opacity: 0.5; pointer-events: none; }
.hero-orb.o1 { width: 320px; height: 320px; background: #8b9dff; top: -80px; left: -60px; animation: float 9s ease-in-out infinite; }
.hero-orb.o2 { width: 260px; height: 260px; background: #b57bff; bottom: -70px; right: -40px; animation: float 11s ease-in-out infinite reverse; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(24px); } }

.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; z-index: 0; opacity: 0; transition: opacity 0.6s ease; }
.hero.has-bg .hero-bg { opacity: 1; }
.hero-shade { position: absolute; inset: 0; z-index: 1; opacity: 0; transition: opacity 0.6s ease; background: linear-gradient(180deg, rgba(15,23,42,0.35) 0%, rgba(15,23,42,0.25) 40%, rgba(15,23,42,0.6) 100%); }
.hero.has-bg .hero-shade { opacity: 1; }
.hero-inner { position: relative; z-index: 2; max-width: 720px; padding: 3rem 1.25rem; }
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.4rem 0.95rem;
    border-radius: 2rem;
    margin-bottom: 1.25rem;
}
.hero-title {
    color: #fff;
    font-size: clamp(2.2rem, 6vw, 3.6rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
}
.hero-subtitle { font-size: clamp(1.1rem, 2.5vw, 1.5rem); font-weight: 600; opacity: 0.95; margin-bottom: 0.6rem; }
.hero-desc { font-size: 1.02rem; opacity: 0.85; margin-bottom: 2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; }

/* 特色 */
.section-features { background: var(--bg); }
.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.75rem 1.4rem;
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.feature-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--grad); opacity: 0; transition: opacity 0.25s;
}
.feature-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); border-color: rgba(var(--accent-rgb), 0.2); }
.feature-card:hover::before { opacity: 1; }
.feature-icon {
    width: 3.4rem; height: 3.4rem;
    border-radius: 0.9rem;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.4rem; margin-bottom: 1rem;
    transition: transform 0.25s;
}
.feature-card:hover .feature-icon { transform: scale(1.08) rotate(-3deg); }
.feature-icon.c1 { color: #7c3aed; background: rgba(124, 58, 237, 0.12); }
.feature-icon.c2 { color: #0891b2; background: rgba(8, 145, 178, 0.12); }
.feature-icon.c3 { color: #059669; background: rgba(5, 150, 105, 0.12); }
.feature-icon.c4 { color: #d97706; background: rgba(217, 119, 6, 0.12); }
.feature-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.4rem; }
.feature-card p { font-size: 0.875rem; color: var(--muted); margin: 0; }

/* 数据统计条 */
.stats-band {
    background: var(--grad);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.stats-band::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 80% 0%, rgba(255,255,255,0.18), transparent 60%);
}
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; text-align: center; position: relative; z-index: 1; }
.stat-num { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; line-height: 1; }
.stat-label { font-size: 0.85rem; opacity: 0.85; margin-top: 0.4rem; }

/* 页脚 */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2.5rem 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}
.site-footer .footer-icp { font-size: 0.8rem; opacity: 0.75; margin-top: 0.4rem; }

/* ============================================================
   登录页 login.php
   ============================================================ */
.auth-body { background: var(--grad); }

.auth-page {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.auth-page::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 12% 18%, rgba(255,255,255,0.22), transparent 52%),
        radial-gradient(ellipse at 88% 82%, rgba(118,75,162,0.55), transparent 52%);
    pointer-events: none;
}
.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(56px);
    opacity: 0.45;
    pointer-events: none;
    z-index: 0;
}
.auth-orb.o1 { width: 280px; height: 280px; background: #8b9dff; top: -60px; left: -50px; animation: float 9s ease-in-out infinite; }
.auth-orb.o2 { width: 220px; height: 220px; background: #b57bff; bottom: 10%; right: -40px; animation: float 11s ease-in-out infinite reverse; }
.auth-orb.o3 { width: 160px; height: 160px; background: #667eea; top: 40%; left: 8%; animation: float 13s ease-in-out infinite; opacity: 0.3; }

.auth-topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
}
.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(255,255,255,0.88);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.45rem 0.75rem;
    border-radius: 2rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    backdrop-filter: blur(8px);
    transition: background 0.2s, color 0.2s;
}
.auth-back:hover { color: #fff; background: rgba(255,255,255,0.18); }
.auth-theme-btn {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
}
.auth-theme-btn:hover { background: rgba(255,255,255,0.22); color: #fff; }

.auth-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 1.25rem 2rem;
    position: relative;
    z-index: 1;
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 1.35rem;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.32);
    padding: 2.25rem 2rem 1.75rem;
    overflow: hidden;
}
.auth-card-glow {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--grad);
}
html.dark .auth-card { border-color: var(--border); }

.auth-header { text-align: center; margin-bottom: 1.5rem; }
.auth-logo {
    width: 3.75rem; height: 3.75rem; margin: 0 auto 0.85rem;
    border-radius: 1.1rem; background: var(--grad); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 1.55rem;
    box-shadow: 0 10px 26px rgba(var(--accent-rgb), 0.42);
}
.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
    border: 1px solid rgba(var(--accent-rgb), 0.18);
    padding: 0.28rem 0.7rem;
    border-radius: 2rem;
    margin-bottom: 0.75rem;
}
.auth-title { font-size: 1.55rem; font-weight: 800; }
.auth-sub { color: var(--muted); font-size: 0.9rem; margin-top: 0.4rem; line-height: 1.5; }

.auth-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 1.6rem;
    padding: 0 0.25rem;
}
.auth-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}
.auth-step .step-num {
    width: 1.65rem; height: 1.65rem;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem; font-weight: 800;
    background: var(--surface-muted);
    color: var(--muted);
    border: 2px solid var(--border-strong);
    transition: all 0.25s;
}
.auth-step .step-label { font-size: 0.68rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.auth-step.active .step-num { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.35); }
.auth-step.active .step-label { color: var(--accent); }
.auth-step.done .step-num { background: var(--success-bg); color: var(--success); border-color: rgba(5,150,105,0.3); }
.auth-step-line { flex: 1; height: 2px; background: var(--border-strong); margin: 0 0.35rem; margin-bottom: 1.1rem; min-width: 1.5rem; }

.auth-form { margin-bottom: 0.75rem; }
.input-wrap { position: relative; }
.input-wrap .input-icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.9rem;
    pointer-events: none;
}
.input-wrap .input { padding-left: 2.5rem; }
.auth-submit {
    margin-top: 0.25rem;
    position: relative;
    overflow: hidden;
}
.auth-submit.loading { opacity: 0.85; pointer-events: none; }
.auth-submit.loading i { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 1.5rem;
    font-size: 0.86rem;
    color: var(--muted);
    margin-bottom: 1.1rem;
    text-align: center;
}
.auth-status.success { color: var(--success); }
.auth-status.error { color: var(--danger); }
.auth-status.loading { color: var(--accent); }

.auth-tiers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin-bottom: 1.1rem;
}
.auth-tier {
    text-align: center;
    padding: 0.65rem 0.4rem;
    border-radius: 0.75rem;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    transition: transform 0.2s, border-color 0.2s;
}
.auth-tier .tier-num { display: block; font-size: 1.25rem; font-weight: 800; color: var(--text-strong); line-height: 1.1; }
.auth-tier .tier-label { display: block; font-size: 0.7rem; color: var(--muted); margin-top: 0.15rem; }
.auth-tier.featured {
    background: var(--grad-soft);
    border-color: rgba(var(--accent-rgb), 0.25);
    transform: scale(1.04);
    box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.12);
}
.auth-tier.featured .tier-num { color: var(--accent); }

.auth-tips {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
}
.auth-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.76rem;
    color: var(--muted);
    line-height: 1.45;
}
.auth-tip i { color: var(--accent); margin-top: 0.1rem; flex-shrink: 0; }

.auth-foot {
    margin-top: 1.25rem;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.65);
    text-align: center;
}

@media (max-width: 480px) {
    .auth-card { padding: 1.75rem 1.25rem 1.5rem; }
    .auth-step .step-label { font-size: 0.62rem; }
    .auth-step-line { min-width: 0.75rem; }
}

/* 兼容旧类名 */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    background: var(--grad);
}

/* ── 表单 ── */
.field { display: block; margin-bottom: 1rem; }
.field-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; }
.input, .textarea {
    width: 100%;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--surface-muted);
    border: 1px solid var(--border-strong);
    border-radius: 0.7rem;
    padding: 0.72rem 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input::placeholder { color: var(--muted); opacity: 0.7; }
.input:focus, .textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}
.input-mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; letter-spacing: 0.12em; text-transform: uppercase; text-align: center; }

/* ── 状态文本 ── */
.status-text { font-size: 0.88rem; min-height: 1.25rem; color: var(--muted); }
.status-text.success { color: var(--success); }
.status-text.error { color: var(--danger); }
.empty-hint { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 0.88rem; padding: 2rem 0; }

/* ── 提示条 ── */
.alert {
    display: flex; align-items: flex-start; gap: 0.6rem;
    padding: 0.8rem 1rem; border-radius: 0.75rem; font-size: 0.88rem;
    border: 1px solid transparent;
}
.alert-success { background: var(--success-bg); color: var(--success); border-color: rgba(5,150,105,0.25); }
.alert-danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(220,38,38,0.25); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: rgba(217,119,6,0.28); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: rgba(8,145,178,0.25); }

/* ============================================================
   用户控制台 app.php
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

/* 侧边栏 */
.app-sidebar {
    width: 264px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 60;
    transition: transform 0.3s ease;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.sidebar-brand .brand-logo { width: 2.4rem; height: 2.4rem; font-size: 1.15rem; }
.sidebar-brand-name { font-weight: 800; font-size: 1rem; color: var(--text-strong); line-height: 1.2; }
.sidebar-brand-sub { font-size: 0.72rem; color: var(--muted); }

.sidebar-nav { flex: 1; padding: 0.9rem; display: flex; flex-direction: column; gap: 0.3rem; overflow-y: auto; }
.nav-link {
    display: flex; align-items: center; gap: 0.75rem;
    width: 100%;
    font-family: inherit; font-size: 0.92rem; font-weight: 600;
    color: var(--muted);
    background: transparent;
    border: none;
    border-radius: 0.7rem;
    padding: 0.7rem 0.85rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.18s;
}
.nav-link .nav-ico { width: 1.35rem; text-align: center; font-size: 1rem; }
.nav-link:hover:not(:disabled) { background: rgba(var(--accent-rgb), 0.08); color: var(--accent); }
.nav-link.active { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.32); }
.nav-link:disabled { opacity: 0.45; cursor: not-allowed; }
.nav-link .nav-soon { margin-left: auto; font-size: 0.62rem; background: var(--surface-muted); color: var(--muted); padding: 0.1rem 0.4rem; border-radius: 1rem; }

.sidebar-foot { padding: 0.9rem; border-top: 1px solid var(--border); }
.credits-box {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--grad-soft);
    border: 1px solid rgba(var(--accent-rgb), 0.15);
    border-radius: 0.8rem;
    padding: 0.7rem 0.95rem;
    margin-bottom: 0.7rem;
}
.credits-box .label { font-size: 0.8rem; color: var(--muted); }
.credits-box .num { font-size: 1.5rem; font-weight: 800; color: var(--accent); }

/* 主区域 */
.app-main { flex: 1; margin-left: 264px; display: flex; flex-direction: column; min-width: 0; }
.app-topbar {
    position: sticky; top: 0; z-index: 40;
    height: var(--header-h);
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0 1.25rem;
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid var(--border);
}
.app-topbar .topbar-title { font-size: 1.1rem; font-weight: 700; flex: 1; }
.menu-toggle { display: none; }
.app-content { flex: 1; padding: 1.5rem; width: 100%; max-width: 960px; margin: 0 auto; }

.view { display: block; }
.view.hidden { display: none; }
.hidden { display: none !important; }

/* 概览统计卡 */
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.2rem 1.3rem;
}
.stat-card .sc-title { font-size: 0.82rem; color: var(--muted); }
.stat-card .sc-value { font-size: 1.9rem; font-weight: 800; margin-top: 0.3rem; }
.stat-card .sc-value.accent { color: var(--accent); }

.block-title { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 0.85rem; }
.block { margin-bottom: 1.75rem; }

/* 快捷入口 */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.85rem; }
.quick-card {
    display: flex; flex-direction: column; gap: 0.15rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.1rem;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.quick-card:hover:not(:disabled) { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: rgba(var(--accent-rgb), 0.25); }
.quick-card:disabled { opacity: 0.5; cursor: not-allowed; }
.quick-ico {
    width: 2.6rem; height: 2.6rem; border-radius: 0.75rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; color: #fff; margin-bottom: 0.6rem;
}
.quick-ico.q1 { background: linear-gradient(135deg, #0d6efd, #667eea); }
.quick-ico.q2 { background: linear-gradient(135deg, #e6a817, #f093fb); }
.quick-ico.q3 { background: linear-gradient(135deg, #198754, #20c997); }
.quick-ico.q4 { background: var(--grad); }
.quick-card .qc-title { font-weight: 700; font-size: 0.9rem; }
.quick-card .qc-sub { font-size: 0.75rem; color: var(--muted); }

/* 历史记录 */
.history-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    box-shadow: var(--shadow-sm);
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
}
.history-item .hi-time { font-size: 0.72rem; color: var(--muted); }
.history-item .hi-result.success { color: var(--success); font-weight: 600; }
.history-item .hi-result.error { color: var(--danger); font-weight: 600; }
.history-item .hi-meta { color: var(--muted); margin-top: 0.2rem; }

/* 闲鱼扫码登录 */
.xy-login-wrap {
    max-width: 480px;
    margin: 0 auto;
}
.xy-login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.15rem;
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    overflow: hidden;
}
.xy-login-head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}
.xy-login-icon {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    border-radius: 0.9rem;
    background: var(--grad);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.3);
}
.xy-login-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-strong);
    line-height: 1.25;
    margin: 0;
}
.xy-login-desc {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0.2rem 0 0;
    line-height: 1.45;
}

.xy-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    padding: 0.75rem 0.5rem;
    margin-bottom: 1rem;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 0.85rem;
}
.xy-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    flex: 1;
    min-width: 0;
    text-align: center;
}
.xy-step-num {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--grad);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.xy-step-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--muted);
    line-height: 1.2;
}
.xy-step-line {
    flex-shrink: 0;
    width: 1.25rem;
    height: 2px;
    background: var(--border-strong);
    border-radius: 1px;
    margin-bottom: 1.1rem;
}

.xy-qr-zone { margin-bottom: 1rem; }
.qr-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    padding: 1.25rem;
    border: 2px dashed var(--border-strong);
    border-radius: 1rem;
    background: linear-gradient(160deg, var(--surface-muted) 0%, color-mix(in srgb, var(--accent) 4%, var(--surface-muted)) 100%);
    position: relative;
}
.qr-frame::before {
    content: '';
    position: absolute;
    inset: 0.65rem;
    border: 1px solid rgba(var(--accent-rgb), 0.12);
    border-radius: 0.75rem;
    pointer-events: none;
}
.qr-frame img {
    width: min(200px, 58vw);
    height: min(200px, 58vw);
    border-radius: 0.65rem;
    background: #fff;
    padding: 0.35rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    position: relative;
    z-index: 1;
}
.qr-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.86rem;
    padding: 1rem;
    position: relative;
    z-index: 1;
}
.qr-placeholder-icon {
    font-size: 2.5rem;
    color: var(--accent);
    opacity: 0.55;
    line-height: 1;
}

.xy-status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    min-height: 1.5rem;
}
.xy-status-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--muted);
    opacity: 0.5;
}
.xy-status-dot.idle { background: var(--muted); opacity: 0.45; }
.xy-status-dot.waiting {
    background: var(--accent);
    opacity: 1;
    animation: xy-pulse 1.6s ease-in-out infinite;
}
.xy-status-dot.scanned {
    background: var(--warning);
    opacity: 1;
    animation: xy-pulse 1s ease-in-out infinite;
}
.xy-status-dot.success { background: var(--success); opacity: 1; }
.xy-status-dot.error { background: var(--danger); opacity: 1; }
@keyframes xy-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.65; }
}

.xy-actions {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.xy-actions .btn { white-space: normal; }
.xy-logged-actions {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
#qrConfirmBtn.pulse-hint {
    animation: xy-btn-pulse 1.8s ease-in-out infinite;
}
@keyframes xy-btn-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.35); }
    50% { box-shadow: 0 0 0 6px rgba(5, 150, 105, 0); }
}

.xy-user-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    background: var(--success-bg);
    border: 1px solid rgba(5, 150, 105, 0.22);
    border-radius: 0.85rem;
}
.xy-user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.xy-user-label {
    font-size: 0.72rem;
    color: var(--success);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.xy-user-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-strong);
    margin-top: 0.1rem;
    word-break: break-all;
}

.xy-tips {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 1.15rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.xy-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.76rem;
    color: var(--muted);
    line-height: 1.45;
}
.xy-tip i {
    color: var(--accent);
    margin-top: 0.12rem;
    flex-shrink: 0;
    width: 0.9rem;
    text-align: center;
}
.xy-tip strong { color: var(--text); font-weight: 600; }

.status-text.scanning { color: var(--warning); font-weight: 600; }

@media (max-width: 480px) {
    .app-content { padding: 1rem; }
    .xy-login-card { padding: 1.15rem; border-radius: 1rem; }
    .xy-login-head { gap: 0.7rem; }
    .xy-login-icon { width: 2.6rem; height: 2.6rem; font-size: 1.15rem; }
    .xy-login-title { font-size: 1.05rem; }
    .xy-step-label { font-size: 0.62rem; }
    .xy-step-line { width: 0.6rem; }
    .qr-frame { min-height: 200px; padding: 1rem; }
}

/* Tabs */
.tabs {
    display: inline-flex;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    padding: 0.28rem;
    gap: 0.25rem;
    margin: 1rem 0;
}
.tab-btn {
    font-family: inherit; font-size: 0.85rem; font-weight: 600;
    color: var(--muted); background: transparent; border: none;
    padding: 0.5rem 1rem; border-radius: 0.6rem; cursor: pointer;
    transition: all 0.18s;
}
.tab-btn.tab-active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }

/* 上传拖拽区 */
.dropzone {
    display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 2.2rem 1rem;
    cursor: pointer;
    color: var(--muted);
    transition: border-color 0.2s, background 0.2s;
}
.dropzone:hover { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.04); }
.dropzone-plus {
    width: 3rem; height: 3rem; border-radius: 50%;
    background: rgba(var(--accent-rgb), 0.1); color: var(--accent);
    display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}
.preview-img { max-height: 208px; border-radius: var(--radius); margin: 1rem auto 0; border: 1px solid var(--border); }

/* 素材市场网格 */
.material-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.85rem; margin-top: 1rem; }
.material-grid.compact { grid-template-columns: repeat(4, 1fr); }
.material-item {
    border: 2px solid var(--border);
    border-radius: 0.85rem;
    overflow: hidden;
    cursor: pointer;
    background: var(--surface);
    transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.material-item:hover { transform: translateY(-3px); border-color: rgba(var(--accent-rgb), 0.4); box-shadow: var(--shadow); }
.material-item.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.25); }
.material-item img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.material-meta { padding: 0.5rem 0.6rem; font-size: 0.72rem; }
.material-meta .mt-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.material-meta .mt-sub { color: var(--muted); margin-top: 0.15rem; display: flex; align-items: center; gap: 0.3rem; }
.material-item { position: relative; }
.material-cat-badge {
    position: absolute; top: 0.4rem; left: 0.4rem; z-index: 2;
    font-size: 0.62rem; font-weight: 600; color: #fff;
    background: rgba(15,23,42,0.55); backdrop-filter: blur(4px);
    padding: 0.12rem 0.45rem; border-radius: 2rem;
}
.like-btn {
    display: inline-flex; align-items: center; gap: 0.2rem;
    border: none; background: transparent; cursor: pointer;
    color: var(--muted); font-size: 0.72rem; font-family: inherit;
    padding: 0.1rem 0.3rem; border-radius: 0.4rem; transition: color 0.15s, transform 0.15s;
}
.material-meta .mt-sub .like-btn { margin-left: auto; }
.like-btn:hover { color: #e5484d; }
.like-btn.liked { color: #e5484d; }
.like-btn.liked i { animation: pop 0.35s ease; }

/* 市场工具栏 */
.market-toolbar { display: flex; gap: 0.6rem; align-items: center; margin: 1rem 0 0.75rem; flex-wrap: wrap; }
.market-search { position: relative; flex: 1; min-width: 180px; }
.market-search i { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 0.8rem; }
.market-search .input { width: 100%; padding-left: 2rem; }
.chip-row { display: flex; gap: 0.45rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.chip {
    font-size: 0.78rem; font-weight: 600; color: var(--muted);
    background: var(--surface-muted); border: 1px solid var(--border);
    padding: 0.32rem 0.8rem; border-radius: 2rem; cursor: pointer;
    transition: all 0.15s; font-family: inherit;
}
.chip:hover { color: var(--accent); border-color: rgba(var(--accent-rgb),0.4); }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; }

.pager { display: flex; justify-content: center; align-items: center; gap: 0.75rem; margin-top: 1.25rem; }
.pager .page-info { font-size: 0.85rem; color: var(--muted); }

/* 分享框 */
.share-box {
    background: var(--grad-soft);
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    border-radius: var(--radius);
    padding: 1.1rem;
    margin-top: 1rem;
}

/* 遮罩（移动端侧栏） */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 55;
}

/* 空状态 */
.placeholder-center { text-align: center; padding: 3.5rem 1rem; }
.placeholder-center .pc-ico { font-size: 3rem; color: var(--accent); opacity: 0.6; margin-bottom: 0.75rem; }

/* 工具类 */
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.85rem; }
.mt-4 { margin-top: 1.25rem; }
.mb-0 { margin-bottom: 0; }
.break-all { word-break: break-all; }
.stack > * + * { margin-top: 1.1rem; }

/* ============================================================
   动效 / 交互
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(0.96); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }

.view:not(.hidden), .admin-page:not(.hidden) { animation: fadeInUp 0.35s ease both; }
.feature-card, .stat-card, .quick-card, .material-item, .history-item { animation: fadeInUp 0.4s ease both; }
.reveal { animation: fadeInUp 0.5s ease both; }

/* 内联加载旋转 */
.spinner {
    display: inline-block;
    width: 1.05em; height: 1.05em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: -0.15em;
}
.btn.is-loading { pointer-events: none; opacity: 0.75; }

/* 骨架屏 */
.skeleton {
    background: linear-gradient(90deg, var(--surface-muted) 25%, rgba(var(--accent-rgb),0.08) 37%, var(--surface-muted) 63%);
    background-size: 800px 100%;
    animation: shimmer 1.4s infinite linear;
    border-radius: 0.6rem;
}
.skeleton-line { height: 0.9rem; margin: 0.4rem 0; }
.skeleton-card { height: 90px; border-radius: var(--radius); }

/* 顶部加载进度条 */
#topProgress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0;
    background: var(--grad); z-index: 2000;
    box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.6);
    transition: width 0.3s ease, opacity 0.4s ease;
    opacity: 0;
}
#topProgress.active { opacity: 1; }

/* ============================================================
   Toast 通知
   ============================================================ */
.toast-stack {
    position: fixed; right: 1.25rem; bottom: 1.25rem;
    z-index: 1500; display: flex; flex-direction: column; gap: 0.6rem;
    max-width: min(360px, calc(100vw - 2rem));
}
.toast {
    display: flex; align-items: flex-start; gap: 0.6rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-hover);
    padding: 0.8rem 1rem;
    font-size: 0.88rem;
    animation: fadeInUp 0.3s ease both;
}
.toast.leaving { animation: fadeIn 0.3s reverse both; }
.toast.success { border-left-color: var(--success); }
.toast.success .toast-ico { color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.error .toast-ico { color: var(--danger); }
.toast-ico { color: var(--accent); font-size: 1rem; margin-top: 0.1rem; }

/* ============================================================
   模态框（确认 / 输入）
   ============================================================ */
.modal-mask {
    position: fixed; inset: 0; z-index: 1200;
    display: flex; align-items: center; justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    padding: 1.25rem;
    animation: fadeIn 0.2s ease both;
}
.modal-box {
    width: 100%; max-width: 400px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(15,23,42,0.3);
    padding: 1.5rem;
    animation: pop 0.25s ease both;
}
.modal-box h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.modal-box p { color: var(--muted); font-size: 0.9rem; margin: 0 0 1rem; }
.modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1.25rem; }

/* ============================================================
   管理后台专用
   ============================================================ */
.admin-content { max-width: 1180px; }

.admin-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.admin-stat {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.2rem 1.3rem;
    overflow: hidden;
    animation: fadeInUp 0.4s ease both;
}
.admin-stat::after {
    content: ''; position: absolute; right: -18px; top: -18px;
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--grad-soft);
}
.admin-stat .as-label { font-size: 0.8rem; color: var(--muted); }
.admin-stat .as-value { font-size: 1.9rem; font-weight: 800; margin-top: 0.3rem; color: var(--text-strong); }
.admin-stat .as-ico {
    position: absolute; right: 0.9rem; top: 0.9rem;
    color: var(--accent); opacity: 0.55; font-size: 1.1rem;
}

/* 卡片头 */
.card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.75rem; flex-wrap: wrap;
    padding: 1.05rem 1.5rem;
    border-bottom: 1px solid var(--border);
}
.card-head .card-title { margin: 0; font-size: 1.02rem; }
.card-head-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* 表单栅格 */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; align-items: end; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-section-title {
    font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--accent); margin: 1.5rem 0 0.9rem; padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.form-section-title:first-child { margin-top: 0; }

/* select 与 input 一致 */
.select {
    width: 100%; font-family: inherit; font-size: 0.92rem; color: var(--text);
    background: var(--surface-muted);
    border: 1px solid var(--border-strong);
    border-radius: 0.7rem; padding: 0.6rem 2rem 0.6rem 0.85rem;
    appearance: none; -webkit-appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.7rem center;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.15); }
.select-sm { padding: 0.42rem 1.8rem 0.42rem 0.7rem; font-size: 0.83rem; width: auto; }
.input-sm { padding: 0.42rem 0.7rem; font-size: 0.83rem; width: auto; }

/* 复选框 */
.checkbox-row { display: flex; align-items: center; gap: 0.55rem; cursor: pointer; font-size: 0.9rem; }
.checkbox-row input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }

/* 数据表格 */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.data-table thead th {
    text-align: left; font-weight: 600; font-size: 0.74rem;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--muted); background: var(--surface-muted);
    padding: 0.7rem 0.9rem; white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
.data-table tbody td { padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: rgba(var(--accent-rgb), 0.04); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .col-actions { text-align: right; }
.cell-empty { text-align: center; color: var(--muted); padding: 2.5rem 0 !important; }
code, .code {
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: 0.8rem; background: var(--surface-muted);
    padding: 0.12rem 0.4rem; border-radius: 0.35rem; color: var(--text);
}
.thumb-sm { width: 44px; height: 44px; object-fit: cover; border-radius: 0.5rem; border: 1px solid var(--border); }

/* 表格内小按钮 */
.btn-xs { padding: 0.32rem 0.65rem; font-size: 0.76rem; border-radius: 0.5rem; }
.btn-group-inline { display: inline-flex; gap: 0.35rem; flex-wrap: nowrap; }

/* 标签 */
.tag { display: inline-flex; align-items: center; font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 2rem; }
.tag-green { background: var(--success-bg); color: var(--success); }
.tag-gray { background: var(--surface-muted); color: var(--muted); border: 1px solid var(--border); }
.tag-red { background: var(--danger-bg); color: var(--danger); }
.tag-yellow { background: var(--warning-bg); color: var(--warning); }
.tag-blue { background: var(--info-bg); color: var(--info); }

/* 代码结果块 */
.code-block {
    margin-top: 1rem; padding: 1rem 1.15rem;
    background: #0f172a; color: #e2e8f0;
    border-radius: 0.75rem;
    font-family: ui-monospace, Menlo, monospace; font-size: 0.8rem; line-height: 1.9;
    max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-all;
}

/* 卡片底部分页 */
.card-foot { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: center; }

/* ── 响应式 ── */
@media (max-width: 1100px) {
    .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 992px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 768px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: 1fr; }
    .stat-cards { grid-template-columns: 1fr; }
    .quick-grid { grid-template-columns: repeat(2, 1fr); }
    .material-grid { grid-template-columns: repeat(3, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1rem; }

    .app-sidebar { transform: translateX(-100%); box-shadow: 0 0 40px rgba(0,0,0,0.2); }
    .app-shell.sidebar-open .app-sidebar { transform: translateX(0); }
    .app-shell.sidebar-open .sidebar-overlay { display: block; }
    .app-main { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
    .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid.cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .grid-4 { grid-template-columns: 1fr; }
    .material-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-cta .btn { width: 100%; }
}
