body {
    font-family: Arial, sans-serif;
    margin: 0;
    display: flex; /* For tool-sidebar and main-dashboard-content layout */
    height: 100vh;
    overflow: hidden; /* Prevent main scrollbar */
}

/* Tool Sidebar */
#tool-sidebar {
    width: 200px;
    background-color: #333;
    color: #fff;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    overflow-y: auto;
    flex-shrink: 0;
}

#tool-sidebar h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #fff;
}

#tool-sidebar ul {
    list-style: none;
    padding: 0;
}

#tool-sidebar ul li a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #ccc;
    border-radius: 5px;
    margin-bottom: 5px;
}

#tool-sidebar ul li a:hover,
#tool-sidebar ul li a.active {
    background-color: #555;
    color: #fff;
}

/* Main Dashboard Content (wrapper for navigation sidebar and main content area) */
#main-dashboard-content {
    flex-grow: 1;
    display: flex; /* For prototype-navigation-sidebar and main-content-area layout */
    height: 100%;
    overflow: hidden; /* Prevent scrollbar on this wrapper */
}

/* Prototype Navigation Sidebar (inner left sidebar) - base theme */
#prototype-navigation-sidebar {
    width: 250px;
    background-color: #f4f4f4;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    overflow-y: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-nav {
    flex-grow: 1;
}
#prototype-navigation-sidebar ul li a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #555;
    border-radius: 5px;
    margin-bottom: 5px;
    font-family: Arial, sans-serif;
    background: none;
    border: none;
    transition: background 0.2s, color 0.2s;
}
#prototype-navigation-sidebar ul li a:hover,
#prototype-navigation-sidebar ul li a.active {
    background-color: #e0e0e0;
    color: #000;
}

/* 粉色风格（Anime AI Theme） */
body.theme-anime-ai #prototype-navigation-sidebar {
    background: #fff0f6;
    box-shadow: 2px 0 10px rgba(255, 105, 180, 0.08);
}
body.theme-anime-ai #prototype-navigation-sidebar ul li a {
    color: #ff69b4;
    font-family: 'Nunito', sans-serif;
    background: none;
    border-radius: 999px;
}
body.theme-anime-ai #prototype-navigation-sidebar ul li a:hover,
body.theme-anime-ai #prototype-navigation-sidebar ul li a.active {
    background: #ffe4ec;
    color: #c2185b;
}

/* 像素风格（Pixel Theme） */
body.theme-pixel #prototype-navigation-sidebar {
    background: #222;
    border-right: 4px solid #0f0;
    box-shadow: none;
}
body.theme-pixel #prototype-navigation-sidebar ul li a {
    color: #0f0;
    font-family: 'Press Start 2P', cursive;
    background: #333;
    border-radius: 0;
    border-left: 4px solid transparent;
    margin-bottom: 8px;
    transition: background 0.1s, color 0.1s, border-left 0.1s;
}
body.theme-pixel #prototype-navigation-sidebar ul li a:hover,
body.theme-pixel #prototype-navigation-sidebar ul li a.active {
    background: #0a0;
    color: #fff;
    border-left: 4px solid #0f0;
}

/* 仪表盘风格卡片 */
.card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    padding: 24px;
    margin-bottom: 24px;
    transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    transform: translateY(-2px) scale(1.01);
}
body.theme-anime-ai .card {
    background: #fff0f6;
    box-shadow: 0 8px 32px rgba(255, 105, 180, 0.08);
}
body.theme-pixel .card {
    background: #222;
    border: 2px solid #0f0;
    border-radius: 0;
    color: #0f0;
    font-family: 'Press Start 2P', cursive;
}

/* Sidebar 分组与分隔线 */
.sidebar-group {
    margin-bottom: 24px;
}
.sidebar-group-title {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 12px;
    letter-spacing: 1px;
    color: #bbb;
    text-transform: uppercase;
}
.sidebar-separator {
    height: 1px;
    background: #444;
    margin: 16px 0;
    opacity: 0.2;
}

/* Prototype Navigation Sidebar 分组 */
.nav-group {
    margin-bottom: 24px;
}
.nav-group-title {
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #888;
    letter-spacing: 1px;
}

