/* START OF FILE style.css */

/* Version 1.7.0: Fully Responsive AI Agent UI */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

/* 设计 Token：亮色 / 暗色基础色板 */
:root {
  /* 背景 */
  --bg-main: #fdfaf4;
  --bg-elevated: rgba(255, 255, 255, 0.85);
  --bg-elevated-soft: rgba(255, 255, 255, 0.7);
  --bg-backdrop: rgba(255, 255, 255, 0.25);

  /* 文字 */
  --text-main: #20252d;
  --text-muted: #7a7f8a;
  --text-faint: #b0b5c0;
  --text-on-accent: #ffffff;

  /* 边框与分割线 */
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.16);

  /* 强调色（帝国主题） */
  --accent: #00aeff;
  --accent-soft: rgba(0, 174, 255, 0.1);
  --accent-strong: #0092d6;
  --accent-glow: rgba(0, 174, 255, 0.55);

  /* 状态色（预留） */
  --status-good: #44c48c;
  --status-warn: #ffb347;
  --status-danger: #ff5c5c;

  /* 阴影 */
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.12);
  --shadow-strong: 0 28px 80px rgba(0, 0, 0, 0.22);

  /* 通用尺寸/动效 */
  --card-radius: 18px;
  --transition-fast: 0.18s ease-out;
  --transition-normal: 0.32s ease;
  --transition-slow: 0.5s ease;
  
   /* 新增：磨砂层的颜色（亮色主题下） */
    --frost-glass-color: rgba(255, 255, 255, 0.5);
    
     /* 新增：音乐播放器磨砂层的颜色（亮色主题下） */
       --player-glass-bg: rgba(255, 255, 255, 0.7);
    --player-glass-hover-bg: rgba(255, 255, 255, 0.9);
    --player-glass-border: rgba(0, 0, 0, 0.06);
    --player-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    --player-shadow-hover: 0 6px 15px rgba(0, 0, 0, 0.1);
    
     --ai-chat-window-bg: rgba(255, 255, 255, 0.92);
  --ai-chat-header-bg: rgba(255, 255, 255, 0.78);
  --ai-chat-input-bg: rgba(255, 255, 255, 0.86);

  --ai-chat-ai-bubble-bg: rgba(0, 0, 0, 0.04);
  --ai-chat-border: var(--border-color);
  --ai-chat-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);

  --ai-chat-link-color: var(--accent-color);
  --ai-chat-link-bg: rgba(0, 123, 255, 0.10);
}

:root[data-theme="dark"] {
  --bg-main: #05060a;
  --bg-elevated: rgba(18, 22, 32, 0.96);
  --bg-elevated-soft: rgba(18, 22, 32, 0.88);
  --bg-backdrop: rgba(5, 8, 16, 0.6);

  --text-main: #f2f4ff;
  --text-muted: #8d95a8;
  --text-faint: #666f86;
  --text-on-accent: #0b1015;

  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-strong: rgba(255, 255, 255, 0.18);

  --accent: #35b6ff;
  --accent-soft: rgba(53, 182, 255, 0.15);
  --accent-strong: #5ac6ff;
  --accent-glow: rgba(53, 182, 255, 0.7);

  --status-good: #46d39c;
  --status-warn: #ffc970;
  --status-danger: #ff7b7b;

  --shadow-soft: 0 20px 50px rgba(0, 0, 0, 0.6);
  --shadow-strong: 0 40px 90px rgba(0, 0, 0, 0.85);
  
   /* 暗色下，磨砂用接近黑色的透明层 */
    --frost-glass-color: rgba(5, 8, 16, 0.55);
    
       --ai-chat-window-bg: rgba(18, 22, 32, 0.92);
  --ai-chat-header-bg: rgba(18, 22, 32, 0.72);
  --ai-chat-input-bg: rgba(18, 22, 32, 0.80);

  --ai-chat-ai-bubble-bg: rgba(255, 255, 255, 0.06);
  --ai-chat-border: var(--border-color);
  --ai-chat-shadow: 0 30px 80px rgba(0, 0, 0, 0.75);

  --ai-chat-link-color: var(--accent-color);
  --ai-chat-link-bg: rgba(53, 182, 255, 0.14);
    
  /*音乐播放器磨砂层的颜色*/
  /* :root[data-theme="dark"] {
    --player-glass-bg: rgba(18, 22, 32, 0.7);       /* 深色磨砂 */
  /*  --player-glass-hover-bg: rgba(18, 22, 32, 0.85);
    --player-glass-border: rgba(255, 255, 255, 0.08);
    --player-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
    --player-shadow-hover: 0 6px 15px rgba(0, 0, 0, 0.8);
    
    
}*/
/* ==============================
   AI Chat Theme Surfaces (NEW)
   ============================== */


}


/* 1. 默认背景样式（由主题控制） */
body {
    background-color: var(--bg-main);
    color: var(--text-main);
    background-image: none;
    background-size: cover;
    background-position: center;
    transition:
        background-color var(--transition-slow, 0.5s ease),
        color var(--transition-normal, 0.3s ease),
        background-image 0.5s ease;
}


/* 2. 磨砂效果背景 */
body.mosaic-background {
    background-image: url('images/帝国总理府.png');
    background-size: cover;
    background-position: center;
    position: relative;
     z-index: -10;
}

/* 3. 磨砂效果 */
body.mosaic-background::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--frost-glass-color);
    pointer-events: none;
    backdrop-filter: blur(5px);
    z-index: -1;
    transition:
        background-color var(--transition-slow, 0.5s ease),
        backdrop-filter var(--transition-slow, 0.5s ease);


    /* 可选：让主题切换时磨砂层也平滑过渡 */
    transition:
        background-color var(--transition-slow, 0.5s ease),
        backdrop-filter var(--transition-slow, 0.5s ease);
}


