/* ============================================================
   base.css — 全局样式（导航、footer、全局变量、字体、滚动条等）
   从 templates/base.html 的 {% block base_style %} 中提取
   ============================================================ */

/* ─── 全局重置 ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, 'PingFang SC', 'Noto Sans SC', sans-serif;
    background: transparent;
    color: #fff;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
    
}

/* 全站隐藏浏览器原生密码显示按钮（避免双重小眼睛） */
input[type="password"]::-webkit-reveal-button { display: none !important; }

/* 背景层 */
.bg-grid {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(59,130,246,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59,130,246,0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse 65% 55% at 50% 40%, black, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 65% 55% at 50% 40%, black, transparent 70%);
    will-change: transform;
    transform: translateZ(0);
}

/* 导航 */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: 14px 40px;
    display: flex; align-items: center; justify-content: space-between;
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    background: rgba(7,7,8,0.95);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.nav-brand {
    display: flex; align-items: center; gap: 10px;
    font-size: 16px; font-weight: 600; letter-spacing: -0.3px;
    color: #fff; text-decoration: none;
}
.nav-icon {
    width: 28px; height: 28px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #fff;
    box-shadow: 0 0 16px rgba(59,130,246,0.3);
}
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a {
    color: rgba(255,255,255,0.5); text-decoration: none;
    font-size: 14px; font-weight: 500;
    transition: color .2s;
}
.nav-links a:hover { color: #fff; }
.nav-links a.btn-primary { color: #070708 !important; }

.card-depth {
    background: #16161a;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all .3s;
}
@media (hover: hover) {
    .card-depth:hover {
        border-color: rgba(59,130,246,0.2);
        transform: translateY(-3px);
        box-shadow: 0 8px 32px rgba(59,130,246,0.08);
    }
}

/* ════════════════════════════════════════════════════════════
   全站卡片微光系统 v2 — 深色背景层次凸显
   
   三级微光体系：
     - --glow-outer：外层容器/主卡片（如 .card, .card-depth, 主要板块）
       大微光 = 底部投影 + 顶部描边 + 软蓝光晕
     - --glow-inner：嵌套内层卡片（如 .card .card, 子面板）
       小微光 = 较浅投影 + 较淡光晕
     - --glow-mini：极小元素/标签（如小徽章、状态标签）
       极微光 = 仅轮廓描边 + 极小投影
   
   所有卡片容器自动获得相应级别的微光：
     - 非嵌套类（外层）：card, card-depth, card-sm, card-enhanced 等 → --glow-outer
     - 嵌套类（内层）：card .card, card-depth .card-sm 等 → --glow-inner
   
   使用 :where() 保持零特异性，各页面 CSS 可自由覆盖。
   ════════════════════════════════════════════════════════════ */
:root {
    --glow-outer: 0 2px 12px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.04), 0 6px 50px rgba(210,225,255,0.10), 0 2px 80px rgba(210,225,255,0.04);
    --glow-inner: 0 1px 6px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.03), 0 3px 25px rgba(210,225,255,0.06), 0 1px 40px rgba(210,225,255,0.02);
    --glow-mini: 0 1px 3px rgba(0,0,0,0.08), 0 0 0 1px rgba(255,255,255,0.03);

    /* ─── 配色体系（源自 L01 资产生成区） ─── */
    --color-brand: #60a5fa;             /* 品牌蓝 */
    --color-brand-bg: rgba(59,130,246,0.08);   /* 品牌蓝底色 */
    --color-brand-border: rgba(59,130,246,0.25); /* 品牌蓝边框 */
    --color-text-primary: rgba(255,255,255,0.85); /* 主标题 */
    --color-text-secondary: rgba(255,255,255,0.60); /* 正文 */
    --color-text-tertiary: rgba(255,255,255,0.40); /* 辅助/计数 */
    --color-text-muted: rgba(255,255,255,0.35);   /* 副标题 */
    --color-bg-subtle: rgba(255,255,255,0.02);     /* 极淡白底 */
    --color-border-subtle: rgba(255,255,255,0.06); /* 极淡白边框 */
    --color-dot-person: #f87171;         /* 红 — 人物 */
    --color-dot-scene: #38bdf8;           /* 蓝 — 场景 */
    --color-dot-prop: #fbbf24;            /* 黄 — 道具 */
}

