/* ═══════════════════════════════════════════════════════
   UAA AI写作 — 全局设计系统
   主题：深邃星空紫·科技蓝
════════════════════════════════════════════════════════ */

/* 字体说明：
   - Noto Serif SC + JetBrains Mono 通过 layout.html 的 <head> 按需引入
   - 不在此处 @import，避免写作页面（chat.html）不需要这些字体也加载
   - 系统字体栈（PingFang SC / 微软雅黑等）无需网络请求，作为默认字体 */

/* ── CSS 变量 ── */
:root {
    /* 背景层次 */
    --bg-base:          #20243A;
    --bg-surface:       #252942;
    --bg-card:          #2A2E48;
    --bg-card-hover:    #303452;
    --bg-elevated:      #363A5C;

    /* 登录框背景 */
    --bg-login:         #A9AFD9;

    /* 主题色 */
    --purple:           #8B5CF6;
    --purple-light:     #A78BFA;
    --purple-dark:      #7C3AED;
    --blue:             #3B82F6;
    --blue-light:       #60A5FA;

    /* 渐变 */
    --gradient-primary: linear-gradient(135deg, #9333EA 0%, #3B82F6 100%);
    --gradient-card:    linear-gradient(135deg, rgba(139,92,246,0.15) 0%, rgba(59,130,246,0.08) 100%);
    --gradient-glow:    linear-gradient(135deg, rgba(147,51,234,0.3) 0%, rgba(59,130,246,0.2) 100%);

    /* 边框 */
    --border-subtle:    rgba(139,92,246,0.15);
    --border-normal:    rgba(139,92,246,0.25);
    --border-active:    rgba(139,92,246,0.6);

    /* 文字 */
    --text-primary:     #F0ECFF;
    --text-secondary:   rgba(240,236,255,0.75);
    --text-muted:       rgba(240,236,255,0.45);
    --text-disabled:    rgba(240,236,255,0.25);

    /* 侧边栏 */
    --sidebar-bg:       #0F0D24;
    --sidebar-width:    240px;

    /* 状态色 */
    --success:          #10B981;
    --warning:          #F59E0B;
    --danger:           #EF4444;
    --info:             #06B6D4;

    /* 阴影 */
    --shadow-sm:        0 2px 8px rgba(0,0,0,0.3);
    --shadow-md:        0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg:        0 8px 40px rgba(0,0,0,0.5);
    --shadow-glow:      0 0 20px rgba(139,92,246,0.25);
    --shadow-btn:       0 4px 20px rgba(147,51,234,0.4);

    /* 圆角 */
    --radius-sm:        6px;
    --radius-md:        10px;
    --radius-lg:        14px;
    --radius-xl:        20px;
    --radius-pill:      50px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
                 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--purple-light); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--purple); }

/* ── 自定义滚动条 ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139,92,246,0.5); }

/* ── 工具类 ── */
.font-serif   { font-family: 'Songti SC','STSong','SimSun','Source Han Serif SC',Georgia,serif; }
.font-mono    { font-family: 'SF Mono','Cascadia Code','Consolas','Courier New',monospace; }
.text-primary { color: var(--text-primary); }
.text-muted   { color: var(--text-muted); }
.text-accent  { color: var(--purple-light); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }

.mt-1 { margin-top: 4px; }  .mt-2 { margin-top: 8px; }  .mt-3 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 16px; }

.flex          { display: flex; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2         { gap: 8px; }
.gap-3         { gap: 12px; }
.w-full        { width: 100%; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ── 背景装饰（全局星空效果）── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 20% 10%, rgba(139,92,246,0.08) 0%, transparent 60%),
        radial-gradient(ellipse 50% 70% at 80% 90%, rgba(59,130,246,0.06) 0%, transparent 55%),
        radial-gradient(ellipse 40% 40% at 60% 40%, rgba(147,51,234,0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ── Remix Icon 全局适配 ── */
.icon { font-size: 15px; line-height: 1; flex-shrink: 0; }
i[class^="ri-"], i[class*=" ri-"] { line-height: 1; }

/* 旋转动画（刷新按钮用）*/
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