/* 4. 页面切换按钮的样式 */
/* ====== 基础按钮样式(背景切换按钮） ====== */
.background-toggle-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;

    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;

    background-color: #007BFF;
    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: none;
    transition: background-color 0.3s ease;
}

/* 图标仍然居中 */
.background-toggle-button svg {
    width: 22px;
    height: 22px;
    display: block;
    stroke: #FFF;
    fill: none;
}

/* 悬停 */
.background-toggle-button:hover {
    background-color: #0056b3;
}

/* ====== 点击触发扩散波，只执行一次 ====== */
.background-toggle-button.bg-toggle-pulsing {
    animation: bg-toggle-pulse 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

/* 扩散波动画 */
@keyframes bg-toggle-pulse {
    0% { 
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(255,255,255,0.35);
    }
    40% { 
        transform: scale(1.08);
        box-shadow: 0 0 0 40px rgba(255,255,255,0.18);
    }
    75% { 
        transform: scale(1.02);
        box-shadow: 0 0 0 80px rgba(255,255,255,0.02);
    }
    100% { 
        transform: scale(1);
        box-shadow: none;
    }
}

/* ====== 背景激活时的呼吸光（持续循环） ====== */
.background-toggle-button.bg-toggle-active {
    animation: bg-toggle-breath 3.2s ease-in-out infinite;
}

/* 呼吸光动画 */
@keyframes bg-toggle-breath {
    0% {
        box-shadow: 0 0 16px rgba(255,255,255,0.22);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 40px rgba(255,255,255,0.10);
        transform: scale(1.04);
    }
    100% {
        box-shadow: 0 0 16px rgba(255,255,255,0.22);
        transform: scale(1);
    }
}





/* 明暗主题切换按钮：与背景按钮统一风格，稍微向左偏一点 */
.theme-toggle-button {
    position: fixed;
    top: 20px;
    right: 80px; /* 背景按钮在右 20px，这里往左挪一点，避免重叠 */
    z-index: 9999;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    padding: 8px 14px;
    background-color: var(--bg-elevated);
    color: var(--text-main);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    box-shadow: var(--shadow-soft);
    transition:
        background-color var(--transition-fast),
        color var(--transition-fast),
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        transform var(--transition-fast);
}

.theme-toggle-button:hover {
    background-color: var(--accent-soft);
    border-color: var(--accent);
    box-shadow: var(--shadow-strong);
    transform: translateY(-1px);
}

.theme-toggle-icon {
    font-size: 1.1rem;
    line-height: 1;
}


:root {
    --primary-bg-color: var(--bg-main);
    --text-color: var(--text-main);
    --accent-color: var(--accent);
    --logo-shadow-color: var(--accent-glow);
    --border-color: var(--border-subtle);
    --transition-speed: var(--transition-normal);
    --logo-size: 300px;
    --scroll-transition-duration: 1.2s;
}


body, html {
    margin: 0; padding: 0; width: 100%; height: 100%;
    font-family: 'Poppins', 'Microsoft YaHei', sans-serif;
    background-color: var(--primary-bg-color);
    color: var(--text-color);
    overflow: hidden;
}

body.is-navigating { pointer-events: none; }

.page-scroller {
    width: 100%;
    height: 100%;
    transition: transform var(--scroll-transition-duration) cubic-bezier(0.65, 0, 0.35, 1);
}
.page-section {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
     z-index: 1;/*主页面的那些文字的位置*/
}

.view-container {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: 100px 40px 40px 40px; 
    box-sizing: border-box;
    opacity: 0; visibility: hidden;
    transition: opacity var(--transition-speed) ease-in-out, visibility var(--transition-speed) ease-in-out;
}
.view-container.active-view { opacity: 1; visibility: visible; }

.back-button, .breadcrumb, .view-mode-toggle {
    position: absolute;
    top: 32px;
    z-index: 11;
    opacity: 0;
}
.active-view .back-button.animate-in,
.active-view .breadcrumb.animate-in,
.active-view .view-mode-toggle.animate-in {
    animation: fade-in 0.5s ease forwards;
}

/* 返回按钮：全站统一蓝色圆形按钮 */
.back-button {
    left: 40px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #007BFF;              /* 纯蓝 */
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    font-weight: 300;
    color: #ffffff;                          /* 白色箭头 */
    cursor: pointer;
    transition: all 0.2s ease-out;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}
.back-button.animate-in {
    animation-delay: 0.4s;
}
.back-button:hover {
    transform: scale(1.05) translateY(-1px);
    background-color: #0056b3;              /* 深一点的蓝 */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* 面包屑：无底黑字 */
.breadcrumb {
    left: 100px;
    font-size: 1.1em;
    color: var(--text-main);;                          /* 黑字 */
}
.breadcrumb.animate-in {
    animation-delay: 0.5s;
}
.breadcrumb a {
    color: var(--text-main);;                          /* 链接也用黑色 */
    text-decoration: none;
    transition: color 0.3s;z
    font-weight: 400;
}
.breadcrumb a:hover {
    color: #007BFF;                          /* 悬停变蓝 */
}
.breadcrumb span {
    margin: 0 12px;
}
.breadcrumb a.active {
    color: #007BFF;
    font-weight: 600;
    pointer-events: none;
    cursor: default;
}





/* 视图切换条：小磨砂条 */
.view-mode-toggle {
    right: 40px;
    display: flex;
    background-color: var(--bg-elevated-soft);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 4px;
    box-shadow: var(--shadow-soft);
}
.view-mode-toggle.animate-in {
    animation-delay: 0.6s;
}

.toggle-button {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6px;
    color: var(--text-muted);
    transition: all 0.3s ease;
}
.toggle-button:hover {
    color: var(--text-main);
    background-color: var(--accent-soft);
}
.toggle-button.active {
    color: var(--text-on-accent);
    background-color: var(--accent);
}
.toggle-button svg {
    width: 100%;
    height: 100%;
}


#landing-view { overflow: hidden; }
#landing-view .empire-logo {
    max-width: var(--logo-size); width: 40%; margin-bottom: 20px;
    animation: breathe 4s ease-in-out infinite; cursor: pointer; transition: transform 0.3s ease;
}
#landing-view .empire-logo:hover { transform: scale(1.1); }

/* ====== L1 → L2 徽标传送门动效 ====== */

/* 点击后：Landing 其它内容淡出 + 轻微后退 */
body.landing-portal-mode #landing-view .intro-text,
body.landing-portal-mode #landing-view .sponsor-info,
body.landing-portal-mode #landing-view .music-player,
body.landing-portal-mode #landing-view .scroll-down-hint {
    opacity: 0;
    filter: blur(2px);
    transform: translateY(10px) scale(0.98);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        filter 0.3s ease;
}

