:root {
    --primary-color: #e8f4fc;
    --secondary-color: #f0f4f8;
    --accent-color: #7ec8e3;
    --accent-blue: #5ba4c9;
    --text-color: #2c3e50;
    --text-light: #5a6c7d;
    --border-color: #d1dce5;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --holo-color: rgba(126, 200, 227, 0.3);
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e8f4fc 100%);
    --bg-main: #f5f7fa;
    --bg-secondary: #ffffff;
    --card-bg: #ffffff;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --holo-glow: 0 0 20px rgba(126, 200, 227, 0.4);
    /* 阅读界面统一标题色：深蓝，浅色背景对比度 8.79:1，符合 WCAG AA */
    --title-color: #1a4a6e;
}

[data-theme="dark"] {
    --primary-color: #1a1d23;
    --secondary-color: #242830;
    --accent-color: #7ec8e3;
    --accent-blue: #5ba4c9;
    --text-color: #e8f4fc;
    --text-light: #a0b4c8;
    --border-color: #3a4050;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --holo-color: rgba(126, 200, 227, 0.15);
    --bg-gradient: linear-gradient(135deg, #1a1d23 0%, #242830 100%);
    --bg-main: #1a1d23;
    --bg-secondary: #242830;
    --card-bg: #2a2f38;
    --nav-bg: rgba(26, 29, 35, 0.95);
    --holo-glow: 0 0 20px rgba(126, 200, 227, 0.2);
    /* 暗色主题下使用亮蓝，深色背景对比度 8.45:1，符合 WCAG AA */
    --title-color: #6ec1e4;
}

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

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: transform 0.3s ease, background 0.3s;
}

.navbar.nav-hidden {
    transform: translateY(-100%);
}

.navbar.nav-scrolled {
    box-shadow: 0 2px 20px var(--shadow-color);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.8rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent-blue);
}

.logo-icon {
    font-size: 1.5rem;
}

/* 导航栏/聊天界面内联 SVG 图标：随文字字号缩放，跟随主题色 */
.nav-icon,
.ui-icon {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    vertical-align: -0.15em;
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding: 0.3rem 0;
    transition: color 0.3s;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s;
}

.nav-menu a:hover {
    color: var(--accent-blue);
}

.nav-menu a:hover::after {
    width: 100%;
}

.nav-menu a.nav-vip {
    color: #ffc864;
}

.nav-menu a.nav-vip:hover {
    color: #ffdd88;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    cursor: pointer;
    user-select: none;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--nav-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(5px);
}

.nav-dropdown-menu li {
    list-style: none;
}

.nav-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s, color 0.3s;
    white-space: nowrap;
}

.nav-dropdown-menu a:hover {
    background: var(--secondary-color);
    color: var(--accent-blue);
}

.nav-dropdown-menu a::after {
    display: none;
}

.nav-dropdown-menu .nav-vip-item {
    border-top: 1px solid var(--border-color);
    margin-top: 0.3rem;
    padding-top: 0.3rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.search-btn, .theme-btn, .menu-btn, .admin-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.4rem;
    border-radius: 8px;
    transition: background 0.3s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover, .theme-btn:hover, .admin-btn:hover {
    background: var(--secondary-color);
}

.menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 0.5rem;
}

.menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-color);
    transition: transform 0.3s;
}

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-box {
    display: flex;
    gap: 1rem;
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
}

.search-box input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--secondary-color);
    color: var(--text-color);
    outline: none;
    transition: border-color 0.3s;
}

.search-box input:focus {
    border-color: var(--accent-color);
}

.search-box button {
    padding: 0.8rem 2rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.search-box button:hover {
    background: var(--accent-blue);
}

.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-color);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s, visibility 0.5s;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    display: flex;
    gap: 0.5rem;
}

.holo-dot {
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: holo-pulse 1.4s infinite ease-in-out both;
}

.holo-dot:nth-child(1) { animation-delay: -0.32s; }
.holo-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes holo-pulse {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
        box-shadow: var(--holo-glow);
    }
}

.main-content {
    padding-top: 70px;
    min-height: calc(100vh - 70px);
    opacity: 0;
    transition: opacity 0.5s ease 0.3s;
}

.main-content.loaded {
    opacity: 1;
}

.home-page {
    min-height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.home-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
}

.home-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
}

.holo-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 15s infinite ease-in-out;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.6;
    }
    25% {
        transform: translateY(-100px) translateX(50px);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-50px) translateX(-30px);
        opacity: 0.4;
    }
    75% {
        transform: translateY(-150px) translateX(20px);
        opacity: 0.7;
    }
}

.home-content {
    text-align: center;
    padding: 2rem;
    z-index: 1;
}

.home-banner {
    max-width: 600px;
    max-height: 500px;
    border-radius: 16px;
    box-shadow: var(--holo-glow);
    margin-bottom: 2rem;
    animation: banner-glow 3s ease-in-out infinite;
}

@keyframes banner-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(126, 200, 227, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(126, 200, 227, 0.6);
    }
}

.home-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 30px rgba(126, 200, 227, 0.5);
}

.home-title-en {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.home-slogan {
    font-size: 1.5rem;
    color: var(--text-color);
    font-style: italic;
    padding: 1rem 2rem;
    border-left: 3px solid var(--accent-color);
    background: var(--holo-color);
    display: inline-block;
}

.recent-updates {
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin: 3rem auto 0;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px var(--shadow-color);
}

.recent-title {
    text-align: center;
    font-size: 1.5rem;
    color: var(--accent-blue);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.recent-title-icon {
    color: var(--accent-color);
    font-size: 0.8rem;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--holo-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.recent-item:hover {
    background: rgba(126, 200, 227, 0.1);
    border-color: var(--accent-color);
    transform: translateX(5px);
}

.recent-type {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: var(--accent-color);
    color: var(--bg-color);
    font-weight: 600;
    white-space: nowrap;
}

.recent-type.type-blog {
    background: linear-gradient(135deg, #7ec8e3, #5ba3c0);
}

.recent-type.type-gallery {
    background: linear-gradient(135deg, #f5a9b8, #e891a0);
}

.recent-type.type-story {
    background: linear-gradient(135deg, #b8e0d2, #9cc9bc);
}

.recent-item-title {
    flex: 1;
    color: var(--text-color);
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-time {
    color: var(--text-light);
    font-size: 0.8rem;
    white-space: nowrap;
}

.recent-empty {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
    font-style: italic;
}

.page-header {
    padding: 8rem 2rem 4rem;
    text-align: center;
    background: linear-gradient(180deg, var(--holo-color) 0%, transparent 100%);
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--title-color);
    margin-bottom: 1rem;
}

.page-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.oc-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.oc-card {
    position: relative;
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(100, 200, 255, 0.04) 100%);
    border-radius: 16px;
    padding: 1.75rem 1.75rem 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px var(--shadow-color);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.75rem;
    align-items: stretch;
}

.oc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-blue) 0%, var(--accent-color) 100%);
}

.oc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px var(--shadow-color);
}

.oc-card-main {
    min-width: 0;
}

.oc-card-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin: 0 0 1.25rem;
    padding: 0 0 0.6rem 0.5rem;
    border-bottom: 2px dashed var(--border-color);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.oc-card-title::before {
    content: '▍';
    color: var(--accent-color);
    font-size: 1.1rem;
    line-height: 1;
}

.oc-basic-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem 1.5rem;
}

.info-item {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    column-gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    background: var(--secondary-color);
    border-radius: 8px;
    border-left: 2px solid transparent;
    transition: border-color 0.3s, background 0.3s;
    min-height: 2.2rem;
}

.info-item:hover {
    border-left-color: var(--accent-blue);
    background: rgba(100, 200, 255, 0.08);
}

.info-label {
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.info-label::after {
    content: '：';
    color: var(--accent-blue);
    margin-left: 1px;
}

.info-value {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.98rem;
    line-height: 1.4;
    word-break: break-word;
}

.oc-special-mark {
    margin-top: 1.25rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, rgba(100, 200, 255, 0.08) 0%, rgba(100, 200, 255, 0.02) 100%);
    border: 1px dashed var(--accent-color);
    border-radius: 10px;
    position: relative;
}

.oc-special-mark .info-label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-blue);
    background: var(--card-bg);
    padding: 0.15rem 0.6rem;
    border-radius: 4px;
    margin-bottom: 0.4rem;
}

.oc-special-mark .info-label::before {
    content: '✦';
    color: var(--accent-color);
    font-size: 0.9rem;
}

.oc-special-mark .info-value {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
}

/* 轮播图 */
.oc-carousel {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--secondary-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    aspect-ratio: 3 / 4;
    width: 100%;
    height: 100%;
    min-height: 320px;
    align-self: stretch;
}

.oc-carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.oc-carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.oc-carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.oc-carousel-slide:hover img {
    transform: scale(1.05);
}

.oc-carousel-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.7rem 0.85rem;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.oc-carousel-title {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
}

.oc-carousel-painter {
    font-size: 0.72rem;
    opacity: 0.85;
}

.oc-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s, background 0.3s, transform 0.3s;
    z-index: 2;
    padding: 0;
}

.oc-carousel:hover .oc-carousel-btn {
    opacity: 1;
}

.oc-carousel-btn:hover {
    background: var(--accent-blue);
}

.oc-carousel-prev {
    left: 0.5rem;
}

.oc-carousel-next {
    right: 0.5rem;
}

.oc-carousel-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.6rem;
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    z-index: 2;
}

.oc-carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s, width 0.3s;
}

.oc-carousel-dot.active {
    background: #fff;
    width: 18px;
    border-radius: 3px;
}

.oc-carousel-dot:hover {
    background: rgba(255, 255, 255, 0.85);
}

.oc-card > div[style*="margin-top"] {
    margin-top: 1.25rem !important;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, rgba(100, 200, 255, 0.08) 0%, rgba(100, 200, 255, 0.02) 100%);
    border: 1px dashed var(--accent-color);
    border-radius: 10px;
    position: relative;
}

.oc-card > div[style*="margin-top"] .info-label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-blue);
    background: var(--card-bg);
    padding: 0.15rem 0.6rem;
    border-radius: 4px;
    margin-bottom: 0.4rem;
}

.oc-card > div[style*="margin-top"] .info-label::before {
    content: '✦';
    color: var(--accent-color);
    font-size: 0.9rem;
}

.oc-card > div[style*="margin-top"] .info-value {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
}

.oc-content {
    position: relative;
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(100, 200, 255, 0.04) 100%);
    border-radius: 16px;
    padding: 1.75rem 1.75rem 1.5rem;
    margin-bottom: 1.75rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px var(--shadow-color);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.oc-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-blue) 0%, var(--accent-color) 100%);
}

.oc-content:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px var(--shadow-color);
}

.oc-content h3 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--title-color);
    margin: 0 0 1.25rem;
    padding: 0 0 0.6rem 0.5rem;
    border-bottom: 2px dashed var(--border-color);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.oc-content h3::before {
    content: '▍';
    color: var(--accent-color);
    font-size: 1.1rem;
    line-height: 1;
}

.oc-content p {
    color: var(--text-color);
    line-height: 1.85;
    margin: 0 0 0.85rem;
    font-size: 0.95rem;
}

.oc-content div {
    white-space: pre-wrap;
    color: var(--text-color);
    line-height: 1.85;
    font-size: 0.95rem;
    padding: 0 0.5rem;
}

.oc-content div:empty::before,
.oc-content div:empty::after {
    content: '';
}

.oc-content div:not(:empty) {
    position: relative;
}

/* 列表项样式 - 让 - 开头的项目更清晰 */
.oc-content div > *,
.oc-content div {
    color: var(--text-color);
}

.story-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.story-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px var(--shadow-color);
}

.story-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.story-info {
    padding: 1.2rem;
}

.story-title {
    font-size: 1.2rem;
    color: var(--accent-blue);
    margin-bottom: 0.4rem;
}

.story-summary {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-meta {
    margin-bottom: 0.5rem;
}

.story-category {
    display: inline-block;
    background: rgba(100, 200, 255, 0.15);
    color: var(--accent-blue);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.category-tab {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.category-tab:hover {
    background: rgba(100, 200, 255, 0.1);
    border-color: var(--accent-blue);
}

.category-tab.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.category-tree {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
}

.category-parent {
    margin-bottom: 0.5rem;
}

.category-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--secondary-color);
    border-radius: 8px;
    gap: 1rem;
}

.category-row.child {
    background: rgba(100, 200, 255, 0.05);
    margin-top: 0.5rem;
    margin-left: 2rem;
}

.category-name {
    font-weight: 500;
    min-width: 120px;
}

/* ============ 故事页：上次读到 / 更新至 / 最近阅读 / 阅读进度 ============ */

/* 上次读到 */
.story-last-read {
    background: linear-gradient(135deg, rgba(100, 200, 255, 0.12), rgba(180, 130, 255, 0.12));
    border: 1px solid rgba(100, 200, 255, 0.25);
    border-radius: 14px;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.story-last-read::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(100, 200, 255, 0.05) 50%, transparent 100%);
    pointer-events: none;
}

.story-last-read-empty {
    background: var(--card-bg);
    border-style: dashed;
}

.last-read-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--accent-blue);
    background: rgba(100, 200, 255, 0.15);
    padding: 0.18rem 0.7rem;
    border-radius: 999px;
    margin-bottom: 0.7rem;
    font-weight: 500;
}

.badge-icon {
    font-size: 0.9rem;
}

.last-read-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.last-read-info {
    flex: 1;
    min-width: 0;
}

.last-read-category {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-bottom: 0.2rem;
}

.last-read-chapter {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--title-color);
    margin-bottom: 0.35rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.last-read-summary {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.last-read-progress {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.4rem;
}

.progress-bar-wrap {
    flex: 1;
    max-width: 240px;
    height: 6px;
    background: rgba(100, 200, 255, 0.15);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar-wrap.small {
    height: 4px;
    max-width: 80px;
    flex: 0 0 80px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), #a8edea);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.78rem;
    color: var(--text-light);
    white-space: nowrap;
}

.last-read-action {
    flex-shrink: 0;
}

.resume-btn {
    background: var(--accent-blue);
    color: #fff;
    border: none;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.resume-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(100, 200, 255, 0.3);
}

.last-read-empty {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
}

.story-login-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    margin-left: 0.4rem;
    border-bottom: 1px dashed currentColor;
}

.story-login-link:hover {
    color: var(--accent-blue);
    opacity: 0.8;
}

/* 更新至 */
.story-latest-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(90deg, #fff7e6 0%, #ffe7c2 100%);
    color: #b85a00;
    border: 1px solid #ffd591;
    border-radius: 12px;
    padding: 0.85rem 1.2rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 2px 8px rgba(255, 173, 87, 0.12);
}

[data-theme="dark"] .story-latest-bar {
    background: linear-gradient(90deg, rgba(255, 173, 87, 0.18), rgba(255, 136, 0, 0.15));
    border-color: rgba(255, 173, 87, 0.35);
    color: #ffc78a;
}

.latest-bar-left {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    min-width: 0;
    flex: 1;
}

