/* Google Fonts loaded asynchronously via JS - do NOT use @import */

/**
 * ZAUN Unified Styles v2.0.0
 * Pixel Art / Modern Retro Theme
 * Merged from zaun-style.css + zaun-auth.css + zaun-chat.css
 */

/* ==================== 1. 统一 CSS 变量 ==================== */
:root {
    --zs-primary: #33ffcc;
    --zs-primary-light: #66ffff;
    --zs-primary-dark: #009977;
    --zs-primary-dim: #004d40;
    --zs-accent: #ffcc00;
    --zs-danger: #ff0044;
    --zs-success: #00ff88;

    --zs-bg-body: #060610;
    --zs-bg-panel: #0a0a1a;
    --zs-bg-input: #000000;
    --zs-bg-card: #0d0d20;
    --zs-bg-sidebar: rgba(4, 8, 18, 0.92);

    --zs-border: #33ffcc;
    --zs-border-dim: #1a4a40;
    --zs-shadow: #000000;

    --zs-text: #ffffff;
    --zs-text-muted: #7aa8c0;
    --zs-text-dim: #445566;

    --zs-font-title: 'Press Start 2P', cursive;
    --zs-font-body: 'DotGothic16', 'Courier New', monospace;
    --zs-mobile-safe-gap: clamp(8px, 2vw, 16px);
    --zs-mobile-panel-max: min(100vw - (var(--zs-mobile-safe-gap) * 2), 1100px);
}

/* 旧变量别名 — JS inline style 引用 */
.zaun-auth-overlay {
    --zaun-auth-primary: var(--zs-primary);
    --zaun-primary: var(--zs-primary);
}

.zaun-chat-panel {
    --zs-text-muted: #7aa8c0;
    --zs-text-dim: #88aebd;
    --zc-text-dim: #88aebd;
    --zc-primary: var(--zs-primary);
}

/* ==================== 2. 重置 & 全局基础 ==================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--zs-font-body);
    background: var(--zs-bg-body);
    color: var(--zs-text);
    min-height: 100vh;
    image-rendering: pixelated;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(51, 255, 204, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(51, 255, 204, 0.015) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--zs-accent);
    text-decoration: none;
    font-weight: bold;
}

a:hover {
    text-decoration: underline;
}

/* ==================== 3. 全局滚动条 ==================== */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--zs-primary) transparent;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--zs-bg-body); }
::-webkit-scrollbar-thumb { background: var(--zs-primary); border: none; }
::-webkit-scrollbar-thumb:hover { background: #fff; }

.zaun-auth-overlay * {
    scrollbar-width: thin;
    scrollbar-color: var(--zs-primary) transparent;
}
.zaun-auth-overlay *::-webkit-scrollbar { width: 6px; height: 6px; }
.zaun-auth-overlay *::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
.zaun-auth-overlay *::-webkit-scrollbar-thumb { background: var(--zs-primary); border: none; }
.zaun-auth-overlay *::-webkit-scrollbar-thumb:hover { background: #fff; }

.zaun-chat-panel * {
    scrollbar-width: thin;
    scrollbar-color: var(--zs-primary) transparent;
}
.zaun-chat-panel *::-webkit-scrollbar { width: 6px; height: 6px; }
.zaun-chat-panel *::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
.zaun-chat-panel *::-webkit-scrollbar-thumb { background: var(--zs-primary); border: none; }
.zaun-chat-panel *::-webkit-scrollbar-thumb:hover { background: #fff; }

/* ==================== 4. 网站布局组件 (.zs-*) ==================== */

/* 导航栏 */
.zs-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--zs-bg-panel);
    border-bottom: 2px solid var(--zs-border-dim);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
}

.zs-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--zs-primary);
}

.zs-nav-logo {
    font-family: var(--zs-font-title);
    font-size: 14px;
    color: var(--zs-primary);
    letter-spacing: 1px;
}

.zs-nav-links {
    display: flex;
    gap: 12px;
}