/* 克隆出来、执行动画的徽标 */
.logo-portal-clone {
    /* transitionFromLanding 里已经写 transform/opacity 过渡，这里补充光圈感 */
    filter: drop-shadow(0 0 16px rgba(90, 198, 255, 0.7));
}

/* 克隆徽标周围的光圈 */
.logo-portal-clone::before {
    content: "";
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    background:
        radial-gradient(circle,
            rgba(90, 198, 255, 0.7) 0%,
            rgba(90, 198, 255, 0.35) 35%,
            transparent 70%);
    opacity: 0;
    transform: scale(0.4);
    pointer-events: none;
    animation: logo-portal-glow 0.6s ease-out forwards;
}

/* 光圈扩散关键帧 */
@keyframes logo-portal-glow {
    0% {
        opacity: 0;
        transform: scale(0.4);
    }
    40% {
        opacity: 1;
        transform: scale(1.0);
    }
    100% {
        opacity: 0;
        transform: scale(1.6);
    }
}

/* L2 分类视图：从徽标位置“浮出” */
#category-view.enter-from-logo-portal {
    opacity: 0;
    transform-origin: center top;
    transform: translateY(40px) scale(0.94);
}

#category-view.enter-from-logo-portal.active-view {
    transition:
        opacity 0.55s cubic-bezier(0.19, 1, 0.22, 1),
        transform 0.55s cubic-bezier(0.19, 1, 0.22, 1);
    opacity: 1;
    transform: translateY(0) scale(1);
}


#landing-view .intro-text {
    max-width: 600px; font-size: 1.1em; line-height: 1.8; text-align: center;
    opacity: 0; transform: translateY(30px);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}
#landing-view .intro-text.visible { opacity: 1; transform: translateY(0); }
@keyframes breathe {
    0%, 100% { filter: drop-shadow(0 0 10px var(--logo-shadow-color)); }
    50% { filter: drop-shadow(0 0 25px var(--logo-shadow-color)); }
}

.scroll-down-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #aaa;
    font-size: 0.9em;
    animation: bounce 2s infinite;
    z-index: 5;
    opacity: 0.8;
    cursor: default;
    text-align: center;
}
.scroll-down-hint::after {
    content: '▼';
    display: block;
    margin-top: 5px;
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translate(-50%, 0); }
    40% { transform: translate(-50%, -10px); }
    60% { transform: translate(-50%, -5px); }
}

.category-gateway {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1000px;
    flex-wrap: wrap;
    gap: 20px;
}

/* 大入口卡片：背景、边框、阴影全部走 Token */
.category-panel {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
    margin: 0;
    padding: 60px 40px;
    background-color: var(--bg-elevated-soft);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 0;
    transform: translateY(30px);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    box-shadow: var(--shadow-soft);
    z
}

/* 内层半透明盖板，保证背景图不影响文字可读性 */
.category-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-elevated);
    border-radius: 12px;
    pointer-events: none;
    transition: background-color 0.3s ease;
}
.category-panel:hover::before {
    background-color: var(--bg-elevated-soft);
}

.category-panel.animate-in {
    animation: fade-in-up 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.category-panel:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-strong);
}

/* 标题：直接吃主文字色 */
.panel-title {
    font-size: 2.5em;
    font-weight: 600;
    margin: 0;
    color: var(--text-main);
    pointer-events: none;
    position: relative;
    z-index: 1;
}


.view-content-container {
    width: 100%;
    max-width: 1000px;
    position: relative;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.view-content {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}
.view-content.active {
    opacity: 1;
    transform: scale(1);
    position: relative;
    pointer-events: auto;
}

.list-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* 列表卡片：同样走统一 Token */
.list-item {
    background-color: var(--bg-elevated-soft);
    border-radius: 8px;
    margin-bottom: 10px;
    opacity: 0;
    transform: translateX(-100vw);
    cursor: pointer;
    transition:
        background-color 0.3s,
        transform 0.3s,
        box-shadow 0.3s;
    position: relative;
    box-shadow: var(--shadow-soft);
}
.list-item.animate-in {
    animation: slide-in-overshoot 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.list-item:hover {
    background-color: var(--bg-elevated);
    transform: translateX(-5px);
    box-shadow: var(--shadow-strong);
}

.list-title {
    padding: 18px 20px;
    margin: 0;
    font-size: 1.2em;
    font-weight: 400;
    pointer-events: none;
    color: var(--text-main);
     z-index: 1;
}


.tree-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    overflow: hidden;
}
#g6-tree-container {
    width: 100%;
    height: 100%;
    position: relative;
}
.g6-tooltip {
    border: 1px solid #e2e2e2;
    border-radius: 4px;
    font-size: 12px;
    color: #545454;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px 8px;
    box-shadow: rgb(174, 174, 174) 0px 0px 10px;
}

/* ===== 详情页主体布局 ===== */
.detail-content {
    display: flex;
    width: 100%;
    max-width: 1100px;
    max-height: 100%;
    align-items: center;

    /* 新增：详情整体作为一张“卡片” */
    background-color: var(--bg-elevated);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    padding: 32px 32px;
    box-sizing: border-box;
    transition:
        background-color var(--transition-normal),
        box-shadow var(--transition-normal),
        transform var(--transition-fast);
}