/* ─── 外层卡片/容器 — 大微光 ─── */
.card-glow,
:where(.card, .card-depth, .card-sm, .card-enhanced, [class*="card-lg"]) {
    box-shadow: var(--glow-outer);
    transition: box-shadow 0.25s ease;
}
.card-glow:hover,
:where(.card, .card-depth, .card-sm, .card-enhanced):hover {
    box-shadow: var(--glow-outer), 0 4px 24px rgba(0,0,0,0.3);
}

/* ─── 嵌套内层卡片 — 小微光 ─── */
:where(.card .card, .card-depth .card-sm, .card .card-sm, .card-enhanced .card-sm) {
    box-shadow: var(--glow-inner);
    transition: box-shadow 0.25s ease;
}
:where(.card .card, .card-depth .card-sm, .card .card-sm, .card-enhanced .card-sm):hover {
    box-shadow: var(--glow-inner), 0 2px 12px rgba(0,0,0,0.2);
}

/* ─── 极小微光（标签/小徽章） ─── */
.card-glow-sm {
    box-shadow: var(--glow-mini);
    transition: box-shadow 0.25s ease;
}
.card-glow-sm:hover {
    box-shadow: var(--glow-mini), 0 2px 8px rgba(0,0,0,0.2);
}

/* ════════════════════════════════════════════════════════════
   全站配色体系实用类（源自 L01 资产生成区）
   ════════════════════════════════════════════════════════════ */

/* ─── 品牌色卡片（检测区/功能模块突出） ─── */
.card-brand {
    background: var(--color-brand-bg) !important;
    border: 1px solid var(--color-brand-border) !important;
    border-radius: 8px;
    padding: 12px;
}

/* ─── 空状态/辅助区卡片 ─── */
.card-void {
    background: var(--color-bg-subtle) !important;
    border: 1px solid var(--color-border-subtle) !important;
    border-radius: 8px;
    padding: 12px;
}

/* ─── 区块标题体系 ─── */
/* 主标题：📸 资产生成 */
.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.4;
}
/* 副标题：从剧本检测角色/场景/道具 → 生成标准照 */
.section-desc {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}
/* 计数：检测到待生成 */
.section-count {
    color: var(--color-text-tertiary);
    font-size: 0.75rem;
}

/* ─── 分类圆点 ─── */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-person { background: var(--color-dot-person); }
.dot-scene  { background: var(--color-dot-scene); }
.dot-prop   { background: var(--color-dot-prop); }

/* ─── 分类标题（人物/场景/道具） ─── */
.cat-label {
    font-weight: 600;
    font-size: 0.85rem;
}
.cat-label.person { color: var(--color-dot-person); }
.cat-label.scene  { color: var(--color-dot-scene); }
.cat-label.prop   { color: var(--color-dot-prop); }