.zs-nav-btn {
    font-family: var(--zs-font-body);
    font-size: 14px;
    padding: 8px 16px;
    border: 2px solid var(--zs-border-dim);
    background: transparent;
    color: var(--zs-text-muted);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.zs-nav-btn:hover {
    border-color: var(--zs-primary);
    color: var(--zs-primary);
    text-decoration: none;
}

.zs-nav-btn-primary {
    background: var(--zs-primary);
    border-color: var(--zs-primary);
    color: #000;
    font-weight: bold;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.zs-nav-btn-primary:hover {
    background: #fff;
    color: #000;
    filter: brightness(1.1);
}

.zs-nav-user {
    display: none;
    align-items: center;
    gap: 12px;
}

.zs-nav-user.show { display: flex; }
.zs-nav-links.hide { display: none; }

.zs-nav-username {
    color: var(--zs-primary);
    font-size: 14px;
}

/* 卡片 / 面板 */
.zs-card {
    background: var(--zs-bg-panel);
    border: 2px solid var(--zs-border-dim);
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    position: relative;
}

.zs-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    height: 2px;
    background: var(--zs-primary);
}

.zs-card-hover {
    transition: border-color 0.15s ease, filter 0.15s ease;
    cursor: pointer;
}

.zs-card-hover:hover {
    border-color: var(--zs-primary);
    filter: brightness(1.15);
}

.zs-card-hover:active {
    filter: brightness(0.9);
}

/* 表单元素 */
.zs-form-group {
    margin-bottom: 14px;
}

.zs-label {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--zs-primary);
    text-transform: uppercase;
}

.zs-input {
    width: 100%;
    padding: 10px;
    background: var(--zs-bg-input);
    border: 2px solid #333;
    color: var(--zs-primary);
    font-family: var(--zs-font-body);
    font-size: 15px;
    outline: none;
}

.zs-input:focus {
    border-color: var(--zs-primary);
    background: #050505;
}

.zs-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.zs-input::placeholder {
    color: var(--zs-text-dim);
}

/* 按钮 */
.zs-btn {
    display: inline-block;
    padding: 12px 20px;
    background: var(--zs-primary);
    border: 2px solid #000;
    color: #000;
    font-family: var(--zs-font-title);
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: filter 0.15s ease;
    text-align: center;
    text-decoration: none;
}

.zs-btn:hover:not(:disabled) {
    background: #fff;
    filter: brightness(1.1);
    text-decoration: none;
}

.zs-btn:active:not(:disabled) {
    filter: brightness(0.9);
    box-shadow: none;
}

.zs-btn:disabled {
    background: #333;
    color: #666;
    border-color: #000;
    cursor: not-allowed;
    box-shadow: none;
}

.zs-btn-full { width: 100%; }

.zs-btn-secondary {
    background: transparent;
    border-color: var(--zs-primary);
    color: var(--zs-primary);
    box-shadow: none;
    font-family: var(--zs-font-body);
    font-size: 14px;
}

.zs-btn-secondary:hover:not(:disabled) {
    background: var(--zs-primary);
    color: #000;
}

.zs-btn-danger {
    background: transparent;
    border-color: var(--zs-danger);
    color: var(--zs-danger);
    box-shadow: none;
    font-family: var(--zs-font-body);
    font-size: 14px;
}

.zs-btn-danger:hover:not(:disabled) {
    background: var(--zs-danger);
    color: #fff;
}

/* 消息提示 */
.zs-msg {
    padding: 10px;
    border: 2px solid transparent;
    font-size: 14px;
    text-align: center;
    margin-bottom: 16px;
}

.zs-msg.error {
    background: #1a0000;
    border-color: var(--zs-danger);
    color: #ff3366;
}

.zs-msg.success {
    background: #001a0a;
    border-color: var(--zs-success);
    color: var(--zs-success);
}

.zs-msg.hidden { display: none; }

/* 验证码行 */
.zs-code-row {
    display: flex;
    gap: 8px;
}

.zs-code-row .zs-input { flex: 1; }

.zs-code-btn {
    padding: 0 14px;
    background: #1a1a2e;
    border: 2px solid var(--zs-primary);
    color: var(--zs-primary);
    cursor: pointer;
    font-family: var(--zs-font-body);
    font-size: 13px;
    white-space: nowrap;
}

.zs-code-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #444;
    color: #666;
}

/* 复选框 */
.zs-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--zs-text-muted);
    margin: 8px 0;
    cursor: pointer;
}

.zs-checkbox-row input[type="checkbox"] {
    appearance: none;
    width: 14px;
    height: 14px;
    border: 2px solid var(--zs-primary);
    background: #000;
    cursor: pointer;
    position: relative;
}

.zs-checkbox-row input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: var(--zs-primary);
}

/* 选项行 */
.zs-options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0 16px;
}

/* 页脚 */
.zs-footer {
    text-align: center;
    padding: 24px;
    color: var(--zs-text-dim);
    font-size: 13px;
    border-top: 2px solid var(--zs-border-dim);
    margin-top: auto;
}

/* 链接区 */
.zs-link-area {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--zs-text-muted);
}

/* 标题 */
.zs-title {
    font-family: var(--zs-font-title);
    font-size: 20px;
    text-align: center;
    margin-bottom: 8px;
    color: var(--zs-primary);
}

.zs-subtitle {
    font-size: 15px;
    color: var(--zs-text-muted);
    text-align: center;
    margin-bottom: 24px;
}