/* 左侧：封面/插图区域 */
.detail-left {
    flex: 0 0 35%;
    padding-right: 40px;
    opacity: 0;
    transform: translateX(-30px);
}
.detail-left.animate-in {
    animation: slide-fade-in-left 0.8s cubic-bezier(0.25, 1, 0.5, 1) 0.2s forwards;
}

/* 右侧：标题 + 事件框（事件框内滚动） */
.detail-right {
    flex: 1;
    max-height: calc(100vh - 140px);

    /* 新增：垂直布局，让 title 固定在上，正文框占剩余空间 */
    display: flex;
    flex-direction: column;

    /* 不再让整列滚动，滚动交给 #detail-text */
    overflow: hidden;

    padding-right: 15px;
    opacity: 0;
    transform: translateY(30px);
    z-index: 1;
}

.detail-right.animate-in {
    animation: fade-in-up 0.8s cubic-bezier(0.25, 1, 0.5, 1) 0.4s forwards;
}

/* 封面图：背景 & 圆角吃 Token */
#detail-image {
    width: 100%;
    border-radius: 12px;
    background-color: var(--bg-elevated-soft);
    min-height: 200px;
    object-fit: cover;
    box-shadow: var(--shadow-soft);
}

/* 标题：跟随主文字色 */
#detail-title {
  flex-shrink: 0;
  margin-bottom: 12px;
}


/* 正文框：统一高度，多余内容在内部滚动 */
#detail-text {
  font-size: 1.1em;
  line-height: 1.9;
  color: var(--text-muted);

  /* 关键：固定高度。你可以根据帝国纪元元年的视觉来微调这两个值 */
  flex: 0 0 260px;              /* 固定占 260px 高度 */
  max-height: 260px;            /* 即使内容再多，也不再长 */

  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  padding-right: 4px;
}

/* 小滚动条美化，可选 */
#detail-text::-webkit-scrollbar {
  width: 6px;
}
#detail-text::-webkit-scrollbar-thumb {
  background-color: var(--accent-color);
  border-radius: 4px;
}
#detail-text::-webkit-scrollbar-track {
  background: transparent;
}


/* 可选：单独给正文框一个细滚动条样式 */
#detail-text::-webkit-scrollbar {
    width: 6px;
}
#detail-text::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 4px;
}
#detail-text::-webkit-scrollbar-track {
    background: transparent;
}

/* 可选：详情卡片轻微浮起 */
.detail-content:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-strong);
}



/* 图谱所在整屏，背景跟随主题主背景 */
#graph-section {
    background-color: var(--bg-main);
}

/* ECharts 容器本身透明，只负责占位 */
#relationship-graph-container {
    width: 100%;
    height: 100vh;
    min-height: 500px;
    position: relative;
}

/* 图谱返回按钮：用统一 Token 做磨砂小胶囊 */
.graph-back-button {
    position: absolute;
    top: 32px;
    left: 40px;
    padding: 8px 16px;
    background-color: var(--bg-elevated-soft);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    display: none;
    transition:
        opacity 0.5s,
        background-color var(--transition-fast),
        box-shadow var(--transition-fast),
        transform var(--transition-fast);
    backdrop-filter: blur(5px);
    font-size: 0.9em;
    box-shadow: var(--shadow-soft);
}
.graph-back-button:hover {
    background-color: var(--bg-elevated);
    box-shadow: var(--shadow-strong);
    transform: scale(1.05);
}


@keyframes fade-in { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes fade-in-up { 0% { opacity: 0; transform: translateY(30px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes slide-fade-in-left { 0% { opacity: 0; transform: translateX(-30px); } 100% { opacity: 1; transform: translateX(0); } }
@keyframes slide-in-overshoot {
    0% { opacity: 0; transform: translateX(-100vw); }
    70% { opacity: 1; transform: translateX(10px); }
    100% { opacity: 1; transform: translateX(0); }
}
@keyframes pop-in {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

@media (max-width: 768px) {
    .view-container { padding: 80px 20px 20px 20px; }
    .breadcrumb { left: 70px; right: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .category-gateway { flex-direction: column; }
    .category-panel { margin: 15px 0; width: 80%; min-width: 200px; }
    .panel-title { font-size: 2em; }
    .detail-content { flex-direction: column; align-items: center; max-height: calc(100vh - 100px); overflow-y: auto; }
    .detail-left { padding-right: 0; margin-bottom: 20px; width: 80%; flex-shrink: 0; }
    .detail-right { height: auto; max-height: none; overflow-y: visible; }
    #detail-title { font-size: 2em; }

    .graph-back-button {
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        padding: 10px 20px;
        font-size: 1em;
    }
    
    /* Reader specific responsive styles */
    .reader-controls {
        right: 20px;
    }
    .reader-toc-panel {
        width: 250px;
    }

    /* Music player specific responsive styles */
    .music-player { 
        top: 20px; 
        max-width: calc(100% - 40px); 
        padding: 8px 12px; 
    }
    #current-song { 
        max-width: 120px; 
        font-size: 0.88em; 
    }
    .control-btn, .play-pause-btn, .loop-btn, .toggle-btn { 
        width: 32px; 
        height: 32px; 
        font-size: 1em; 
    }

    #progress-bar { 
        width: 160px; 
    }
}

/* Music Player Styles */
.music-player {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    padding: 8px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    z-index: 10;
    transition: all 0.25s ease;
    backdrop-filter: blur(5px);
}
.music-player:hover {
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}



#current-song {
    font-size: 0.95em;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    text-align: center;
}
.controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.control-btn,
.play-pause-btn,
.loop-btn,
.toggle-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.12s ease;
    padding: 0;
    flex-shrink: 0;
}
.control-btn:hover,
.play-pause-btn:hover,
.loop-btn:hover,
.toggle-btn:hover {
    background-color: #008fcc;
    transform: scale(1.06);
}
.control-btn svg,
.loop-btn svg,
.toggle-btn svg {
    width: 60%;
    height: 60%;
    fill: currentColor;
}
.loop-btn.active {
    background-color: #ffc107;
    color: #333;
}
.loop-btn.active:hover { background-color: #e0a800; }
.extra-controls {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.extra-controls.active { display: flex; }
#progress-bar { width: 220px; }
.music-player.minimized {
    padding: 6px 12px;
    flex-direction: row;
    justify-content: center;
    gap: 6px;
    min-width: 120px;
}
.music-player.minimized .controls > :not(.toggle-btn) {
    display: none !important;
}
.music-player.minimized .extra-controls {
    display: none !important;
}
.music-player.minimized .toggle-btn {
    width: 34px;
    height: 34px;
}
.music-player.minimized #current-song {
    max-width: 220px;
    font-size: 1em;
    font-weight: 500;
}
/* 暗色主题下的音乐播放器整体玻璃风格 */
:root[data-theme="dark"] .music-player {
    background-color: rgba(15, 23, 42, 0.85);          /* 深色磨砂玻璃 */
    border-color: rgba(148, 163, 184, 0.4);            /* 稍亮的边框 */
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.75);        /* 阴影加深一点 */
}

:root[data-theme="dark"] .music-player:hover {
    background-color: rgba(15, 23, 42, 0.95);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.9);
}

/* 歌曲标题：在深色玻璃上用浅字 */
:root[data-theme="dark"] .music-player #current-song {
    color: #e5e7eb;  /* 相当于 Tailwind 的 text-gray-200 */
}