/* Main Content Area (after structure simplification) */
#main-content-area {
    width: 100%;
    height: 100%;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 32px 0 0 0;
    overflow-y: auto;
    gap: 32px;
}

/* 卡片、按钮、输入框等主题适配（已支持 .card、.ai-search-btn、.ai-search-input 等） */

/* 主题下主内容区背景色/渐变覆盖 */
body.theme-anime-ai #main-content-area { background: linear-gradient(135deg, #fff0f6 0%, #fce4ec 100%); }
body.theme-pixel #main-content-area { background: #222; }
body.theme-ghibli #main-content-area { background: url('https://images.unsplash.com/photo-1606741965422-99c2b72d5d07') no-repeat center center fixed; background-size: cover; }
body.theme-dreamy-garden #main-content-area { background: linear-gradient(180deg, #ffe0f7 0%, #b2f2bb 100%); }
body.theme-forest #main-content-area { background: linear-gradient(180deg, #b7e0b2 0%, #e7f5e6 100%); }
body.theme-starry-night #main-content-area { background: linear-gradient(180deg, #232946 0%, #393e6b 100%); }
body.theme-candy #main-content-area { background: linear-gradient(180deg, #ffe0f7 0%, #fff9c4 100%); }
body.theme-seaside #main-content-area { background: linear-gradient(180deg, #d0f0fd 0%, #ffeaa7 100%); }

/* 卡片样式适配（已支持 .card） */

/* 搜索区、按钮、输入框等适配（如有需要可继续细化） */

.search-container {
    display: flex;
}

/* Sidebar Search (Base Theme) */
.sidebar-search-container {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    background: #fff;
    border-radius: 8px;
    padding: 4px 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.sidebar-search-input {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    font-size: 1rem;
    color: #333;
    padding: 6px 8px;
    width: 90%;
}
.sidebar-search-icon {
    color: #888;
    font-size: 1.1em;
    margin-left: 4px;
}

/* Anime AI Search 结构和布局（无色彩） */
.ai-search-body {
    position: relative;
    overflow-x: hidden;
}
.ai-search-container {
    width: 100%;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 20;
}
.ai-search-header {
    text-align: center;
    margin-bottom: 32px;
}
.ai-search-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 16px;
}
.ai-search-desc {
    font-size: 1.25rem;
}
.ai-search-search-section {
    width: 100%;
    max-width: 600px;
    margin-bottom: 48px;
    position: relative;
}
.ai-search-search-box {
    border-radius: 999px;
    display: flex;
    align-items: center;
}
.ai-search-input {
    flex-grow: 1;
    padding: 16px 24px;
    border: 1.5px solid;
    border-radius: 999px;
    font-size: 1rem;
    outline: none;
    background: transparent;
}
.ai-search-btn {
    border: none;
    border-radius: 999px;
    padding: 16px;
    margin-left: 8px;
    cursor: pointer;
    font-size: 1.25rem;
    transition: box-shadow 0.3s, transform 0.3s;
}
.ai-search-btn:hover {
    transition: box-shadow 0.3s, transform 0.3s;
}
.ai-search-voice-btn {
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.2s;
}
.ai-search-suggestions {
    width: 100%;
    max-width: 600px;
    margin-bottom: 32px;
}
.ai-search-suggestions-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
}
.ai-search-suggestion-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.ai-search-suggestion-btn {
    border: none;
    border-radius: 999px;
    padding: 8px 24px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}
.ai-search-results-container {
    width: 90%;
    height: 600px;
}
.ai-search-results-title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 24px;
}
.ai-search-results-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}
.result-card {
    border-radius: 24px;
    padding: 24px;
    transition: box-shadow 0.3s, transform 0.3s;
}
.result-card:hover {
    transition: box-shadow 0.3s, transform 0.3s;
}
.ai-search-loading {
    margin-top: 32px;
    text-align: center;
}
.ai-search-loading-balls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.ai-search-loading-ball {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    animation: ai-bounce 1.2s infinite;
}
.ball2 { animation-delay: 0.2s; }
.ball3 { animation-delay: 0.4s; }
@keyframes ai-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-16px); }
}
.ai-search-loading-text {
    margin-top: 16px;
}
.ai-search-footer {
    width: 100%;
    padding: 16px 0;
    text-align: center;
    position: absolute;
    bottom: 0;
    left: 0;
}

/* 导航/主题按钮高亮 */
#tool-sidebar ul li a.active,
#tool-sidebar ul li a:hover,
#prototype-navigation-sidebar .nav-link.active,
#prototype-navigation-sidebar .nav-link:hover {
    background: linear-gradient(90deg, #ff69b4 0%, #fad0c4 100%);
    color: #fff;
    font-weight: bold;
}
body.theme-anime-ai #tool-sidebar ul li a.active,
body.theme-anime-ai #tool-sidebar ul li a:hover,
body.theme-anime-ai #prototype-navigation-sidebar .nav-link.active,
body.theme-anime-ai #prototype-navigation-sidebar .nav-link:hover {
    background: #ffe4ec;
    color: #c2185b;
}
body.theme-pixel #tool-sidebar ul li a.active,
body.theme-pixel #tool-sidebar ul li a:hover,
body.theme-pixel #prototype-navigation-sidebar .nav-link.active,
body.theme-pixel #prototype-navigation-sidebar .nav-link:hover {
    background: #0a0;
    color: #fff;
    border-left: 4px solid #0f0;
}


.nav-link {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    color: #444;
    text-decoration: none;
    background: #aea1a1;
}
/* 历史记录分组容器样式 */
.sidebar-history-container {
    margin: 18px 0 18px 0;
    padding: 0 0 0 0;
    border-top: 1px solid #ececec;
    border-bottom: 1px solid #ececec;
    padding-top: 12px;
    padding-bottom: 12px;
}
/* 历史记录极简列表 */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}
.history-item {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    color: #444;
    text-decoration: none;
    font-size: 0.98em;
    background: none;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
}
.history-item:hover,
.history-item.active {
    background: #e0e0e0;
    color: #000;
}
body.theme-anime-ai .history-item:hover,
body.theme-anime-ai .history-item.active {
    background: #ffe4ec;
    color: #c2185b;
}
body.theme-pixel .history-item:hover,
body.theme-pixel .history-item.active {
    background: #0a0;
    color: #fff;
    border-left: 4px solid #0f0;
}

/* 响应式优化 */
@media (max-width: 700px) {
    #tool-sidebar {
        display: none;
    }
    #prototype-navigation-sidebar {
        width: 100px;
        padding: 8px;
    }
    #main-content-area {
        padding: 8px;
        gap: 12px;
    }
    .card {
        padding: 12px;
        margin-bottom: 12px;
    }
}

