/* ==================== 🎨 艺术主题变量系统 ==================== */

/* 1. 暖橙枫叶 (warm-maple) */
:root, [data-theme="warm-maple"] {
    --bg-gradient: linear-gradient(135deg, #fff5e6 0%, #ffe4cc 100%);
    --primary-color: #ff8c42;
    --primary-hover: #f77a2a;
    --user-bubble: #ffb366;
    --user-text: #ffffff;
    --bot-bubble: #ffe4cc;
    --bot-text: #4a3e3d;
    --card-bg: rgba(255, 255, 255, 0.88);
    --border-color: rgba(255, 228, 204, 0.8);
    --text-main: #4a3e3d;
    --text-muted: #8c7a78;
    --shadow-soft: 0 12px 36px rgba(255, 140, 0, 0.12);
    --input-bg: #ffffff;
    --input-border: #ffd8b3;
    --sidebar-bg: rgba(255, 250, 245, 0.95);
    --ornament-glow: rgba(255, 140, 0, 0.15);
}

/* 2. 星空夜幕 (starry-night) */
[data-theme="starry-night"] {
    --bg-gradient: linear-gradient(135deg, #181a2e 0%, #282b4a 100%);
    --primary-color: #a393eb;
    --primary-hover: #8e7ce6;
    --user-bubble: #7b68ee;
    --user-text: #ffffff;
    --bot-bubble: #2d3154;
    --bot-text: #e2e5f8;
    --card-bg: rgba(30, 33, 58, 0.88);
    --border-color: rgba(163, 147, 235, 0.25);
    --text-main: #e2e5f8;
    --text-muted: #9aa0c7;
    --shadow-soft: 0 12px 36px rgba(0, 0, 0, 0.35);
    --input-bg: #232645;
    --input-border: #424775;
    --sidebar-bg: rgba(26, 28, 48, 0.95);
    --ornament-glow: rgba(163, 147, 235, 0.2);
}

/* 3. 新增高质感艺术风格：金枫复古 (gold-amber) */
[data-theme="gold-amber"] {
    --bg-gradient: linear-gradient(135deg, #2b231d 0%, #3d3027 100%);
    --primary-color: #e6b87d;
    --primary-hover: #d4a366;
    --user-bubble: linear-gradient(135deg, #c89551 0%, #a67332 100%);
    --user-text: #fffdfa;
    --bot-bubble: rgba(61, 48, 39, 0.85);
    --bot-text: #f3e9dc;
    --card-bg: rgba(43, 35, 29, 0.88);
    --border-color: rgba(230, 184, 125, 0.35);
    --text-main: #f3e9dc;
    --text-muted: #b8a695;
    --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.45);
    --input-bg: #211a15;
    --input-border: #524337;
    --sidebar-bg: rgba(35, 28, 23, 0.96);
    --ornament-glow: rgba(230, 184, 125, 0.25);
}

/* ==================== 全局基础与布局 ==================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-gradient);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
    overflow: hidden;
    transition: background 0.5s ease;
}

/* 背景动态飘落 */
.maple-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.maple-leaf {
    position: absolute;
    font-size: 22px;
    animation: fall 12s infinite linear;
    opacity: 0.65;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

@keyframes fall {
    0% { top: -40px; transform: rotate(0deg) translateX(0); }
    50% { transform: rotate(180deg) translateX(30px); }
    100% { top: 105vh; transform: rotate(360deg) translateX(-30px); }
}

/* ==================== 主界面卡片 ==================== */
.chat-app {
    width: 100%;
    max-width: 520px;
    height: 85vh;
    max-height: 780px;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
    overflow: hidden;
    transition: all 0.3s ease;
}

@media (max-width: 600px) {
    body { padding: 0; }
    .chat-app {
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
        border: none;
    }
}

/* ==================== 顶部 Header ==================== */
.chat-header {
    padding: 14px 18px;
    padding-top: calc(14px + env(safe-area-inset-top));
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--border-color);
    width: 38px;
    height: 38px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px var(--ornament-glow);
}

.nav-btn:active {
    transform: scale(0.92);
}

.header-center {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-container { position: relative; }

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 10px var(--ornament-glow);
}

.status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #52c41a;
    border: 2px solid #fff;
    border-radius: 50%;
}

.header-info h2 {
    font-size: 16px;
    color: var(--primary-color);
    font-weight: 700;
}

.subtitle {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.online-tag {
    font-size: 10px;
    background: rgba(82, 196, 26, 0.15);
    color: #52c41a;
    padding: 1px 6px;
    border-radius: 10px;
}

/* ==================== 双侧边栏 (Sidebars) ==================== */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 280px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
}

.sidebar-left {
    left: 0;
    transform: translateX(-100%);
    border-radius: 0 20px 20px 0;
}

.sidebar-right {
    right: 0;
    transform: translateX(100%);
    border-radius: 20px 0 0 20px;
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    padding: 20px;
    padding-top: calc(20px + env(safe-area-inset-top));
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h3 {
    font-size: 16px;
    color: var(--primary-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.sidebar-content {
    padding: 18px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-group h4, .decor-card h4 {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

/* 主题选择切换容器：改成横向排列 */
.theme-options {
    display: flex;
    flex-direction: row; /* 水平一字排开 */
    gap: 12px;           /* 小按钮之间的间距 */
    align-items: center;
}

/* 主题小按钮：圆角小方块风格 */
.theme-card {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;         /* 稍微宽一点点，方块比例更好看 */
    height: 38px;        
    padding: 0;          
    border: 1px solid var(--border-color);
    border-radius: 10px;  /* ✨ 这里改成 10px 就是柔和的方方圆角啦！（喜欢更方一点可以改 8px） */
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); /* 加上弹性过渡，悬停时会更有质感 */
}

.theme-card .theme-icon {
    font-size: 18px;
}

/* 选中或悬停效果 */
.theme-card:hover,
.theme-card.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px) scale(1.08); /* 微微向上浮起并放大 */
    box-shadow: 0 4px 12px var(--ornament-glow);
}
/* 历史对话列表 */
.chat-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    border: 1px solid transparent;
}

.chat-item.active {
    border-color: var(--border-color);
    background: rgba(255, 255, 255, 0.08);
}

.chat-item-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-item-info .title {
    font-size: 13px;
    font-weight: 600;
}

.chat-item-info .preview {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.new-chat-btn {
    margin-top: 8px;
    width: 100%;
    padding: 10px;
    background: none;
    border: 1px dashed var(--border-color);
    color: var(--primary-color);
    border-radius: 12px;
    font-size: 13px;
    cursor: pointer;
}

/* 右侧装饰卡片与贴纸 */
.decor-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: 16px;
}

.decor-text {
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text-main);
    font-style: italic;
}

.sticker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 6px;
}

.sticker {
    font-size: 24px;
    text-align: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.sticker:hover {
    transform: scale(1.15) rotate(5deg);
}

/* 全局遮罩 */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ==================== 聊天区域与气泡 ==================== */
.chat-box {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.time-divider {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin: 4px 0;
    position: relative;
}

.message-wrapper {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.message-avatar { width: 32px; height: 32px; font-size: 16px; }
.bot-wrapper { align-self: flex-start; }
.user-wrapper { align-self: flex-end; flex-direction: row-reverse; }

.message-content {
    display: flex;
    flex-direction: column;
}

.message {
    padding: 12px 16px;
    font-size: 14.5px;
    line-height: 1.5;
    word-break: break-word;
    border: 1px solid var(--border-color);
}

.bot-message {
    background: var(--bot-bubble);
    color: var(--bot-text);
    border-radius: 18px 18px 18px 4px;
}

.user-message {
    background: var(--user-bubble);
    color: var(--user-text);
    border-radius: 18px 18px 4px 18px;
}

.timestamp {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    padding: 0 4px;
}

.user-wrapper .timestamp { text-align: right; }

/* 打字动画 */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 8px 20px;
    font-size: 12px;
    color: var(--text-muted);
}

.typing-indicator.active { display: flex; }

.typing-indicator span {
    width: 5px;
    height: 5px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: blink 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes blink {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.2); }
}

/* ==================== 底部输入框 ==================== */
.input-container {
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}

.input-container input {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 14.5px;
    outline: none;
    color: var(--text-main);
    transition: all 0.25s ease;
}

.input-container input:focus {
    border-color: var(--primary-color);
}

.send-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.send-btn:active { transform: scale(0.95); }
/* ==================== 🧠 深度思考 toggle 开关样式 ==================== */
.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.switch-label {
    display: flex;
    flex-direction: column;
}

.switch-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.switch-sub {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* iOS 风格 Switch 按钮 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid var(--border-color);
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-main);
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(18px);
    background-color: #ffffff;
}
/* ==================== 细节修饰 ==================== */

/* 1. 隐藏侧边栏的内容拖动条，但保留鼠标滚轮滑动功能 */
.sidebar-content {
    -ms-overflow-style: none;  /* IE 和 Edge */
    scrollbar-width: none;  /* Firefox */
}
.sidebar-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge 隐藏滚动条 */
}