/* Hero Section */
.zs-hero {
    text-align: center;
    padding: 120px 24px 48px;
    position: relative;
    z-index: 1;
}

.zs-hero-title {
    font-family: var(--zs-font-title);
    font-size: 28px;
    color: var(--zs-primary);
    margin-bottom: 16px;
    line-height: 1.6;
    letter-spacing: 2px;
}

.zs-hero-sub {
    font-size: 16px;
    color: var(--zs-text-muted);
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 功能网格 */
.zs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

.zs-grid-icon { font-size: 32px; margin-bottom: 12px; }

.zs-grid-title {
    font-family: var(--zs-font-title);
    font-size: 11px;
    margin-bottom: 8px;
    color: var(--zs-primary);
}

.zs-grid-desc { color: var(--zs-text-muted); font-size: 14px; }

.zs-tag {
    display: inline-block;
    padding: 4px 8px;
    border: 1px solid var(--zs-primary);
    font-size: 11px;
    color: var(--zs-primary);
    margin-top: 8px;
}

/* 布局 */
.zs-center-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.zs-auth-container {
    width: 100%;
    max-width: 420px;
}

/* 页面顶栏（非 fixed） */
.zs-header {
    background: var(--zs-bg-panel);
    border-bottom: 2px solid var(--zs-border-dim);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.zs-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--zs-primary);
}

.zs-header-logo {
    font-family: var(--zs-font-title);
    font-size: 14px;
    color: var(--zs-primary);
}

.zs-header-user { display: flex; align-items: center; gap: 12px; }

.zs-header-username { color: var(--zs-text-muted); font-size: 14px; }

/* 容器 */
.zs-container {
    max-width: var(--zs-mobile-panel-max);
    margin: 24px auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* 欢迎面板 */
.zs-welcome { text-align: center; padding: 28px; margin-bottom: 24px; }

.zs-welcome h1 {
    font-family: var(--zs-font-title);
    font-size: 16px;
    color: var(--zs-primary);
    margin-bottom: 10px;
}

.zs-welcome p { color: var(--zs-text-muted); font-size: 15px; }

/* 工具 */
.hidden { display: none; }

/* ==================== 5. Auth 浮层组件 (.zaun-auth-*) ==================== */

.zaun-auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    font-family: var(--zs-font-body);
    image-rendering: pixelated;
    overflow: hidden;
}

.zaun-auth-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(51, 255, 204, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(51, 255, 204, 0.015) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

.zaun-auth-overlay.hidden { display: none; }

.zaun-auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--zs-bg-panel);
    border: 2px solid var(--zs-border);
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 1;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0 !important;
}

.zaun-auth-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    height: 2px;
    background: var(--zs-primary);
}

.zaun-auth-title {
    font-family: var(--zs-font-title);
    font-size: 20px;
    text-align: center;
    margin-bottom: 10px;
    color: var(--zs-primary);
}

.zaun-auth-sub {
    font-size: 15px;
    color: var(--zs-text-muted);
    text-align: center;
    margin-bottom: 24px;
}

.zaun-auth-msg {
    padding: 10px;
    border: 2px solid transparent;
    font-size: 14px;
    text-align: center;
    margin-bottom: 16px;
}

.zaun-auth-msg.error {
    background: #1a0000;
    border-color: #ff0044;
    color: #ff3366;
}

.zaun-auth-msg.success {
    background: #001a0a;
    border-color: #00ff88;
    color: #00ff88;
}

.zaun-auth-msg.hidden { display: none; }

.zaun-auth-group { margin-bottom: 12px; }

.zaun-auth-label {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--zs-primary);
    text-transform: uppercase;
}

.zaun-auth-input {
    width: 100%;
    padding: 10px;
    background: var(--zs-bg-input);
    border: 2px solid #333;
    color: var(--zs-primary);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    box-sizing: border-box;
}

.zaun-auth-input:focus {
    border-color: var(--zs-primary);
    background: #050505;
}

.zaun-auth-row { display: flex; gap: 8px; }

.zaun-auth-code-btn {
    padding: 0 12px;
    background: #1a1a2e;
    border: 2px solid var(--zs-primary);
    color: var(--zs-primary);
    cursor: pointer;
    font-family: var(--zs-font-title);
    font-size: 10px;
    white-space: nowrap;
}

.zaun-auth-code-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #444;
    color: #666;
}

.zaun-auth-btn {
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    background: var(--zs-primary);
    border: 2px solid #000;
    color: #000;
    font-family: var(--zs-font-title);
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: filter 0.15s ease;
}

.zaun-auth-btn:hover:not(:disabled) {
    background: #fff;
    filter: brightness(1.1);
}

.zaun-auth-btn:active:not(:disabled) {
    filter: brightness(0.9);
    box-shadow: none;
}