/* 播放器按钮：基础状态仍用 accent 色，暗色下略压一点亮度 */
:root[data-theme="dark"] .music-player .control-btn,
:root[data-theme="dark"] .music-player .play-pause-btn,
:root[data-theme="dark"] .music-player .loop-btn,
:root[data-theme="dark"] .music-player .toggle-btn {
    background-color: var(--accent-color);  /* 继续用你的 accent-color */
    color: #0b1120;                         /* 深色背景上的图标用深色，保证在亮色按钮上有对比 */
}

/* 悬停时略微加深 accent */
:root[data-theme="dark"] .music-player .control-btn:hover,
:root[data-theme="dark"] .music-player .play-pause-btn:hover,
:root[data-theme="dark"] .music-player .loop-btn:hover,
:root[data-theme="dark"] .music-player .toggle-btn:hover {
    background-color: #0f5fbf;  /* 比原来的 #007acc 稍暗一点的蓝，可以按需要微调 */
}


/* 进度条：用 CSS 的 accent-color，让滑块/轨道跟主题变色 */
:root[data-theme="light"] .music-player #progress-bar {
    accent-color: var(--accent-color); ！important
}
:root[data-theme="dark"] .music-player #progress-bar {
    accent-color: #38bdf8;  /* 稍亮一点的青蓝，在暗背景上清晰 */
}

    /* 循环开启状态：基础样式（亮/暗通用） */
.music-player .loop-btn.active {
    background-color: #ffc107; !important  /* 黄色：两种主题都用同一个值 */
    color: #333333;              /* 默认深色文字（亮色主题用） */
}

/* 循环图标跟随文本颜色，不再单独乱改填充 */
.music-player .loop-btn.active svg,
.music-player .loop-btn.active i {
    fill: currentColor;
    stroke: currentColor;
}
/* 暗色主题下：只把内部内容变白，其他一切保持一致 */
:root[data-theme="dark"] .music-player .loop-btn.active {
    color: #ffffff;   /* 背景仍是 #ffc107，上面基础样式规定的 */
}
/* 暗色主题下：循环开启按钮保持亮色模式的黄色背景，内部变白 */
:root[data-theme="dark"] .music-player .loop-btn.active {
    background-color: #ffc107;    /* 背景保持黄色，和亮色完全一致 */
    color: #ffffff;               /* 图标/文字反转成白色 */
}

/* 如果内部是 SVG 或 <i> 图标，也统一用白色 */
:root[data-theme="dark"] .music-player .loop-btn.active svg,
:root[data-theme="dark"] .music-player .loop-btn.active i {
    fill: #ffffff;
    stroke: #ffffff;
}

/* 一圈匀速旋转（循环阶段） */
@keyframes loopRotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* 激活瞬间的“弹一下”启动动画（0.45s） */
@keyframes loopSpinKick {
    0%   { transform: rotate(0deg); }
    60%  { transform: rotate(380deg); }  /* 稍微过冲一点 */
    100% { transform: rotate(360deg); }
}

/* 激活时：对图标本身加动画（不动按钮本体） */
.music-player .loop-btn.active svg,
.music-player .loop-btn.active i {
    transform-origin: center;

    /* 两个动画叠加：
       1) 0.45s 的弹性启动，只执行一次
       2) 1.6s 一圈的匀速旋转，从 0.45s 后开始无限循环
    */
    animation:
        loopSpinKick 0.45s cubic-bezier(0.25, 1.5, 0.5, 1) 0s 1 both,
        loopRotate   1.6s linear 0.45s infinite;
}
/* 亮色主题下的发光脉冲：弱一点，避免太刺眼 */
@keyframes loopGlowPulseLight {
    0%   { box-shadow: 0 0 0px rgba(0, 0, 0, 0); }
    50%  { box-shadow: 0 0 10px rgba(0, 0, 0, 0.6); }
    100% { box-shadow: 0 0 0px rgba(0, 0, 0, 0); }
}

/* 暗色主题下的发光脉冲：略强一点，在暗背景更清晰 */
@keyframes loopGlowPulseDark {
    0%   { box-shadow: 0 0 0px rgba(255, 255, 255, 0); }
    50%  { box-shadow: 0 0 12px rgba(255, 255, 255, 0.9); }
    100% { box-shadow: 0 0 0px rgba(255, 255, 255, 0); }
}