/* 2. 动态隐藏头像的样式逻辑 */
body.hide-avatars .message-avatar {
    display: none !important;
}

/* 头像隐藏后，把对方消息气泡往左边挪一点，对齐更好看 */
body.hide-avatars .bot-wrapper .message-content {
    margin-left: 0; 
}
/* ==================== ⚙️ 悬浮设置弹窗 ==================== */
.settings-popup {
    position: absolute;
    top: 70px;
    right: 15px;
    width: 260px;
    background: var(--chat-bg); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 20px;
    z-index: 1000;
    border: 1px solid rgba(0, 0, 0, 0.06);
    
    /* 默认隐藏，带有优雅的滑入效果 */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 当卡片激活时显示 */
.settings-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
/* ==================== 🌸 顶部状态栏精简微调 ==================== */
.header-info h2 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

/* ==================== ⚙️ 悬浮设置弹窗美化（解决拥挤与字体） ==================== */
.settings-popup {
    position: absolute;
    top: 70px;
    right: 15px;
    width: 240px;
    /* 修复之前变量名缺失的问题，直接使用卡片背景变量 */
    background: var(--card-bg); 
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    padding: 16px 18px;
    z-index: 1000;
    border: 1px solid var(--border-color);
    
    /* 统一整个卡片内部的字体规范，避免继承杂乱 */
    font-family: inherit;
    color: var(--text-main);

    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 弹窗标题 */
.popup-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 0.5px;
}

/* 弹窗内部区块 */
.popup-section {
    margin-bottom: 14px;
}

.popup-label {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

/* 解决原先上下两行拥挤的核心：为设置项增加舒适的上下间距 */
.settings-popup .switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0; /* 增加上下呼吸空间，绝不拥挤 */
    border-top: 1px dashed var(--border-color); /* 加上一条极淡的分隔线增加精致感 */
}

.settings-popup .switch-row:first-of-type {
    border-top: none; /* 第一个开关不需要顶部线 */
}

.settings-popup .switch-title {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-main);
}
/* ==================== 🛡️ 安保面板 ==================== */
.security-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 300px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
    z-index: 10000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.security-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.security-panel h3 {
    text-align: center;
    color: var(--primary-color);
    font-size: 16px;
    margin-bottom: 16px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 10px;
}