.zaun-auth-btn:disabled {
    background: #333;
    color: #666;
    border-color: #000;
    cursor: not-allowed;
    box-shadow: none;
}

.zaun-auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--zs-text-muted);
    margin: 8px 0;
    cursor: pointer;
}

.zaun-auth-remember input[type="checkbox"] {
    appearance: none;
    width: 14px;
    height: 14px;
    border: 2px solid var(--zs-primary);
    background: #000;
    cursor: pointer;
    position: relative;
    border-radius: 0;
}

.zaun-auth-remember input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: var(--zs-primary);
}

.zaun-auth-show-pwd {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--zs-text-muted);
    margin: 4px 0 8px;
    cursor: pointer;
}

.zaun-auth-show-pwd input[type="checkbox"] {
    appearance: none;
    width: 14px;
    height: 14px;
    border: 2px solid var(--zs-primary);
    background: #000;
    cursor: pointer;
    position: relative;
    border-radius: 0;
}

.zaun-auth-show-pwd input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: var(--zs-primary);
}

.zaun-auth-footer {
    text-align: center;
    font-size: 14px;
    color: var(--zs-text-muted);
    margin-top: 20px;
}

.zaun-auth-link {
    color: var(--zs-accent);
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    margin-left: 4px;
}

.zaun-auth-link:hover { text-decoration: underline; }

/* 模式切换显隐 */
.zaun-auth-only-login { display: block; }
.zaun-auth-only-register { display: none; }

.zaun-auth-overlay[data-mode="register"] .zaun-auth-only-login { display: none; }
.zaun-auth-overlay[data-mode="register"] .zaun-auth-only-register { display: block; }

/* 浅色主题 */
.zaun-auth-overlay[data-theme="light"] {
    --zs-primary: #0000aa;
    --zs-bg-panel: #e0e0d0;
    --zs-bg-input: #ffffff;
    --zs-border: #000000;
    --zs-text: #000000;
    --zs-text-muted: #444444;
}

.zaun-auth-overlay[data-theme="light"] .zaun-auth-card::before { background: #808080; }
.zaun-auth-overlay[data-theme="light"] .zaun-auth-btn { background: #808080; color: #fff; }

/* 账号下拉列表 */
.zaun-auth-accounts-dropdown {
    position: absolute;
    top: calc(100% - 10px);
    left: 0;
    right: 0;
    background: #1f1f1f;
    border: 4px solid #4ade80;
    border-top: none;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.zaun-auth-accounts-dropdown.hidden { display: none !important; }

.zaun-auth-account-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 2px dashed #333;
    cursor: pointer;
}

.zaun-auth-account-item:hover { background: rgba(74, 222, 128, 0.1); }
.zaun-auth-account-item:last-child { border-bottom: none; }

.zaun-auth-account-info { flex: 1; }
.zaun-auth-account-name { font-size: 14px; color: #fff; }
.zaun-auth-account-email { font-size: 12px; color: #888; }

.zaun-auth-account-del {
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 20px;
    cursor: pointer;
    padding: 0 5px;
}

.zaun-auth-account-del:hover { color: #f87171; }

/* ==================== 6. Chat 面板组件 (.zaun-chat-*) ==================== */

/* FAB 触发按钮 */
.zaun-chat-btn-wrapper {
    position: fixed;
    bottom: clamp(16px, 4vw, 32px);
    right: clamp(16px, 4vw, 32px);
    z-index: 99999;
}

.zaun-chat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--zs-bg-panel);
    border: 2px solid var(--zs-primary);
    color: var(--zs-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: filter 0.15s ease;
    padding: 0;
    position: relative;
}

.zaun-chat-btn:hover {
    filter: brightness(1.15);
    color: #fff;
    border-color: #fff;
}

.zaun-chat-btn:active {
    filter: brightness(0.9);
    box-shadow: none;
}

.zaun-chat-btn svg { width: 28px; height: 28px; }

.zaun-chat-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 24px;
    height: 24px;
    padding: 0 4px;
    background: var(--zs-danger);
    border: 2px solid #000;
    color: #fff;
    font-family: var(--zs-font-body);
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* 主容器与面板 */
.zaun-chat-container {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(8px, 4vw, 32px) clamp(8px, 2vw, 24px);
    background: rgba(0, 0, 0, 0.85);
    font-family: var(--zs-font-body);
    image-rendering: pixelated;
}

.zaun-chat-container.hidden { display: none; }

.zaun-chat-container,
.zaun-chat-container * { touch-action: auto; }

.zaun-chat-container input,
.zaun-chat-container textarea {
    -webkit-user-select: text !important;
    user-select: text !important;
    touch-action: manipulation !important;
}

.zaun-chat-panel {
    display: flex;
    width: 1010px;
    height: 620px;
    background: var(--zs-bg-panel);
    border: 2px solid var(--zs-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
    color: var(--zs-text);
}

.zaun-chat-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--zs-primary);
    z-index: 10;
}

/* 第一栏：主导航轨道 */
.zaun-chat-nav-rail {
    flex: 0 0 68px;
    background: #04040a;
    border-right: 2px solid var(--zs-border-dim);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    gap: 10px;
    z-index: 5;
}

.zaun-chat-nav-item {
    width: 52px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(51, 255, 204, 0.05);
    border: 1px solid rgba(51, 255, 204, 0.4) !important;
    color: var(--zs-text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    font-size: 14px;
    font-weight: bold;
    text-shadow: none !important;
    -webkit-text-stroke: 0 !important;
    font-family: var(--zs-font-title), sans-serif;
}

.zaun-chat-nav-item:hover {
    color: var(--zs-primary);
    border-color: var(--zs-border-dim);
}

.zaun-chat-nav-item.active {
    background: var(--zs-primary);
    color: #000;
    border: 1px solid var(--zs-primary) !important;
    box-shadow: none;
    text-shadow: none !important;
    -webkit-text-stroke: 0 !important;
}

.zaun-chat-nav-item svg { width: 22px; height: 22px; }
.zaun-chat-nav-spacer { flex: 1; }

.zc-nav-close { color: var(--zs-danger); }

.zc-nav-close:hover {
    background: var(--zs-danger);
    color: #fff;
    border-color: #000;
}

/* 第二栏：次级侧边栏 */
.zaun-chat-sidebar {
    flex: 0 0 230px;
    background: var(--zs-bg-sidebar);
    border-right: 1px solid var(--zs-border-dim);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.zaun-chat-sidebar-header {
    padding: 10px 12px;
    border-bottom: 1px solid var(--zs-border-dim);
}

.zaun-chat-sidebar-title {
    font-family: var(--zs-font-title);
    font-size: 11px;
    color: var(--zs-primary);
    letter-spacing: 1px;
}

.zaun-chat-sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 16px 8px 8px;
}

/* 会话/列表项 */
.zaun-chat-list-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--zs-text);
    text-align: left;
    cursor: pointer;
    margin-bottom: 4px;
    width: calc(100% - 8px);
    box-sizing: border-box;
}

.zaun-chat-list-item:hover {
    background: rgba(51, 255, 204, 0.05);
    border-color: var(--zs-border-dim);
}

.zaun-chat-list-item.active {
    background: var(--zs-primary);
    border-color: var(--zs-primary);
    color: #000;
}

.zaun-chat-list-item.active .zaun-chat-item-name,
.zaun-chat-list-item.active .zaun-chat-item-meta {
    color: #000;
}

.zaun-chat-item-name {
    font-weight: bold;
    color: var(--zs-primary);
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
}

.zaun-chat-item-name span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.zaun-chat-item-meta {
    font-size: 12px;
    color: var(--zs-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 第三栏：主区域 */
.zaun-chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #080814;
    min-width: 0;
    overflow-x: hidden;
}

/* 视图切换显隐逻辑 */
.zaun-chat-pane {
    display: none;
    flex-direction: column;
    height: 100%;
}

.hall-only,
.private-only,
.social-only,
.boss-only {
    display: none !important;
}

.zaun-chat-panel[data-view="hall"] .hall-pane { display: flex; }
.zaun-chat-panel[data-view="hall"] .hall-only { display: block !important; }
.zaun-chat-panel[data-view="hall"] div.zaun-chat-input-area.hall-only { display: flex !important; }
.zaun-chat-panel[data-view="hall"] span.zaun-chat-current-title.hall-only { display: inline-block !important; }

.zaun-chat-panel[data-view="private"] .private-pane { display: flex; }
.zaun-chat-panel[data-view="private"] .private-only { display: block !important; }
.zaun-chat-panel[data-view="private"] div.zaun-chat-input-area.private-only { display: flex !important; }
.zaun-chat-panel[data-view="private"] span.zaun-chat-current-title.private-only { display: inline-block !important; }

.zaun-chat-panel[data-view="social"] .social-pane { display: flex; }
.zaun-chat-panel[data-view="social"] .social-only { display: block !important; }
.zaun-chat-panel[data-view="social"] span.zaun-chat-current-title.social-only { display: inline-block !important; }

.zaun-chat-panel[data-view="boss"] .boss-pane { display: flex; }
.zaun-chat-panel[data-view="boss"] .boss-only { display: block !important; }
.zaun-chat-panel[data-view="boss"] span.zaun-chat-current-title.boss-only { display: inline-block !important; }

/* 顶部状态/标题栏 */
.zaun-chat-main-header {
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--zs-border-dim);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.zaun-chat-current-title { font-weight: bold; color: #fff; }

.zaun-chat-conn-status {
    font-size: 11px;
    color: var(--zs-text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
}

.zaun-chat-conn-status.online::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--zs-success);
    box-shadow: 0 0 4px var(--zs-success);
}

/* 消息滚动区 */
.zaun-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* 消息流 - 现代像素阵列 */
.zaun-chat-msg {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 2px;
    padding: 6px 10px;
    border-left: 2px solid transparent;
}

.zaun-chat-msg:nth-child(odd) {
    background: rgba(255, 255, 255, 0.02);
}

.zaun-chat-msg.own {
    align-self: flex-start;
    border-left-color: var(--zs-primary);
}

.zaun-chat-msg-info {
    font-size: 11px;
    color: var(--zs-text-dim);
    display: flex;
    gap: 8px;
    align-items: center;
}

.zaun-chat-msg.own .zaun-chat-msg-info { flex-direction: row; }

.zaun-chat-sender-name { color: var(--zs-primary); font-weight: bold; }

button.zaun-chat-user-link {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    color: var(--zs-primary) !important;
    font-weight: bold !important;
    font-family: inherit !important;
    font-size: inherit !important;
    cursor: pointer !important;
    text-shadow: none !important;
    box-shadow: none !important;
    outline: none !important;
}

button.zaun-chat-user-link:hover { text-decoration: underline; opacity: 0.8; }

.zaun-chat-bubble {
    padding: 0;
    background: transparent !important;
    border: none !important;
    color: #fff;
    line-height: 1.4;
    word-break: break-word;
    position: relative;
}

.zaun-chat-msg.own .zaun-chat-bubble {
    background: transparent;
    border-color: transparent;
}

.zaun-chat-msg.system {
    align-self: center;
    width: auto;
    background: transparent !important;
}

.zaun-chat-msg.system .zaun-chat-bubble {
    background: transparent;
    border: 1px dashed var(--zs-border-dim) !important;
    color: var(--zs-text-muted);
    font-size: 12px;
    text-align: center;
    padding: 4px 12px;
}

/* 输入区域 */
.zaun-chat-input-area {
    padding: 8px 12px;
    background: var(--zs-bg-panel);
    border-top: 1px solid var(--zs-border-dim);
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.zaun-chat-textarea {
    flex: 1;
    background: var(--zs-bg-input);
    border: 1px solid #333;
    padding: 8px 10px;
    color: var(--zs-primary);
    font-family: var(--zs-font-body);
    font-size: 14px;
    min-height: 34px;
    max-height: 120px;
    outline: none;
    resize: none;
}

.zaun-chat-textarea:focus { border-color: var(--zs-primary); }

.zaun-chat-send-btn {
    width: 72px;
    height: 34px;
    background: var(--zs-primary);
    border: 1px solid #000;
    color: #000;
    font-family: var(--zs-font-title);
    font-size: 9px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: none;
    transition: filter 0.15s ease;
}

.zaun-chat-send-btn:active {
    filter: brightness(0.9);
    box-shadow: none;
}

.zaun-chat-send-btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
    border-color: #000;
}

/* 社交管理 */
.zaun-chat-social-tabs {
    display: flex;
    border-bottom: none;
    margin: 8px 12px 0 12px;
}

.zaun-chat-add-friend {
    display: flex;
    gap: 12px;
    margin: 16px 12px 0 12px;
    align-items: stretch;
}

.zaun-chat-add-friend input { flex: 1; font-size: 14px; }

.zaun-chat-add-friend .zaun-chat-send-btn {
    width: 100px;
    font-size: 11px;
}

.zaun-chat-tab-btn {
    flex: 1;
    padding: 8px;
    background: rgba(51, 255, 204, 0.05);
    border: 1px solid rgba(51, 255, 204, 0.4) !important;
    color: var(--zs-text-muted);
    font-family: var(--zs-font-body);
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    text-shadow: none !important;
    -webkit-text-stroke: 0 !important;
    margin: 0 4px;
}

.zaun-chat-tab-btn.active {
    color: #000;
    background: var(--zs-primary);
    border: 1px solid var(--zs-primary) !important;
    text-shadow: none !important;
    -webkit-text-stroke: 0 !important;
}

.zaun-chat-social-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--zs-border-dim);
    background: rgba(255, 255, 255, 0.02);
    margin: 0 12px 8px 12px;
}

.zaun-chat-mini-btn {
    padding: 6px 12px;
    background: var(--zs-bg-panel);
    border: 1px solid var(--zs-border-dim);
    color: var(--zs-primary);
    font-size: 13px;
    cursor: pointer;
}

.zaun-chat-mini-btn:hover {
    background: var(--zs-primary);
    color: #000;
}

.zaun-chat-empty { padding: 24px; text-align: center; color: var(--zs-text-muted); }
.zaun-chat-empty.small { padding: 12px 0; }

.zaun-chat-boss-card {
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 4px;
    border: 1px solid var(--zs-border-dim);
    margin: 8px 10px;
    background: rgba(0, 0, 0, 0.4);
    color: var(--zs-text);
    font-size: 13px;
}

.zaun-chat-boss-card .label {
    color: var(--zs-accent);
    font-size: 11px;
    font-weight: bold;
}

.zaun-chat-boss-card.muted .label { color: var(--zs-text-muted); }

.zaun-chat-subhint {
    padding: 10px;
    color: var(--zs-text-dim);
    font-size: 12px;
}

.zaun-chat-quick-card {
    padding: 10px 12px;
    border: 1px solid var(--zs-border-dim);
    background: rgba(0, 0, 0, 0.3);
    margin: 4px 0;
}

.zaun-chat-quick-title {
    font-weight: bold;
    color: var(--zs-primary);
    font-size: 13px;
    margin-bottom: 6px;
}

.zaun-chat-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ==================== 7. 响应式 - 网站 ==================== */
@media (max-width: 640px) {
    body { min-width: 320px; }
    .zs-hero-title { font-size: 18px; }
    .zs-nav { padding: 0 12px; }
    .zs-grid { grid-template-columns: 1fr; padding: 0 12px; }
    .zs-container,
    .zs-center-page {
        padding-left: var(--zs-mobile-safe-gap);
        padding-right: var(--zs-mobile-safe-gap);
    }
}

/* ==================== 8. 响应式 - Auth ==================== */
@media (max-width: 768px) {
    .zaun-auth-card { max-width: 360px; padding: 20px; }
    .zaun-auth-title { font-size: 16px; }
    .zaun-auth-sub { font-size: 13px; margin-bottom: 16px; }
}

@media (max-width: 480px) {
    .zaun-auth-card {
        max-width: calc(100vw - 20px);
        padding: 12px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
        max-height: 95vh;
    }
    .zaun-auth-title { font-size: 14px; margin-bottom: 6px; }
    .zaun-auth-sub { font-size: 11px; margin-bottom: 10px; }
    .zaun-auth-input { padding: 8px; font-size: 13px; }
    .zaun-auth-btn { padding: 10px; font-size: 11px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
    .zaun-auth-group { margin-bottom: 10px; }
    .zaun-auth-label { font-size: 11px; margin-bottom: 4px; }
    .zaun-auth-msg { padding: 6px; font-size: 12px; margin-bottom: 10px; }
    .zaun-auth-footer { font-size: 11px; margin-top: 10px; }
    .zaun-auth-code-btn { font-size: 8px; padding: 0 8px; }
    .zaun-auth-remember,
    .zaun-auth-show-pwd { font-size: 12px; }
    .zaun-auth-accounts-dropdown { max-height: 150px; }
}

@media (max-width: 360px) {
    .zaun-auth-card { max-width: calc(100vw - 16px); padding: 12px; }
    .zaun-auth-title { font-size: 12px; }
    .zaun-auth-input { padding: 8px; font-size: 13px; }
    .zaun-auth-btn { padding: 10px; font-size: 10px; }
}

@media (max-height: 600px) {
    .zaun-auth-card { padding: 10px 14px; max-height: 95vh; }
    .zaun-auth-title { font-size: 13px; margin-bottom: 4px; }
    .zaun-auth-sub { margin-bottom: 6px; font-size: 11px; }
    .zaun-auth-group { margin-bottom: 6px; }
    .zaun-auth-input { padding: 6px; font-size: 12px; }
    .zaun-auth-btn { padding: 8px; margin-top: 4px; font-size: 10px; }
    .zaun-auth-footer { margin-top: 6px; font-size: 10px; }
    .zaun-auth-msg { margin-bottom: 6px; padding: 4px; }
}

/* ==================== 9. 响应式 - Chat ==================== */
@media (max-width: 600px) {
    .zaun-chat-container { padding: 0; }
}

@media (max-width: 1070px),
(max-height: 680px) {
    .zaun-chat-container { padding: 0; }
}

/* ==================== 10. Keyframes - 机械动画 ==================== */
@keyframes zs-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes zs-fade-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}
@keyframes zs-card-in {
    from { transform: translateY(16px) scale(0.98); opacity: 0; }
    to   { transform: translateY(0) scale(1);       opacity: 1; }
}
@keyframes zs-card-out {
    from { transform: translateY(0) scale(1);       opacity: 1; }
    to   { transform: translateY(16px) scale(0.98); opacity: 0; }
}
@keyframes zs-slide-up-sm {
    from { transform: translateY(6px);  opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
@keyframes zs-shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-4px); }
    40%      { transform: translateX(4px); }
    60%      { transform: translateX(-3px); }
    80%      { transform: translateX(3px); }
}
@keyframes zs-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.3; }
}

