/* ============================================================
   Open Image Club · 科技风设计系统（共享）
   深空底 + 电光青蓝渐变 + 玻璃拟态 + 霓虹描边
   ============================================================ */
:root {
    --bg: #05070f;
    --bg-soft: #0a0f1e;
    --panel: rgba(15, 23, 42, 0.62);
    --panel-solid: #0d1526;
    --panel-hover: rgba(23, 34, 60, 0.75);
    --border: rgba(94, 129, 202, 0.22);
    --border-strong: rgba(103, 232, 249, 0.45);

    --text: #e6edf7;
    --text-dim: #8b98b4;
    --text-faint: #5b6884;

    --cyan: #22d3ee;
    --indigo: #6366f1;
    --violet: #a78bfa;
    --green: #34d399;
    --red: #f87171;
    --amber: #fbbf24;

    --grad-main: linear-gradient(135deg, #22d3ee 0%, #6366f1 55%, #a78bfa 100%);
    --glow-cyan: 0 0 22px rgba(34, 211, 238, 0.35);
    --glow-main: 0 8px 30px rgba(56, 189, 248, 0.28);

    --radius: 14px;
    --radius-sm: 9px;
    --mono: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
}

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

html { color-scheme: dark; }

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    /* 网格 + 双辉光背景 */
    background-image:
        radial-gradient(ellipse 60% 40% at 12% -5%, rgba(56, 189, 248, 0.14), transparent 60%),
        radial-gradient(ellipse 50% 35% at 95% 8%, rgba(139, 92, 246, 0.12), transparent 60%),
        radial-gradient(ellipse 55% 45% at 50% 115%, rgba(14, 165, 233, 0.08), transparent 65%),
        linear-gradient(rgba(96, 133, 205, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(96, 133, 205, 0.05) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 44px 44px, 44px 44px;
    background-attachment: fixed;
}

a { color: var(--cyan); text-decoration: none; }
::selection { background: rgba(34, 211, 238, 0.35); }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(94, 129, 202, 0.3); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(94, 129, 202, 0.5); }

/* ==================== 顶栏 ==================== */
.topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 22px;
    padding: 0 28px; height: 62px;
    background: rgba(5, 8, 16, 0.78);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.topbar .logo {
    display: flex; align-items: center; gap: 11px;
    font-weight: 700; font-size: 16px; letter-spacing: 1px; cursor: pointer;
}
.topbar .logo .logo-mark {
    width: 34px; height: 34px; border-radius: 9px;
    background: var(--grad-main);
    display: grid; place-items: center;
    font-size: 17px; color: #04121c;
    box-shadow: var(--glow-cyan);
}
.topbar .logo .logo-text b { background: var(--grad-main); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar .logo .logo-text span { color: var(--text-faint); font-weight: 400; font-size: 12px; display: block; letter-spacing: 2px; }

.topbar nav { display: flex; gap: 4px; margin-left: 8px; }
.topbar nav a {
    padding: 7px 15px; border-radius: var(--radius-sm);
    color: var(--text-dim); font-size: 14px; transition: all 0.18s;
}
.topbar nav a:hover { color: var(--text); background: rgba(94, 129, 202, 0.12); }
.topbar nav a.active {
    color: #04121c; font-weight: 600;
    background: var(--grad-main); box-shadow: var(--glow-cyan);
}
/* 「去聊天」跨系统入口（对应 chat.html 顶栏的「去生图」） */
.topbar nav a.nav-go-chat {
    color: var(--cyan); border: 1px solid rgba(34, 211, 238, 0.35);
    margin-left: 10px; white-space: nowrap;
}
.topbar nav a.nav-go-chat:hover {
    color: #04121c; background: var(--grad-main); box-shadow: var(--glow-cyan);
}

.topbar .spacer { flex: 1; }

/* 用户区 */
.user-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 8px 5px 6px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--panel);
    font-size: 13px; cursor: default;
}
.user-chip .avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--grad-main); color: #04121c;
    display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.user-chip .uname { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .credits-badge {
    display: inline-flex; gap: 8px; align-items: center;
    font-family: var(--mono); font-size: 12px; color: var(--amber);
    border: 1px solid rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.08);
    padding: 2px 10px; border-radius: 999px; white-space: nowrap;
}
.user-chip .logout-btn {
    border: none; background: rgba(248, 113, 113, 0.12); color: var(--red);
    font-size: 12px; padding: 4px 11px; border-radius: 999px; cursor: pointer;
    transition: all 0.18s;
}
.user-chip .logout-btn:hover { background: rgba(248, 113, 113, 0.25); }
.user-chip .redeem-btn {
    border: 1px solid rgba(52, 211, 153, 0.45); background: rgba(52, 211, 153, 0.1);
    color: var(--green); font-size: 12px; padding: 2px 10px; border-radius: 999px;
    cursor: pointer; white-space: nowrap; transition: all 0.18s;
}
.user-chip .redeem-btn:hover {
    background: rgba(52, 211, 153, 0.22); box-shadow: 0 0 10px rgba(52, 211, 153, 0.25);
}