/* 亮色：按钮自身做轻微发光呼吸 */
:root[data-theme="light"] .music-player .loop-btn.active {
    animation: loopGlowPulseLight 2.4s ease-in-out 0.45s infinite;
}

/* 暗色：发光稍微强一点 */
:root[data-theme="dark"] .music-player .loop-btn.active {
    animation: loopGlowPulseDark 2.0s ease-in-out 0.45s infinite;
}





/* 赞助信息文字*/
.sponsor-info { text-align: center; margin-top: 20px; font-size: 1.1em; color: #bbb; }
.sponsor-info label { margin-right: 5px; }
#sponsor-name {
    font-size: 1.5em; font-weight: bold;
    background: linear-gradient( to right, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3 );
    background-size: 200% auto;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    animation: rainbow-flow 4s linear infinite;
}
#sponsor-name:hover {
    animation-play-state: paused;
}
@keyframes rainbow-flow {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}


/* --- Reader Styles --- */
#reader-view {
    padding: 0;
    background-color: #F5F2E8;
    color: #3f3f3f;
    transition: background-color 0.3s ease, color 0.3s ease;
    align-items: flex-start;
    justify-content: flex-start;
    --ui-visibility-transition: transform 0.4s cubic-bezier(0.2, 1, 0.3, 1);
}
#reader-view.dark-mode {
    background-color: #1a1a1a;
    color: #ccc;
}
#reader-view .back-button, #reader-view .breadcrumb {
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    transition: var(--ui-visibility-transition);
}
#reader-view.dark-mode .back-button, #reader-view.dark-mode .breadcrumb {
    background-color: rgba(40, 40, 40, 0.4);
}

.reader-controls {
    position: fixed;
    top: 32px;
    right: 40px;
    z-index: 102;
    display: flex;
    gap: 10px;
    background: rgba(255,255,255,0.2);
    padding: 8px;
    border-radius: 25px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: var(--ui-visibility-transition);
}
#reader-view.dark-mode .reader-controls {
    background: rgba(40,40,40,0.4);
    border-color: rgba(255, 255, 255, 0.1);
}
.reader-controls button {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}
.reader-controls button:hover {
    background-color: rgba(0,0,0,0.1);
}

#reader-view.immersive .back-button, 
#reader-view.immersive .breadcrumb, 
#reader-view.immersive .reader-controls {
    transform: translateY(-200%); /* 向上滑出屏幕 */
}

.reader-toc-panel {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 300px;
    background: #fff;
    z-index: 101;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    padding: 100px 20px 20px;
    box-sizing: border-box;
    overflow-y: auto;
    box-shadow: 5px 0 15px rgba(0,0,0,0.1);
}
.reader-toc-panel.visible {
    transform: translateX(0);
}
#reader-view.dark-mode .reader-toc-panel {
    background-color: #2c2c2c;
}
.reader-toc-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.reader-toc-panel a {
    text-decoration: none;
    color: #333;
    display: block;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
    border-radius: 5px;
}
.reader-toc-panel a:hover {
    background-color: #f0f0f0;
}
#reader-view.dark-mode .reader-toc-panel a {
    color: #ddd;
    border-bottom-color: #444;
}
#reader-view.dark-mode .reader-toc-panel a:hover {
    background-color: #444;
}

.reader-content-wrapper {
    width: 100%;
    height: 100%;
    overflow-y: auto; 
    padding: 100px 20px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}
#reader-content {
    max-width: 800px;
    margin: 0 auto;
    font-family: 'Source Han Serif CN', 'Songti SC', serif;
    font-size: 19px;
    line-height: 2;
    letter-spacing: 0.5px;
    text-align: justify;
    transition: font-size 0.2s;
}
#reader-content p {
    margin: 0 0 2em 0;
    text-indent: 2em;
}
#reader-content h2 {
    font-size: 1.8em;
    margin: 2.5em 0 1.5em;
    text-align: center;
    text-indent: 0;
}
.highlighted-paragraph {
    background-color: rgba(255, 229, 100, 0.6);
    transition: background-color 0.5s ease;
    border-radius: 4px;
    padding: 0.2em 0;
    margin: -0.2em 0;
}
#reader-view.dark-mode .highlighted-paragraph {
    background-color: rgba(255, 235, 59, 0.4);
}

/* --- AI Agent Styles (Fully Responsive) --- */
#ai-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #007bff, #00aeff);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
#ai-fab:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.5);
}

#ai-chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    
    /* 使用 max-* 和 vw/vh 单位实现响应式布局 */
    width: 90vw; /* 基础宽度为视窗宽度的90% */
    height: 75vh; /* 基础高度为视窗高度的75% */
    max-width: 400px;  /* 在大屏幕上，最大宽度不超过 400px */
    max-height: 600px; /* 在大屏幕上，最大高度不超过 600px */

    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 998;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