/* ==================== 11. 动画工具类 ==================== */
/* 容器（遮罩层）用 opacity 动画，不碰 transform — 避免与 scale/translate 冲突 */
.zs-enter      { animation: zs-fade-in   0.2s ease-out forwards; }
.zs-exit       { animation: zs-fade-out  0.15s ease-in forwards; }
/* 内层卡片可安全使用 transform */
.zs-card-enter { animation: zs-card-in   0.25s ease-out forwards; }
.zs-card-exit  { animation: zs-card-out  0.15s ease-in forwards; }
.zs-shake      { animation: zs-shake     0.3s ease-out; }
.zs-msg-enter  { animation: zs-slide-up-sm 0.15s ease-out; }

/* ==================== 12. 工业视觉层 - 扫描线 + CRT ==================== */

/* Chat panel: CRT 辉光 + 暗角 */
.zaun-chat-panel {
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(51, 255, 204, 0.08),
        inset 0 0 60px rgba(0, 0, 0, 0.4);
    position: relative;
}
/* 扫描线 */
.zaun-chat-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 3px,
            rgba(0, 0, 0, 0.08) 3px,
            rgba(0, 0, 0, 0.08) 4px
        );
    pointer-events: none;
    z-index: 100;
}

/* Auth card: CRT 辉光 + 扫描线 */
.zaun-auth-card {
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(51, 255, 204, 0.08),
        inset 0 0 40px rgba(0, 0, 0, 0.3);
    position: relative;
}
.zaun-auth-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 3px,
            rgba(0, 0, 0, 0.08) 3px,
            rgba(0, 0, 0, 0.08) 4px
        );
    pointer-events: none;
    z-index: 0;
}