/* ==================== 按钮 ==================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    padding: 10px 20px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s; letter-spacing: 0.5px;
    font-family: inherit; line-height: 1.4;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: saturate(0.4); }

.btn-primary {
    background: var(--grad-main); color: #04121c;
    box-shadow: var(--glow-main);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 36px rgba(56, 189, 248, 0.4); }

.btn-ghost {
    background: transparent; color: var(--cyan);
    border-color: var(--border-strong);
}
.btn-ghost:hover:not(:disabled) { background: rgba(34, 211, 238, 0.1); }

.btn-danger {
    background: rgba(248, 113, 113, 0.14); color: var(--red);
    border-color: rgba(248, 113, 113, 0.4);
}
.btn-danger:hover:not(:disabled) { background: rgba(248, 113, 113, 0.28); }

.btn-sm { padding: 6px 13px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 14px 26px; font-size: 15.5px; border-radius: 11px; }
.btn-block { width: 100%; }

/* ==================== 玻璃卡片 ==================== */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}
.card .card-head {
    display: flex; align-items: center; gap: 10px;
    padding: 15px 20px; border-bottom: 1px solid var(--border);
    font-weight: 600; font-size: 14.5px;
}
.card .card-head .hint { margin-left: auto; font-size: 12px; color: var(--text-faint); font-weight: 400; }
.card .card-body { padding: 20px; }

/* 角标装饰（四角霓虹） */
.corner-deco { position: relative; }
.corner-deco::before, .corner-deco::after {
    content: ''; position: absolute; width: 14px; height: 14px;
    border: 1.5px solid var(--border-strong); opacity: 0.7; pointer-events: none;
}
.corner-deco::before { top: -1px; left: -1px; border-right: none; border-bottom: none; border-radius: 4px 0 0 0; }
.corner-deco::after { bottom: -1px; right: -1px; border-left: none; border-top: none; border-radius: 0 0 4px 0; }

/* ==================== 表单 ==================== */
.field { margin-bottom: 18px; }
.field > label {
    display: flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 600; color: var(--text-dim);
    margin-bottom: 8px; letter-spacing: 0.5px;
}
.field > label .req { color: var(--cyan); }