.latest-label {
    font-weight: 600;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.latest-chapter {
    font-size: 1.05rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.latest-total {
    font-weight: 400;
    font-size: 0.85rem;
    opacity: 0.8;
    margin-left: 0.2rem;
}

.latest-bar-right {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-shrink: 0;
}

.latest-time {
    font-size: 0.8rem;
    opacity: 0.75;
}

.latest-go {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.latest-go:hover {
    opacity: 0.8;
}

.go-arrow {
    display: inline-block;
    margin-left: 0.2rem;
    transition: transform 0.2s;
}

.latest-go:hover .go-arrow {
    transform: translateX(3px);
}

/* 章节段落标题行 */
.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.9rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-title {
    font-size: 1.05rem;
    color: var(--text-color);
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

/* 最近阅读标题：使用蓝色 (#5ba4c9)，与 h3、story-title 保持一致
   浅色背景对比度 3.07:1（用于较大字号标题，可读性满足）
   暗色背景（#1a1d23）对比度 5.83:1，符合 WCAG AA */
.story-recent-list .section-title-row .section-title {
    color: #5ba4c9;
}

/* 故事页 - 目录标题：使用蓝色 #5badd9，浅色背景对比度约 3.16:1 */
.story-page .story-section .section-title-row .section-title {
    color: #5badd9;
}

/* 故事页 - "已更新至"信息条：文字色统一为蓝色 #5badd9 */
.story-page .story-latest-bar {
    color: #5badd9;
}

.section-count {
    font-size: 0.82rem;
    color: var(--text-light);
    font-weight: 400;
}

.section-tip {
    font-size: 0.8rem;
    color: var(--text-light);
}

.section-tools {
    display: flex;
    gap: 0.5rem;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.tool-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.tool-btn.active {
    background: rgba(100, 200, 255, 0.12);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.tool-icon {
    font-size: 0.95rem;
}

/* 最近阅读 */
.story-recent-list {
    margin-bottom: 1.5rem;
}

.recent-list-inner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.8rem;
}

.recent-read-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.recent-read-item:hover {
    border-color: var(--accent-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--shadow-color);
}

.recent-read-main {
    flex: 1;
    min-width: 0;
}

.recent-read-chapter {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 0.25rem;
}

.recent-read-meta {
    display: flex;
    gap: 0.6rem;
    font-size: 0.78rem;
    color: var(--text-light);
}

.recent-cat {
    color: var(--accent-blue);
}

/* 故事段落 */
.story-section {
    margin-top: 0.5rem;
}

.story-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

/* 卡片进度标签 */
.story-progress-tag {
    display: inline-block;
    background: rgba(82, 196, 26, 0.15);
    color: #389e0d;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 500;
    margin-left: 0.4rem;
}

[data-theme="dark"] .story-progress-tag {
    background: rgba(82, 196, 26, 0.22);
    color: #95de64;
}

/* 故事详情页：阅读进度条 */
.reading-progress-bar {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(100, 200, 255, 0.12);
    z-index: 50;
}

.reading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), #a8edea);
    transition: width 0.15s ease-out;
    box-shadow: 0 0 8px rgba(100, 200, 255, 0.4);
}


.category-slug {
    color: var(--text-light);
    font-size: 0.85rem;
    background: rgba(100, 200, 255, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.category-status {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(200, 200, 200, 0.2);
    color: var(--text-light);
}

.category-status.is-show {
    background: rgba(100, 200, 100, 0.2);
    color: #4caf50;
}

.category-actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

.add-sub-btn {
    background: rgba(100, 200, 255, 0.2);
    color: var(--accent-blue);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s;
}

.add-sub-btn:hover {
    background: rgba(100, 200, 255, 0.3);
}

.category-children {
    margin-top: 0.5rem;
}

.category-sub-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-left: 1rem;
    margin-top: 0.5rem;
}

.category-sub-tab {
    background: rgba(100, 200, 255, 0.1);
    color: var(--text-light);
    border: 1px solid transparent;
    padding: 0.3rem 0.7rem;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s;
}

.category-sub-tab:hover {
    background: rgba(100, 200, 255, 0.2);
}

.category-sub-tab.active {
    background: rgba(100, 200, 255, 0.3);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.story-detail-page .page-header,
.blog-detail-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.story-detail-page .page-header .page-title,
.blog-detail-page .page-header .page-title {
    color: var(--title-color);
}

.story-detail-page .back-btn,
.blog-detail-page .back-btn {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.story-detail-page .back-btn:hover,
.blog-detail-page .back-btn:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.story-detail-page .story-cover {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 2rem;
}

.story-detail-page .story-content {
    line-height: 1.8;
    font-size: 1.1rem;
}

.story-detail-page .story-content p {
    margin-bottom: 1rem;
}

.story-detail-page .story-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 2rem 0 1rem 0;
    color: var(--title-color);
    border-bottom: 2px solid var(--accent-blue);
    padding-bottom: 0.5rem;
}

.story-detail-page .story-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 1.8rem 0 1rem 0;
    color: var(--title-color);
}

.story-detail-page .story-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1.5rem 0 0.8rem 0;
    color: var(--title-color);
}

.story-detail-page .story-content h4 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 1.2rem 0 0.6rem 0;
    color: var(--title-color);
}

.story-detail-page .story-content h5 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem 0;
    color: var(--title-color);
}

.story-detail-page .story-content h6 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.8rem 0 0.5rem 0;
    color: var(--title-color);
    opacity: 0.85;
}

.story-detail-page .story-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

.story-detail-page .story-content blockquote {
    border-left: 4px solid var(--accent-blue);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--text-light);
    font-style: italic;
}

.story-detail-page .story-content ul,
.story-detail-page .story-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.story-detail-page .story-content li {
    margin-bottom: 0.5rem;
}

.story-detail-page .story-content code {
    background: var(--card-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

.story-detail-page .story-content pre {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

.story-detail-page .story-content pre code {
    background: none;
    padding: 0;
}

.chapter-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.chapter-nav-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    max-width: 45%;
}

.chapter-nav-btn:hover:not(.disabled) {
    background: rgba(100, 200, 255, 0.1);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 200, 255, 0.2);
}

.chapter-nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chapter-nav-btn.prev {
    justify-content: flex-start;
}

.chapter-nav-btn.next {
    justify-content: flex-end;
}

.nav-arrow {
    font-size: 1.5rem;
    color: var(--accent-blue);
    font-weight: bold;
}

.nav-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: left;
}

.chapter-nav-btn.next .nav-text {
    text-align: right;
}

.nav-label {
    font-size: 0.8rem;
    color: var(--text-light);
}

.nav-title {
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

@media (max-width: 768px) {
    .chapter-nav {
        flex-direction: column;
    }
    
    .chapter-nav-btn {
        max-width: 100%;
    }
    
    .nav-title {
        max-width: 150px;
    }
}

.float-ball {
    position: fixed;
    right: 20px;
    bottom: 80px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #7ec8e3 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(91, 164, 201, 0.4);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.float-ball:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(91, 164, 201, 0.6);
}

.float-ball.expanded {
    transform: scale(1.15);
    box-shadow: 0 8px 40px rgba(91, 164, 201, 0.7);
}

.float-ball-icon {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.float-ball.expanded .float-ball-icon {
    transform: rotate(90deg);
}

.float-menu {
    position: absolute;
    right: 70px;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.float-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--card-bg);
    border-radius: 28px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    border: 1px solid var(--border-color);
}

.float-menu-item:hover {
    background: rgba(100, 200, 255, 0.15);
    transform: translateX(-5px);
    box-shadow: 0 6px 20px rgba(91, 164, 201, 0.3);
}

.float-menu-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.float-menu-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #7ec8e3 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    font-weight: bold;
}

.float-menu-text {
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: 500;
}

.chat-float-menu-btn {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #60a5fa 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    z-index: 1002;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    user-select: none;
    -webkit-user-select: none;
    flex-shrink: 0;
}

.chat-float-menu-panel {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem 0;
    min-width: 180px;
    max-width: calc(100vw - 20px);
    z-index: 1002;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.chat-float-menu-item {
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-float-menu-item:hover {
    background: var(--hover-bg);
}

.chat-float-menu-item:active {
    background: var(--active-bg);
}

/* ========== 生成小说弹窗 ========== */
.generate-novel-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
    box-sizing: border-box;
    backdrop-filter: blur(2px);
}

.generate-novel-dialog {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: generate-novel-fade-in 0.25s ease-out;
}

@keyframes generate-novel-fade-in {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.generate-novel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.generate-novel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 600;
}

.generate-novel-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.generate-novel-close:hover:not(:disabled) {
    background: var(--hover-bg);
    color: var(--text-color);
}

.generate-novel-close:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.generate-novel-body {
    padding: 20px;
    overflow-y: auto;
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.6;
}

.generate-novel-intro {
    margin: 0 0 16px 0;
    color: var(--text-color);
}

.generate-novel-intro strong {
    color: var(--primary-color, #5c6bc0);
    font-weight: 600;
}

.generate-novel-info {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.generate-novel-info .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.generate-novel-info .info-row + .info-row {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
}

.generate-novel-info .info-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.generate-novel-info .info-value {
    color: var(--text-color);
    font-weight: 600;
}

.generate-novel-info .info-warn {
    color: #f59e0b;
    font-size: 0.85rem;
}

.generate-novel-tips {
    margin: 0 0 16px 0;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.7;
}

.generate-novel-tips li {
    margin-bottom: 4px;
}

.generate-novel-error {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    border-left: 3px solid #ef4444;
    margin-top: 8px;
    word-break: break-word;
}

.generate-novel-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.generate-novel-cancel,
.generate-novel-confirm {
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 0.92rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.2s, color 0.2s, opacity 0.2s;
    font-weight: 500;
}

.generate-novel-cancel {
    background: var(--bg-primary);
    color: var(--text-color);
    border-color: var(--border-color);
}

.generate-novel-cancel:hover:not(:disabled) {
    background: var(--hover-bg);
}

.generate-novel-confirm {
    background: var(--primary-color, #5c6bc0);
    color: #ffffff;
}

.generate-novel-confirm:hover:not(:disabled) {
    filter: brightness(1.1);
}

.generate-novel-cancel:disabled,
.generate-novel-confirm:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ========== 字数选择 + 文风选择（生成小说弹窗内） ========== */
.gn-form-group {
    margin-bottom: 14px;
}

.gn-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.gn-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.gn-label-row .gn-label {
    margin-bottom: 0;
}

.gn-radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gn-radio-pill {
    flex: 1;
    min-width: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 6px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-color);
    font-size: 0.85rem;
    transition: all 0.2s;
    text-align: center;
}

.gn-radio-pill:hover {
    border-color: var(--primary-color, #5c6bc0);
    background: var(--hover-bg);
}

.gn-radio-pill.active {
    border-color: var(--primary-color, #5c6bc0);
    background: rgba(92, 107, 192, 0.12);
    color: var(--primary-color, #5c6bc0);
    font-weight: 600;
}

.gn-radio-num {
    font-size: 0.7rem;
    opacity: 0.75;
    margin-top: 2px;
}

.gn-empty {
    background: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.gn-empty a {
    color: var(--primary-color, #5c6bc0);
    cursor: pointer;
    text-decoration: underline;
    margin-left: 4px;
}

.gn-style-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
}

.gn-style-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.gn-style-item:hover {
    border-color: var(--primary-color, #5c6bc0);
}

.gn-style-item.active {
    border-color: var(--primary-color, #5c6bc0);
    background: rgba(92, 107, 192, 0.1);
}

.gn-style-radio {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
    position: relative;
    background: var(--bg-primary);
}

.gn-style-item.active .gn-style-radio {
    border-color: var(--primary-color, #5c6bc0);
}

.gn-style-item.active .gn-style-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--primary-color, #5c6bc0);
    border-radius: 50%;
}

.gn-style-info {
    flex: 1;
    min-width: 0;
}

.gn-style-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gn-tag-default {
    font-size: 0.7rem;
    background: var(--primary-color, #5c6bc0);
    color: #fff;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.gn-style-preview {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.gn-style-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.gn-style-card {
    align-items: center;
    cursor: default;
}

.gn-style-card:hover {
    border-color: var(--border-color);
}

.gn-style-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.gn-link-btn {
    background: transparent;
    border: none;
    color: var(--primary-color, #5c6bc0);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 2px 6px;
    transition: opacity 0.2s;
}

.gn-link-btn:hover:not(:disabled) {
    text-decoration: underline;
}

.gn-link-btn:disabled {
    color: var(--text-secondary);
    cursor: default;
}

.gn-link-btn.danger {
    color: #ef4444;
}

.gn-input,
.gn-textarea {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 0.88rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.gn-input:focus,
.gn-textarea:focus {
    outline: none;
    border-color: var(--primary-color, #5c6bc0);
}

.gn-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.gn-counter {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
    opacity: 0.75;
}

.gn-checkbox-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--text-color);
    cursor: pointer;
}

/* ========== 文风样本管理弹窗 ========== */
.style-manager-dialog {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: generate-novel-fade-in 0.25s ease-out;
}

.style-manager-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.sm-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.sm-tab:hover {
    color: var(--text-color);
}

.sm-tab.active {
    color: var(--primary-color, #5c6bc0);
    border-bottom-color: var(--primary-color, #5c6bc0);
    background: var(--bg-primary);
}

.style-manager-body {
    padding: 18px 20px;
    overflow-y: auto;
    flex: 1;
}

@media (max-width: 768px) {
    .float-ball {
        right: 15px;
        bottom: 70px;
        width: 50px;
        height: 50px;
    }
    
    .float-ball-icon {
        font-size: 1.3rem;
    }
    
    .float-menu {
        right: 60px;
    }
    
    .float-menu-item {
        padding: 10px 16px;
    }
    
    .float-menu-icon {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .float-menu-text {
        font-size: 0.85rem;
    }
}

.blog-detail-page .blog-detail-title {
    font-size: 2rem;
    color: var(--accent-blue);
    margin-bottom: 1rem;
}

.blog-detail-page .blog-detail-cover {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 2rem;
}

.blog-detail-page .blog-detail-content {
    line-height: 1.8;
    font-size: 1.1rem;
}

.blog-detail-page .blog-detail-content p {
    margin-bottom: 1rem;
}

.blog-detail-page .blog-detail-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 2rem 0 1rem 0;
    color: var(--text-color);
    border-bottom: 2px solid var(--accent-blue);
    padding-bottom: 0.5rem;
}

.blog-detail-page .blog-detail-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 1.8rem 0 1rem 0;
    color: var(--text-color);
}

.blog-detail-page .blog-detail-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1.5rem 0 0.8rem 0;
    color: var(--text-color);
}

.blog-detail-page .blog-detail-content h4 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 1.2rem 0 0.6rem 0;
    color: var(--text-color);
}

.blog-detail-page .blog-detail-content h5 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem 0;
    color: var(--text-color);
}

.blog-detail-page .blog-detail-content h6 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.8rem 0 0.5rem 0;
    color: var(--text-light);
}

.blog-detail-page .blog-detail-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

.blog-detail-page .blog-detail-content blockquote {
    border-left: 4px solid var(--accent-blue);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--text-light);
    font-style: italic;
}

.blog-detail-page .blog-detail-content ul,
.blog-detail-page .blog-detail-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.blog-detail-page .blog-detail-content li {
    margin-bottom: 0.5rem;
}

.blog-detail-page .blog-detail-content code {
    background: var(--card-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

.blog-detail-page .blog-detail-content pre {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

.blog-detail-page .blog-detail-content pre code {
    background: none;
    padding: 0;
}

.blog-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.blog-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px var(--shadow-color);
}

.blog-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--secondary-color);
}

.blog-info {
    padding: 1.5rem;
}

.blog-title {
    font-size: 1.3rem;
    color: var(--accent-blue);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.blog-tag {
    padding: 0.2rem 0.6rem;
    background: var(--holo-color);
    color: var(--accent-blue);
    border-radius: 4px;
    font-size: 0.8rem;
}

.blog-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 3rem;
    margin: 2rem auto;
    max-width: 900px;
    border: 1px solid var(--border-color);
}

.blog-content h1 {
    color: var(--accent-blue);
    margin-bottom: 1.5rem;
}

.gallery-filters {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 2rem;
    padding: 0.5rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.gallery-filters::-webkit-scrollbar {
    display: none;
}

.gallery-filters .filter-btn {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .gallery-filters {
        flex-wrap: wrap;
        overflow-x: visible;
        padding-right: 0.5rem;
    }

    .gallery-filters .filter-btn {
        flex-shrink: 1;
        padding: 0.5rem 1.1rem;
        font-size: 0.88rem;
    }
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    background: var(--secondary-color);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-color);
    transition: all 0.3s;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 3/4;
}

.img-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: linear-gradient(135deg, var(--bg-secondary) 25%, var(--bg-primary) 50%, var(--bg-secondary) 75%);
}

.img-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-secondary) 25%, var(--bg-primary) 50%, var(--bg-secondary) 75%);
    background-size: 200% 200%;
    animation: shimmer 1.5s ease-in-out infinite;
    transition: opacity 0.5s ease-out;
}

.img-placeholder.shimmer {
    animation: shimmer 1.5s ease-in-out infinite;
}

.img-placeholder.error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--secondary-color);
    color: var(--text-light);
}

.img-error-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.img-error-text {
    font-size: 0.8rem;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.img-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    filter: blur(10px);
    transform: scale(1.05);
    transition: opacity 0.5s ease-out, filter 0.5s ease-out, transform 0.5s ease-out;
}

.img-thumb.loaded {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
}

.gallery-item:hover .img-thumb.loaded {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-title {
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.gallery-painter {
    font-size: 0.85rem;
    opacity: 0.8;
}

.gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    background: none;
    border: none;
}

.lightbox-info {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
}

.author-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.author-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 3rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.author-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.5rem;
    border: 4px solid var(--accent-color);
    box-shadow: var(--holo-glow);
}

.author-content h3 {
    color: var(--accent-blue);
    margin-bottom: 1rem;
}

.author-content p {
    color: var(--text-color);
    line-height: 1.8;
    margin-bottom: 1rem;
    text-align: left;
}

.author-social {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--secondary-color);
    border-radius: 25px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s;
}