/* ─── 内联标签（检测列表中的每个标签项） ─── */
.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.78rem;
    color: var(--color-text-secondary);
    transition: all 0.12s;
}
.tag-item:hover {
    background: rgba(255,255,255,0.07);
    border-color: var(--color-brand);
    color: #fff;
}
/* 彩色标签变体（人物/场景/道具） */
.tag-item.person { background: rgba(248,113,113,0.1); color: #fca5a5; }
.tag-item.scene  { background: rgba(56,189,248,0.1); color: #7dd3fc; }
.tag-item.prop   { background: rgba(251,191,36,0.1); color: #fde68a; }

/* 链接 */
a { color: rgba(255,255,255,0.7); transition: color .2s; }
a:hover { color: #fff; }

/* ─── 卡片样式由 Tabler .card 提供（不再覆盖） ─── */

/* 登录/注册页：所有非交互元素不可选、不显示文本光标 */
.auth-page * {
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
}
.auth-page input,
.auth-page textarea,
.auth-page button,
.auth-page a,
.auth-page .btn-primary {
    user-select: auto;
    -webkit-user-select: auto;
    cursor: auto;
}

/* 滚动条 */
.footer {
    text-align: center; padding: 32px;
    font-size: 13px; color: rgba(255,255,255,0.55);
    border-top: 1px solid rgba(255,255,255,0.04);
}
.footer-company-name {
    font-size: 14px; color: rgba(255,255,255,0.75);
    margin-bottom: 6px; font-weight: 500;
}
.footer-biz {
    font-size: 12px; color: rgba(255,255,255,0.5);
    margin-bottom: 6px; line-height: 1.5;
}
.footer-address, .footer-phone {
    font-size: 12px; line-height: 1.6; margin-bottom: 2px;
    word-break: break-word; overflow-wrap: break-word;
}
.footer-meta {
    margin-top: 8px; font-size: 12px;
    color: rgba(255,255,255,0.4);
}
.footer-links {
    margin-top: 8px; font-size: 12px;
    display: flex; flex-wrap: wrap;
    justify-content: center; gap: 12px;
}
.footer-links a {
    color: rgba(255,255,255,0.45);
    text-decoration: none; transition: color 0.2s;
}
.footer-links a:hover {
    color: rgba(255,255,255,0.75);
}

/* ─── 移动端基准（< 640px） ─── */
@media (max-width: 640px) {
    .navbar { padding: 10px 12px; gap: 6px; flex-wrap: wrap; }
    .nav-brand { font-size: 14px; }
    .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
    .nav-secondary { display: none; }
    .nav-links a { font-size: 11px; white-space: nowrap; }
    /* 容器内距压缩 */
    .content-container { padding: 24px 16px 48px !important; }
    .page-header { margin-bottom: 20px; }
    .page-header-text h1 { font-size: 1.25rem; }
    /* footer 留安全区 */
    .footer { padding: 24px 16px max(80px,env(safe-area-inset-bottom,80px)); font-size: 12px; }
    /* 触控目标 ≥ 44px */
    button, .btn-primary, .btn-secondary, .btn-danger, select, [data-action] { min-height: 44px; }
    /* 输入防 iOS 缩放 */
    input, textarea { font-size: 16px !important; }
    /* 响应式标题 */
    h1 { font-size: clamp(1.25rem, 5vw, 1.5rem) !important; }
    h2 { font-size: clamp(1rem, 4vw, 1.25rem) !important; }
    /* 卡片圆角移动端缩小 */
    .card, .preview-box { border-radius: 12px !important; }
    /* 选择框全宽 + 大触控 */
    select { width: 100%; min-height: 44px; padding: 12px 14px !important; }
    /* 表格移动端横滑 */
    table {
        display: block; width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
}

/* ─── 汉堡菜单按钮 ─── */
.nav-toggle {
    display: none;
    background: none; border: none; cursor: pointer;
    width: 36px; height: 36px;
    align-items: center; justify-content: center;
    border-radius: 8px;
    color: rgba(255,255,255,0.7);
    font-size: 22px;
    padding: 0;
    transition: all .2s;
    position: relative;
    z-index: 102;
}
.nav-toggle:hover { background: rgba(255,255,255,0.06); color: #fff; }

/* ─── 移动端菜单下拉 ─── */
.mobile-menu {
    display: flex;
    position: fixed; top: 56px; left: 0; right: 0; z-index: 101;
    background: rgba(7,7,8,0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 8px 16px 16px;
    flex-direction: column;
    gap: 2px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
}
.mobile-menu.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.mobile-menu a {
    display: block;
    padding: 12px 16px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    transition: all .15s;
}
.mobile-menu a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.mobile-menu .mobile-divider {
    border-top: 1px solid rgba(255,255,255,0.05);
    margin: 6px 16px 4px;
}

/* 768px 断点：移动端导航折叠 */
@media (max-width: 768px) {
    .nav-links { display: none !important; }
    .nav-toggle { display: flex; }
}

/* ═══ 通用布局组件 ═══ */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 32px; flex-wrap: wrap; gap: 12px;
}
.page-header-text h1 { font-size: 1.5rem; font-weight: 700; }
.page-header-text p { font-size: 0.875rem; color: rgba(255,255,255,0.4); margin-top: 4px; }
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; gap: 12px;
}
.section-title {
    font-size: 15px; font-weight: 600; color: rgba(255,255,255,0.85);
    display: flex; align-items: center; gap: 8px;
}
.section-actions {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
/* ═══ 统一容器系统（对标 Linear/Geist） ─── */
.content-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 40px 24px 80px;
}
.section-gap { margin-bottom: 32px; }

/* ═══ 客服面板（CS Panel）═══ */
.cs-panel {
    position:fixed;top:72px;right:24px;z-index:99999;
    width:360px;max-width:calc(100vw - 48px);height:500px;max-height:calc(100vh - 160px);
    background:#16161a;border:1px solid rgba(255,255,255,0.08);
    border-radius:16px;display:none;flex-direction:column;
    box-shadow:0 16px 64px rgba(0,0,0,0.5);overflow:clip;
    cursor:default;
}
.cs-panel.open { display:flex; }
.cs-head {
    display:flex;align-items:center;justify-content:space-between;
    padding:16px 20px;border-bottom:1px solid rgba(255,255,255,0.06);
    flex-shrink:0;cursor:grab;user-select:none;
}
.cs-head:active { cursor:grabbing; }
.cs-head h3 { font-size:15px;font-weight:600;display:flex;align-items:center;gap:8px; }
.cs-head .cs-close {
    background:none;border:none;color:rgba(255,255,255,0.4);cursor:pointer;
    font-size:18px;padding:4px;border-radius:4px;transition:color .2s;
}
.cs-head .cs-close:hover { color:#fff; }
.cs-msgs {
    flex:1;overflow-y:auto;padding:16px 16px 8px;
    display:flex;flex-direction:column;gap:12px;
}
.cs-msgs::-webkit-scrollbar { width:3px; }
.cs-msgs::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.1);border-radius:3px; }
.cs-msg { max-width:85%;display:flex;flex-direction:column;gap:3px; }
.cs-msg.user { align-self:flex-end;align-items:flex-end; }
.cs-msg.assistant { align-self:flex-start;align-items:flex-start; }
.cs-msg .bubble {
    padding:10px 14px;border-radius:12px;font-size:13px;line-height:1.6;
    word-break:break-word;white-space:pre-wrap;
}
.cs-msg.user .bubble {
    background:linear-gradient(135deg,#a855f7,#6366f1);color:#fff;
    border-bottom-right-radius:4px;
}
.cs-msg.assistant .bubble {
    background:rgba(255,255,255,0.06);color:rgba(255,255,255,0.85);
    border-bottom-left-radius:4px;
}
.cs-msg .time { font-size:11px;color:rgba(255,255,255,0.45);padding:0 4px; }
.cs-msg.assistant .avatar {
    width:24px;height:24px;border-radius:6px;
    background:linear-gradient(135deg,#ff5e5b,#a855f7);
    display:flex;align-items:center;justify-content:center;
    font-size:12px;color:#fff;flex-shrink:0;
}
.cs-assistant-row { display:flex;align-items:flex-start;gap:8px; }
.cs-input {
    display:flex;align-items:center;gap:8px;
    padding:12px 16px;border-top:1px solid rgba(255,255,255,0.06);flex-shrink:0;
}
.cs-input textarea {
    flex:1;background:rgba(255,255,255,0.05);border:1px solid rgba(255,255,255,0.08);
    border-radius:10px;padding:10px 12px;color:#fff;font-size:13px;
    resize:none;outline:none;font-family:inherit;max-height:80px;
    color-scheme:dark;
}
.cs-input textarea:focus { border-color:rgba(168,85,247,0.4); }
.cs-input textarea:disabled { opacity:0.4; }
.cs-input .cs-send {
    width:38px;height:38px;border-radius:10px;border:none;
    background:linear-gradient(135deg,#a855f7,#6366f1);color:#fff;
    cursor:pointer;font-size:16px;display:flex;align-items:center;
    justify-content:center;transition:all .2s;flex-shrink:0;
}
.cs-input .cs-send:hover { transform:scale(1.05); }
.cs-input .cs-send:disabled { opacity:0.4;cursor:not-allowed;transform:none; }
.cs-loading {
    display:flex;align-items:center;gap:6px;padding:10px 14px;
    background:rgba(255,255,255,0.04);border-radius:12px;align-self:flex-start;
    border-bottom-left-radius:4px;
}
.cs-loading span {
    width:6px;height:6px;border-radius:50%;background:rgba(255,255,255,0.3);
    animation:cs-bounce 1.4s ease-in-out infinite;
}
.cs-loading span:nth-child(2) { animation-delay:.2s; }
.cs-loading span:nth-child(3) { animation-delay:.4s; }
@keyframes cs-bounce {
    0%,80%,100% { transform:scale(0.6);opacity:0.3; }
    40% { transform:scale(1);opacity:0.8; }
}
.cs-welcome { text-align:center;padding:20px 0;color:rgba(255,255,255,0.5);font-size:13px; }
.cs-error { text-align:center;padding:8px 0;color:#f87171;font-size:12px;cursor:pointer; }

/* ─── 客服面板小屏适配 ─── */
@media (max-width: 640px) {
    .cs-panel { right: 6px; top: 64px; width: calc(100vw - 12px); height: calc(100vh - 140px); border-radius: 12px; }
    .cs-msgs { padding: 12px 10px; }
    .cs-input { padding: 8px 10px 12px; }
    .cs-input textarea { font-size: 15px; padding: 10px 12px; }
}