.input, .textarea {
    width: 100%; padding: 11px 14px;
    background: rgba(7, 12, 24, 0.7);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-size: 14px; font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.input:focus, .textarea:focus {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.6; }

/* ==================== 徽章 ==================== */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11.5px; padding: 3px 10px; border-radius: 999px;
    border: 1px solid var(--border); color: var(--text-dim);
    background: rgba(94, 129, 202, 0.1); white-space: nowrap;
}
.badge.b-cyan { color: var(--cyan); border-color: rgba(34, 211, 238, 0.35); background: rgba(34, 211, 238, 0.08); }
.badge.b-violet { color: var(--violet); border-color: rgba(167, 139, 250, 0.35); background: rgba(167, 139, 250, 0.08); }
.badge.b-amber { color: var(--amber); border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.badge.b-green { color: var(--green); border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
.badge.b-red { color: var(--red); border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }
.badge.b-dim { color: var(--text-faint); border-style: dashed; }

/* 状态点 */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.g { background: var(--green); box-shadow: 0 0 8px rgba(52, 211, 153, 0.8); }
.dot.r { background: var(--red); box-shadow: 0 0 8px rgba(248, 113, 113, 0.8); }
.dot.y { background: var(--amber); box-shadow: 0 0 8px rgba(251, 191, 36, 0.8); }
.dot.pulse { animation: dotPulse 1.6s ease-in-out infinite; }
@keyframes dotPulse { 50% { opacity: 0.35; } }

/* ==================== Toast ==================== */
#toastBox {
    position: fixed; top: 76px; right: 24px; z-index: 999;
    display: flex; flex-direction: column; gap: 10px; max-width: 360px;
}
.toast {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 16px; border-radius: var(--radius-sm);
    background: rgba(13, 21, 38, 0.94); border: 1px solid var(--border);
    backdrop-filter: blur(12px); font-size: 13.5px; line-height: 1.5;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
    animation: toastIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.toast.out { animation: toastOut 0.25s ease forwards; }
.toast .t-ico { font-size: 15px; flex-shrink: 0; }
.toast.t-ok { border-color: rgba(52, 211, 153, 0.45); }
.toast.t-err { border-color: rgba(248, 113, 113, 0.5); }
.toast.t-info { border-color: rgba(34, 211, 238, 0.45); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* ==================== 弹窗（确认框 / 大图） ==================== */
.modal-mask {
    position: fixed; inset: 0; z-index: 900;
    background: rgba(3, 6, 12, 0.75); backdrop-filter: blur(6px);
    display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-mask.show { display: flex; animation: fadeIn 0.2s ease; }
.modal-box {
    background: var(--panel-solid); border: 1px solid var(--border);
    border-radius: var(--radius); width: 100%; max-width: 420px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    animation: modalIn 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
.modal-box .m-head { padding: 18px 22px 0; font-size: 16px; font-weight: 700; }
.modal-box .m-body { padding: 14px 22px 4px; color: var(--text-dim); font-size: 14px; line-height: 1.7; }
.modal-box .m-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 22px 20px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: scale(0.92) translateY(12px); } }

/* 大图预览 */
.lightbox { max-width: min(92vw, 1100px); max-height: 86vh; }
.lightbox img { display: block; max-width: 100%; max-height: 86vh; border-radius: 10px; }

/* ==================== 空状态 ==================== */
.empty {
    text-align: center; padding: 70px 20px; color: var(--text-faint);
}
.empty .e-ico { font-size: 52px; margin-bottom: 16px; filter: grayscale(0.3); opacity: 0.85; }
.empty .e-title { font-size: 16px; color: var(--text-dim); margin-bottom: 8px; }
.empty .e-sub { font-size: 13px; margin-bottom: 22px; line-height: 1.7; }

/* ==================== 登录门槛遮罩 ==================== */
.login-gate {
    max-width: 480px; margin: 60px auto; text-align: center;
    padding: 56px 36px;
}
.login-gate .lg-ico {
    width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 18px;
    background: var(--grad-main); display: grid; place-items: center;
    font-size: 28px; box-shadow: var(--glow-cyan);
}
.login-gate h2 { font-size: 20px; margin-bottom: 10px; }
.login-gate p { color: var(--text-dim); font-size: 13.5px; line-height: 1.8; margin-bottom: 26px; }

/* ==================== 响应式 ==================== */
@media (max-width: 760px) {
    .topbar { padding: 0 14px; gap: 10px; height: auto; min-height: 56px; flex-wrap: wrap; }
    .topbar nav { order: 3; width: 100%; margin: 0 0 8px; justify-content: center; }
    #toastBox { left: 14px; right: 14px; top: 120px; max-width: none; }
}