.social-link:hover {
    background: var(--accent-color);
    color: white;
}

.account-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.account-modal-content {
    background: var(--secondary-color);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    position: relative;
    border: 1px solid var(--accent-blue);
    box-shadow: 0 0 30px rgba(100, 200, 255, 0.3);
    min-width: 280px;
}

.account-modal-content .close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-gray);
    transition: color 0.3s;
}

.account-modal-content .close-btn:hover {
    color: var(--accent-blue);
}

.account-modal-content h3 {
    color: var(--accent-blue);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.account-number {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-color);
    margin: 1rem 0;
    padding: 0.8rem;
    background: rgba(100, 200, 255, 0.1);
    border-radius: 8px;
    word-break: break-all;
}

.account-tip {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.page-btn {
    padding: 0.6rem 1rem;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.3s;
}

.page-btn:hover, .page-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--accent-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(126, 200, 227, 0.4);
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(126, 200, 227, 0.6);
}

.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0.6rem 0.8rem;
        gap: 0.4rem;
    }

    .nav-logo {
        font-size: 1rem;
        flex-shrink: 0;
    }

    .logo-icon {
        font-size: 1.2rem;
    }

    .logo-text {
        display: none;
    }

    .nav-actions {
        gap: 0.25rem;
        flex-shrink: 0;
    }

    .search-btn, .theme-btn, .menu-btn, .admin-btn, .user-btn {
        font-size: 1rem;
        padding: 0.35rem;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--nav-bg);
        flex-direction: column;
        padding: 2rem;
        gap: 1rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-dropdown {
        position: relative;
        width: 100%;
    }

    .nav-dropdown-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.6rem 0;
        width: auto;
    }

    .nav-dropdown-menu {
        position: relative;
        transform: none;
        background: transparent;
        border: none;
        padding: 0;
        padding-left: 1rem;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        display: none;
        width: 100%;
        box-sizing: border-box;
    }

    .nav-dropdown-menu.active {
        display: block;
    }

    .nav-dropdown-menu a {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.8rem 1rem;
        color: var(--text-color);
        text-decoration: none;
        font-weight: 500;
        transition: background 0.3s, color 0.3s;
        white-space: normal;
        overflow: hidden;
    }

    .nav-dropdown-menu a:hover {
        background: var(--secondary-color);
        color: var(--accent-blue);
    }

    .nav-dropdown-menu a::after {
        display: none;
    }

    .nav-dropdown-menu .nav-vip-item {
        border-top: none;
        margin-top: 0;
        padding-top: 0;
    }

    .menu-btn {
        display: flex;
    }

    .home-title {
        font-size: 2rem;
    }

    .home-slogan {
        font-size: 1.2rem;
    }

    .page-title {
        font-size: 1.8rem;
    }

    .oc-card {
        padding: 1.4rem 1.4rem 1.2rem;
        border-radius: 14px;
        grid-template-columns: 1fr 220px;
        gap: 1.25rem;
    }

    .oc-card-title {
        font-size: 1.05rem;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }

    .oc-basic-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem 0.75rem;
    }

    .info-item {
        padding: 0.45rem 0.6rem;
    }

    .info-value {
        font-size: 0.9rem;
    }

    .oc-content {
        padding: 1.4rem 1.4rem 1.2rem;
        border-radius: 14px;
        margin-bottom: 1.25rem;
    }

    .oc-content h3 {
        font-size: 1.05rem;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }

    .oc-content p,
    .oc-content div {
        font-size: 0.9rem;
        line-height: 1.75;
    }

    .oc-basic-info {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .info-item {
        padding: 0.5rem 0.7rem;
        gap: 0.5rem;
    }

    .info-label {
        font-size: 0.75rem;
        min-width: 3.2em;
    }

    .info-value {
        font-size: 0.9rem;
    }

    .blog-list, .story-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .story-card {
        border-radius: 8px;
    }
    
    .story-card img {
        width: 100%;
        height: 80px;
    }
    
    .story-info {
        padding: 0.5rem;
    }
    
    .story-title {
        font-size: 0.8rem;
        margin-bottom: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .story-summary {
        display: none;
    }
    
    .story-meta {
        margin-bottom: 0;
    }
    
    .story-category {
        font-size: 0.6rem;
        padding: 0.1rem 0.4rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .gallery-item {
        aspect-ratio: 1/1;
    }

    .author-card {
        padding: 1.5rem;
    }

    .author-avatar {
        width: 100px;
        height: 100px;
    }

    .author-content h3 {
        font-size: 1.1rem;
    }

    .page-container {
        padding: 1rem;
    }

    .story-detail-page .page-header,
    .blog-detail-page .page-header {
        margin-bottom: 1.5rem;
    }

    .story-detail-page .back-btn,
    .blog-detail-page .back-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
        border-radius: 20px;
        background: rgba(100, 200, 255, 0.1);
        border: none;
    }

    .story-detail-page .back-btn:hover,
    .blog-detail-page .back-btn:hover {
        background: var(--accent-blue);
        transform: translateX(-3px);
    }

    .story-detail-page .page-title,
    .blog-detail-page .blog-detail-title {
        font-size: 1.4rem;
    }

    .page-header {
        padding: 6rem 1rem 2.5rem;
    }

    .page-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0.5rem 0.6rem;
    }

    .nav-logo {
        font-size: 0.95rem;
    }

    .nav-actions {
        gap: 0.15rem;
    }

    .search-btn, .theme-btn, .menu-btn, .admin-btn, .user-btn {
        font-size: 0.95rem;
        padding: 0.3rem;
    }

    .admin-btn {
        display: none;
    }

    .gallery-filters .filter-btn {
        padding: 0.45rem 0.9rem;
        font-size: 0.85rem;
    }

    .page-header {
        padding: 5.5rem 0.8rem 2rem;
    }

    .oc-card {
        padding: 0.9rem 0.9rem 0.8rem;
        border-radius: 10px;
        grid-template-columns: 1fr 130px;
        gap: 0.6rem;
    }

    .oc-card-title {
        font-size: 0.88rem;
        margin-bottom: 0.7rem;
        padding-bottom: 0.4rem;
        letter-spacing: 0.3px;
        gap: 0.4rem;
    }

    .oc-card-title::before {
        font-size: 0.95rem;
    }

    .oc-basic-info {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .info-item {
        padding: 0.4rem 0.55rem;
        column-gap: 0.35rem;
        min-height: 0;
    }

    .info-label {
        font-size: 0.72rem;
    }

    .info-value {
        font-size: 0.88rem;
    }

    .oc-special-mark {
        margin-top: 0.6rem;
        padding: 0.55rem 0.7rem;
    }

    .oc-special-mark .info-label {
        font-size: 0.7rem;
        padding: 0.1rem 0.45rem;
    }

    .oc-special-mark .info-value {
        font-size: 0.78rem;
    }

    .oc-carousel {
        border-radius: 8px;
        aspect-ratio: 3 / 4;
    }

    .oc-carousel-btn {
        width: 22px;
        height: 22px;
        font-size: 1rem;
    }

    .oc-carousel-prev {
        left: 0.3rem;
    }

    .oc-carousel-next {
        right: 0.3rem;
    }

    .oc-carousel-caption {
        padding: 0.45rem 0.55rem;
    }

    .oc-carousel-title {
        font-size: 0.7rem;
    }

    .oc-carousel-painter {
        font-size: 0.62rem;
    }

    .oc-carousel-dots {
        bottom: 0.35rem;
        gap: 0.25rem;
    }

    .oc-carousel-dot {
        width: 4px;
        height: 4px;
    }

    .oc-carousel-dot.active {
        width: 12px;
    }

    .oc-content {
        padding: 1.1rem 1.1rem 0.95rem;
        border-radius: 12px;
        margin-bottom: 1rem;
    }

    .oc-content h3 {
        font-size: 0.95rem;
        margin-bottom: 0.85rem;
        padding-bottom: 0.45rem;
        letter-spacing: 0.3px;
    }

    .oc-content p,
    .oc-content div {
        font-size: 0.85rem;
        line-height: 1.7;
        padding: 0;
    }

    .info-item {
        padding: 0.4rem 0.6rem;
        gap: 0.4rem;
        flex-wrap: wrap;
    }

    .info-label {
        font-size: 0.72rem;
        min-width: 0;
    }

    .info-value {
        font-size: 0.85rem;
    }

    .oc-card > div[style*="margin-top"] {
        padding: 0.7rem 0.85rem;
    }
}

.admin-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0e17 0%, #1a2332 100%);
}

.admin-dashboard {
    width: 100%;
    min-height: 100vh;
    background: #0f172a;
}

.admin-dashboard .admin-header {
    background: #1e293b;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-dashboard .admin-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.admin-dashboard .admin-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-dashboard .admin-user .back-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.admin-dashboard .admin-user .back-link:hover {
    color: #64c8ff;
}

.admin-dashboard .admin-content {
    padding: 1.5rem;
}

.back-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.back-link:hover {
    color: #64c8ff;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-box {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 200, 255, 0.2);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
}

.login-title {
    font-size: 1.8rem;
    color: var(--accent-blue);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 2rem;
}

.login-box .form-group {
    margin-bottom: 1.5rem;
}

.login-box input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(100, 200, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
}

.login-box input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.form-error {
    color: #ff6b6b;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.login-btn {
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, var(--accent-blue), #00d4ff);
    border: none;
    border-radius: 8px;
    color: #0a0e17;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(100, 200, 255, 0.4);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-back {
    margin-top: 1.5rem;
}

.login-back a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.9rem;
}

.login-back a:hover {
    color: var(--accent-blue);
}

.admin-layout {
    display: flex;
    min-height: 100vh;
    background: #0f172a;
}

.admin-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.admin-sidebar {
    width: 260px;
    background: #1e293b;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-logo {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.25rem;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-group {
    margin-bottom: 1.5rem;
}

.nav-group-title {
    padding: 0.5rem 1.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.4);
}