#ai-chat-window.hidden {
    display: flex; /* 保持 flex 以便动画正确执行 */
}
#ai-chat-window:not(.hidden) {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.chat-header {
    padding: 15px 20px;
    background: #f7f7f7;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* 防止头部在 flex 布局中被压缩 */
}
/* 【【【 CHANGE START 】】】 */
.new-chat {
    font-size: 1.6em;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    transition: color 0.2s, transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
.new-chat:hover {
    color: var(--text-color);
    transform: rotate(90deg);
}
.chat-header h3 {
    margin: 0;
    font-size: 1.1em;
    flex-grow: 1;
    text-align: center;
    padding: 0 10px;
}
/* 【【【 CHANGE END 】】】 */
.close-chat {
    font-size: 1.5em;
    cursor: pointer;
    color: #aaa;
    transition: color 0.2s;
}
.close-chat:hover {
    color: var(--text-color);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.message {
    margin-bottom: 15px;
    max-width: 90%;
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
}
.user-response {
    background-color: var(--accent-color);
    color: white;
    border-bottom-right-radius: 5px;
    margin-left: auto;
}
.ai-response {
    background-color: #f1f1f1;
    color: var(--text-color);
    border-bottom-left-radius: 5px;
    margin-right: auto;
}
.ai-response.thinking::after {
    content: '▋';
    display: inline-block;
    animation: blink 1s infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* 【【【 CHANGE START 】】】 */
.system-notification-response {
    font-size: 0.8em;
    text-align: center;
    color: #aaa;
    background-color: transparent;
    width: 100%;
    max-width: 100%;
    margin-top: -5px;
    margin-bottom: 10px;
    padding: 0;
}
/* 【【【 CHANGE END 】】】 */

.ai-response a.novel-link, .detail-text a.novel-link {
    color: #0056b3;
    font-weight: bold;
    text-decoration: underline;
    cursor: pointer;
    background-color: rgba(0, 123, 255, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
}

.chat-input-area {
    display: flex;
    padding: 15px;
    border-top: 1px solid var(--border-color);
    background-color: #fff;
    flex-shrink: 0; /* 防止输入区被压缩 */
}
#chat-input {
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 1em;
    resize: none;
    margin-right: 10px;
    transition: border-color 0.2s;
    font-family: inherit;
}
#chat-input:focus {
    outline: none;
    border-color: var(--accent-color);
}
#chat-send {
    padding: 10px 20px;
    border: none;
    background-color: var(--accent-color);
    color: white;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.2s;
}
#chat-send:hover {
    background-color: #0086c3;
}
#chat-send:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* --- Library & Novel Styles --- */
#library-icon {
    position: absolute;
    top: 32px;
    left: 40px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    color: var(--text-color);
}
#library-icon:hover {
    transform: scale(1.1) rotate(-10deg);
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    color: var(--accent-color);
}
#library-icon svg {
    width: 24px;
    height: 24px;
}

.library-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
}
.library-title {
    font-size: 2.5em;
    font-weight: 600;
    margin-bottom: 40px;
    color: var(--text-color);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.library-title.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.novel-grid {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 30px;
    overflow-y: auto;
    padding: 0 20px 20px;
}
.novel-card {
    cursor: pointer;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1), 
                transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.novel-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}
.novel-card:hover {
    transform: translateY(-10px);
}
.novel-cover {
    width: 100%;
    padding-bottom: 140%; /* 封面高宽比 */
    background-color: #eee;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    transition: box-shadow 0.3s ease;
}
.novel-card:hover .novel-cover {
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}
.novel-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

/* --- Final Media Queries for Mobile Fine-tuning --- */
@media (max-width: 768px) {
    #library-icon {
        left: 20px;
        top: 20px;
    }
    .novel-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 20px;
    }
    .library-title {
        font-size: 2em;
    }
}

@media (max-width: 480px) {
    /* 在小屏幕上，让AI聊天窗口几乎占满屏幕 */
    #ai-chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 90px);
        max-width: none; /* 取消最大宽度限制 */
        max-height: none;/* 取消最大高度限制 */
        bottom: 70px;
        right: 10px;
        left: 10px; /* 左右都设置，使其居中 */
    }
    #ai-fab {
        bottom: 20px;
        right: 20px;
    }
}
/* 请将这些样式添加到 style.css 文件的末尾 */

/* --- 新增：加载占位符样式 --- */
.loading-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    color: #999;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
}

.loading-placeholder.error {
    color: #d9534f;
    font-weight: bold;
}

/* AI Chat Window */
#ai-chat-window {
  background-color: var(--ai-chat-window-bg);
  border: 1px solid var(--ai-chat-border);
  box-shadow: var(--ai-chat-shadow);
  backdrop-filter: blur(8px);
}

.chat-header {
  background-color: var(--ai-chat-header-bg);
  border-bottom: 1px solid var(--ai-chat-border);
}


.chat-input-area {
  background-color: var(--ai-chat-input-bg);
  border-top: 1px solid var(--ai-chat-border);
}

#chat-input {
  background-color: rgba(0,0,0,0); /* 让它吃输入区的“面” */
  color: var(--text-color);
  border: 1px solid var(--ai-chat-border);
}

#chat-input::placeholder {
  color: var(--text-muted);
}


/* 消息气泡 */
.message.ai-response {
  background-color: var(--ai-chat-ai-bubble-bg);
  color: var(--text-color);
}


.message.user-response {
  background-color: var(--ai-chat-bubble-user-bg);
  color: var(--ai-chat-bubble-user-text);
}

/* 发送按钮也吃主题强调色（可选但建议一起做，避免暗色下“固定亮蓝”不统一） */
#chat-send {
  background-color: var(--ai-chat-send-bg);
}

#chat-send:hover {
  background-color: var(--ai-chat-send-bg-hover);
}

/* --- START OF FILE style.css (追加内容) --- */

/* =========================================
   ARCHIVE STYLE DETAIL VIEW (档案风格详情页)
   覆盖原有的 .detail-content 样式
   ========================================= */

/* 1. 档案袋/文件纸主体 */
#detail-view .detail-content {
    /* 重置原有卡片样式 */
    border-radius: 2px !important; /* 极小的圆角，接近直角 */
    background-color: #F2F0E6 !important; /* 档案纸张的米白色 */
    box-shadow: 
        15px 15px 0 rgba(0,0,0,0.8), /* 硬投影 */
        inset 0 0 100px rgba(0,0,0,0.05) !important; /* 纸张陈旧感内阴影 */
    border: 3px solid #111 !important; /* 粗黑边框 */
    
    /* 增加内部装饰：顶部红线和网格背景 */
    background-image: 
        linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px),
        linear-gradient(#D80000, #D80000); /* 顶部红线 */
    background-size: 
        20px 20px, 
        20px 20px,
        100% 8px; /* 红线高度 */
    background-repeat: repeat, repeat, no-repeat;
    background-position: 0 0, 0 0, 0 0;
    
    padding: 50px 40px 40px 40px !important; /* 顶部留出红线空间 */
    position: relative;
    overflow: visible !important; /* 允许印章溢出 */
}