/* ==================== 13. 工业边框装饰 ==================== */

/* Nav rail 加粗 */
.zaun-chat-nav-rail { border-right-width: 3px; }

/* 活跃导航项辉光 */
.zaun-chat-nav-item.active { box-shadow: 0 0 10px rgba(51, 255, 204, 0.35); }

/* 按钮按下深度效果 */
.zaun-chat-nav-item:active:not(.zc-nav-close)  { transform: translateY(1px); }
.zaun-chat-send-btn:active:not(:disabled)       { transform: translateY(2px); box-shadow: none; }
.zaun-auth-btn:active:not(:disabled)            { transform: translateY(2px); box-shadow: none; }
.zaun-chat-btn:active                           { transform: translateY(1px); }

/* 侧边栏角标 */
.zaun-chat-sidebar { position: relative; }
.zaun-chat-sidebar::after {
    content: '';
    position: absolute;
    bottom: 8px; right: 8px;
    width: 8px; height: 8px;
    border-right: 2px solid var(--zs-border-dim);
    border-bottom: 2px solid var(--zs-border-dim);
    pointer-events: none;
}

/* Auth card 右下角标 */
.zaun-auth-card::after {
    content: '';
    position: absolute;
    bottom: 8px; right: 8px;
    width: 10px; height: 10px;
    border-right: 2px solid var(--zs-primary);
    border-bottom: 2px solid var(--zs-primary);
    pointer-events: none;
}

/* ==================== 14. 消息入场 + 状态脉冲 ==================== */
.zaun-chat-msg   { animation: zs-slide-up-sm 0.15s ease-out; }
.zaun-chat-msg.system { animation: none; }

/* 在线状态脉冲指示 */
.zaun-chat-conn-status.online::before {
    content: '';
    width: 6px; height: 6px;
    background: var(--zs-success);
    box-shadow: 0 0 6px var(--zs-success);
    animation: zs-pulse 2s infinite;
}

/* Auth 错误抖动 */
.zaun-auth-msg.error.zs-shake { animation: zs-shake 0.3s ease-out; }

/* 侧边栏活跃项辉光 */
.zaun-chat-list-item.active { box-shadow: inset 0 0 12px rgba(51, 255, 204, 0.15); }

/* 输入框聚焦工业边框 */
.zaun-chat-textarea:focus,
.zaun-auth-input:focus {
    box-shadow: 0 0 8px rgba(51, 255, 204, 0.2);
}

/* ==================== 15. 响应式 - 工业层 ==================== */
@media (max-width: 1070px),
(max-height: 680px) {
    .zaun-chat-panel { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
    .zaun-chat-panel::after { background: none; }
}