/* 动画粒子背景和角色动画 */
.kawaii-particles {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none; z-index: 1;
}
.particle {
    position: absolute;
    font-size: 20px;
    animation: particleFloat 8s infinite linear;
    user-select: none;
}
@keyframes particleFloat {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}
.anime-character {
    position: absolute;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    pointer-events: none;
}
.float { animation: float 6s ease-in-out infinite; }
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}
.bounce { animation: bounce 2s infinite; }
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.pulse { animation: pulse 2s infinite; }
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
/* 主题动画钩子：不同主题下可覆盖动画元素样式 */
body.theme-anime-ai .anime-character div { background: #ffe4ec; color: #c2185b; }
body.theme-anime-ai .kawaii-particles .particle { color: #ff69b4; }
body.theme-anime-ai .anime-character.float div { background: #ffe4ec; }
body.theme-anime-ai .anime-character.bounce div { background: #ffb6c1; }
body.theme-anime-ai .anime-character.pulse div { background: #fff0f6; }

body.theme-pixel .anime-character div {
    background: #222;
    color: #0f0;
    font-family: 'Press Start 2P', cursive;
    border: 2px solid #0f0;
    box-shadow: 4px 4px 0 #0a0;
}
body.theme-pixel .kawaii-particles .particle {
    color: #0f0;
    font-family: 'Press Start 2P', cursive;
    text-shadow: 2px 2px 0 #0a0;
}
body.theme-pixel .anime-character.float div { background: #333; }
body.theme-pixel .anime-character.bounce div { background: #222; }
body.theme-pixel .anime-character.pulse div { background: #111; }

/* 聊天模拟区块样式 */
.chat-simulate-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px 12px;
    min-width: 260px;
    max-width: 520px;
    margin: 0 auto;
}
.chat-message {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    width: 100%;
}
.user-message {
    flex-direction: row-reverse;
    justify-content: flex-end;
}
.ai-message {
    flex-direction: row;
    justify-content: flex-start;
}
.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f4f4;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    flex-shrink: 0;
}
.user-message .chat-avatar {
    background: #ffe0f6;
}
.ai-message .chat-avatar {
    background: #e0f7fa;
}
.chat-bubble {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 1.05rem;
    background: #f7f7f7;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    word-break: break-all;
    position: relative;
}
.user-message .chat-bubble {
    background: linear-gradient(135deg, #ffe0f6 0%, #fad0c4 100%);
    color: #c2185b;
    border-bottom-right-radius: 6px;
    border-bottom-left-radius: 18px;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    align-self: flex-end;
}
.ai-message .chat-bubble {
    background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
    color: #00796b;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 18px;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    align-self: flex-start;
}
/* 主题适配（举例：动漫AI主题、像素主题） */
body.theme-anime-ai .user-message .chat-bubble {
    background: linear-gradient(135deg, #ffe4ec 0%, #fad0c4 100%);
    color: #c2185b;
}
body.theme-anime-ai .ai-message .chat-bubble {
    background: linear-gradient(135deg, #fff0f6 0%, #e0f7fa 100%);
    color: #ff69b4;
}
body.theme-pixel .chat-bubble {
    font-family: 'Press Start 2P', cursive;
    background: #222;
    color: #0f0;
    border: 2px solid #0f0;
    border-radius: 0;
    box-shadow: 4px 4px 0 #0a0;
}
body.theme-pixel .user-message .chat-bubble {
    background: #333;
    color: #0f0;
    border-left: 4px solid #0f0;
}
body.theme-pixel .ai-message .chat-bubble {
    background: #222;
    color: #0f0;
    border-right: 4px solid #0f0;
}
body.theme-pixel .chat-avatar {
    background: #222;
    color: #0f0;
    border: 2px solid #0f0;
    font-family: 'Press Start 2P', cursive;
}

/* 聊天模拟区块样式修正（适配无嵌套结构） */
.ai-search-results-grid .chat-message {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    width: 100%;
    margin-bottom: 18px;
}
.ai-search-results-grid .user-message {
    flex-direction: row-reverse;
    justify-content: flex-end;
    text-align: right;
}
.ai-search-results-grid .ai-message {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
}
.ai-search-results-grid .user-message .chat-bubble {
    margin-left: 0;
    margin-right: 0;
    margin-left: auto;
}
.ai-search-results-grid .ai-message .chat-bubble {
    margin-right: 0;
    margin-left: 0;
    margin-right: auto;
}

/* 主题适配举例 */
body.theme-anime-ai .ai-search-results-grid .user-message .chat-bubble {
    background: linear-gradient(135deg, #ffe4ec 0%, #fad0c4 100%);
    color: #c2185b;
}
body.theme-anime-ai .ai-search-results-grid .ai-message .chat-bubble {
    background: linear-gradient(135deg, #fff0f6 0%, #e0f7fa 100%);
    color: #ff69b4;
}
body.theme-pixel .ai-search-results-grid .chat-bubble {
    font-family: 'Press Start 2P', cursive;
    background: #222;
    color: #0f0;
    border: 2px solid #0f0;
    border-radius: 0;
    box-shadow: 4px 4px 0 #0a0;
}
body.theme-pixel .ai-search-results-grid .user-message .chat-bubble {
    background: #333;
    color: #0f0;
    border-left: 4px solid #0f0;
}
body.theme-pixel .ai-search-results-grid .ai-message .chat-bubble {
    background: #222;
    color: #0f0;
    border-right: 4px solid #0f0;
}
body.theme-pixel .ai-search-results-grid .chat-avatar {
    background: #222;
    color: #0f0;
    border: 2px solid #0f0;
    font-family: 'Press Start 2P', cursive;
}