/* 装饰：右上角的“机密”印章 */
#detail-view .detail-content::after {
    content: "TOP SECRET // 绝密";
    position: absolute;
    top: -25px;
    right: 20px;
    background-color: #D80000;
    color: #fff;
    font-family: 'Russo One', sans-serif; /* 借用 timeline 的字体 */
    font-size: 1rem;
    padding: 5px 15px;
    transform: rotate(-2deg);
    box-shadow: 3px 3px 0 #111;
    border: 2px solid #111;
    z-index: 10;
}

/* 装饰：左上角的档案编号 */
#detail-view .detail-content::before {
    content: "ARCHIVE_ID: " attr(data-cat-index) "-X09"; /* 模拟编号 */
    position: absolute;
    top: 15px;
    left: 20px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    color: #D80000;
    letter-spacing: 2px;
}

/* 2. 左侧图片区：证物照片风格 */
#detail-view .detail-left {
    position: relative;
    padding-right: 30px !important;
}

#detail-image {
    border-radius: 0 !important; /* 直角 */
    border: 4px solid #fff !important; /* 白边模拟相纸 */
    box-shadow: 0 2px 5px rgba(0,0,0,0.3) !important;
    filter: grayscale(80%) contrast(1.2); /* 褪色黑白照片感 */
    transform: rotate(-1deg); /* 轻微歪斜，像贴上去的 */
    transition: all 0.3s ease;
    background-color: #000; /* 图片未加载时的底色 */
}

/* 悬停时图片恢复彩色 */
#detail-view .detail-content:hover #detail-image {
    filter: grayscale(0%) contrast(1);
    transform: rotate(0deg) scale(1.02);
    box-shadow: 5px 5px 10px rgba(0,0,0,0.3) !important;
}

/* 装饰：图片上的“回形针” */
#detail-view .detail-left::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 40px;
    width: 15px;
    height: 40px;
    border: 3px solid #555;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    z-index: 5;
}

/* 3. 右侧内容区：打字机文档 */
#detail-view .detail-right {
    border-left: 2px dashed rgba(0,0,0,0.2); /* 分割线 */
    padding-left: 30px !important;
}

/* 标题 */
#detail-title {
    font-family: 'Russo One', 'Impact', sans-serif !important;
    text-transform: uppercase;
    font-size: 2.2rem !important;
    color: #111 !important;
    border-bottom: 4px solid #111;
    padding-bottom: 10px;
    margin-bottom: 20px !important;
    letter-spacing: 1px;
    line-height: 1.1;
}

/* 正文容器 */
#detail-text {
    font-family: 'Share Tech Mono', 'Courier New', monospace !important;
    font-size: 1.05rem !important;
    color: #333 !important;
    line-height: 1.6 !important;
    text-align: justify; /* 两端对齐，像报纸 */
    
    /* 滚动条区域样式 */
    background-color: rgba(255,255,255,0.4);
    border: 1px solid #aaa;
    padding: 15px;
}

/* 档案风格的滚动条 */
#detail-text::-webkit-scrollbar {
    width: 12px;
    background: #e0e0e0;
    border-left: 1px solid #000;
}
#detail-text::-webkit-scrollbar-thumb {
    background-color: #D80000; /* 鲜艳的红色滑块 */
    border: 1px solid #000;
    border-radius: 0;
    box-shadow: inset 1px 1px 0 rgba(255,255,255,0.5);
}
#detail-text::-webkit-scrollbar-track {
    background-image: linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc), 
                      linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc);
    background-size: 4px 4px;
    background-position: 0 0, 2px 2px;
}

/* 4. 暗色模式适配 (Dark Mode) */
/* 如果系统处于暗色模式，档案变成“底片”或“终端荧光屏”风格 */
:root[data-theme="dark"] #detail-view .detail-content {
    background-color: #121212 !important;
    border-color: #444 !important;
    box-shadow: 
        15px 15px 0 #000,
        inset 0 0 50px rgba(0,0,0,0.8) !important;
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(#D80000, #D80000); /* 红线保持 */
}

:root[data-theme="dark"] #detail-view .detail-content::after {
    border-color: #fff;
    box-shadow: 3px 3px 0 #000;
}

:root[data-theme="dark"] #detail-title {
    color: #f0f0f0 !important;
    border-bottom-color: #D80000;
    text-shadow: 0 0 5px rgba(255,255,255,0.2);
}

:root[data-theme="dark"] #detail-text {
    color: #aaa !important;
    background-color: rgba(0,0,0,0.3);
    border-color: #444;
}

:root[data-theme="dark"] #detail-image {
    border-color: #333 !important;
    filter: grayscale(100%) contrast(1.1) brightness(0.8);
}

/* 5. 移动端适配 */
@media (max-width: 768px) {
    #detail-view .detail-content {
        padding: 50px 20px 20px 20px !important;
        flex-direction: column;
    }
    
    #detail-view .detail-left {
        width: 100% !important;
        padding-right: 0 !important;
        margin-bottom: 20px;
        text-align: center;
    }
    
    #detail-image {
        max-width: 200px;
        transform: rotate(-2deg);
    }
    
    #detail-view .detail-right {
        border-left: none;
        border-top: 2px dashed rgba(0,0,0,0.2);
        padding-left: 0 !important;
        padding-top: 20px;
    }
    
    #detail-view .detail-content::after {
        font-size: 0.8rem;
        padding: 3px 10px;
        top: -15px;
        right: 10px;
    }
}