.sec-info p {
    font-size: 13px;
    margin-bottom: 12px;
    word-break: break-all;
}

.sec-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.sec-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 12px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    color: white;
    transition: transform 0.2s;
}
.sec-actions button:active { transform: scale(0.95); }

.ban-btn { background: #ff4d4f; }
.unban-btn { background: #52c41a; }
/* ==================== 🛡️ 全功能安保面板 ==================== */
.security-panel-large {
    width: 90%;
    max-width: 420px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    padding: 18px;
}

.sec-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border-color);
    margin-bottom: 12px;
}

.sec-header h3 {
    font-size: 15px;
    color: var(--primary-color);
    margin: 0;
}

.sec-list-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    padding-right: 2px;
}

/* 单个访客卡片 */
.visitor-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}

.visitor-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.visitor-ip-box {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

/* 在线 / 离线 / 封禁 状态指示灯 */
.status-dot-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.status-dot-indicator.online {
    background-color: #52c41a;
    box-shadow: 0 0 8px #52c41a;
}
.status-dot-indicator.offline {
    background-color: #8c8c8c;
}
.status-dot-indicator.banned {
    background-color: #ff4d4f;
    box-shadow: 0 0 8px #ff4d4f;
}

.geo-tag {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
    font-weight: normal;
}

.visitor-device {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    word-break: break-all;
}

.visitor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 2px;
}