.nav-group-title.has-sub {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    text-transform: none;
    letter-spacing: normal;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.nav-group-title.has-sub:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sub-arrow {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

.nav-sub-items {
    padding-left: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border-left-color: #3b82f6;
}

.nav-icon {
    font-size: 1.1rem;
}

.nav-text {
    font-size: 0.9rem;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-name {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.logout-btn {
    padding: 0.4rem 0.8rem;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #ef4444;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.25);
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}

.admin-main .admin-header {
    background: #1e293b;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
}

.hamburger span {
    width: 22px;
    height: 2px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 2px;
    transition: all 0.3s;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.admin-main .admin-content {
    flex: 1;
    padding: 1.5rem;
    background: #0f172a;
}

.admin-section {
    background: #1e293b;
    border-radius: 12px;
    padding: 1.5rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 1.25rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-form .form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.admin-form .form-group {
    margin-bottom: 1rem;
}

.admin-form .form-group label {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.4rem;
}

.admin-form .form-group input,
.admin-form .form-group textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.admin-form .form-group input:focus,
.admin-form .form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.admin-form .form-group textarea {
    resize: vertical;
    min-height: 80px;
}

@media (max-width: 768px) {
    .admin-overlay.show {
        display: block;
    }

    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .admin-main {
        margin-left: 0;
    }

    .hamburger {
        display: flex;
    }

    .admin-form .form-row {
        grid-template-columns: 1fr;
    }

    .section-toolbar {
        transform-origin: top left;
        transform: scale(0.75);
        margin-bottom: 0.5rem;
    }

    .blog-table {
        transform-origin: top left;
        transform: scale(0.7);
        margin-bottom: -80px;
    }

    .blog-table table {
        min-width: 700px;
    }

    .admin-section {
        padding: 0.5rem;
    }

    .section-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
}

.admin-section label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.admin-section input,
.admin-section textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(100, 200, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
}

.admin-section input:focus,
.admin-section textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.save-btn {
    padding: 0.8rem 2rem;
    background: linear-gradient(135deg, var(--accent-blue), #00d4ff);
    border: none;
    border-radius: 8px;
    color: #0a0e17;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(100, 200, 255, 0.4);
}

.avatar-upload {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.avatar-preview {
    width: 120px;
    height: 120px;
    border: 2px dashed var(--accent-blue);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    background: rgba(100, 200, 255, 0.1);
    transition: all 0.3s;
}

.avatar-preview:hover {
    border-color: #00d4ff;
    background: rgba(100, 200, 255, 0.2);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    color: var(--text-gray);
    font-size: 0.85rem;
    text-align: center;
    padding: 10px;
}

.add-btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: rgba(100, 200, 255, 0.2);
    border: 1px solid var(--accent-blue);
    border-radius: 8px;
    color: var(--accent-blue);
    text-decoration: none;
    transition: all 0.3s;
}

.add-btn:hover {
    background: rgba(100, 200, 255, 0.3);
}

.back-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    text-decoration: underline;
}

.blog-list-header {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.list-stats {
    display: flex;
    gap: 1.5rem;
    margin-right: auto;
}

.stat-item {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.stat-item strong {
    color: var(--accent-blue);
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .list-stats {
        flex-wrap: nowrap;
        gap: 1rem;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .stat-item {
        white-space: nowrap;
    }
}

.stat-item strong {
    color: var(--accent-blue);
    font-size: 1.1rem;
}

.filter-select {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(100, 200, 255, 0.5);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 120px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(100, 200, 255, 0.3);
}

.filter-select option {
    background: #1e293b;
    color: #fff;
    padding: 0.5rem;
}

.type-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.type-badge.type-1 {
    background: rgba(255, 100, 100, 0.2);
    color: #ff6b6b;
}

.type-badge.type-2 {
    background: rgba(100, 200, 255, 0.2);
    color: #64c8ff;
}

.type-badge.type-3 {
    background: rgba(255, 200, 100, 0.2);
    color: #ffc864;
}

.blog-form {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(100, 200, 255, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.blog-form h3 {
    color: var(--accent-blue);
    margin-bottom: 1.5rem;
}

.blog-form .form-group {
    margin-bottom: 1rem;
}

.blog-form label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.blog-form input[type="text"],
.blog-form textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(100, 200, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
}

.blog-form input:focus,
.blog-form textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.cancel-btn {
    padding: 0.8rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s;
}

.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.blog-table table {
    width: 100%;
    border-collapse: collapse;
}

.blog-table th,
.blog-table td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid rgba(100, 200, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.blog-table th {
    color: var(--accent-blue);
    font-weight: 500;
}

.blog-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.edit-btn, .delete-btn {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    transition: all 0.3s;
}

.edit-btn {
    background: rgba(100, 200, 255, 0.2);
    color: var(--accent-blue);
}

.edit-btn:hover {
    background: rgba(100, 200, 255, 0.3);
}

.delete-btn {
    background: rgba(255, 100, 100, 0.2);
    color: #ff6b6b;
}

.delete-btn:hover {
    background: rgba(255, 100, 100, 0.3);
}

.empty-tip {
    text-align: center;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.5);
}

.thumb-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.upload-area {
    border: 2px dashed rgba(100, 200, 255, 0.3);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area:hover {
    border-color: var(--accent-blue);
    background: rgba(100, 200, 255, 0.05);
}

.upload-area.has-image {
    border-style: solid;
    padding: 1rem;
}

.upload-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
}

.upload-tip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.5);
}

.upload-icon {
    font-size: 2rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.search-page {
    min-height: 100vh;
    padding-top: 80px;
}

.search-page .page-header {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--holo-color);
}

.search-page .page-title {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.search-page .page-subtitle {
    color: var(--text-light);
    font-size: 1rem;
}

.search-page .blog-card {
    cursor: pointer;
}

.search-page .gallery-item {
    cursor: pointer;
}

.search-no-result {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.search-no-result .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.search-no-result .text {
    font-size: 1.1rem;
}

.search-section-title {
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
    color: var(--accent-blue);
    font-size: 1.3rem;
}

.chat-page {
    min-height: 100vh;
    padding-top: 70px;
}

.chat-container {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 680px;
    height: calc(100vh - 70px);
    height: calc(100dvh - 70px);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    z-index: 100;
    transition: height 0.2s ease;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    min-width: 0;
}

.chat-header .chat-avatar {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(100, 200, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-header .chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-header .chat-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.chat-header .chat-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-header .chat-status {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 0.1rem 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-header .member-avatars {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.chat-header .member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--bg-main);
    margin-right: -10px;
    background: rgba(100, 200, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-header .member-avatar:first-child {
    margin-left: 0;
}

.chat-header .member-avatar:last-child {
    margin-right: 0;
}

.chat-header .member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-header .more-members {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-left: 0.25rem;
}

.chat-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--bg-main);
}

.chat-footer {
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.chat-input-area {
    display: flex;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
}

.chat-message {
    display: flex;
    gap: 0.6rem;
    max-width: 75%;
    -webkit-user-select: none;
    user-select: none;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-message {
    align-self: flex-start;
}

.message-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    max-width: 100%;
}

.user-message .message-content {
    align-items: flex-end;
}

.message-bubble {
    padding: 0.5rem 0.85rem;
    border-radius: 12px;
    line-height: 1.45;
    word-break: break-word;
}

.ai-message .message-bubble {
    background: var(--card-bg);
    color: var(--text-color);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.user-message .message-bubble {
    background: var(--accent-blue);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.message-bubble.loading {
    background: var(--hover-bg);
    color: var(--text-light);
    font-style: italic;
}

.message-time {
    font-size: 0.7rem;
    color: var(--text-light);
    padding: 0 0.25rem;
}

/* ============ 长按消息撤销菜单 ============ */
.chat-message {
    cursor: context-menu;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
}

.chat-message:active .message-bubble {
    transform: scale(0.98);
    transition: transform 0.15s ease;
}

.msg-context-menu {
    position: fixed;
    z-index: 9999;
    min-width: 180px;
    background: var(--bg-secondary, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    animation: msgMenuFadeIn 0.18s ease-out;
}

@keyframes msgMenuFadeIn {
    from { opacity: 0; transform: translateY(-4px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.msg-context-item {
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-color, #1f2937);
    transition: background-color 0.12s;
    white-space: nowrap;
}

.msg-context-item:hover {
    background: var(--hover-bg, rgba(59, 130, 246, 0.12));
}

.msg-context-item.msg-context-danger {
    color: #ef4444;
}

.msg-context-item.msg-context-danger:hover {
    background: rgba(239, 68, 68, 0.12);
}

.msg-context-item.msg-context-cancel {
    color: var(--text-light, #6b7280);
    border-top: 1px solid var(--border-color, #e5e7eb);
    margin-top: 0.15rem;
    border-radius: 0 0 6px 6px;
}

.message-editing {
    background: rgba(59, 130, 246, 0.08) !important;
    border: 1px dashed var(--accent-blue, #4a90e2) !important;
    padding: 0.6rem !important;
}

.message-edit-textarea {
    width: 100%;
    min-height: 60px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    font-size: 0.95rem;
    resize: vertical;
    background: var(--bg-main, #ffffff);
    color: var(--text-color, #1f2937);
    outline: none;
    font-family: inherit;
}

.message-edit-textarea:focus {
    border-color: var(--accent-blue, #4a90e2);
}

.message-edit-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
    justify-content: flex-end;
}

.msg-edit-btn {
    padding: 0.3rem 0.75rem;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.15s, background-color 0.15s;
}

.msg-edit-btn:hover {
    opacity: 0.9;
}

.msg-edit-save {
    background: var(--accent-blue, #4a90e2);
    color: white;
}

.msg-edit-cancel {
    background: var(--bg-main, #f3f4f6);
    color: var(--text-color, #1f2937);
    border: 1px solid var(--border-color, #e5e7eb);
}

.chat-input-area {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.chat-input-area input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-main);
    color: var(--text-color);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input-area input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.15);
}

.chat-input-area input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chat-input-area button {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 20px;
    background: var(--accent-blue);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-input-area button:hover:not(:disabled) {
    background: #5a9fd4;
    transform: none;
}

.chat-input-area button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-input-area .clear-btn {
    padding: 0.6rem 1rem;
    background: transparent;
    font-size: 0.9rem;
    color: var(--text-light);
    border: none;
    border-radius: 20px;
    flex-shrink: 0;
}

.chat-input-area .clear-btn:hover {
    background: var(--hover-bg);
    color: #ff6b6b;
}

.chat-input-area:focus-within {
    outline: none;
}

.chat-input-area .quick-punctuation {
    display: flex;
    gap: 0.4rem;
    padding: 0 0 0.25rem 0;
    flex-wrap: wrap;
    flex: 1 1 100%;
    align-content: flex-start;
    touch-action: manipulation;
    -webkit-touch-callout: none;
}

.chat-input-area .quick-punctuation button {
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

.chat-input-area .quick-punctuation button:hover {
    background: var(--hover-bg);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

@media (max-width: 768px) {
    .chat-page {
        padding-top: 0;
    }

    .page-header {
        display: none;
    }

    .page-container {
        padding: 0;
        max-width: 100%;
    }

    .chat-container {
        position: fixed;
        top: 50px;
        left: 0;
        right: 0;
        /* bottom:0 铺满布局视口，max-height 用 dvh 限制不超可视区（iOS 键盘场景）
           不支持 dvh 的浏览器由 JS（visualViewport）动态设置高度收缩，避免底部留白 */
        bottom: 0;
        max-height: calc(100dvh - 50px);
        transform: none;
        max-width: 100%;
        border-radius: 0;
        border: none;
        /* flex 布局：body 自动填满，footer 贴底 */
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* 聊天下方留白由 flex 布局自动处理，无需 CSS 变量 */
    .chat-page {
        padding-bottom: 0;
    }

    .chat-footer {
        position: relative;
        flex-shrink: 0;
        bottom: auto;
        left: auto;
        right: auto;
        padding: 0;
        padding-bottom: 0;
        z-index: auto;
        background: var(--bg-secondary);
        border-top: 1px solid var(--border-color);
    }

    .chat-header {
        padding: 0.6rem 0.8rem;
        gap: 0.6rem;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: var(--nav-bg);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 0;
        border: none;
        border-bottom: 1px solid var(--border-color);
    }

    .chat-header .chat-avatar {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
        border-radius: 50%;
        overflow: hidden;
        background: rgba(100, 200, 255, 0.1);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .chat-header .chat-name {
        font-size: 0.9rem;
    }

    .chat-header .chat-status {
        font-size: 0.7rem;
    }

    .chat-header-actions {
        gap: 0.25rem;
    }

    .header-action-btn {
        width: 32px;
        height: 32px;
        padding: 0;
        font-size: 0.9rem;
    }

    .chat-body {
        position: relative;
        flex: 1;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        overflow: hidden;
    }

    .chat-messages {
        height: 100%;
        padding: 0.8rem;
        gap: 0.6rem;
    }

    /* 移动端：temp-settings-inline 作为 flex 子元素，位于 body 和 footer 之间
       折叠时只显示一条细线（类似 QQ 的 + 号工具栏），展开后占满所需高度 */
    .chat-page .temp-settings-inline {
        position: relative;
        flex-shrink: 0;
        bottom: auto;
        left: auto;
        right: auto;
        z-index: auto;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    /* 折叠态：收成一条细指示条，不干扰输入 */
    .chat-page .temp-settings-inline.is-collapsed {
        pointer-events: none;
    }
    /* 折叠态 header 变成细线指示器，仅 toggle 箭头可点击 */
    .chat-page .temp-settings-inline.is-collapsed .temp-settings-inline-header {
        height: 5px;
        min-height: 5px;
        padding: 0;
        border-bottom: none;
        border-top: 3px solid var(--accent-blue);
        border-radius: 0;
        background: transparent;
        opacity: 0.7;
        pointer-events: none;
    }
    /* 折叠态仅 toggle 小三角可点击 */
    .chat-page .temp-settings-inline.is-collapsed .temp-settings-inline-toggle {
        pointer-events: auto;
        cursor: pointer;
        padding: 4px 12px;
        font-size: 0.65rem;
        position: relative;
        top: -6px;
    }
    /* 折叠态标题文字不显示 */
    .chat-page .temp-settings-inline.is-collapsed .temp-settings-inline-title {
        display: none;
    }
    .chat-page .temp-settings-inline-header {
        width: 100%;
        box-sizing: border-box;
    }

    .chat-message {
        max-width: 82%;
        gap: 0.5rem;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
    }

    .message-bubble {
        padding: 0.45rem 0.75rem;
        font-size: 0.95rem;
    }

    .chat-input-area {
        padding: 0.3rem 0.6rem 0.15rem 0.6rem;
        gap: 0.4rem;
    }

    .chat-input-area .quick-punctuation {
        padding: 0 0 0.3rem 0;
    }

    .chat-input-area .quick-punctuation button {
        padding: 0.25rem 0.4rem;
        font-size: 0.8rem;
    }

    .chat-input-area input {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        min-width: 0;
        flex: 1;
    }

    .chat-input-area button {
        padding: 0.45rem 0.7rem;
        font-size: 0.75rem;
        min-width: 50px;
        flex-shrink: 0;
    }

    .chat-input-area .clear-btn {
        padding: 0.45rem 0.7rem;
        font-size: 0.75rem;
        min-width: 50px;
        flex-shrink: 0;
    }

    .agent-modal {
        padding: 0.5rem;
        align-items: flex-end;
    }

    .agent-modal-content {
        max-height: 85vh;
        padding: 1.5rem;
        border-radius: 16px 16px 0 0;
    }

    .modal-avatar {
        width: 60px;
        height: 60px;
    }

    .modal-name {
        font-size: 1.25rem;
    }

    .modal-chat-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }

    .message-bubble img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
        margin-top: 0.25rem;
    }
}

.example-dialogue-editor {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    background: var(--card-bg);
}

.dialogue-preview {
    min-height: 80px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.dialogue-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--secondary-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.dialogue-pair {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dialogue-user,
.dialogue-assistant {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.dialogue-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--accent-blue);
    min-width: 30px;
}

.dialogue-text {
    color: var(--text-color);
}

.dialogue-user .dialogue-label {
    color: #5ba4c9;
}

.dialogue-assistant .dialogue-label {
    color: #7ec8a0;
}

.dialogue-delete-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0.3rem;
    line-height: 1;
}

.dialogue-delete-btn:hover {
    color: #ff4444;
}

.dialogue-empty {
    text-align: center;
    color: var(--text-light);
    padding: 1.5rem;
    font-size: 0.9rem;
}

.dialogue-input-row {
    display: flex;
    gap: 0.5rem;
}

.dialogue-input-row input {
    flex: 1;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--bg-gradient);
    color: var(--text-color);
}

.dialogue-input-row input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.add-dialogue-btn {
    padding: 0.6rem 1rem;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
}

.add-dialogue-btn:hover {
    background: var(--accent-cyan);
}

.user-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.4rem;
    border-radius: 8px;
    transition: background 0.3s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.user-btn:hover {
    background: var(--secondary-color);
}

.user-btn.logged-in .user-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    border: 2px solid var(--nav-bg);
}

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.auth-modal.active {
    opacity: 1;
    visibility: visible;
}

.auth-modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.auth-modal.active .auth-modal-content {
    transform: scale(1);
}

.auth-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.auth-modal-header h2 {
    font-size: 1.2rem;
    color: var(--text-color);
}

.auth-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0 0.5rem;
}

.auth-close:hover {
    color: var(--text-color);
}

.auth-modal-body {
    padding: 1.5rem;
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-color);
}

.auth-form .form-group input,
.auth-form .form-group select,
.auth-form .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--bg-primary);
    color: var(--text-color);
}

.auth-form .form-group input:focus,
.auth-form .form-group select:focus,
.auth-form .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.auth-submit {
    width: 100%;
    padding: 0.75rem;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 0.5rem;
}

.auth-submit:hover {
    background: var(--accent-cyan);
}

.auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-switch {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.auth-switch a {
    color: var(--accent-blue);
    cursor: pointer;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.user-center-page {
    min-height: 100vh;
    padding-top: 70px;
}

.user-center-content {
    max-width: 800px;
    margin: 0 auto;
}

.user-info-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 12px var(--shadow-color);
}

.user-avatar {
    width: 64px;
    height: 64px;
    background: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.user-details {
    flex: 1;
}

.user-details h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.user-username {
    color: var(--text-light);
    font-size: 0.9rem;
}

.user-type-badge {
    margin-left: 0.5rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    vertical-align: middle;
}

.user-type-badge.vip {
    background: rgba(100, 200, 255, 0.2);
    color: #64c8ff;
}

.user-time {
    color: var(--text-light);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-logout:hover {
    background: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
}

.user-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.user-tab {
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-light);
    border-radius: 6px;
    transition: all 0.2s;
}

.user-tab:hover {
    background: var(--secondary-color);
    color: var(--text-color);
}

.user-tab.active {
    background: var(--accent-blue);
    color: white;
}

.tab-content {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px var(--shadow-color);
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.empty-state p {
    margin-bottom: 1rem;
}

.empty-hint {
    font-size: 0.85rem;
    color: var(--text-light);
}

.btn-primary {
    padding: 0.6rem 1.2rem;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-primary:hover {
    background: var(--accent-cyan);
}

.btn-secondary {
    padding: 0.6rem 1.2rem;
    background: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: var(--border-color);
}

.session-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--secondary-color);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.session-item:hover {
    background: var(--border-color);
}

.session-preview {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.session-agent-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-bottom: 0.25rem;
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    font-weight: 500;
}

.session-agent-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.session-agent-avatar-fallback {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}

.session-agent-name-text {
    line-height: 1;
}

.session-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.session-actions {
    display: flex;
    gap: 0.5rem;
}

.session-load-btn, .session-delete-btn {
    padding: 0.3rem 0.6rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.session-load-btn {
    background: var(--accent-blue);
    color: white;
}

.session-delete-btn {
    background: #ff6b6b;
    color: white;
}

.session-sub-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.session-sub-tab {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--secondary-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-light);
    transition: all 0.2s;
}

.session-sub-tab:hover {
    background: var(--border-color);
}

.session-sub-tab.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.group-session-item .session-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.group-badge {
    background: rgba(168, 85, 247, 0.2);
    color: #c4b5fd;
}

.memory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.memory-header h3 {
    font-size: 1rem;
    margin-right: auto;
}

.memory-form {
    background: var(--secondary-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.memory-form .form-group {
    margin-bottom: 1rem;
}

.memory-form .form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    color: var(--text-color);
}

.memory-form .form-group input[type="text"],
.memory-form .form-group textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--bg-primary);
    color: var(--text-color);
}

.memory-form .form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.memory-form .form-group input[type="range"] {
    width: calc(100% - 40px);
    vertical-align: middle;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.memory-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.memory-item {
    padding: 1rem;
    background: var(--secondary-color);
    border-radius: 8px;
}

.memory-header-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.memory-agent-badge {
    display: inline-block;
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    font-weight: 500;
}

.memory-type-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.memory-type-badge.type-important {
    background: #fef3c7;
    color: #92400e;
}

.memory-type-badge.type-preference {
    background: #dbeafe;
    color: #1e40af;
}

.memory-type-badge.type-interaction {
    background: #d1fae5;
    color: #065f46;
}

.memory-type-badge.type-custom {
    background: #f3e8ff;
    color: #6b21a8;
}

.memory-type-badge.type-identity {
    background: #fce7f3;
    color: #9d174d;
}

.memory-agent-group {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.memory-agent-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    background: rgba(59, 130, 246, 0.25);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.memory-agent-header:hover {
    background: rgba(59, 130, 246, 0.35);
}

.memory-agent-header .agent-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #000000;
}

.memory-agent-header .agent-memory-count {
    font-size: 0.8rem;
    color: #888;
    margin-left: auto;
}

.memory-agent-content {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.memory-type-group {
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.memory-type-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.memory-type-header:hover {
    background: rgba(255, 255, 255, 0.06);
}

.memory-type-header .memory-type-badge {
    margin-bottom: 0;
    font-size: 0.7rem;
}

.memory-type-header .type-memory-count {
    font-size: 0.75rem;
    color: #777;
    margin-left: auto;
}

.memory-type-content {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.expand-icon {
    font-size: 0.7rem;
    color: #aaa;
    width: 14px;
}

.memory-content {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.memory-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.memory-importance {
    font-size: 0.8rem;
    color: var(--text-light);
}

.memory-delete-btn {
    padding: 0.2rem 0.5rem;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

.profile-form .form-group {
    margin-bottom: 1rem;
}

.profile-form .form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    color: var(--text-color);
}

.profile-form .form-group input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--bg-primary);
    color: var(--text-color);
}

.avatar-upload-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(100, 200, 255, 0.05);
    border-radius: 12px;
}

.avatar-upload-section .avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--accent-blue);
    background: rgba(100, 200, 255, 0.1);
    flex-shrink: 0;
}

.avatar-upload-section .avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-upload-section .avatar-placeholder {
    font-size: 2rem;
    color: var(--accent-blue);
}

.avatar-upload-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.avatar-hint {
    font-size: 0.75rem;
    color: var(--text-gray);
    margin: 0;
}

.password-form {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.password-title {
    font-size: 1rem;
    color: var(--text-color);
    margin: 0 0 1rem 0;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-warning:hover:not(:disabled) {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.btn-warning:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mt-1 {
    margin-top: 0.5rem;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-gray);
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 1.2rem;
}

.modal-body .form-group {
    margin-bottom: 1rem;
}

.modal-body .form-group:last-child {
    margin-bottom: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    padding: 1rem 1.2rem;
    border-top: 1px solid var(--border-color);
}

.chat-header-actions {
    display: flex;
    gap: 0.5rem;
}

.header-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.3rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.header-action-btn:hover {
    background: var(--secondary-color);
}

.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

.sessions-panel {
    position: absolute;
    top: 60px;
    right: 0;
    width: 280px;
    max-height: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color);
    z-index: 100;
    overflow: hidden;
}

.sessions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sessions-header h4 {
    font-size: 0.9rem;
}

.sessions-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-light);
}

.sessions-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

.sessions-list {
    max-height: 340px;
    overflow-y: auto;
}

.sessions-list .session-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
}

.sessions-list .session-item:last-child {
    border-bottom: none;
}

.sessions-list .session-item.active {
    background: var(--holo-color);
}

.sessions-list .session-preview {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sessions-list .session-info {
    display: flex;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.login-hint {
    text-align: center;
    padding: 1rem;
    background: var(--secondary-color);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.login-hint p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.login-hint button {
    padding: 0.5rem 1rem;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.login-hint button:hover {
    background: var(--accent-cyan);
}

.user-not-login {
    text-align: center;
    padding: 3rem;
}

.user-not-login p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

@media (max-width: 768px) {
    .user-info-card {
        flex-direction: column;
        text-align: center;
    }

    .user-tabs {
        flex-wrap: wrap;
    }

    .user-tab {
        flex: 1;
        min-width: 80px;
        text-align: center;
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    .sessions-panel {
        position: fixed;
        top: 53px;
        right: 0;
        left: 0;
        width: auto;
        max-height: calc(100vh - 120px);
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        transform: none;
        z-index: 999;
    }

    .login-hint button {
        padding: 0.4rem 0.85rem;
        font-size: 0.8rem;
    }

    .profile-login-hint button {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .btn-logout {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

.forum-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.forum-search {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    max-width: 400px;
}

.forum-search input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-color);
}

.forum-search button {
    padding: 0.6rem 1.2rem;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.forum-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.forum-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.forum-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.forum-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.forum-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.forum-badge.top {
    background: #ff6b6b;
    color: white;
}

.forum-badge.essence {
    background: #ffd700;
    color: #333;
}

.forum-nickname {
    color: var(--accent-blue);
    font-weight: 500;
    font-size: 0.9rem;
}

.forum-time {
    color: var(--text-light);
    font-size: 0.8rem;
}

.forum-title {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.forum-content {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.forum-stats {
    display: flex;
    gap: 1rem;
    color: var(--text-light);
    font-size: 0.85rem;
}

.forum-detail-page {
    max-width: 800px;
    margin: 0 auto;
}

.forum-detail-header {
    margin-bottom: 2rem;
}

.forum-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.forum-detail-title {
    font-size: 1.8rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.forum-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.forum-author {
    color: var(--accent-blue);
    font-weight: 500;
}

.forum-detail-content {
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 2rem;
}

.forum-detail-content p {
    margin-bottom: 1rem;
}

.forum-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.action-btn {
    padding: 0.5rem 1rem;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-color);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.action-btn.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: var(--bg-secondary);
}

.ai-subtabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.ai-subtab {
    padding: 0.6rem 1.25rem;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
}

.ai-subtab:hover {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.85);
}

.ai-subtab.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.ai-subtab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 6px;
    background: rgba(255,255,255,0.25);
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ai-subtab.active .ai-subtab-badge {
    background: rgba(255,255,255,0.35);
}

.ai-subpanel {
    animation: fadeIn 0.3s ease;
}

.ai-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.ai-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}

.ai-card-icon {
    font-size: 1.1rem;
}

.ai-card-desc {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 400;
    color: rgba(255,255,255,0.35);
}

.official-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.official-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    transition: all 0.25s;
}

.official-card:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.12);
}

.official-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255,255,255,0.08);
}

.official-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.official-card-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1.2rem;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
}

.official-card-body {
    flex: 1;
    min-width: 0;
}

.official-card-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.25rem;
}

.official-card-desc {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.4rem;
}

.official-card-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.75rem;
}

.official-card-model {
    padding: 2px 8px;
    background: rgba(59,130,246,0.15);
    color: #60a5fa;
    border-radius: 4px;
}

.official-card-status {
    padding: 2px 8px;
    border-radius: 4px;
}

.official-card-status.public {
    background: rgba(34,197,94,0.15);
    color: #4ade80;
}

.official-card-status.private {
    background: rgba(251,191,36,0.15);
    color: #fbbf24;
}

.official-card-time {
    color: rgba(255,255,255,0.35);
}

.official-card-actions {
    flex-shrink: 0;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.empty-state-text {
    font-size: 1rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 0.25rem;
}

.empty-state-desc {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.3);
}

.test-result {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
}

.test-result-label {
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    margin-bottom: 0.4rem;
}

.test-result-content {
    color: rgba(255,255,255,0.85);
    line-height: 1.6;
}

.btn-cancel {
    padding: 0.6rem 1.25rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.required {
    color: #f87171;
    font-weight: 700;
}

.avatar-preview-lg {
    width: 160px;
    height: 160px;
}

.forum-comments {
    margin-top: 2rem;
}

.forum-comments h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.comment-form {
    margin-bottom: 2rem;
}

.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-color);
    margin-bottom: 0.75rem;
    resize: vertical;
}

.comment-login-tip {
    text-align: center;
    padding: 1.5rem;
    background: var(--secondary-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

.comment-login-tip a {
    color: var(--accent-blue);
    cursor: pointer;
    text-decoration: underline;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.comment-author {
    color: var(--accent-blue);
    font-weight: 500;
    font-size: 0.9rem;
}

.comment-time {
    color: var(--text-light);
    font-size: 0.8rem;
}

.comment-delete {
    background: none;
    border: none;
    color: #ff6b6b;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: auto;
}

.comment-body {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.comment-actions {
    display: flex;
    gap: 1rem;
}

.like-btn, .reply-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.like-btn:hover, .reply-btn:hover {
    background: var(--secondary-color);
    color: var(--text-color);
}

.like-btn.active {
    color: #ff6b6b;
}

.reply-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.reply-form input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-color);
    font-size: 0.85rem;
}

.reply-form button {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.reply-form button:first-of-type {
    background: var(--accent-blue);
    color: white;
}

.reply-form button:last-of-type {
    background: var(--secondary-color);
    color: var(--text-color);
}

.reply-list {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border-color);
}

.reply-item {
    padding: 0.75rem;
    background: var(--secondary-color);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.reply-item:last-child {
    margin-bottom: 0;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.1rem;
    color: var(--text-color);
}

.modal-header button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    padding: 1.25rem;
}

.modal-body .form-group {
    margin-bottom: 1rem;
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-color);
}

.modal-body .form-group input,
.modal-body .form-group textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-color);
    font-size: 0.9rem;
}

.modal-body .form-group textarea {
    resize: vertical;
}

.image-upload-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.image-upload-item {
    position: relative;
    width: 70px;
    height: 70px;
}

.image-upload-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.image-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
}

.image-upload-btn {
    width: 70px;
    height: 70px;
    border: 2px dashed var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-light);
    font-size: 24px;
    transition: all 0.2s;
}

.image-upload-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

.btn-primary {
    padding: 0.6rem 1.2rem;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-primary:hover {
    background: var(--accent-cyan);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 0.6rem 1.2rem;
    background: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: var(--border-color);
}

.tieba-layout {
    display: flex;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.tieba-sidebar {
    width: 220px;
    flex-shrink: 0;
}

.tieba-user-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    cursor: pointer;
}

.tieba-user-card:hover {
    border-color: var(--accent-blue);
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.user-level {
    font-size: 0.75rem;
    color: var(--accent-blue);
}

.tieba-nav {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.tieba-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.tieba-nav .nav-item:last-child {
    border-bottom: none;
}

.tieba-nav .nav-item:hover {
    background: var(--secondary-color);
}

.tieba-nav .nav-item.active {
    background: var(--accent-blue);
    color: white;
}

.tieba-nav .nav-icon {
    font-size: 1rem;
}

.tieba-main {
    flex: 1;
    min-width: 0;
}

.tieba-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tieba-search {
    flex: 1;
    display: flex;
    gap: 0.5rem;
}

.tieba-search input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-color);
}

.tieba-search button {
    padding: 0.6rem 1rem;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.tieba-post-btn {
    padding: 0.6rem 1.2rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}

.tieba-filter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.filter-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

.tieba-filter select {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-color);
}

.tieba-loading, .tieba-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.tieba-thread-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tieba-thread {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.tieba-thread:hover {
    border-color: var(--accent-blue);
    transform: translateX(4px);
}

.thread-avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
}

.avatar-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: bold;
}

.thread-content {
    flex: 1;
    min-width: 0;
}

.thread-title {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.thread-badge {
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
}

.thread-badge.top {
    background: #ff6b6b;
    color: white;
}

.thread-badge.essence {
    background: #ffd700;
    color: #333;
}

.thread-separator {
    color: var(--text-light);
}

.thread-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.meta-author {
    color: var(--accent-blue);
}

.thread-stats {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-light);
    font-size: 0.85rem;
}

.stat-num {
    min-width: 20px;
}

.tieba-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem;
}

.tieba-pagination button {
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-color);
}

.tieba-pagination button:hover:not(:disabled) {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.tieba-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    color: var(--text-light);
    font-size: 0.9rem;
}

.tieba-detail-layout {
    display: flex;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.tieba-thread-detail {
    flex: 1;
    min-width: 0;
}

.thread-header {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.thread-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.thread-title {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}

.thread-info {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.info-author {
    color: var(--accent-blue);
    font-weight: 500;
}

.thread-body {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--text-color);
}

.thread-body p {
    margin-bottom: 1rem;
}

.post-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.post-image {
    max-width: 200px;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.post-image:hover {
    transform: scale(1.02);
}

.thread-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.action-btn {
    padding: 0.5rem 1rem;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-color);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.action-btn.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.action-btn.danger:hover {
    background: #ff6b6b;
    border-color: #ff6b6b;
    color: white;
}

.tieba-reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--secondary-color);
    border-radius: 8px 8px 0 0;
    border: 1px solid var(--border-color);
    border-bottom: none;
}

.reply-count {
    font-weight: 600;
    color: var(--text-color);
}

.reply-sort {
    color: var(--accent-blue);
    cursor: pointer;
}

.tieba-reply-form {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    margin-bottom: 1rem;
}

.reply-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.reply-input-wrapper {
    flex: 1;
}

.reply-input-wrapper textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-color);
    margin-bottom: 0.5rem;
    resize: vertical;
    font-family: inherit;
}

.reply-submit-btn {
    padding: 0.5rem 1.5rem;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.reply-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.reply-image-btn {
    padding: 0.4rem 0.8rem;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-color);
}

.reply-image-btn:hover {
    background: var(--accent-color);
}

.comment-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.comment-image-item {
    position: relative;
    width: 60px;
    height: 60px;
}

.comment-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.comment-image-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
}

.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.image-preview-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.preview-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tieba-login-tip {
    text-align: center;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.tieba-login-tip a {
    color: var(--accent-blue);
    cursor: pointer;
    text-decoration: underline;
}

.tieba-floor-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tieba-floor {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.floor-left {
    flex-shrink: 0;
    text-align: center;
}

.floor-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
    overflow: hidden;
}

.floor-level {
    font-size: 0.65rem;
    color: var(--text-light);
}

.floor-right {
    flex: 1;
    min-width: 0;
}

.floor-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.floor-nickname {
    color: var(--accent-blue);
    font-weight: 600;
    font-size: 0.9rem;
}

.floor-number {
    background: var(--secondary-color);
    padding: 0.1rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    color: var(--text-light);
}

.floor-time {
    color: var(--text-light);
    font-size: 0.8rem;
}

.floor-delete {
    margin-left: auto;
    background: none;
    border: none;
    color: #ff6b6b;
    font-size: 0.8rem;
    cursor: pointer;
}

.floor-content {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.floor-actions {
    display: flex;
    gap: 1rem;
}

.floor-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.floor-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.floor-image:hover {
    transform: scale(1.05);
}

.floor-action-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.floor-action-btn:hover {
    background: var(--secondary-color);
    color: var(--text-color);
}

.floor-action-btn.active {
    color: #ff6b6b;
}

.floor-reply-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.floor-reply-form input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-color);
    font-size: 0.85rem;
}

.reply-btn-submit {
    padding: 0.4rem 0.75rem;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.reply-btn-cancel {
    padding: 0.4rem 0.75rem;
    background: var(--secondary-color);
    color: var(--text-color);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.floor-reply-list {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--secondary-color);
    border-radius: 6px;
}

.floor-reply-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.floor-reply-item:last-child {
    border-bottom: none;
}

.reply-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--accent-blue);
    overflow: hidden;
}

.reply-body {
    flex: 1;
    min-width: 0;
}

.reply-nickname {
    color: var(--accent-blue);
    font-weight: 500;
    font-size: 0.85rem;
}

.reply-target {
    color: var(--text-light);
    font-size: 0.85rem;
}

.reply-content {
    color: var(--text-color);
    font-size: 0.85rem;
}

.reply-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.25rem;
}

.reply-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.reply-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
}

.reply-time {
    color: var(--text-light);
    font-size: 0.75rem;
}

.reply-delete {
    background: none;
    border: none;
    color: #ff6b6b;
    font-size: 0.75rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .forum-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .forum-search {
        max-width: 100%;
    }

    .forum-search button {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .forum-detail-title {
        font-size: 1.4rem;
    }

    .forum-actions {
        flex-wrap: wrap;
    }

    .tieba-layout {
        flex-direction: column;
        padding: 0.75rem;
    }

    .tieba-sidebar {
        width: 100%;
    }

    .tieba-header {
        flex-direction: column;
    }

    .tieba-thread {
        flex-wrap: wrap;
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .thread-avatar {
        width: 36px;
        height: 36px;
    }

    .thread-content {
        flex: 1 1 calc(100% - 50px);
        min-width: 0;
    }

    .thread-title {
        font-size: 0.9rem;
        line-height: 1.3;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .thread-meta {
        font-size: 0.75rem;
    }

    .thread-stats {
        flex: 0 0 100%;
        justify-content: flex-start;
        gap: 1rem;
        margin-top: 0.25rem;
    }

    .stat-item {
        font-size: 0.75rem;
    }

    .tieba-detail-layout {
        flex-direction: column;
        padding: 0.75rem;
    }

    .tieba-floor {
        flex-direction: column;
    }

    .floor-left {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .floor-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .floor-level {
        font-size: 0.6rem;
    }

    .floor-right {
        width: 100%;
    }

    .floor-header {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .floor-nickname {
        font-size: 0.85rem;
    }

    .floor-content {
        font-size: 0.9rem;
    }

    .floor-images {
        gap: 0.25rem;
    }

    .floor-image {
        width: 60px;
        height: 60px;
    }

    .post-images {
        gap: 0.5rem;
    }

    .post-image {
        max-width: 120px;
        max-height: 120px;
    }

    .reply-images {
        gap: 0.2rem;
    }

    .reply-image {
        width: 40px;
        height: 40px;
    }

    .reply-body {
        min-width: 0;
    }

    .reply-content {
        font-size: 0.85rem;
        word-break: break-word;
    }

    .reply-form button {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .btn-cancel {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .tieba-pagination button {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .modal-header button {
        padding: 0.4rem 0.8rem;
        font-size: 1.2rem;
    }

    .image-upload-list {
        gap: 0.4rem;
    }

    .image-upload-item,
    .image-upload-btn {
        width: 56px;
        height: 56px;
    }

    .comment-images {
        gap: 0.25rem;
    }

    .comment-image-item {
        width: 48px;
        height: 48px;
    }

    .reply-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .reply-input-wrapper textarea {
        font-size: 0.9rem;
    }
}

/* AI智能体页面 */
.ai-agents-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0e17 0%, #1a1f35 100%);
    padding-bottom: 2rem;
}

.ai-agents-page .page-header {
    text-align: center;
    padding: 8rem 2rem 4rem;
    background: linear-gradient(180deg, var(--holo-color) 0%, transparent 100%);
}

.ai-agents-page .page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--title-color);
    margin-bottom: 1rem;
}

.ai-agents-page .page-subtitle {
    font-size: 1rem;
    color: var(--text-light);
}

.ai-agents-page .page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.ai-agents-page .loading-state,
.ai-agents-page .empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.7);
}

.ai-agents-page .list-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

.ai-agents-page .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent-blue);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.ai-agents-page .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(100, 200, 255, 0.4);
}

.ai-agents-page .empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.ai-agents-page .empty-hint {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.5rem;
}

.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.agent-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(100, 200, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s;
    position: relative;
}

.agent-card.is-official {
    border-color: rgba(255, 200, 100, 0.4);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(50, 35, 25, 0.8) 100%);
}

.agent-card:hover {
    transform: translateY(-4px);
    border-color: rgba(100, 200, 255, 0.5);
    box-shadow: 0 8px 32px rgba(100, 200, 255, 0.2);
}

.agent-official-badge {
    position: absolute;
    top: -8px;
    right: 12px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}

.agent-card-main {
    cursor: pointer;
}

.agent-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.agent-detail-btn,
.agent-chat-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.agent-detail-btn {
    background: rgba(100, 200, 255, 0.15);
    color: rgba(100, 200, 255, 0.9);
}

.agent-detail-btn:hover {
    background: rgba(100, 200, 255, 0.25);
}

.agent-chat-btn {
    background: linear-gradient(135deg, var(--accent-blue), #3b82f6);
    color: white;
}

.agent-chat-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.agent-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 1rem;
    background: rgba(100, 200, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.agent-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agent-default-avatar {
    font-size: 2rem;
}

.agent-info .agent-name {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.agent-info .agent-creator {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.agent-info .agent-desc {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.agent-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.agent-tag {
    background: rgba(100, 200, 255, 0.2);
    color: var(--accent-blue);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.agent-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.agent-modal-content {
    background: #1e293b;
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 1rem;
    background: rgba(100, 200, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-name {
    text-align: center;
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.modal-creator {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1.5rem;
}

.modal-section {
    margin-bottom: 1.25rem;
}

.modal-section h4 {
    color: var(--accent-blue);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.modal-section p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    line-height: 1.6;
}

.modal-chat-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #60a5fa 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
}

.modal-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

/* VIP设置页面 */
.vip-settings-page {
    min-height: 100vh;
    background: var(--bg-main);
    padding-bottom: 2rem;
}

.vip-settings-page .page-header {
    text-align: center;
    padding: 8rem 2rem 4rem;
    background: linear-gradient(180deg, var(--holo-color) 0%, transparent 100%);
}

.vip-settings-page .page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--title-color);
    margin-bottom: 1rem;
}

.vip-settings-page .page-subtitle {
    font-size: 1rem;
    color: var(--text-light);
}

.vip-settings-page .page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.vip-required {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.vip-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.vip-required h2 {
    color: var(--accent-blue);
    margin-bottom: 1rem;
}

.vip-required p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.vip-hint {
    font-size: 0.9rem;
    color: var(--text-light);
}

.settings-content {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 2rem;
}

.settings-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.settings-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.settings-tab:hover {
    background: var(--primary-color);
    border-color: var(--accent-blue);
}

.settings-tab.active {
    background: var(--holo-color);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.settings-section {
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.vip-settings-page .form-group {
    margin-bottom: 1.5rem;
}

.vip-settings-page .form-group label {
    display: block;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.vip-settings-page .form-group input[type="text"],
.vip-settings-page .form-group input[type="number"],
.vip-settings-page .form-group textarea,
.vip-settings-page .form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 8px;
    font-size: 1rem;
}

.vip-settings-page .form-group input:focus,
.vip-settings-page .form-group textarea:focus,
.vip-settings-page .form-group select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.vip-settings-page .form-group select option {
    background: var(--secondary-color);
    color: var(--text-color);
}

.vip-settings-page .form-group input[type="range"] {
    width: 100%;
    margin: 0.5rem 0;
}

.relation-page {
    min-height: calc(100vh - 200px);
}

.relation-content {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
}

.relation-toolbar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.relation-main {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
}

.relation-canvas-container {
    position: relative;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    height: 400px;
}

.relation-canvas {
    width: 100%;
    height: 100%;
    cursor: grab;
    display: block;
}

.relation-canvas:active {
    cursor: grabbing;
}

.canvas-hint {
    position: absolute;
    top: 10px;
    left: 14px;
    text-align: left;
    color: var(--text-light);
    font-size: 0.9rem;
}

.relation-list-panel {
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
}

.relation-list-panel h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.no-relations {
    color: var(--text-light);
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem 0;
}

.relation-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.relation-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
}

.relation-agents {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.agent-chip {
    background: rgba(100, 200, 255, 0.15);
    color: #64c8ff;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.relation-arrow {
    color: var(--text-light);
    font-size: 0.9rem;
}

.relation-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.relation-type-badge {
    background: rgba(255, 200, 100, 0.15);
    color: #ffc864;
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
}

.relation-desc {
    color: var(--text-light);
    font-size: 0.8rem;
}

.relation-item .btn-danger {
    margin-top: 0.5rem;
    width: 100%;
}

.relation-memory {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-color);
}

.memory-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.memory-badge.level-1 {
    background: rgba(150, 150, 150, 0.2);
    color: var(--text-light);
}

.memory-badge.level-2 {
    background: rgba(100, 200, 255, 0.2);
    color: #64c8ff;
}

.memory-badge.level-3 {
    background: rgba(200, 100, 255, 0.2);
    color: #c864ff;
}

.btn-xs {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

.btn-xs.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-xs.btn-secondary:hover {
    background: var(--border-color);
}

.btn-xs.btn-danger {
    background: rgba(255, 100, 100, 0.1);
    color: #ff6464;
    border: 1px solid rgba(255, 100, 100, 0.3);
}

.btn-xs.btn-danger:hover {
    background: rgba(255, 100, 100, 0.2);
}

.memory-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.memory-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
}

.memory-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.memory-agents {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.memory-agent-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
}

.memory-connect {
    display: flex;
    align-items: center;
}

.memory-level-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.memory-level-badge.level-1 {
    background: rgba(150, 150, 150, 0.15);
    color: #999;
    border: 1px solid rgba(150, 150, 150, 0.3);
}

.memory-level-badge.level-2 {
    background: rgba(100, 200, 255, 0.15);
    color: #64c8ff;
    border: 1px solid rgba(100, 200, 255, 0.3);
}

.memory-level-badge.level-3 {
    background: rgba(255, 100, 200, 0.15);
    color: #ff64c8;
    border: 1px solid rgba(255, 100, 200, 0.3);
}

.memory-actions {
    display: flex;
    gap: 0.5rem;
}

.memory-body {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.memory-label {
    font-weight: 600;
    color: var(--text-color);
}

.memory-words {
    color: #ffc864;
}

.memory-desc {
    color: var(--text-light);
}

.level-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.level-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.level-option:hover {
    border-color: #64c8ff;
}

.level-option.active {
    border-color: #64c8ff;
    background: rgba(100, 200, 255, 0.08);
}

.level-radio {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.level-option.active .level-radio {
    border-color: #64c8ff;
}

.level-option.active .level-radio::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64c8ff;
}

.level-name {
    font-weight: 600;
    color: var(--text-color);
    min-width: 60px;
}

.level-desc {
    font-size: 0.8rem;
    color: var(--text-light);
}

.form-hint {
    color: var(--text-light);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.avatar-upload {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--holo-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 2rem;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: var(--primary-color);
}

.btn-primary {
    width: 100%;
    padding: 0.875rem 2rem;
    background: var(--accent-blue);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(100, 200, 255, 0.4);
}

.public-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.toggle-info h3 {
    color: var(--text-color);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.toggle-info p {
    color: var(--text-light);
    font-size: 0.85rem;
}

.toggle-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-toggle {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--secondary-color);
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-toggle:hover {
    background: var(--primary-color);
}

.btn-toggle.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 28px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #ffc864;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.public-preview {
    margin-bottom: 1.5rem;
}

.public-preview h4 {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.preview-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--holo-color);
    border: 1px solid var(--accent-blue);
    border-radius: 12px;
}

.preview-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--holo-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    overflow: hidden;
}

.preview-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-info h5 {
    color: var(--text-color);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.preview-info p {
    color: var(--text-light);
    font-size: 0.85rem;
}

.agents-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.agent-list-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s;
}

.agent-list-card:hover {
    border-color: var(--accent-blue);
}

.agent-list-avatar {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 50%;
    background: var(--holo-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    overflow: hidden;
}

.agent-list-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agent-list-info {
    flex: 1;
    min-width: 0;
}

.agent-list-name {
    color: var(--text-color);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.agent-list-desc {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agent-list-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag-public {
    background: rgba(100, 255, 150, 0.2) !important;
    color: #64ff96 !important;
}

.tag-private {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-light) !important;
}

.agent-list-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.settings-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.settings-actions .btn-primary {
    flex: 1;
}

.settings-actions .btn-secondary {
    flex-shrink: 0;
}

.settings-actions .btn-knowledge {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 6px;
    border: 1px solid rgba(109, 179, 242, 0.4);
    background: rgba(109, 179, 242, 0.15);
    color: #6db3f2;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-actions .btn-knowledge:hover {
    background: rgba(109, 179, 242, 0.3);
    border-color: rgba(109, 179, 242, 0.6);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 80, 80, 0.4);
    background: rgba(255, 80, 80, 0.15);
    color: #ff6b6b;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: rgba(255, 80, 80, 0.3);
    border-color: rgba(255, 80, 80, 0.6);
}

.list-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.list-toolbar .btn-primary {
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.loading-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.success-message {
    padding: 1rem;
    background: rgba(100, 255, 150, 0.2);
    border: 1px solid rgba(100, 255, 150, 0.4);
    border-radius: 8px;
    color: #64ff96;
    text-align: center;
    margin-top: 1rem;
}

.error-message {
    padding: 1rem;
    background: rgba(255, 100, 100, 0.2);
    border: 1px solid rgba(255, 100, 100, 0.4);
    border-radius: 8px;
    color: #ff6464;
    text-align: center;
    margin-top: 1rem;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .ai-agents-page .page-title,
    .vip-settings-page .page-title {
        font-size: 1.75rem;
    }

    .agents-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1rem;
    }

    .agent-card {
        padding: 1rem;
        border-radius: 12px;
    }

    .agent-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(100, 200, 255, 0.15);
    }

    .agent-official-badge {
        top: -6px;
        right: 8px;
        padding: 0.15rem 0.5rem;
        font-size: 0.65rem;
        border-radius: 6px;
    }

    .agent-avatar {
        width: 48px;
        height: 48px;
        margin-bottom: 0.75rem;
    }

    .agent-default-avatar {
        font-size: 1.5rem;
    }

    .agent-info .agent-name {
        font-size: 1rem;
        margin-bottom: 0.35rem;
    }

    .agent-info .agent-creator {
        font-size: 0.75rem;
        margin-bottom: 0.35rem;
    }

    .agent-info .agent-desc {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }

    .agent-tags {
        gap: 0.35rem;
    }

    .agent-tag {
        padding: 0.2rem 0.6rem;
        font-size: 0.7rem;
        border-radius: 16px;
    }

    .agent-card-actions {
        gap: 0.4rem;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
    }

    .agent-detail-btn,
    .agent-chat-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        border-radius: 6px;
    }

    .agent-chat-btn:hover {
        transform: scale(1.01);
        box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
    }

    .settings-tabs {
        flex-direction: column;
    }

    .public-toggle {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .settings-content {
        padding: 1rem;
        border-radius: 12px;
    }

    .list-toolbar {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .list-toolbar .btn-primary {
        justify-content: center;
    }

    .agent-list-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }

    .agent-list-avatar {
        width: 48px;
        height: 48px;
        min-width: 48px;
        font-size: 1.25rem;
    }

    .agent-list-info {
        width: 100%;
    }

    .agent-list-desc {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .agent-list-meta {
        margin-top: 0.5rem;
    }

    .agent-list-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 0.5rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-color);
    }

    .agent-list-actions .btn-sm {
        flex: 1;
        text-align: center;
        padding: 0.5rem;
    }

    .relation-main {
        grid-template-columns: 1fr;
    }

    .relation-canvas-container {
        height: 300px;
    }

    .relation-canvas {
        height: 100%;
    }

    .relation-list-panel {
        max-height: 250px;
        overflow-y: auto;
    }

    .memory-header {
        flex-direction: column;
    }

    .memory-actions {
        width: 100%;
    }

    .memory-actions .btn-sm {
        flex: 1;
        text-align: center;
    }

    .level-option {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }

    .level-name {
        font-size: 0.85rem;
        min-width: 50px;
    }

    .level-desc {
        font-size: 0.7rem;
    }
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-color);
    border-radius: 12px;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stats-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
}

.panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table th,
.stats-table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.stats-table th {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

.stats-table td {
    font-size: 0.9rem;
}

.rank-badge {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--secondary-color);
    color: var(--text-light);
}

.rank-badge.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffb800);
    color: #fff;
}

.rank-badge.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #a8a8a8);
    color: #fff;
}

.rank-badge.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #b87333);
    color: #fff;
}

.agent-list,
.user-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.agent-item,
.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: var(--secondary-color);
    border-radius: 8px;
}

.agent-name,
.user-name {
    font-weight: 500;
    color: var(--text-color);
}

.agent-stats {
    font-size: 0.8rem;
    color: var(--text-light);
}

.today-count {
    color: var(--accent-blue);
    font-weight: 600;
}

.total-count {
    color: var(--text-light);
}

.user-count {
    font-size: 0.85rem;
    color: var(--accent-blue);
    font-weight: 600;
}

.stats-chart-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.simple-chart {
    padding: 1rem 0;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 150px;
    gap: 0.5rem;
}

.chart-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.chart-bar {
    width: 100%;
    max-width: 30px;
    background: linear-gradient(180deg, var(--accent-color), var(--accent-blue));
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    transition: height 0.3s ease;
}

.chart-label {
    font-size: 0.65rem;
    color: var(--text-light);
    margin-top: 0.25rem;
    text-align: center;
}

.chart-value {
    font-size: 0.7rem;
    color: var(--text-color);
    font-weight: 500;
    margin-top: 0.125rem;
}

.stats-days-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
}

.empty-hint {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .chart-bars {
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
}

/* ============ AI档案面板 ============ */
.ai-profile-panel {
    position: fixed;
    top: 0;
    right: -340px;
    width: 320px;
    height: 100vh;
    background: var(--card-bg);
    border-left: 1px solid var(--border-color);
    box-shadow: -4px 0 20px var(--shadow-color);
    z-index: 1100;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.ai-profile-panel.panel-open {
    right: 0;
}

.profile-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1099;
    animation: fadeIn 0.3s ease;
}

.temp-settings-panel {
    position: fixed;
    top: 0;
    right: -340px;
    width: 320px;
    height: 100vh;
    background: var(--card-bg);
    box-shadow: -5px 0 20px var(--shadow-color);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    overflow: hidden;
}

.temp-settings-panel.panel-open {
    right: 0;
}

.temp-settings-intro {
    padding: 0.8rem 1.2rem;
    background: rgba(126, 200, 227, 0.1);
    border-bottom: 1px solid var(--border-color);
}

.temp-settings-intro p {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
}

.temp-settings-intro strong {
    color: var(--accent-blue);
}

.temp-settings-actions {
    padding: 1rem 1.2rem;
    display: flex;
    gap: 0.8rem;
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
}

.temp-settings-actions .profile-ai-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

.temp-settings-actions .clear-settings-btn {
    background: #ff6b6b;
    color: white;
}

.temp-settings-actions .clear-settings-btn:hover {
    background: #ff5252;
}

.temp-settings-message {
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}

.temp-settings-message.message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.temp-settings-message.message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.temp-settings-inline {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px var(--shadow-color);
    transition: padding 0.2s ease;
}

.temp-settings-inline.is-collapsed {
    /* 折叠态不显示 body */
}
.temp-settings-inline.is-collapsed .temp-settings-inline-body {
    display: none;
}

.temp-settings-inline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(126, 200, 227, 0.1);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.15s;
    width: 515px;
    height: 32px;
}

/* 调试模式：URL 加 ?debug=mobile 启用，给关键元素画可视边框 */
.chat-page[data-debug="mobile"] .chat-container {
    outline: 2px dashed red !important;
    outline-offset: -2px;
}
.chat-page[data-debug="mobile"] .chat-header {
    outline: 2px dashed blue !important;
    outline-offset: -2px;
}
.chat-page[data-debug="mobile"] .chat-body {
    outline: 2px dashed green !important;
    outline-offset: -2px;
}
.chat-page[data-debug="mobile"] .chat-footer {
    outline: 2px dashed orange !important;
    outline-offset: -2px;
}
.chat-page[data-debug="mobile"] .temp-settings-inline {
    outline: 2px dashed purple !important;
    outline-offset: -2px;
}
.chat-page[data-debug="mobile"]::after {
    content: "container=red header=blue body=green footer=orange temp=purple";
    position: fixed;
    top: 0;
    left: 0;
    background: black;
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    z-index: 99999;
    pointer-events: none;
}

.temp-settings-inline-header:hover {
    background: rgba(126, 200, 227, 0.18);
}

.temp-settings-inline.is-collapsed .temp-settings-inline-header {
    border-bottom: none;
}

.temp-settings-inline-toggle {
    font-size: 0.78rem;
    color: var(--accent-blue);
    font-weight: normal;
}

.temp-settings-inline-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
    color: var(--accent-blue);
}

.temp-settings-badge {
    background: #4caf50;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: normal;
}

.temp-settings-inline-body {
    padding: 1rem;
}

.temp-settings-inline-row {
    margin-bottom: 1rem;
}

.temp-settings-inline-row:last-child {
    margin-bottom: 0.5rem;
}

.temp-settings-inline-row label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.temp-settings-inline-row textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--bg-secondary);
    color: var(--text-color);
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
}

.temp-settings-inline-row textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(126, 200, 227, 0.2);
}

.temp-settings-inline-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.clear-temp-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.clear-temp-btn:hover {
    background: #ff5252;
}

.clear-temp-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .temp-settings-panel {
        width: 85vw;
        right: -85vw;
    }

    .temp-settings-panel.panel-open {
        right: 0;
    }
}

.profile-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.2rem 0.8rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 1;
}

.profile-panel-header h3 {
    font-size: 1.1rem;
    color: var(--accent-blue);
    margin: 0;
}

.profile-panel-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.profile-panel-close:hover {
    background: var(--secondary-color);
}

.profile-panel-body {
    padding: 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.profile-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-section label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.profile-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.profile-section-header label {
    margin: 0;
    flex-shrink: 0;
}

.profile-ai-btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--accent-blue);
    background: transparent;
    color: var(--accent-blue);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.profile-ai-btn:hover:not(:disabled) {
    background: var(--accent-blue);
    color: #fff;
}

.profile-ai-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.profile-input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-main);
    color: var(--text-color);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.profile-input:focus {
    border-color: var(--accent-blue);
}

.profile-textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-main);
    color: var(--text-color);
    font-size: 0.9rem;
    outline: none;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    line-height: 1.5;
    transition: border-color 0.2s;
}

.profile-textarea:focus {
    border-color: var(--accent-blue);
}

.favorability-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.favorability-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #e74c3c, #f39c12, #2ecc71, #e91e63);
    outline: none;
    cursor: pointer;
}

.favorability-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--accent-blue);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: transform 0.15s;
}

.favorability-slider::-webkit-slider-thumb:active {
    transform: scale(1.2);
}

.favorability-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-blue);
    min-width: 45px;
    text-align: right;
}

.favorability-bar {
    width: 100%;
    height: 10px;
    background: var(--secondary-color);
    border-radius: 5px;
    overflow: hidden;
}

.favorability-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.favorability-fill.fav-low {
    background: linear-gradient(90deg, #e74c3c, #f39c12);
}

.favorability-fill.fav-mid {
    background: linear-gradient(90deg, #f39c12, #2ecc71);
}

.favorability-fill.fav-high {
    background: linear-gradient(90deg, #2ecc71, #27ae60);
}

.favorability-fill.fav-max {
    background: linear-gradient(90deg, #e91e63, #ff6b9d);
    animation: pulseFav 2s infinite;
}

.favorability-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.fav-auto-btn {
    margin-top: 0.6rem;
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    color: #fff;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s;
    width: 100%;
    text-align: center;
}

.fav-auto-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.35);
}

.fav-auto-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.profile-login-hint {
    text-align: center;
    padding: 2rem 0;
}

.profile-login-hint p {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.profile-login-hint button {
    padding: 0.6rem 1.5rem;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.profile-login-hint button:hover {
    opacity: 0.85;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulseFav {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .ai-profile-panel {
        width: 85vw;
        right: -85vw;
    }

    .ai-profile-panel.panel-open {
        right: 0;
    }
}

/* ============ AI群聊页面样式 ============ */
.group-chat-page {
    min-height: 100vh;
    padding-top: 70px;
}

/* 群聊消息动画 */
.group-chat-page .chat-message {
    animation: messageSlideIn 0.3s ease forwards;
}

.group-chat-page .user-message {
    animation-name: messageSlideInRight;
}

.group-chat-page .ai-message {
    animation-name: messageSlideInLeft;
}

/* 群聊系统消息（如 X 加入/离开群聊） */
.group-chat-page .chat-message.system-message {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: messageFadeIn 0.35s ease forwards;
}

.group-chat-page .system-message-bubble {
    background: rgba(0, 0, 0, 0.06);
    color: #6b7280;
    font-size: 0.78rem;
    padding: 4px 12px;
    border-radius: 10px;
    line-height: 1.4;
    text-align: center;
    max-width: 80%;
    word-break: break-word;
}

.group-chat-page .ai-message .message-bubble {
    color: #1f2937;
}

@media (prefers-color-scheme: dark) {
    .group-chat-page .system-message-bubble {
        background: rgba(255, 255, 255, 0.08);
        color: #9ca3af;
    }
}

@keyframes messageFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 群聊消息容器修复 - 确保显示完整 */
.group-chat-page .chat-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.group-chat-page .chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--bg-main);
    -webkit-overflow-scrolling: touch;
    /* 确保消息不被遮挡 */
    padding-bottom: env(safe-area-inset-bottom, 10px);
}

.group-chat-page .chat-messages .chat-message {
    /* 确保消息完整显示 */
    flex-shrink: 0;
    margin-bottom: 0.25rem;
}

.group-chat-page .chat-messages .chat-message:last-child {
    /* 最后一条消息留出底部间距 */
    margin-bottom: 0.5rem;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes messageSlideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes messageSlideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 新消息高亮效果 */
.group-chat-page .chat-message.new-message {
    animation: messagePopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes messagePopIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 消息气泡呼吸效果 */
.group-chat-page .chat-message.ai-message .message-bubble {
    animation: bubbleFadeIn 0.3s ease;
}

.group-chat-page .chat-message.user-message .message-bubble {
    animation: bubbleFadeIn 0.3s ease;
}

@keyframes bubbleFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.group-chat-create {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 1rem;
}

.group-chat-create .page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.group-chat-create .page-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.group-chat-create .page-subtitle {
    color: var(--text-light);
    font-size: 1rem;
}

.group-chat-create .page-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.group-chat-create .chat-container {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 680px;
    height: calc(100vh - 70px);
    height: calc(100dvh - 70px);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    z-index: 100;
    transition: height 0.2s ease;
}

.group-chat-create .chat-container .back-btn {
    padding: 0.4rem 0.8rem;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.group-chat-create .member-avatars {
    display: flex;
    gap: 0;
    align-items: center;
}

.group-chat-create .member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
    margin-left: -8px;
    background: var(--holo-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 1rem;
}

.group-chat-create .member-avatar:first-child {
    margin-left: 0;
}

.group-chat-create .member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.group-chat-create .more-members {
    margin-left: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

.recent-sessions {
    margin-bottom: 3rem;
}

.recent-sessions h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.session-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.session-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

.session-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(100, 200, 255, 0.15);
    border-color: var(--accent-blue);
}

.session-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.session-card-header h4 {
    font-size: 1.1rem;
    color: var(--text-color);
}

.member-count {
    background: rgba(100, 200, 255, 0.15);
    color: var(--accent-blue);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.session-scene {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.session-members {
    color: var(--accent-blue);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.session-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-light);
}

.session-meta .delete-btn {
    padding: 0.3rem 0.8rem;
    background: rgba(255, 100, 100, 0.1);
    border: 1px solid rgba(255, 100, 100, 0.3);
    color: #ff6b6b;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.session-meta .delete-btn:hover {
    background: rgba(255, 100, 100, 0.2);
}

.create-form {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
}

.create-form h3 {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.create-form .form-group {
    margin-bottom: 1.5rem;
}

.create-form .form-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.create-form .form-group input[type="text"],
.create-form .form-group textarea,
.create-form .form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-main);
    color: var(--text-color);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.create-form .form-group input[type="text"]:focus,
.create-form .form-group textarea:focus,
.create-form .form-group select:focus {
    border-color: var(--accent-blue);
}

.create-form .form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    line-height: 1.6;
}

.agent-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.agent-category h4 {
    font-size: 1rem;
    color: var(--accent-blue);
    margin-bottom: 1rem;
}

.agent-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
}

.agent-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.agent-item:hover {
    background: var(--primary-color);
}

.agent-item.selected {
    background: rgba(100, 200, 255, 0.15);
    border-color: var(--accent-blue);
}

.agent-item .agent-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--holo-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.agent-item .agent-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agent-item .agent-name {
    flex: 1;
    font-weight: 600;
    color: var(--text-color);
}

.agent-item .agent-creator {
    font-size: 0.8rem;
    color: var(--text-light);
}

.agent-item .check-mark {
    position: absolute;
    right: 0.75rem;
    color: var(--accent-blue);
    font-size: 1.2rem;
    font-weight: bold;
}

.selected-count {
    text-align: right;
    font-size: 0.9rem;
    color: var(--accent-blue);
    margin-top: 0.75rem;
}

.create-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-color));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1rem;
}

.create-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(100, 200, 255, 0.4);
}

.create-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.member-selector-bar {
    flex-shrink: 0;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0.6rem 1rem;
    overflow: hidden;
}

.member-selector-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
}

.member-selector-scroll::-webkit-scrollbar {
    height: 3px;
}

.member-selector-scroll::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.member-chip {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    background: var(--secondary-color);
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-color);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    user-select: none;
    flex-shrink: 0;
}

.member-chip:hover {
    background: rgba(100, 200, 255, 0.1);
    border-color: var(--accent-blue);
}

.member-chip.active {
    background: rgba(100, 200, 255, 0.2);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    font-weight: 600;
    box-shadow: 0 0 8px rgba(100, 200, 255, 0.2);
}

.chip-icon {
    font-size: 0.9rem;
}

.chip-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.chip-avatar-placeholder {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--holo-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: bold;
    color: var(--accent-blue);
    border: 1px solid var(--border-color);
}

.target-indicator {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 1001;
    padding: 0;
    background: transparent;
    animation: targetBubbleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes targetBubbleIn {
    from { opacity: 0; transform: scale(0.8) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.target-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-color));
    padding: 0.5rem 1rem;
    border-radius: 24px;
    border: none;
    box-shadow: 0 4px 16px rgba(91, 164, 201, 0.35), 0 2px 6px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    font-weight: 500;
}

.target-tag strong {
    color: #fff;
}

.target-clear {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.15rem 0.35rem;
    line-height: 1;
    margin-left: 0.3rem;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.target-clear:hover {
    background: rgba(255, 107, 107, 0.8);
    transform: rotate(90deg);
}

.settings-btn {
    background: rgba(100, 200, 255, 0.1);
    border: 1px solid rgba(100, 200, 255, 0.3);
    color: var(--accent-blue);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: 0.5rem;
    flex-shrink: 0;
}
.settings-btn:hover {
    background: rgba(100, 200, 255, 0.2);
    transform: rotate(30deg);
}

.new-conv-btn {
    background: rgba(100, 255, 150, 0.1);
    border: 1px solid rgba(100, 255, 150, 0.3);
    color: #66cc99;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: 0.3rem;
}
.new-conv-btn:hover {
    background: rgba(100, 255, 150, 0.2);
}

.group-chat-settings {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.settings-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.settings-tabs button {
    padding: 0.4rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s;
}
.settings-tabs button.active {
    color: var(--accent-blue);
    border-bottom: 2px solid var(--accent-blue);
    font-weight: 600;
    margin-bottom: -0.5rem;
}
.settings-tabs button:hover {
    background: rgba(100, 200, 255, 0.05);
}

.settings-panel h4 {
    font-size: 0.95rem;
    color: var(--text-color);
    margin: 1rem 0 0.5rem 0;
}

.settings-panel .form-group {
    margin-bottom: 0.8rem;
}
.settings-panel .form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.3rem;
}
.settings-panel .form-group textarea,
.settings-panel .form-group select,
.settings-panel .form-group input[type="text"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.9rem;
    box-sizing: border-box;
    resize: vertical;
}
.settings-panel .form-group textarea:focus,
.settings-panel .form-group select:focus,
.settings-panel .form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(100, 200, 255, 0.15);
}

.member-list-settings {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}
.member-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
}
.member-avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    overflow: hidden;
    flex-shrink: 0;
}
.member-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.member-row .member-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-color);
}
.remove-member-btn {
    background: rgba(255, 100, 100, 0.1);
    border: 1px solid rgba(255, 100, 100, 0.3);
    color: #ff6b6b;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.remove-member-btn:hover {
    background: rgba(255, 100, 100, 0.2);
}
.agent-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.add-member-btn {
    background: var(--accent-blue);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.add-member-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}
.add-member-btn:hover:not(:disabled) {
    opacity: 0.85;
}

.save-settings-btn {
    background: var(--accent-blue);
    color: #fff;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    margin-top: 0.5rem;
}
.save-settings-btn:hover {
    opacity: 0.85;
}

.delete-settings-btn {
    background: rgba(255, 100, 100, 0.1);
    color: #ff6b6b;
    border: 1px solid rgba(255, 100, 100, 0.3);
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    margin-left: 0.5rem;
}
.delete-settings-btn:hover {
    background: rgba(255, 100, 100, 0.2);
}

.temp-settings-btns {
    display: flex;
    margin-top: 0.5rem;
}

.new-conv-footer-btn {
    background: rgba(100, 255, 150, 0.1);
    border: 1px solid rgba(100, 255, 150, 0.3);
    color: #66cc99;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    margin-left: 0.3rem;
}
.new-conv-footer-btn:hover {
    background: rgba(100, 255, 150, 0.15);
}

/* 群聊房间样式 */
/* 响应式设计 */
@media (max-width: 768px) {
    .group-chat-page {
        padding-top: 0;
    }

    .group-chat-page .chat-container {
        top: 50px;
        left: 0;
        right: 0;
        bottom: 0;
        transform: none;
        max-width: 100%;
        height: calc(100vh - 50px);
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
    }

    .group-chat-page .chat-header {
        position: fixed;
        top: 50px;
        left: 0;
        right: 0;
        z-index: 1001;
        background: var(--nav-bg);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .group-chat-page .member-selector-bar {
        position: fixed;
        top: 97px;
        left: 0;
        right: 0;
        z-index: 1001;
        padding: 0.45rem 0.6rem;
        background: var(--nav-bg);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    }

    .group-chat-page .chat-body {
        margin: 0;
        padding: 0;
        flex: 1;
        overflow: hidden;
        min-height: 0;
    }

    .group-chat-page .chat-messages {
        padding: 0.5rem 0.6rem;
        gap: 0.6rem;
    }

    .group-chat-create .page-title {
        font-size: 1.75rem;
    }

    .group-chat-create .chat-container {
        top: 60px;
        height: calc(100vh - 60px);
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .group-chat-create .member-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }

    .session-cards {
        grid-template-columns: 1fr;
    }

    .agent-selector {
        grid-template-columns: 1fr;
    }

    .create-form {
        padding: 1.5rem;
    }

    .chat-message .message-avatar {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }

    .chat-message .message-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
    }

    .member-selector-bar {
        padding: 0.4rem 0.5rem;
    }

    .member-chip {
        padding: 0.35rem 0.65rem;
        font-size: 0.78rem;
        gap: 0.25rem;
    }

    .chip-avatar,
    .chip-avatar-placeholder {
        width: 18px;
        height: 18px;
    }

    .target-tag {
        font-size: 0.72rem;
        padding: 0.2rem 0.6rem;
    }

    .group-chat-page .target-indicator {
        position: fixed;
        bottom: 100px;
        right: 12px;
        left: auto;
        z-index: 1001;
    }

    .group-chat-page .target-tag {
        font-size: 0.76rem;
        padding: 0.4rem 0.85rem;
        box-shadow: 0 4px 14px rgba(91, 164, 201, 0.4), 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .group-chat-page .target-clear {
        width: 20px;
        height: 20px;
        font-size: 0.8rem;
    }

    .group-chat-page .group-chat-settings {
        position: fixed;
        top: 97px;
        left: 0;
        right: 0;
        z-index: 1002;
        max-height: calc(100vh - 150px);
        border-bottom: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .group-chat-page .settings-btn,
    .group-chat-page .new-conv-btn {
        width: 32px;
        height: 32px;
        font-size: 0.95rem;
    }
}


/* ============ ����ҳ�ع�����Ӧʽ���� ============ */
@media (max-width: 768px) {
    .story-last-read,
    .story-latest-bar {
        padding: 0.85rem 1rem;
    }

    .last-read-content {
        flex-direction: column;
        align-items: stretch;
        gap: 0.7rem;
    }

    .last-read-action {
        align-self: flex-end;
    }

    .resume-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .story-latest-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .latest-bar-right {
        align-self: flex-end;
    }

    .latest-chapter {
        font-size: 0.95rem;
    }

    .latest-label {
        font-size: 0.88rem;
    }

    .section-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .section-tools {
        align-self: flex-end;
    }

    .recent-list-inner {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .last-read-chapter {
        font-size: 1.05rem;
    }

    .progress-bar-wrap {
        max-width: 160px;
    }
}

/* ��ɫģʽ�µ� �ϴζ���ģ�� */
[data-theme="dark"] .story-last-read {
    background: linear-gradient(135deg, rgba(100, 200, 255, 0.18), rgba(180, 130, 255, 0.18));
    border-color: rgba(100, 200, 255, 0.35);
}

[data-theme="dark"] .story-last-read-empty {
    background: var(--card-bg);
    border-color: var(--border-color);
}

/* ========== 临时拉入 AI（多 agent 共存） ========== */

/* 头部右上角"在场临时 AI"小标签 */
.invited-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    background: linear-gradient(135deg, rgba(255, 150, 100, 0.15), rgba(255, 100, 180, 0.15));
    color: #d97a4a;
    border: 1px solid rgba(255, 150, 100, 0.3);
}
[data-theme="dark"] .invited-tag {
    color: #ffb38a;
    background: linear-gradient(135deg, rgba(255, 150, 100, 0.25), rgba(255, 100, 180, 0.25));
    border-color: rgba(255, 150, 100, 0.4);
}
.user-identity-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(100, 180, 255, 0.15), rgba(100, 255, 180, 0.15));
    color: #4a8ad9;
    border: 1px solid rgba(100, 180, 255, 0.3);
    transition: all 0.2s;
}
.user-identity-tag:hover {
    background: linear-gradient(135deg, rgba(100, 180, 255, 0.25), rgba(100, 255, 180, 0.25));
    border-color: rgba(100, 180, 255, 0.6);
}
[data-theme="dark"] .user-identity-tag {
    color: #8ab8ff;
    background: linear-gradient(135deg, rgba(100, 180, 255, 0.25), rgba(100, 255, 180, 0.25));
    border-color: rgba(100, 180, 255, 0.4);
}

/* 临时成员条（横向 chip 列表） */
.invited-agents-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(255, 200, 100, 0.08), rgba(255, 150, 200, 0.08));
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    flex-shrink: 0;
}
.invited-bar-label {
    font-size: 12px;
    color: var(--text-secondary, #888);
    white-space: nowrap;
    flex-shrink: 0;
}
.invited-bar-list {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
}
.invited-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 6px 3px 3px;
    border-radius: 20px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #eee);
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    max-width: 160px;
    transition: all 0.15s ease;
}
.invited-chip:hover {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.invited-chip-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.invited-chip-avatar-placeholder {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff9a8b, #ff6a88);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}
.invited-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    color: var(--text-primary, #333);
}
.invited-chip-remove {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-secondary, #666);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.invited-chip-remove:hover {
    background: rgba(255, 80, 80, 0.85);
    color: #fff;
}

/* 多 agent 模式下：消息上方的发言者名字 */
.message-sender-name {
    font-size: 12px;
    margin-bottom: 4px;
    padding: 0 4px;
    font-weight: 500;
    line-height: 1.2;
}
.message-sender-name.main-sender {
    color: var(--text-secondary, #888);
}
.message-sender-name.invited-sender {
    color: #d97a4a;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
[data-theme="dark"] .message-sender-name.invited-sender {
    color: #ffb38a;
}
.sender-invited-tag {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 8px;
    font-size: 10px;
    background: rgba(255, 150, 100, 0.15);
    color: #d97a4a;
    border: 1px solid rgba(255, 150, 100, 0.3);
    font-weight: 400;
    line-height: 1;
}
[data-theme="dark"] .sender-invited-tag {
    color: #ffb38a;
    background: rgba(255, 150, 100, 0.25);
    border-color: rgba(255, 150, 100, 0.4);
}

/* 多 agent 消息气泡：左边加一条彩色细线，让用户能一眼区分是哪个 agent 在说话 */
.chat-message.ai-message.multi-agent-msg .message-bubble {
    border-left: 3px solid #ff9a8b;
    padding-left: 12px;
}

/* ========== 拉入 AI 弹窗 ========== */
.invite-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
    box-sizing: border-box;
    backdrop-filter: blur(2px);
    animation: invite-fade-in 0.18s ease;
}
@keyframes invite-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
.invite-dialog {
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: invite-zoom-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes invite-zoom-in {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
/* 称呼弹窗更紧凑 */
.display-name-dialog {
    max-width: 340px !important;
}
.invite-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}
.invite-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}
.invite-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}
.invite-close:hover {
    background: var(--hover-bg, rgba(0,0,0,0.06));
}
.invite-body {
    flex: 1;
    padding: 14px 18px;
    overflow-y: auto;
    min-height: 200px;
}
.invite-intro {
    margin: 0 0 12px 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}
.invite-intro strong {
    color: var(--text-primary);
}
.invite-search {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.invite-search-input {
    flex: 1;
    height: 34px;
    border-radius: 17px;
    border: 1px solid var(--border-color);
    background: var(--input-bg, rgba(0,0,0,0.03));
    color: var(--text-primary);
    padding: 0 14px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}
.invite-search-input:focus {
    border-color: var(--primary-color, #ff9a8b);
}
.invite-selected-count {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.invite-loading, .invite-empty {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
    font-size: 13px;
}
.invite-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.invite-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--card-bg, transparent);
    cursor: pointer;
    transition: all 0.15s ease;
}
.invite-item:hover {
    border-color: var(--primary-color, #ff9a8b);
    background: var(--hover-bg, rgba(255, 154, 139, 0.06));
}
.invite-item.selected {
    border-color: var(--primary-color, #ff9a8b);
    background: linear-gradient(135deg, rgba(255, 154, 139, 0.1), rgba(255, 106, 136, 0.1));
}
.invite-item.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.invite-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.invite-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff9a8b, #ff6a88);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.invite-info {
    flex: 1;
    min-width: 0;
}
.invite-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}
.invite-tag-official, .invite-tag-self, .invite-tag-private {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.4;
}
.invite-tag-official {
    background: rgba(100, 150, 255, 0.15);
    color: #4a6dd9;
    border: 1px solid rgba(100, 150, 255, 0.3);
}
.invite-tag-self {
    background: rgba(255, 154, 139, 0.15);
    color: #d97a4a;
    border: 1px solid rgba(255, 154, 139, 0.3);
}
.invite-tag-private {
    background: rgba(160, 120, 200, 0.15);
    color: #8a5fbf;
    border: 1px solid rgba(160, 120, 200, 0.3);
}
[data-theme="dark"] .invite-tag-official {
    color: #95b3ff;
    background: rgba(100, 150, 255, 0.25);
    border-color: rgba(100, 150, 255, 0.4);
}
[data-theme="dark"] .invite-tag-self {
    color: #ffb38a;
    background: rgba(255, 154, 139, 0.25);
    border-color: rgba(255, 154, 139, 0.4);
}
[data-theme="dark"] .invite-tag-private {
    color: #c69de8;
    background: rgba(160, 120, 200, 0.25);
    border-color: rgba(160, 120, 200, 0.4);
}
.invite-check {
    color: var(--primary-color, #ff6a88);
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
}
.invite-add {
    color: var(--text-secondary);
    font-size: 20px;
    font-weight: 300;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}
.invite-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 18px;
    border-top: 1px solid var(--border-color);
    background: var(--card-bg, rgba(0,0,0,0.02));
}
.invite-cancel, .invite-confirm {
    height: 36px;
    padding: 0 18px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}
.invite-cancel:hover {
    background: var(--hover-bg, rgba(0,0,0,0.06));
}
.invite-confirm {
    background: linear-gradient(135deg, #ff9a8b, #ff6a88);
    color: #fff;
    border: none;
    font-weight: 500;
}
.invite-confirm:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(255, 106, 136, 0.4);
    transform: translateY(-1px);
}
.invite-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