.btn-mini {
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease;
}
.btn-mini:active { transform: scale(0.92); }
.btn-ban { background: #ff4d4f; color: #fff; }
.btn-unban { background: #52c41a; color: #fff; }
/* ==================== 🛡️ 安保面板刷新按钮优化 ==================== */
.sec-header .nav-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.sec-header .nav-btn:active {
    transform: scale(0.9);
}
/* ==================== 🚨 阿念的安保警示灯动画 ==================== */
@keyframes alertBlink {
    0% { box-shadow: 0 0 5px rgba(255, 77, 79, 0.4); transform: scale(1); }
    50% { box-shadow: 0 0 15px rgba(255, 77, 79, 0.9); transform: scale(1.1); background: rgba(255, 77, 79, 0.15); }
    100% { box-shadow: 0 0 5px rgba(255, 77, 79, 0.4); transform: scale(1); }
}

#alertLightBtn.active {
    display: flex !important; /* 强制显示 */
    animation: alertBlink 1.5s infinite ease-in-out;
}
/* ==================== 🚪 全屏物理防盗门 ==================== */
.login-gate {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: var(--bg-gradient);
    z-index: 99999; /* 铺在最上层 */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}
.gate-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    text-align: center;
    transition: transform 0.3s;
}
.gate-input-group {
    display: flex; gap: 10px; margin-top: 20px;
}
.gate-input-group input {
    padding: 10px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--input-bg); color: var(--text-main);
}
.gate-input-group button {
    padding: 10px 20px; border-radius: 12px; border: none; background: var(--primary-color); color: white; cursor: pointer;
}
/* 报警小红灯与震动动画 */
.gate-alarm {
    margin-top: 15px; font-size: 12px; color: #ff4d4f; min-height: 18px; font-weight: bold;
}
.shake { animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both; }
.red-alert { box-shadow: 0 0 30px rgba(255, 77, 79, 0.4) !important; border-color: #ff4d4f !important; }
@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* 分类面板样式 */
.banned-toggle-btn {
    width: 100%; margin: 15px 0 5px 0; padding: 10px;
    background: rgba(255, 77, 79, 0.1); border: 1px dashed #ff4d4f;
    color: #ff4d4f; border-radius: 12px; cursor: pointer;
}
.banned-list.show { display: flex !important; flex-direction: column; gap: 10px; }
/* ==================== 🛡️ 安保系统 2.0 样式 ==================== */
/* 闪烁的星星 */
.star-flashing {
    display: inline-block;
    animation: star-blink 0.6s infinite alternate;
    color: #ffeb3b;
    text-shadow: 0 0 15px #ffeb3b;
}
@keyframes star-blink {
    from { opacity: 1; transform: scale(1.3); }
    to { opacity: 0.3; transform: scale(0.9); }
}

/* 白名单排排坐 */
.whitelist-container {
    display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px;
    padding: 15px; background: rgba(76, 175, 80, 0.05); border-radius: 12px; border: 1px solid rgba(76, 175, 80, 0.2);
}
.whitelist-title { width: 100%; font-size: 12px; color: #4caf50; font-weight: bold; margin-bottom: 5px; }

.whitelist-box {
    background: var(--card-bg); border: 1px solid var(--border-color);
    padding: 6px 12px; border-radius: 20px; font-size: 13px;
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    position: relative; user-select: none; transition: 0.2s;
}
.whitelist-box:hover { background: var(--bg-main); border-color: #4caf50; }

/* 长按弹出的详情信息 */
.whitelist-details {
    display: none; position: absolute; top: 120%; left: 0;
    background: var(--card-bg); border: 1px solid var(--border-color);
    padding: 10px; border-radius: 8px; z-index: 100; min-width: 180px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); font-size: 12px; white-space: nowrap;
}
.whitelist-box.expanded .whitelist-details { display: block; }

/* 状态灯泡 */
.status-light { width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-shadow: 0 0 5px currentColor; }
.light-green { color: #4caf50; background: #4caf50; }
.light-yellow { color: #ffeb3b; background: #ffeb3b; }
.light-red { color: #ff4d4f; background: #ff4d4f; }
.light-grey { color: #9e9e9e; background: #9e9e9e; box-shadow: none; }

/* NEW 标签 */
.badge-new {
    background: #ff4d4f; color: white; padding: 2px 6px;
    border-radius: 10px; font-size: 10px; margin-left: 8px; font-weight: bold;
    animation: pulse 1.5s infinite;
}
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }