        @import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

        :root {
            --primary-color: #0d9488;
            --secondary-color: #0f766e;
            --accent: #14b8a6;
            --bg-gradient: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 50%, #99f6e4 100%);
            --surface: rgba(255, 255, 255, 0.72);
            --surface-solid: #ffffff;
            --surface-hover: rgba(255, 255, 255, 0.88);
            --border: color-mix(in srgb, var(--primary-color) 24%, rgba(100, 116, 139, 0.3));
            --border-strong: color-mix(in srgb, var(--primary-color) 42%, rgba(71, 85, 105, 0.42));
            --text-primary: #0f172a;
            --text-secondary: #475569;
            --text-tertiary: #94a3b8;
            --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
            --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
            --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12), 0 4px 8px rgba(15, 23, 42, 0.04);
            --shadow-xl: 0 24px 64px rgba(15, 23, 42, 0.16);
            --radius-sm: 8px;
            --radius-md: 12px;
            --radius-lg: 16px;
            --radius-xl: 20px;
            --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }

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

        body {
            font-family: 'Plus Jakarta Sans', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
            background: var(--bg-gradient);
            background-attachment: fixed;
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
            color: var(--text-primary);
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        body::before {
            content: '';
            position: fixed;
            inset: 0;
            background:
                radial-gradient(ellipse 600px 400px at 20% 20%, rgba(20, 184, 166, 0.08), transparent),
                radial-gradient(ellipse 500px 300px at 80% 80%, rgba(13, 148, 136, 0.06), transparent);
            pointer-events: none;
            z-index: 0;
        }

        body.chat-active {
            align-items: flex-start;
            padding: 5px;
        }

        /* ===== Scrollbar ===== */
        ::-webkit-scrollbar { width: 6px; height: 6px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.3); border-radius: 3px; }
        ::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.5); }

        /* ===== Theme Selector ===== */
        .theme-selector {
            position: fixed;
            top: 16px;
            right: 16px;
            z-index: 1000;
            display: flex;
            align-items: center;
            gap: 8px;
            background: var(--surface);
            backdrop-filter: blur(20px) saturate(1.4);
            -webkit-backdrop-filter: blur(20px) saturate(1.4);
            border: 1px solid var(--border);
            padding: 8px 16px;
            border-radius: 50px;
            box-shadow: var(--shadow-md);
            transition: var(--transition);
        }

        .theme-selector:hover {
            box-shadow: var(--shadow-lg);
            transform: translateY(-1px);
        }

        .theme-selector span {
            font-size: 13px;
            color: var(--text-secondary);
            font-weight: 500;
        }

        .theme-selector select {
            padding: 5px 10px;
            border: 1.5px solid var(--border-strong);
            border-radius: var(--radius-sm);
            font-size: 13px;
            font-family: inherit;
            background: var(--surface-solid);
            color: var(--text-primary);
            cursor: pointer;
            transition: var(--transition);
            outline: none;
        }

        .theme-selector select:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
        }

        /* Custom Color Picker */
        .theme-custom { --primary-color: var(--custom-primary); --secondary-color: var(--custom-secondary); --bg-gradient: linear-gradient(135deg, var(--custom-primary) 0%, var(--custom-secondary) 100%); }

        .color-picker-panel {
            display: none;
            position: fixed;
            top: 72px;
            right: 16px;
            background: var(--surface-solid);
            padding: 20px;
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-xl);
            border: 1px solid var(--border);
            z-index: 1001;
        }

        .color-picker-panel.show {
            display: block;
            animation: slideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        }

        @keyframes slideDown {
            from { opacity: 0; transform: translateY(-8px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .color-picker-panel h4 {
            margin: 0 0 14px 0;
            color: var(--text-primary);
            font-size: 14px;
            font-weight: 600;
        }

        .color-picker-group {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 12px;
        }

        .color-picker-group label {
            font-size: 13px;
            color: var(--text-secondary);
            min-width: 60px;
        }

        .color-picker-group input[type="color"] {
            width: 36px;
            height: 28px;
            border: 1.5px solid var(--border-strong);
            border-radius: 6px;
            cursor: pointer;
            padding: 2px;
        }

        .color-picker-group input[type="text"] {
            width: 80px;
            padding: 6px 8px;
            border: 1.5px solid var(--border-strong);
            border-radius: 6px;
            font-size: 12px;
            font-family: 'SF Mono', 'Cascadia Code', monospace;
            color: var(--text-primary);
        }

        .color-picker-group input[type="text"]:focus {
            outline: none;
            border-color: var(--primary-color);
        }

        .color-preview {
            display: flex;
            gap: 6px;
            margin-bottom: 14px;
        }

        .color-preview-box {
            width: 48px;
            height: 28px;
            border-radius: 6px;
            border: 1.5px solid var(--border);
        }

        .color-picker-buttons {
            display: flex;
            gap: 8px;
        }

        .color-picker-buttons .btn {
            padding: 8px 16px;
            font-size: 13px;
        }

        .color-picker-divider {
            height: 1px;
            background: var(--border);
            margin: 14px 0;
        }

        /* Theme Colors */
        .theme-normal { --primary-color: #64748b; --secondary-color: #475569; --accent: #94a3b8; --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%); }
        .theme-purple { --primary-color: #7c3aed; --secondary-color: #6d28d9; --accent: #a78bfa; --bg-gradient: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #ddd6fe 100%); }
        .theme-blue { --primary-color: #0284c7; --secondary-color: #0369a1; --accent: #38bdf8; --bg-gradient: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #bae6fd 100%); }
        .theme-green { --primary-color: #059669; --secondary-color: #047857; --accent: #34d399; --bg-gradient: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #a7f3d0 100%); }
        .theme-orange { --primary-color: #ea580c; --secondary-color: #c2410c; --accent: #fb923c; --bg-gradient: linear-gradient(135deg, #fff7ed 0%, #ffedd5 50%, #fed7aa 100%); }
        .theme-pink { --primary-color: #db2777; --secondary-color: #be185d; --accent: #f472b6; --bg-gradient: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 50%, #fbcfe8 100%); }
        .theme-dark { --primary-color: #14b8a6; --secondary-color: #0d9488; --accent: #2dd4bf; --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); --surface: rgba(30, 41, 59, 0.72); --surface-solid: #1e293b; --surface-hover: rgba(51, 65, 85, 0.72); --border: rgba(148, 163, 184, 0.22); --border-strong: rgba(203, 213, 225, 0.38); --text-primary: #f1f5f9; --text-secondary: #94a3b8; --text-tertiary: #64748b; --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2); --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3); --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4); --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.5); }

        /* ===== Container ===== */
        .container {
            background: var(--surface);
            backdrop-filter: blur(24px) saturate(1.4);
            -webkit-backdrop-filter: blur(24px) saturate(1.4);
            border: 1px solid var(--border);
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255, 255, 255, 0.15);
            width: 100%;
            max-width: 1200px;
            display: grid;
            grid-template-columns: 1fr 8px 1fr;
            gap: 0;
            padding: 16px;
            animation: containerIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
            position: relative;
            z-index: 1;
        }

        .section {
            background: var(--surface);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 24px;
            display: flex;
            flex-direction: column;
            min-width: 0;
            overflow: hidden;
            margin: 4px 0;
            height: calc(100vh - 10px);
            min-height: 900px;
            animation: sectionIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        }

        h2 {
            color: var(--text-primary);
            margin-bottom: 20px;
            font-size: 18px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 10px;
            letter-spacing: -0.02em;
        }

        /* ===== Login ===== */
        .login-section {
            grid-column: 1 / -1;
            text-align: center;
            padding: 56px 32px;
            animation: loginIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .login-section h2 {
            justify-content: center;
            font-size: 28px;
            margin-bottom: 8px;
            letter-spacing: -0.03em;
        }

        .login-section p {
            color: var(--text-secondary);
            margin-bottom: 28px;
            font-size: 15px;
        }

        .input-group {
            display: flex;
            gap: 12px;
            justify-content: center;
            flex-wrap: wrap;
        }

        .input-group input {
            padding: 14px 18px;
            font-size: 15px;
            font-family: inherit;
            border: 2px solid var(--border-strong);
            border-radius: var(--radius-md);
            width: 280px;
            transition: var(--transition);
            background: var(--surface);
            color: var(--text-primary);
        }

        .input-group input::placeholder {
            color: var(--text-tertiary);
        }

        .input-group input:focus {
            outline: none;
            border-color: var(--primary-color);
            background: var(--surface-hover);
            box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.1), var(--shadow-sm);
        }

        .login-buttons {
            display: flex;
            gap: 10px;
            width: 280px;
            margin-top: 16px;
            margin-left: auto;
            margin-right: auto;
        }

        .login-buttons .btn {
            flex: 1;
            padding: 14px 16px;
            font-size: 14px;
        }

        .password-group {
            margin-top: 12px;
        }

        input[type="password"]::-ms-reveal {
            display: none;
        }

        /* ===== Buttons ===== */
        .btn {
            padding: 12px 24px;
            font-size: 14px;
            font-weight: 600;
            font-family: inherit;
            background: var(--primary-color);
            color: white;
            border: none;
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: var(--transition);
            position: relative;
            overflow: hidden;
            letter-spacing: -0.01em;
        }

        .btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 20px rgba(13, 148, 136, 0.25);
            filter: brightness(1.08);
        }

        .btn:active {
            transform: translateY(0) scale(0.98);
            transition-duration: 0.08s;
        }

        .btn-secondary {
            background: var(--text-tertiary);
        }

        .btn-secondary:hover {
            box-shadow: 0 6px 20px rgba(148, 163, 184, 0.25);
        }

        .btn-danger {
            background: #ef4444;
        }

        .btn-danger:hover {
            box-shadow: 0 6px 20px rgba(239, 68, 68, 0.25);
        }

        .btn-success {
            background: #10b981;
        }

        .btn-success:hover {
            box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
        }

        .btn-icon {
            padding: 6px 10px;
            font-size: 16px;
            line-height: 1;
            background: transparent;
            color: var(--text-secondary);
            border-radius: var(--radius-sm);
            min-width: 0;
        }

        .btn-icon:hover {
            background: var(--border);
            box-shadow: none;
            filter: none;
        }

        .btn-register {
            background: #10b981;
        }

        .btn-register:hover {
            box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
        }

        .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
            filter: none;
        }

        .btn-sm {
            padding: 6px 12px;
            font-size: 12px;
        }

        .btn-admin-action {
            padding: 7px 14px;
            font-size: 12px;
            white-space: nowrap;
        }

        .btn-admin {
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
            padding: 12px 24px;
            font-size: 14px;
        }

        .btn-admin:hover {
            box-shadow: 0 6px 20px rgba(245, 158, 11, 0.25);
        }

        /* Admin Login Corner */
        .admin-login-corner {
            position: fixed;
            bottom: 16px;
            left: 16px;
            z-index: 1000;
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
            padding: 10px 20px;
            font-size: 13px;
            border-radius: 50px;
            box-shadow: var(--shadow-md);
            transition: var(--transition);
        }

        .admin-login-corner:hover {
            transform: translateY(-1px);
            box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
        }

        /* ===== Chat Layout ===== */
        .chat-left-panel,
        .chat-right-panel {
            display: contents;
        }

        /* Registered Users Modal */
        .registered-users-modal {
            max-width: 1200px !important;
            width: 95% !important;
            max-height: 90vh;
            display: flex;
            flex-direction: column;
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
        }

        .modal-header h3 {
            margin: 0;
        }

        .modal-close-btn {
            background: none;
            border: none;
            font-size: 28px;
            cursor: pointer;
            color: var(--text-tertiary);
            padding: 0;
            line-height: 1;
            transition: var(--transition);
        }

        .modal-close-btn:hover {
            color: #ef4444;
        }

        .delete-all-container {
            display: flex;
            justify-content: flex-end;
            margin-bottom: 16px;
        }

        .approve-all-container {
            display: flex;
            justify-content: flex-end;
            margin-bottom: 16px;
        }

        .user-tabs {
            display: flex;
            gap: 4px;
            margin-bottom: 16px;
            border-bottom: 2px solid var(--border-color);
            padding-bottom: 0;
        }

        .user-tab {
            padding: 8px 16px;
            border: none;
            background: none;
            cursor: pointer;
            font-size: 14px;
            color: var(--text-secondary);
            border-bottom: 2px solid transparent;
            margin-bottom: -2px;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 6px;
        }

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

        .user-tab.active {
            color: var(--primary-color);
            border-bottom-color: var(--primary-color);
        }

        .pending-badge {
            background: #ef4444;
            color: white;
            font-size: 11px;
            padding: 1px 6px;
            border-radius: 10px;
            font-weight: 600;
        }

        .pending-user-info {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .pending-user-ip {
            font-size: 12px;
            color: var(--text-tertiary);
        }

        .delete-all-confirm-modal {
            max-width: 450px;
            width: 90%;
            text-align: center;
        }

        .delete-all-confirm-modal h3 {
            color: #ef4444;
            margin-bottom: 12px;
        }

        .delete-all-confirm-modal p {
            margin-bottom: 8px;
            color: var(--text-secondary);
        }

        .delete-all-confirm-modal .warning-text {
            color: #ef4444;
            font-weight: 600;
            font-size: 14px;
        }

        .delete-all-confirm-modal .modal-buttons {
            margin-top: 20px;
            justify-content: center;
        }

        .delete-all-confirm-modal .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
        }

        .registered-users-grid-wrapper {
            flex: 1;
            overflow-y: auto;
            max-height: 70vh;
        }

        .registered-users-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }

        .registered-users-grid .empty-state {
            grid-column: 1 / -1;
            text-align: center;
            padding: 40px;
            color: var(--text-tertiary);
        }

        .user-card {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 14px 16px;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            transition: var(--transition);
        }

        .user-card:hover {
            border-color: var(--border-strong);
            box-shadow: var(--shadow-sm);
        }

        .user-card-info {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .user-card-name {
            font-weight: 600;
            font-size: 14px;
            color: var(--text-primary);
        }

        .user-card-time {
            font-size: 12px;
            color: var(--text-tertiary);
        }

        .user-card-actions {
            display: flex;
            gap: 6px;
        }

        /* Chat Section */
        .chat-section, .file-section {
            display: none;
        }

        .user-info {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 16px;
            background: var(--surface);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            margin-bottom: 12px;
            min-width: 0;
            overflow: hidden;
        }

        .user-info-left {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .user-avatar {
            width: 34px;
            height: 34px;
            background: var(--primary-color);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 700;
            font-size: 13px;
        }

        .user-name {
            font-weight: 600;
            color: var(--text-primary);
            font-size: 14px;
        }

        /* ===== Messages ===== */
        .messages {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 16px;
            background: var(--surface);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            margin-bottom: 12px;
            scroll-behavior: smooth;
        }

        .message {
            margin-bottom: 12px;
            padding: 12px 16px;
            border-radius: var(--radius-md);
            background: var(--surface);
            border: 1px solid var(--border);
            animation: messageIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
            position: relative;
            transition: var(--transition);
        }

        .message:hover {
            border-color: var(--border-strong);
        }

        .message.own {
            background: rgba(13, 148, 136, 0.06);
            border-color: rgba(13, 148, 136, 0.15);
        }

        .message.own .username {
            color: var(--primary-color);
        }

        .message .header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 6px;
            min-width: 0;
        }

        .message .username {
            font-weight: 600;
            color: var(--primary-color);
            font-size: 13px;
        }

        .message .meta {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 11px;
            color: var(--text-tertiary);
        }

        .message .ip {
            color: var(--accent);
            font-family: 'SF Mono', 'Cascadia Code', monospace;
            font-size: 11px;
        }

        .message .text {
            color: var(--text-primary);
            word-wrap: break-word;
            word-break: break-word;
            overflow-wrap: break-word;
            line-height: 1.6;
            max-width: 100%;
            font-size: 14px;
        }

        .message.system {
            background: rgba(13, 148, 136, 0.06);
            color: var(--primary-color);
            text-align: center;
            font-size: 12px;
            padding: 8px 12px;
            border-color: rgba(13, 148, 136, 0.1);
        }

        .message .reply-quote {
            background: var(--surface);
            padding: 8px 12px;
            border-radius: var(--radius-sm);
            margin-bottom: 8px;
            font-size: 12px;
            color: var(--text-secondary);
            border-left: 3px solid var(--primary-color);
        }

        .message .reply-quote .reply-user {
            color: var(--primary-color);
            font-weight: 600;
        }

        .message .actions {
            display: none;
            position: absolute;
            top: 8px;
            right: 8px;
            gap: 4px;
        }

        .message:hover .actions {
            display: flex;
        }

        .message .action-btn {
            padding: 4px 8px;
            font-size: 11px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            background: var(--surface);
            color: var(--text-secondary);
            border: 1px solid var(--border);
            transition: var(--transition);
            font-family: inherit;
        }

        .message .action-btn:hover {
            background: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }

        .message .action-btn.recall:hover {
            background: #ef4444;
            border-color: #ef4444;
        }

        .message .action-btn.delete {
            background: rgba(239, 68, 68, 0.08);
            color: #dc2626;
            border-color: rgba(239, 68, 68, 0.2);
        }

        .message .action-btn.delete:hover {
            background: #dc2626;
            color: white;
            border-color: #dc2626;
        }

        .mention {
            background: rgba(245, 158, 11, 0.12);
            color: #d97706;
            padding: 1px 6px;
            border-radius: 4px;
            font-weight: 600;
            font-size: 13px;
        }

        .message.mentioned {
            background: rgba(245, 158, 11, 0.06);
            border-color: rgba(245, 158, 11, 0.2);
        }

        .image-preview {
            max-width: 200px;
            max-height: 150px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            margin-top: 8px;
            transition: var(--transition);
        }

        .image-preview:hover {
            transform: scale(1.03);
            box-shadow: var(--shadow-md);
        }

        .video-preview {
            max-width: 300px;
            max-height: 200px;
            border-radius: var(--radius-sm);
            margin-top: 8px;
        }

        .audio-preview {
            width: 100%;
            max-width: 300px;
            margin-top: 8px;
        }

        .file-inline-preview {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 14px;
            background: var(--surface);
            border-radius: var(--radius-sm);
            margin-top: 8px;
            border: 1px solid var(--border);
        }

        .file-inline-icon {
            font-size: 24px;
        }

        .file-inline-link {
            color: var(--primary-color);
            text-decoration: none;
            font-weight: 500;
            font-size: 14px;
        }

        .file-inline-link:hover {
            text-decoration: underline;
        }

        .file-inline-download {
            color: #10b981;
            text-decoration: none;
            font-size: 13px;
            margin-left: auto;
        }

        .file-inline-download:hover {
            text-decoration: underline;
        }

        .edit-input-wrapper {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .edit-input {
            width: 100%;
            padding: 8px 12px;
            border: 2px solid var(--primary-color);
            border-radius: var(--radius-sm);
            font-size: 14px;
            font-family: inherit;
            background: var(--surface-solid);
            color: var(--text-primary);
        }

        .edit-input:focus {
            outline: none;
        }

        .edit-actions {
            display: flex;
            gap: 8px;
        }

        .edit-save-btn, .edit-cancel-btn {
            padding: 5px 14px;
            border: none;
            border-radius: 6px;
            font-size: 12px;
            cursor: pointer;
            font-weight: 600;
            font-family: inherit;
            transition: var(--transition);
        }

        .edit-save-btn {
            background: #10b981;
            color: white;
        }

        .edit-save-btn:hover {
            background: #059669;
        }

        .edit-cancel-btn {
            background: var(--surface);
            color: var(--text-secondary);
            border: 1px solid var(--border);
        }

        .edit-cancel-btn:hover {
            background: var(--border);
        }

        .edited-badge {
            font-size: 11px;
            color: var(--text-tertiary);
            font-style: italic;
        }

        .message .action-btn.edit:hover {
            background: #f59e0b;
            border-color: #f59e0b;
        }

        /* File preview modal */
        .image-modal {
            display: none;
            position: fixed;
            inset: 0;
            padding: clamp(14px, 3vw, 36px);
            background: rgba(9, 14, 27, 0.82);
            backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px);
            z-index: 3000;
            justify-content: center;
            align-items: center;
        }

        body.preview-open {
            overflow: hidden;
        }

        .file-preview-dialog {
            width: min(1120px, 100%);
            height: min(820px, 100%);
            min-height: 360px;
            display: grid;
            grid-template-rows: auto minmax(0, 1fr);
            overflow: hidden;
            border: 1px solid rgba(255, 255, 255, 0.18);
            border-radius: 22px;
            background: color-mix(in srgb, var(--surface-solid) 96%, transparent);
            box-shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
        }

        .file-preview-toolbar {
            min-height: 72px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 18px;
            padding: 12px 14px 12px 18px;
            border-bottom: 1px solid var(--border);
            background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
        }

        .file-preview-title {
            min-width: 0;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .file-preview-title > span:last-child {
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 3px;
        }

        .file-preview-title strong {
            overflow: hidden;
            color: var(--text-primary);
            font-size: 14px;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .file-preview-title small {
            color: var(--text-tertiary);
            font-size: 11px;
        }

        .file-preview-type-icon {
            width: 42px;
            height: 42px;
            display: grid;
            place-items: center;
            flex: 0 0 auto;
            border-radius: 12px;
            background: color-mix(in srgb, var(--primary-color) 10%, var(--surface-solid));
            font-size: 20px;
        }

        .file-preview-actions {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .preview-download-btn,
        .preview-close-btn {
            min-height: 38px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--border);
            border-radius: 10px;
            font-size: 12px;
            font-weight: 700;
            text-decoration: none;
            cursor: pointer;
        }

        .preview-download-btn {
            padding: 0 16px;
            border-color: color-mix(in srgb, var(--primary-color) 25%, transparent);
            background: color-mix(in srgb, var(--primary-color) 10%, var(--surface-solid));
            color: var(--primary-color);
        }

        .preview-close-btn {
            width: 38px;
            padding: 0;
            background: var(--surface-muted);
            color: var(--text-secondary);
        }

        .preview-download-btn:hover,
        .preview-close-btn:hover {
            transform: translateY(-1px);
            border-color: var(--primary-color);
        }

        .file-preview-stage {
            position: relative;
            min-height: 0;
            display: grid;
            place-items: center;
            overflow: hidden;
            padding: clamp(12px, 2vw, 24px);
            background:
                linear-gradient(45deg, color-mix(in srgb, var(--border) 42%, transparent) 25%, transparent 25%) 0 0 / 20px 20px,
                linear-gradient(45deg, transparent 75%, color-mix(in srgb, var(--border) 42%, transparent) 75%) 0 0 / 20px 20px,
                linear-gradient(45deg, transparent 75%, color-mix(in srgb, var(--border) 42%, transparent) 75%) 10px -10px / 20px 20px,
                linear-gradient(45deg, color-mix(in srgb, var(--border) 42%, transparent) 25%, var(--surface-muted) 25%) 10px 10px / 20px 20px;
        }

        .file-preview-stage #previewImage {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            border-radius: 12px;
            box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
        }

        #filePreviewContainer {
            width: 100%;
            height: 100%;
            min-height: 0;
            place-items: center;
        }

        .preview-video {
            max-width: 100%;
            max-height: 100%;
            border-radius: 14px;
            background: #070b14;
            box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
        }

        .preview-audio-card {
            width: min(460px, 92%);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
            padding: 34px;
            border: 1px solid var(--border);
            border-radius: 20px;
            background: var(--surface-solid);
            box-shadow: var(--shadow-lg);
        }

        .preview-audio-card strong {
            max-width: 100%;
            overflow: hidden;
            color: var(--text-primary);
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .preview-audio-card small {
            color: var(--text-tertiary);
        }

        .preview-audio-card audio {
            width: 100%;
            margin-top: 10px;
        }

        .preview-audio-icon {
            width: 64px;
            height: 64px;
            display: grid;
            place-items: center;
            border-radius: 20px;
            background: linear-gradient(145deg, var(--primary-color), var(--secondary-color));
            color: white;
            font-size: 30px;
            box-shadow: 0 14px 30px color-mix(in srgb, var(--primary-color) 28%, transparent);
        }

        .preview-pdf {
            width: 100%;
            height: 100%;
            border: 0;
            border-radius: 12px;
            background: white;
        }

        .preview-text-card {
            width: min(900px, 100%);
            height: 100%;
            overflow: auto;
            border: 1px solid var(--border);
            border-radius: 14px;
            background: var(--surface-solid);
            box-shadow: var(--shadow-md);
        }

        .preview-text-card pre {
            min-height: 100%;
            margin: 0;
            padding: 24px;
            color: var(--text-primary);
            font: 13px/1.75 ui-monospace, SFMono-Regular, Consolas, monospace;
            text-align: left;
            white-space: pre-wrap;
            word-break: break-word;
        }

        .preview-loading {
            position: absolute;
            inset: 0;
            z-index: 2;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            gap: 12px;
            background: color-mix(in srgb, var(--surface-muted) 82%, transparent);
            color: var(--text-secondary);
            font-size: 12px;
        }

        .preview-loading-spinner {
            width: 30px;
            height: 30px;
            border: 3px solid color-mix(in srgb, var(--primary-color) 18%, transparent);
            border-top-color: var(--primary-color);
            border-radius: 50%;
            animation: preview-spin 0.8s linear infinite;
        }

        @keyframes preview-spin {
            to { transform: rotate(360deg); }
        }

        .preview-error-state {
            max-width: 360px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            padding: 32px;
            border: 1px solid var(--border);
            border-radius: 18px;
            background: var(--surface-solid);
            text-align: center;
            box-shadow: var(--shadow-md);
        }

        .preview-error-state > span {
            width: 48px;
            height: 48px;
            display: grid;
            place-items: center;
            border-radius: 50%;
            background: rgba(239, 68, 68, 0.1);
            color: #ef4444;
            font-size: 22px;
            font-weight: 800;
        }

        .preview-error-state strong {
            color: var(--text-primary);
        }

        .preview-error-state small {
            color: var(--text-tertiary);
        }

        /* ===== Input Section ===== */
        .input-section {
            display: flex;
            gap: 10px;
            min-width: 0;
            align-items: center;
        }

        .input-section .btn {
            padding: 10px 20px;
            font-size: 14px;
            white-space: nowrap;
            flex-shrink: 0;
        }

        .input-section input {
            flex: 1;
            min-width: 0;
            padding: 12px 16px;
            font-size: 14px;
            font-family: inherit;
            border: 2px solid var(--border-strong);
            border-radius: var(--radius-md);
            transition: var(--transition);
            background: var(--surface);
            color: var(--text-primary);
        }

        .input-section input::placeholder {
            color: var(--text-tertiary);
        }

        .input-section input:focus {
            outline: none;
            border-color: var(--primary-color);
            background: var(--surface-hover);
            box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.08);
        }

        /* Typing Indicator */
        .typing-indicator {
            padding: 6px 12px;
            font-size: 12px;
            color: var(--text-tertiary);
            font-style: italic;
            min-height: 24px;
            animation: fadeIn 0.3s ease;
        }

        .typing-indicator::before {
            content: '';
            display: inline-block;
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--primary-color);
            margin-right: 6px;
            animation: typingBounce 1.2s ease-in-out infinite;
        }

        /* Emoji Picker */
        .emoji-picker-container {
            position: relative;
        }

        .emoji-picker-btn {
            background: none;
            border: none;
            font-size: 22px;
            cursor: pointer;
            padding: 4px;
            border-radius: var(--radius-sm);
            transition: var(--transition);
        }

        .emoji-picker-btn:hover {
            background: var(--border);
        }

        .emoji-picker-panel {
            display: none;
            position: absolute;
            bottom: calc(100% + 8px);
            left: 0;
            background: var(--surface-solid);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-xl);
            padding: 12px;
            width: 360px;
            max-height: 400px;
            z-index: 100;
            animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .emoji-picker-panel.show {
            display: block;
        }

        .emoji-picker-header {
            display: flex;
            gap: 2px;
            padding-bottom: 8px;
            margin-bottom: 8px;
            border-bottom: 1px solid var(--border);
            overflow-x: auto;
            scrollbar-width: none;
        }

        .emoji-picker-header::-webkit-scrollbar {
            display: none;
        }

        .emoji-category-btn {
            flex-shrink: 0;
            background: none;
            border: none;
            font-size: 18px;
            cursor: pointer;
            padding: 4px 6px;
            border-radius: var(--radius-sm);
            transition: var(--transition);
            opacity: 0.5;
            line-height: 1;
        }

        .emoji-category-btn:hover {
            opacity: 0.85;
            background: var(--border);
        }

        .emoji-category-btn.active {
            opacity: 1;
            background: var(--primary-color);
            background: color-mix(in srgb, var(--primary-color) 15%, transparent);
        }

        .emoji-search-input {
            width: 100%;
            padding: 8px 10px 8px 30px;
            border: 1.5px solid var(--border-strong);
            border-radius: var(--radius-sm);
            font-size: 13px;
            font-family: inherit;
            margin-bottom: 8px;
            background: var(--surface);
            color: var(--text-primary);
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: 10px center;
        }

        .emoji-search-input:focus {
            outline: none;
            border-color: var(--primary-color);
        }

        .emoji-recent-label {
            font-size: 11px;
            color: var(--text-tertiary);
            margin-bottom: 6px;
            padding-left: 2px;
            font-weight: 600;
            letter-spacing: 0.5px;
            text-transform: uppercase;
        }

        .emoji-grid {
            display: grid;
            grid-template-columns: repeat(9, 1fr);
            gap: 2px;
            max-height: 280px;
            overflow-y: auto;
            padding: 2px;
        }

        .emoji-grid::-webkit-scrollbar {
            width: 4px;
        }

        .emoji-grid::-webkit-scrollbar-track {
            background: transparent;
        }

        .emoji-grid::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 4px;
        }

        .emoji-grid .emoji-item {
            font-size: 22px;
            cursor: pointer;
            padding: 5px;
            border-radius: var(--radius-sm);
            text-align: center;
            transition: var(--transition);
            line-height: 1.2;
        }

        .emoji-grid .emoji-item:hover {
            background: color-mix(in srgb, var(--primary-color) 12%, transparent);
            transform: scale(1.2);
        }

        /* Input Wrapper (mention) */
        .input-wrapper {
            flex: 1;
            min-width: 0;
            position: relative;
        }

        .input-wrapper input {
            width: 100%;
            padding: 12px 16px;
            font-size: 14px;
            font-family: inherit;
            border: 2px solid var(--border-strong);
            border-radius: var(--radius-md);
            transition: var(--transition);
            background: var(--surface);
            color: var(--text-primary);
        }

        .input-wrapper input::placeholder {
            color: var(--text-tertiary);
        }

        .input-wrapper input:focus {
            outline: none;
            border-color: var(--primary-color);
            background: var(--surface-hover);
            box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.08);
        }

        .mention-dropdown {
            display: none;
            position: absolute;
            bottom: 100%;
            left: 0;
            right: 0;
            background: var(--surface-solid);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            box-shadow: var(--shadow-lg);
            max-height: 160px;
            overflow-y: auto;
            z-index: 50;
        }

        .mention-item {
            padding: 8px 12px;
            cursor: pointer;
            font-size: 13px;
            color: var(--text-primary);
            transition: var(--transition);
        }

        .mention-item:hover,
        .mention-item.active {
            background: rgba(13, 148, 136, 0.08);
            color: var(--primary-color);
        }

        /* ===== Upload Area ===== */
        .upload-area {
            border: 2px dashed var(--border-strong);
            border-radius: var(--radius-lg);
            padding: 32px;
            text-align: center;
            margin-bottom: 20px;
            transition: var(--transition);
            cursor: pointer;
            background: var(--surface);
        }

        .upload-area:hover:not(.disabled) {
            border-color: var(--primary-color);
            background: rgba(13, 148, 136, 0.04);
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
        }

        .upload-area.drag-over:not(.disabled) {
            border-color: var(--primary-color);
            background: rgba(13, 148, 136, 0.06);
            border-style: solid;
            transform: scale(1.01);
        }

        .upload-area.disabled {
            opacity: 0.5;
            cursor: not-allowed;
            background: rgba(239, 68, 68, 0.04);
            border-color: rgba(239, 68, 68, 0.3);
        }

        .upload-area input[type="file"] {
            display: none;
        }

        .upload-icon {
            font-size: 48px;
            margin-bottom: 12px;
        }

        .upload-text {
            color: var(--text-secondary);
            font-size: 15px;
        }

        .upload-text.has-permission {
            color: var(--primary-color);
            font-weight: 600;
        }

        .upload-text.no-permission {
            color: #dc2626;
        }

        /* ===== File List ===== */
        .file-list {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 12px;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
        }

        .file-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 14px;
            background: var(--surface);
            border-radius: var(--radius-md);
            margin-bottom: 8px;
            transition: var(--transition);
            border: 1px solid var(--border);
            min-width: 0;
        }

        .file-item:hover {
            border-color: var(--primary-color);
            box-shadow: var(--shadow-sm);
        }

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

        .file-name {
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 4px;
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 0;
            font-size: 14px;
        }

        .file-name-text {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            min-width: 0;
            flex: 1;
        }

        .file-meta {
            font-size: 12px;
            color: var(--text-tertiary);
            display: flex;
            gap: 12px;
        }

        .file-icon {
            font-size: 24px;
            margin-right: 12px;
        }

        .download-btn {
            padding: 8px 16px;
            background: #10b981;
            color: white;
            border: none;
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: 13px;
            font-weight: 600;
            font-family: inherit;
            transition: var(--transition);
            white-space: nowrap;
        }

        .download-btn:hover {
            background: #059669;
            transform: translateY(-1px);
        }

        .empty-state {
            text-align: center;
            padding: 40px 20px;
            color: var(--text-tertiary);
        }

        .empty-state-icon {
            font-size: 48px;
            margin-bottom: 12px;
        }

        .empty-state p {
            font-size: 14px;
        }

        /* ===== Modals ===== */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(15, 23, 42, 0.4);
            backdrop-filter: blur(12px) saturate(1.2);
            -webkit-backdrop-filter: blur(12px) saturate(1.2);
            justify-content: center;
            align-items: center;
            z-index: 1000;
            animation: overlayIn 0.2s ease;
        }

        .modal-content {
            background: var(--surface-solid);
            backdrop-filter: blur(24px);
            -webkit-backdrop-filter: blur(24px);
            border: 1px solid var(--border);
            padding: 32px;
            border-radius: var(--radius-xl);
            text-align: center;
            max-width: 420px;
            width: 90%;
            box-shadow: var(--shadow-xl);
            animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .modal-content h3 {
            margin-bottom: 24px;
            color: var(--text-primary);
            font-size: 20px;
            font-weight: 700;
        }

        .modal-content input {
            width: 100%;
            padding: 12px 16px;
            border: 2px solid var(--border-strong);
            border-radius: var(--radius-md);
            margin-bottom: 16px;
            font-size: 15px;
            font-family: inherit;
            transition: var(--transition);
            background: var(--surface);
            color: var(--text-primary);
        }

        .modal-content input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.08);
        }

        .modal-buttons {
            display: flex;
            gap: 12px;
            justify-content: center;
            margin-top: 8px;
        }

        /* Share Link Modal */
        .modal-content label {
            color: var(--text-secondary);
        }

        .modal-content select {
            font-family: inherit;
            color: var(--text-primary);
        }

        /* ===== Admin Panel ===== */
        .admin-panel-outside {
            display: none;
            width: 100%;
            max-width: 600px;
            margin: 60px auto 0;
            padding: 0 20px;
            position: relative;
            z-index: 1;
        }

        .admin-panel-inner {
            background: var(--surface);
            backdrop-filter: blur(20px) saturate(1.4);
            -webkit-backdrop-filter: blur(20px) saturate(1.4);
            padding: 28px;
            border-radius: var(--radius-xl);
            border: 1px solid var(--border);
            box-shadow: var(--shadow-lg);
            animation: sectionIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .admin-panel h3,
        .admin-panel-inner h3 {
            color: var(--text-primary);
            margin-bottom: 20px;
            font-size: 18px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .admin-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            flex-wrap: wrap;
            gap: 12px;
        }

        .admin-input-group {
            display: flex;
            gap: 10px;
            align-items: center;
            flex-wrap: wrap;
        }

        .admin-input-group input {
            padding: 10px 14px;
            border: 2px solid var(--border-strong);
            border-radius: var(--radius-sm);
            font-size: 14px;
            font-family: inherit;
            background: var(--surface);
            color: var(--text-primary);
            transition: var(--transition);
        }

        .admin-input-group input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.08);
        }

        .admin-input {
            padding: 10px 14px;
            border: 2px solid var(--border-strong);
            border-radius: var(--radius-sm);
            font-size: 14px;
            font-family: inherit;
            background: var(--surface);
            color: var(--text-primary);
            transition: var(--transition);
        }

        .admin-input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.08);
        }

        .admin-section-label {
            font-size: 11px;
            font-weight: 700;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            margin-bottom: 10px;
        }

        .admin-tab-selector {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 14px;
            color: var(--text-secondary);
            font-weight: 500;
        }

        .admin-tab-selector select {
            padding: 8px 12px;
            border: 2px solid var(--border-strong);
            border-radius: var(--radius-sm);
            font-size: 14px;
            font-family: inherit;
            background: var(--surface);
            color: var(--text-primary);
            cursor: pointer;
            outline: none;
            transition: var(--transition);
        }

        .admin-tab-selector select:focus {
            border-color: var(--primary-color);
        }

        .admin-tab-panel {
            margin-top: 16px;
        }

        /* Stats Panel */
        .stats-panel {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 10px;
        }

        .stat-card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            padding: 14px 12px;
            text-align: center;
            transition: var(--transition);
        }

        .stat-card:hover {
            border-color: var(--border-strong);
            box-shadow: var(--shadow-sm);
        }

        .stat-icon {
            font-size: 22px;
            margin-bottom: 6px;
        }

        .stat-value {
            font-size: 22px;
            font-weight: 700;
            color: var(--text-primary);
            letter-spacing: -0.02em;
        }

        .stat-label {
            font-size: 11px;
            color: var(--text-tertiary);
            margin-top: 4px;
            font-weight: 500;
        }

        /* Permission List */
        .permission-list {
            background: var(--surface);
            border-radius: var(--radius-md);
            padding: 12px;
            max-height: 300px;
            overflow-y: auto;
            border: 1px solid var(--border);
        }

        .permission-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 12px;
            border-bottom: 1px solid var(--border);
            transition: var(--transition);
        }

        .permission-item:last-child {
            border-bottom: none;
        }

        .permission-item:hover {
            background: var(--surface-hover);
        }

        .permission-user {
            display: flex;
            align-items: center;
            gap: 10px;
            font-weight: 500;
            color: var(--text-primary);
            font-size: 14px;
        }

        .permission-badge {
            display: inline-flex;
            align-items: center;
            padding: 4px 10px;
            background: rgba(16, 185, 129, 0.1);
            color: #059669;
            border-radius: 50px;
            font-size: 12px;
            font-weight: 600;
        }

        /* Vote Section */
        .vote-section {
            margin-top: 8px;
        }

        .vote-create-form {
            margin-bottom: 20px;
        }

        .vote-create-form input {
            width: 100%;
            padding: 10px 14px;
            border: 2px solid var(--border-strong);
            border-radius: var(--radius-sm);
            font-size: 14px;
            font-family: inherit;
            background: var(--surface);
            color: var(--text-primary);
            margin-bottom: 12px;
        }

        .vote-create-form input:focus {
            outline: none;
            border-color: var(--primary-color);
        }

        .vote-options-container {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-bottom: 12px;
        }

        .vote-option-input-row {
            display: flex;
            gap: 8px;
        }

        .vote-option-input {
            flex: 1;
            padding: 8px 12px;
            border: 2px solid var(--border-strong);
            border-radius: var(--radius-sm);
            font-size: 13px;
            font-family: inherit;
            background: var(--surface);
            color: var(--text-primary);
        }

        .vote-option-input:focus {
            outline: none;
            border-color: var(--primary-color);
        }

        .vote-create-actions {
            display: flex;
            gap: 8px;
        }

        .vote-card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            padding: 16px;
            margin-bottom: 12px;
        }

        .vote-question {
            font-weight: 600;
            font-size: 15px;
            color: var(--text-primary);
            margin-bottom: 12px;
        }

        .vote-option {
            padding: 10px 12px;
            margin-bottom: 8px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            cursor: pointer;
            transition: var(--transition);
            background: var(--surface);
        }

        .vote-option:hover {
            border-color: var(--primary-color);
        }

        .vote-option-text {
            font-size: 13px;
            color: var(--text-primary);
            font-weight: 500;
            display: block;
            margin-bottom: 6px;
        }

        /* ===== Chat Tab Selector ===== */
        .chat-tab-selector {
            margin-bottom: 8px;
        }

        .chat-tab-selector select {
            width: 100%;
            padding: 8px 12px;
            border: 2px solid var(--border-strong);
            border-radius: var(--radius-sm);
            font-size: 13px;
            font-family: inherit;
            background: var(--surface);
            color: var(--text-primary);
            cursor: pointer;
            outline: none;
            transition: var(--transition);
        }

        .chat-tab-selector select:focus {
            border-color: var(--primary-color);
        }

        .chat-tab-panel {
            margin-bottom: 8px;
        }

        #voteContainer {
            max-height: 400px;
            overflow-y: auto;
            padding-right: 4px;
        }

        /* ===== Online Users ===== */
        .online-users {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            padding: 12px;
            max-height: 120px;
            overflow-y: auto;
        }

        .online-user-item {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 50px;
            margin: 3px;
            font-size: 12px;
            transition: var(--transition);
        }

        .online-user-item:hover {
            border-color: var(--primary-color);
            background: rgba(13, 148, 136, 0.04);
        }

        .online-user-item .status-dot {
            width: 6px;
            height: 6px;
            background: #10b981;
            border-radius: 50%;
        }

        /* ===== Channel List ===== */
        .channel-section {
            margin-bottom: 12px;
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            padding: 10px;
            background: var(--surface);
        }

        .channel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 8px;
        }

        .channel-list {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .channel-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 10px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            transition: var(--transition);
            font-size: 13px;
            color: var(--text-secondary);
            position: relative;
        }

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

        .channel-item.active {
            background: var(--primary-color);
            color: white;
        }

        .channel-item.active .channel-icon {
            color: white;
        }

        .channel-icon {
            font-weight: 700;
            color: var(--text-tertiary);
            font-size: 14px;
            min-width: 16px;
        }

        .channel-name {
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .channel-delete-btn {
            display: none;
            background: none;
            border: none;
            color: #ef4444;
            cursor: pointer;
            font-size: 16px;
            padding: 0 4px;
            line-height: 1;
            opacity: 0.7;
            transition: var(--transition);
        }

        .channel-item:hover .channel-delete-btn {
            display: block;
        }

        .channel-delete-btn:hover {
            opacity: 1;
        }

        /* ===== Search Box ===== */
        .search-box {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
        }

        .search-box input {
            flex: 1;
            padding: 8px 12px;
            font-size: 13px;
            font-family: inherit;
            border: 2px solid var(--border-strong);
            border-radius: var(--radius-sm);
            background: var(--surface);
            color: var(--text-primary);
        }

        .search-box input::placeholder {
            color: var(--text-tertiary);
        }

        .search-box input:focus {
            outline: none;
            border-color: var(--primary-color);
        }

        /* ===== Toast ===== */
        .toast {
            position: fixed;
            bottom: 24px;
            right: 24px;
            padding: 14px 20px;
            background: var(--text-primary);
            color: var(--surface-solid);
            border-radius: var(--radius-md);
            font-size: 14px;
            font-weight: 500;
            box-shadow: var(--shadow-lg);
            z-index: 2000;
            animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .toast.success {
            background: #10b981;
            color: white;
        }

        .toast.error {
            background: #ef4444;
            color: white;
        }

        /* ===== Pagination ===== */
        .pagination {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 16px;
            padding: 12px 0;
        }

        .pagination-btn {
            padding: 8px 16px;
            background: var(--surface);
            border: 1.5px solid var(--border-strong);
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: 13px;
            font-family: inherit;
            font-weight: 500;
            color: var(--text-primary);
            transition: var(--transition);
        }

        .pagination-btn:hover:not(:disabled) {
            border-color: var(--primary-color);
            color: var(--primary-color);
        }

        .pagination-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        .pagination-info {
            font-size: 13px;
            color: var(--text-secondary);
        }

        /* ===== Private Mode ===== */
        .private-mode-toggle {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 12px;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            margin-bottom: 8px;
            font-size: 13px;
        }

        .private-mode-toggle label {
            display: flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
            color: var(--text-secondary);
            font-weight: 500;
        }

        .private-mode-toggle select {
            padding: 4px 8px;
            border: 1.5px solid var(--border-strong);
            border-radius: 6px;
            font-size: 12px;
            font-family: inherit;
            background: var(--surface);
            color: var(--text-primary);
        }

        /* ===== Export Dropdown ===== */
        .chat-export-dropdown {
            position: relative;
        }

        .dropdown-content {
            display: none;
            position: absolute;
            bottom: 100%;
            left: 0;
            background: var(--surface-solid);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            box-shadow: var(--shadow-lg);
            min-width: 200px;
            z-index: 50;
            animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
            overflow: hidden;
        }

        .dropdown-content.show {
            display: block;
        }

        .dropdown-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 14px;
            border-bottom: 1px solid var(--border);
            font-size: 13px;
            font-weight: 600;
            color: var(--text-primary);
        }

        .dropdown-header .close-btn {
            background: none;
            border: none;
            font-size: 16px;
            cursor: pointer;
            color: var(--text-tertiary);
            padding: 0;
            line-height: 1;
        }

        .dropdown-header .close-btn:hover {
            color: var(--text-primary);
        }

        .dropdown-actions {
            padding: 6px;
        }

        .dropdown-actions button {
            display: block;
            width: 100%;
            text-align: left;
            padding: 8px 12px;
            border: none;
            background: none;
            cursor: pointer;
            font-size: 13px;
            font-family: inherit;
            color: var(--text-primary);
            border-radius: 6px;
            transition: var(--transition);
        }

        .dropdown-actions button:hover {
            background: rgba(13, 148, 136, 0.08);
        }

        /* ===== Pinned Messages ===== */
        .pinned-messages-container {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .pinned-message-item {
            padding: 10px 12px;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 13px;
            color: var(--text-primary);
        }

        .pinned-message-user {
            font-weight: 600;
            color: var(--primary-color);
            font-size: 12px;
            margin-bottom: 4px;
        }

        .pinned-message-text {
            line-height: 1.5;
        }

        /* ===== Share Link Result ===== */
        #shareLinkResult {
            background: rgba(16, 185, 129, 0.06);
            border: 1px solid rgba(16, 185, 129, 0.2);
            border-radius: var(--radius-sm);
        }

        #shareLinkResult label {
            color: #059669;
        }

        /* ===== Reply Preview ===== */
        #replyPreview {
            background: var(--surface);
            border: 1px solid var(--border);
            color: var(--text-secondary);
        }

        /* ===== Private Mode Toggle ===== */
        #privateModeToggle {
            background: rgba(13, 148, 136, 0.06);
            border-color: rgba(13, 148, 136, 0.15);
        }

        .hidden {
            display: none !important;
        }

        /* ===== Animations ===== */
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(6px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes containerIn {
            from { opacity: 0; transform: scale(0.97) translateY(16px); }
            to { opacity: 1; transform: scale(1) translateY(0); }
        }

        @keyframes sectionIn {
            from { opacity: 0; transform: translateY(12px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes loginIn {
            from { opacity: 0; transform: translateY(24px) scale(0.97); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }

        @keyframes messageIn {
            from { opacity: 0; transform: translateY(8px) scale(0.98); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }

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

        @keyframes slideUp {
            from { opacity: 0; transform: translateY(8px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes typingBounce {
            0%, 60%, 100% { transform: translateY(0); }
            30% { transform: translateY(-4px); }
        }

        @keyframes modalIn {
            from { opacity: 0; transform: scale(0.96); }
            to { opacity: 1; transform: scale(1); }
        }

        @keyframes overlayIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        /* ===== Vote Display (dynamic) ===== */
        .vote-card.closed {
            opacity: 0.7;
        }

        .vote-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }

        .vote-status {
            font-size: 11px;
            font-weight: 600;
            padding: 3px 10px;
            border-radius: 50px;
        }

        .vote-status.active {
            background: rgba(16, 185, 129, 0.1);
            color: #059669;
        }

        .vote-status.closed {
            background: rgba(148, 163, 184, 0.15);
            color: var(--text-tertiary);
        }

        .vote-option.voted {
            opacity: 0.85;
            cursor: default;
        }

        .vote-option.user-voted {
            opacity: 1;
            border-color: var(--primary-color);
            background: rgba(13, 148, 136, 0.06);
        }

        .vote-progress-bar {
            height: 6px;
            background: var(--border);
            border-radius: 3px;
            overflow: hidden;
            margin-top: 6px;
        }

        .vote-progress-fill {
            height: 100%;
            background: var(--primary-color);
            border-radius: 3px;
            transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .vote-count {
            font-size: 12px;
            color: var(--text-tertiary);
            margin-top: 4px;
            display: block;
        }

        .vote-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 12px;
            padding-top: 10px;
            border-top: 1px solid var(--border);
            font-size: 12px;
            color: var(--text-tertiary);
        }

        .vote-total {
            font-weight: 600;
            color: var(--text-secondary);
        }

        .vote-option-remove {
            background: none;
            border: 1.5px solid rgba(239, 68, 68, 0.3);
            color: #ef4444;
            width: 28px;
            height: 28px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
            flex-shrink: 0;
        }

        .vote-option-remove:hover {
            background: #ef4444;
            color: white;
            border-color: #ef4444;
        }

        /* ===== Message Badges ===== */
        .pin-badge {
            display: inline-flex;
            align-items: center;
            gap: 3px;
            font-size: 11px;
            font-weight: 600;
            padding: 2px 8px;
            border-radius: 50px;
            background: rgba(245, 158, 11, 0.1);
            color: #d97706;
        }

        .private-divider {
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 12px 0 8px;
            font-size: 12px;
            font-weight: 600;
            color: #8b5cf6;
        }

        .private-divider::before,
        .private-divider::after {
            content: '';
            flex: 1;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.3), transparent);
        }

        /* ===== Action Button Modifiers ===== */
        .message .action-btn.pin:hover {
            background: #f59e0b;
            border-color: #f59e0b;
            color: white;
        }

        .message .action-btn.private:hover {
            background: #8b5cf6;
            border-color: #8b5cf6;
            color: white;
        }

        /* ===== 2026 Visual Refresh ===== */
        :root {
            --primary-color: #4f46e5;
            --secondary-color: #4338ca;
            --accent: #06b6d4;
            --bg-gradient:
                radial-gradient(circle at 12% 15%, rgba(99, 102, 241, 0.18), transparent 30%),
                radial-gradient(circle at 88% 82%, rgba(6, 182, 212, 0.14), transparent 28%),
                linear-gradient(145deg, #eef2ff 0%, #f8fafc 48%, #ecfeff 100%);
            --surface: rgba(255, 255, 255, 0.78);
            --surface-solid: #ffffff;
            --surface-hover: rgba(248, 250, 252, 0.96);
            --border: rgba(79, 70, 229, 0.22);
            --border-strong: rgba(67, 56, 202, 0.38);
            --text-primary: #172033;
            --text-secondary: #59657a;
            --text-tertiary: #8b97ab;
            --shadow-sm: 0 2px 8px rgba(30, 41, 59, 0.06);
            --shadow-md: 0 12px 32px rgba(30, 41, 59, 0.09);
            --shadow-lg: 0 20px 50px rgba(30, 41, 59, 0.12);
            --shadow-xl: 0 34px 90px rgba(30, 41, 59, 0.15);
            --radius-sm: 8px;
            --radius-md: 12px;
            --radius-lg: 18px;
            --radius-xl: 26px;
        }

        .theme-normal {
            --primary-color: #4f46e5;
            --secondary-color: #4338ca;
            --accent: #06b6d4;
            --bg-gradient:
                radial-gradient(circle at 12% 15%, rgba(99, 102, 241, 0.18), transparent 30%),
                radial-gradient(circle at 88% 82%, rgba(6, 182, 212, 0.14), transparent 28%),
                linear-gradient(145deg, #eef2ff 0%, #f8fafc 48%, #ecfeff 100%);
        }

        .theme-dark {
            --surface: rgba(17, 24, 39, 0.82);
            --surface-solid: #151d2d;
            --surface-hover: rgba(30, 41, 59, 0.96);
            --border: rgba(148, 163, 184, 0.22);
            --border-strong: rgba(203, 213, 225, 0.38);
            --text-primary: #f7f8fb;
            --text-secondary: #bdc7d8;
            --text-tertiary: #8491a6;
        }

        body {
            position: relative;
            overflow-x: hidden;
            padding: 28px;
        }

        body::before {
            background-image:
                linear-gradient(rgba(99, 102, 241, 0.025) 1px, transparent 1px),
                linear-gradient(90deg, rgba(99, 102, 241, 0.025) 1px, transparent 1px);
            background-size: 32px 32px;
            mask-image: linear-gradient(to bottom, black, transparent 82%);
            -webkit-mask-image: linear-gradient(to bottom, black, transparent 82%);
        }

        body::after {
            content: '';
            position: fixed;
            width: 360px;
            height: 360px;
            left: -150px;
            bottom: -170px;
            border: 1px solid rgba(99, 102, 241, 0.14);
            border-radius: 50%;
            box-shadow: 0 0 0 48px rgba(99, 102, 241, 0.035),
                        0 0 0 96px rgba(6, 182, 212, 0.02);
            pointer-events: none;
            z-index: 0;
        }

        button,
        input,
        select {
            font: inherit;
        }

        button:focus-visible,
        input:focus-visible,
        select:focus-visible {
            outline: 3px solid color-mix(in srgb, var(--primary-color) 28%, transparent);
            outline-offset: 2px;
        }

        .theme-selector {
            top: 20px;
            right: 24px;
            padding: 7px 8px 7px 14px;
            gap: 6px;
            background: rgba(255, 255, 255, 0.88);
            border-color: var(--border-strong);
            box-shadow: 0 10px 30px rgba(30, 41, 59, 0.1);
        }

        .theme-dark .theme-selector {
            background: rgba(17, 24, 39, 0.9);
            border-color: var(--border);
        }

        .theme-selector select {
            min-width: 104px;
            padding: 7px 30px 7px 10px;
            border: 0;
            background-color: color-mix(in srgb, var(--primary-color) 7%, var(--surface-solid));
            font-weight: 600;
        }

        .color-picker-panel {
            width: min(330px, calc(100vw - 32px));
            top: 76px;
            right: 24px;
            border-color: rgba(255, 255, 255, 0.72);
        }

        .container {
            max-width: 1480px;
            padding: 10px;
            border-radius: 30px;
            background: rgba(255, 255, 255, 0.42);
            border-color: rgba(255, 255, 255, 0.72);
            box-shadow: 0 28px 80px rgba(30, 41, 59, 0.13),
                        inset 0 1px 0 rgba(255, 255, 255, 0.9);
        }

        .theme-dark .container {
            background: rgba(15, 23, 42, 0.48);
            border-color: var(--border);
        }

        /* Login */
        .login-section {
            display: grid;
            grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.78fr);
            gap: clamp(36px, 6vw, 88px);
            align-items: center;
            min-height: min(690px, calc(100vh - 76px));
            padding: clamp(44px, 7vw, 92px);
            text-align: left;
            overflow: hidden;
            position: relative;
            border-radius: 22px;
            background:
                linear-gradient(120deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.58));
        }

        .theme-dark .login-section {
            background: linear-gradient(120deg, rgba(21, 29, 45, 0.94), rgba(17, 24, 39, 0.74));
        }

        .login-section::before {
            content: '';
            position: absolute;
            width: 480px;
            height: 480px;
            right: -250px;
            top: -260px;
            border-radius: 50%;
            background: linear-gradient(145deg, var(--primary-color), var(--accent));
            opacity: 0.1;
        }

        .login-section::after {
            content: '';
            position: absolute;
            width: 170px;
            height: 170px;
            left: 42%;
            bottom: -112px;
            border-radius: 44px;
            border: 24px solid color-mix(in srgb, var(--primary-color) 10%, transparent);
            transform: rotate(20deg);
        }

        .login-showcase,
        .login-form-card {
            position: relative;
            z-index: 1;
        }

        .brand-mark {
            width: 58px;
            height: 58px;
            display: grid;
            place-items: center;
            margin-bottom: 34px;
            border-radius: 17px;
            background: linear-gradient(145deg, var(--primary-color), var(--accent));
            color: #fff;
            font-size: 17px;
            font-weight: 800;
            letter-spacing: -0.06em;
            box-shadow: 0 14px 28px color-mix(in srgb, var(--primary-color) 28%, transparent);
            transform: rotate(-4deg);
        }

        .brand-mark span {
            transform: rotate(4deg);
        }

        .login-kicker {
            display: flex;
            align-items: center;
            gap: 9px;
            margin-bottom: 14px;
            color: var(--primary-color);
            font-size: 12px;
            font-weight: 800;
            letter-spacing: 0.16em;
        }

        .login-kicker span {
            width: 28px;
            height: 2px;
            background: currentColor;
        }

        .login-section .login-showcase h2 {
            display: block;
            max-width: 650px;
            margin: 0 0 22px;
            font-size: clamp(38px, 4.5vw, 64px);
            line-height: 1.12;
            letter-spacing: -0.055em;
            text-align: left;
        }

        .login-section .login-showcase h2 em {
            color: var(--primary-color);
            font-style: normal;
        }

        .login-section .login-showcase > p {
            max-width: 560px;
            margin: 0 0 38px;
            color: var(--text-secondary);
            font-size: 16px;
            line-height: 1.9;
        }

        .login-features {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 12px;
            max-width: 620px;
        }

        .login-feature {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 13px 14px;
            background: rgba(255, 255, 255, 0.56);
            border: 1px solid rgba(255, 255, 255, 0.74);
            border-radius: 13px;
        }

        .theme-dark .login-feature {
            background: rgba(255, 255, 255, 0.035);
            border-color: var(--border);
        }

        .feature-icon {
            width: 34px;
            height: 34px;
            display: grid;
            place-items: center;
            flex: 0 0 auto;
            border-radius: 10px;
            background: color-mix(in srgb, var(--primary-color) 10%, var(--surface-solid));
            color: var(--primary-color);
            font-size: 16px;
            font-weight: 700;
        }

        .login-feature > span:last-child {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .login-feature strong {
            color: var(--text-primary);
            font-size: 12px;
            white-space: nowrap;
        }

        .login-feature small {
            color: var(--text-tertiary);
            font-size: 10px;
        }

        .login-form-card {
            padding: clamp(28px, 4vw, 42px);
            background: color-mix(in srgb, var(--surface-solid) 90%, transparent);
            border: 1px solid rgba(255, 255, 255, 0.86);
            border-radius: 22px;
            box-shadow: 0 26px 64px rgba(30, 41, 59, 0.14);
            backdrop-filter: blur(24px);
            -webkit-backdrop-filter: blur(24px);
        }

        .theme-dark .login-form-card {
            border-color: var(--border);
        }

        .login-form-heading {
            display: flex;
            flex-direction: column;
            gap: 7px;
            margin-bottom: 28px;
        }

        .login-form-heading span {
            color: var(--text-primary);
            font-size: 25px;
            font-weight: 750;
            letter-spacing: -0.035em;
        }

        .login-form-heading small {
            color: var(--text-secondary);
            font-size: 13px;
        }

        .field-label {
            display: flex;
            align-items: center;
            gap: 6px;
            margin: 0 0 8px;
            color: var(--text-primary);
            font-size: 13px;
            font-weight: 650;
        }

        .field-label span {
            color: var(--text-tertiary);
            font-size: 11px;
            font-weight: 500;
        }

        .login-form-card .input-group {
            display: block;
        }

        .login-form-card .input-group input {
            width: 100%;
            padding: 14px 15px;
            border: 1px solid var(--border-strong);
            border-radius: 10px;
            background: color-mix(in srgb, var(--surface-solid) 76%, transparent);
        }

        .login-form-card .input-group input:hover {
            border-color: color-mix(in srgb, var(--primary-color) 38%, transparent);
        }

        .login-form-card .password-group {
            margin: 0;
        }

        .login-form-card .field-label:nth-of-type(2) {
            margin-top: 18px;
        }

        .login-form-card .login-buttons {
            width: 100%;
            margin-top: 24px;
            gap: 9px;
        }

        .login-form-card .login-buttons .btn:first-child {
            flex: 1.35;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
        }

        .login-form-card .login-buttons .btn-register {
            background: color-mix(in srgb, var(--primary-color) 8%, var(--surface-solid));
            color: var(--primary-color);
            border: 1px solid color-mix(in srgb, var(--primary-color) 18%, transparent);
        }

        .guest-hint {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 7px;
            margin-top: 19px;
            color: var(--text-tertiary);
            font-size: 11px;
        }

        .guest-hint span {
            color: #10b981;
            font-weight: 800;
        }

        /* Common controls */
        .btn {
            min-height: 38px;
            border-radius: 10px;
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            box-shadow: 0 8px 18px color-mix(in srgb, var(--primary-color) 18%, transparent);
        }

        .btn:hover {
            box-shadow: 0 12px 24px color-mix(in srgb, var(--primary-color) 24%, transparent);
        }

        .btn-secondary {
            background: color-mix(in srgb, var(--text-secondary) 10%, var(--surface-solid));
            color: var(--text-secondary);
            border: 1px solid var(--border);
            box-shadow: none;
        }

        .btn-secondary:hover {
            color: var(--text-primary);
            background: color-mix(in srgb, var(--primary-color) 8%, var(--surface-solid));
            box-shadow: none;
        }

        .btn-success {
            background: linear-gradient(135deg, #10b981, #059669);
        }

        .btn-danger {
            background: linear-gradient(135deg, #f43f5e, #e11d48);
        }

        .admin-login-corner {
            left: 24px;
            bottom: 22px;
            min-height: 40px;
            padding: 8px 16px;
            background: rgba(255, 255, 255, 0.88);
            color: #b45309;
            border: 1px solid rgba(245, 158, 11, 0.22);
            box-shadow: 0 10px 30px rgba(30, 41, 59, 0.1);
        }

        .theme-dark .admin-login-corner {
            background: rgba(17, 24, 39, 0.9);
        }

        /* Workspace */
        body.chat-active {
            display: block;
            padding: 74px 18px 38px;
        }

        body.chat-active .container {
            margin: 0 auto;
            grid-template-columns: minmax(580px, 1.1fr) 8px minmax(440px, 0.9fr);
            align-items: stretch;
        }

        .section {
            height: calc(100vh - 132px);
            min-height: 680px;
            margin: 0;
            padding: 20px;
            border-radius: 20px;
            background: rgba(255, 255, 255, 0.82);
            border-color: rgba(255, 255, 255, 0.9);
            box-shadow: 0 12px 34px rgba(30, 41, 59, 0.07);
        }

        .theme-dark .section {
            background: rgba(17, 24, 39, 0.8);
            border-color: var(--border);
        }

        .section > h2 {
            min-height: 45px;
            margin-bottom: 14px;
            font-size: 18px;
        }

        .section-heading {
            display: inline-flex;
            align-items: center;
            gap: 11px;
            min-width: 0;
        }

        .section-heading > span:last-child {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .section-heading small {
            color: var(--text-tertiary);
            font-size: 10px;
            font-weight: 500;
            letter-spacing: 0;
        }

        .section-heading-icon {
            width: 38px;
            height: 38px;
            display: grid;
            place-items: center;
            flex: 0 0 auto;
            border-radius: 11px;
            background: color-mix(in srgb, var(--primary-color) 10%, var(--surface-solid));
            color: var(--primary-color);
            font-size: 18px;
            font-weight: 750;
        }

        body.chat-active #chatSection {
            display: grid !important;
            grid-template-columns: minmax(150px, 0.34fr) minmax(0, 1fr);
            grid-template-rows: auto auto minmax(0, 1fr);
            grid-template-areas:
                "header header"
                "userinfo userinfo"
                "left right";
            gap: 0 12px;
        }

        #chatSection > h2 {
            grid-area: header;
        }

        #chatSection > .user-info {
            grid-area: userinfo;
        }

        .chat-left-panel {
            grid-area: left;
            display: flex;
            flex-direction: column;
            min-height: 0;
            padding: 12px;
            overflow-y: auto;
            border: 1px solid var(--border-strong);
            border-radius: 14px;
            background: color-mix(in srgb, var(--primary-color) 3%, var(--surface-solid));
        }

        .chat-right-panel {
            grid-area: right;
            display: flex;
            flex-direction: column;
            min-width: 0;
            min-height: 0;
        }

        .user-info {
            padding: 9px 12px;
            margin-bottom: 12px;
            background: color-mix(in srgb, var(--primary-color) 4%, var(--surface-solid));
            border-radius: 12px;
        }

        .user-avatar {
            background: linear-gradient(145deg, var(--primary-color), var(--accent));
            box-shadow: 0 5px 12px color-mix(in srgb, var(--primary-color) 18%, transparent);
        }

        .chat-tab-selector select,
        .search-box input,
        .input-wrapper input,
        .input-section input,
        .admin-input,
        .admin-input-group input {
            border-width: 1px;
            background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
        }

        .chat-tab-selector select {
            min-height: 40px;
            font-weight: 600;
        }

        .online-users,
        .channel-section {
            padding: 8px;
            background: transparent;
            border: 0;
        }

        .channel-item {
            min-height: 38px;
        }

        .channel-item.active {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            box-shadow: 0 7px 15px color-mix(in srgb, var(--primary-color) 18%, transparent);
        }

        .search-box {
            margin-bottom: 10px;
        }

        .search-box input {
            min-height: 40px;
            padding-left: 14px;
        }

        .messages {
            padding: 14px;
            margin-bottom: 10px;
            border-radius: 14px;
            background:
                linear-gradient(rgba(99, 102, 241, 0.018) 1px, transparent 1px),
                linear-gradient(90deg, rgba(99, 102, 241, 0.018) 1px, transparent 1px),
                color-mix(in srgb, var(--surface-solid) 76%, transparent);
            background-size: 24px 24px;
        }

        .message {
            width: fit-content;
            min-width: min(220px, 72%);
            max-width: 88%;
            padding: 11px 13px;
            margin: 0 auto 9px 0;
            border-color: transparent;
            border-left: 3px solid color-mix(in srgb, var(--primary-color) 36%, transparent);
            background: color-mix(in srgb, var(--surface-solid) 91%, transparent);
            box-shadow: 0 3px 12px rgba(30, 41, 59, 0.045);
        }

        .message.own {
            margin-right: 0;
            margin-left: auto;
            border-left: 1px solid transparent;
            border-right: 3px solid var(--primary-color);
            background: color-mix(in srgb, var(--primary-color) 7%, var(--surface-solid));
        }

        .message.system {
            width: 100%;
            min-width: 0;
            max-width: 100%;
            margin-right: 0;
            border-left: 0;
            box-shadow: none;
        }

        .input-section {
            gap: 8px;
            padding: 8px;
            border: 1px solid var(--border);
            border-radius: 14px;
            background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
        }

        .input-wrapper input {
            min-height: 42px;
            border: 0;
            background: transparent;
            box-shadow: none !important;
        }

        .emoji-picker-btn {
            width: 38px;
            height: 38px;
            padding: 0;
        }

        .input-section .btn {
            min-height: 40px;
            padding: 9px 18px;
        }

        .chat-export-dropdown > .btn {
            min-height: 32px;
            background: transparent;
            border: 0;
            padding-left: 4px !important;
        }

        .upload-area {
            position: relative;
            padding: 32px 24px;
            margin-bottom: 12px;
            border: 1.5px dashed color-mix(in srgb, var(--primary-color) 34%, transparent);
            background:
                linear-gradient(135deg,
                    color-mix(in srgb, var(--primary-color) 7%, transparent),
                    color-mix(in srgb, var(--accent) 5%, transparent));
        }

        .upload-icon {
            width: 52px;
            height: 52px;
            display: grid;
            place-items: center;
            margin: 0 auto 12px;
            border-radius: 15px;
            background: var(--surface-solid);
            box-shadow: var(--shadow-sm);
            font-size: 25px;
        }

        .upload-text {
            font-size: 13px;
            font-weight: 600;
        }

        .file-list {
            padding: 10px;
            border-radius: 14px;
            background: color-mix(in srgb, var(--surface-solid) 74%, transparent);
        }

        .file-item {
            border-color: transparent;
            background: color-mix(in srgb, var(--surface-solid) 92%, transparent);
            box-shadow: 0 3px 10px rgba(30, 41, 59, 0.04);
        }

        .empty-state-icon {
            width: 58px;
            height: 58px;
            display: grid;
            place-items: center;
            margin: 0 auto 14px;
            border-radius: 16px;
            background: color-mix(in srgb, var(--primary-color) 8%, var(--surface-solid));
            font-size: 28px;
            filter: grayscale(0.1);
        }

        .admin-panel-outside {
            max-width: 1480px;
            margin-top: 28px;
        }

        .admin-panel-inner {
            background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
            border-color: var(--border-strong);
        }

        .stat-card {
            background: color-mix(in srgb, var(--surface-solid) 86%, transparent);
            border-color: var(--border);
        }

        .modal-content {
            border-radius: 20px;
            border-color: rgba(255, 255, 255, 0.72);
        }

        .toast {
            border: 1px solid rgba(255, 255, 255, 0.12);
        }

        /* Responsive */
        @media (max-width: 1180px) {
            body.chat-active .container {
                grid-template-columns: 1fr !important;
                gap: 12px;
            }

            .section {
                height: auto;
                min-height: 700px;
            }

            .file-section {
                min-height: 620px;
            }

            .admin-panel-outside {
                padding: 0 18px;
            }
        }

        @media (max-width: 840px) {
            body {
                align-items: flex-start;
                padding: 80px 14px 22px;
            }

            .container {
                border-radius: 22px;
            }

            .login-section {
                grid-template-columns: 1fr;
                gap: 34px;
                min-height: 0;
                padding: 42px 28px 32px;
            }

            .login-showcase {
                text-align: center;
            }

            .brand-mark {
                margin: 0 auto 28px;
            }

            .login-kicker {
                justify-content: center;
            }

            .login-section .login-showcase h2 {
                text-align: center;
                margin-left: auto;
                margin-right: auto;
            }

            .login-section .login-showcase > p {
                margin-left: auto;
                margin-right: auto;
            }

            .login-features {
                margin: 0 auto;
            }

            body.chat-active #chatSection {
                grid-template-columns: 1fr;
                grid-template-rows: auto auto auto minmax(420px, 1fr);
                grid-template-areas:
                    "header"
                    "userinfo"
                    "left"
                    "right";
                gap: 0;
            }

            .chat-left-panel {
                margin-bottom: 10px;
                max-height: 220px;
            }

            .registered-users-grid {
                grid-template-columns: 1fr;
            }

            .stats-panel {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width: 560px) {
            body,
            body.chat-active {
                padding: 72px 8px 18px;
            }

            .theme-selector {
                top: 10px;
                right: 10px;
            }

            .theme-selector > span {
                display: none;
            }

            .color-picker-panel {
                top: 62px;
                right: 10px;
            }

            .container {
                padding: 6px;
                border-radius: 17px;
            }

            .login-section {
                gap: 18px;
                padding: 34px 18px 24px;
                border-radius: 13px;
            }

            .login-form-card {
                order: 1;
            }

            .login-showcase {
                order: 2;
                padding-top: 10px;
            }

            .login-section .login-showcase h2 {
                font-size: 34px;
            }

            .login-section .login-showcase > p {
                font-size: 14px;
                line-height: 1.75;
            }

            .login-features {
                grid-template-columns: 1fr;
            }

            .login-feature {
                justify-content: center;
            }

            .login-form-card {
                padding: 25px 18px;
                border-radius: 16px;
            }

            .login-buttons {
                flex-direction: column;
            }

            .admin-login-corner {
                position: fixed;
                left: 10px;
                bottom: 10px;
                width: auto;
                margin: 0;
                min-height: 36px;
                padding: 6px 12px;
                font-size: 11px;
            }

            .section {
                min-height: 680px;
                padding: 13px;
                border-radius: 14px;
            }

            .section > h2 {
                gap: 6px;
            }

            .section-heading small {
                display: none;
            }

            .chat-left-panel {
                padding: 8px;
            }

            .messages {
                padding: 9px;
            }

            .message {
                padding: 10px;
            }

            .message .header {
                align-items: flex-start;
                gap: 8px;
            }

            .message .meta {
                gap: 5px;
                flex-wrap: wrap;
                justify-content: flex-end;
            }

            .message .actions {
                position: static;
                display: flex;
                flex-wrap: wrap;
                margin-top: 8px;
            }

            .input-section {
                padding: 6px;
            }

            .input-section .btn {
                padding: 8px 12px;
            }

            .file-item {
                align-items: flex-start;
                flex-wrap: wrap;
                gap: 10px;
            }

            .file-info {
                min-width: calc(100% - 42px);
            }

            .file-meta {
                flex-wrap: wrap;
                gap: 4px 10px;
            }

            .modal {
                align-items: flex-end;
            }

            .modal-content {
                width: 100%;
                max-width: none !important;
                max-height: 92vh;
                overflow-y: auto;
                padding: 24px 18px;
                border-radius: 20px 20px 0 0;
            }

            .modal-buttons {
                flex-direction: column;
            }

            .toast {
                left: 12px;
                right: 12px;
                bottom: 12px;
                text-align: center;
            }
        }

        @media (prefers-reduced-motion: reduce) {
            *,
            *::before,
            *::after {
                scroll-behavior: auto !important;
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
            }
        }

        /* ===== Chat & Admin Workspace Refinement ===== */
        .chat-side-heading {
            display: flex;
            align-items: flex-end;
            justify-content: space-between;
            gap: 8px;
            padding: 2px 4px 10px;
            border-bottom: 1px solid var(--border);
        }

        .chat-side-heading span {
            color: var(--text-primary);
            font-size: 12px;
            font-weight: 750;
        }

        .chat-side-heading small {
            color: var(--text-tertiary);
            font-size: 9px;
        }

        .chat-nav-list {
            display: flex;
            flex-direction: column;
            gap: 5px;
            padding: 9px 0 2px;
        }

        .chat-nav-item {
            width: 100%;
            min-height: 39px;
            display: grid;
            grid-template-columns: 27px minmax(0, 1fr) auto;
            align-items: center;
            gap: 7px;
            padding: 6px 8px;
            border: 1px solid transparent;
            border-radius: 10px;
            background: transparent;
            color: var(--text-secondary);
            cursor: pointer;
            text-align: left;
            transition: var(--transition);
        }

        .chat-nav-item:hover {
            color: var(--text-primary);
            background: color-mix(in srgb, var(--primary-color) 5%, var(--surface-solid));
        }

        .chat-nav-item.active {
            color: var(--primary-color);
            border-color: color-mix(in srgb, var(--primary-color) 14%, transparent);
            background: color-mix(in srgb, var(--primary-color) 9%, var(--surface-solid));
            box-shadow: 0 5px 14px color-mix(in srgb, var(--primary-color) 9%, transparent);
        }

        .chat-nav-icon {
            width: 27px;
            height: 27px;
            display: grid;
            place-items: center;
            border-radius: 8px;
            background: color-mix(in srgb, var(--text-tertiary) 8%, var(--surface-solid));
            color: inherit;
            font-size: 13px;
            font-weight: 750;
        }

        .chat-nav-item.active .chat-nav-icon {
            background: var(--primary-color);
            color: #fff;
        }

        .chat-nav-label {
            overflow: hidden;
            font-size: 11px;
            font-weight: 650;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .chat-nav-badge {
            min-width: 20px;
            padding: 2px 6px;
            border-radius: 8px;
            background: color-mix(in srgb, var(--primary-color) 9%, var(--surface-solid));
            color: var(--primary-color);
            font-size: 9px;
            font-weight: 750;
            text-align: center;
        }

        .chat-tab-selector {
            display: none;
        }

        .chat-left-panel .chat-tab-panel {
            margin: 8px 0 0;
            padding-top: 8px;
            border-top: 1px solid var(--border);
        }

        .chat-left-panel .online-users,
        .chat-left-panel .channel-section {
            max-height: none;
            padding: 0;
        }

        .chat-left-panel .online-user-item {
            display: flex;
            margin: 0 0 5px;
            border-radius: 9px;
        }

        .chat-right-panel .search-box {
            padding: 5px;
            border: 1px solid var(--border);
            border-radius: 12px;
            background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
        }

        .chat-right-panel .search-box input {
            border: 0;
            background: transparent;
            box-shadow: none;
        }

        .messages .message {
            max-width: 88%;
        }

        .messages .message.own {
            margin-left: auto;
            border-left: 1px solid color-mix(in srgb, var(--primary-color) 10%, transparent);
            border-right: 3px solid var(--primary-color);
        }

        .messages .message.system {
            max-width: 100%;
            margin-left: auto;
            margin-right: auto;
        }

        .input-section {
            box-shadow: 0 8px 24px rgba(30, 41, 59, 0.06);
        }

        /* Admin console */
        .admin-panel-outside {
            padding: 0 18px 40px;
        }

        .admin-panel-inner {
            padding: 24px;
            border-radius: 24px;
            box-shadow: 0 24px 70px rgba(30, 41, 59, 0.12);
        }

        .admin-console-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 18px;
            margin-bottom: 20px;
        }

        .admin-console-title {
            display: flex;
            align-items: center;
            gap: 13px;
            min-width: 0;
        }

        .admin-console-icon {
            width: 48px;
            height: 48px;
            display: grid;
            place-items: center;
            flex: 0 0 auto;
            border-radius: 14px;
            background: linear-gradient(145deg, #111827, #334155);
            color: #fff;
            font-size: 21px;
            box-shadow: 0 10px 22px rgba(15, 23, 42, 0.2);
        }

        .admin-console-title > span:last-child {
            display: flex;
            flex-direction: column;
            gap: 2px;
            min-width: 0;
        }

        .admin-console-title small {
            color: var(--primary-color);
            font-size: 9px;
            font-style: normal;
            font-weight: 800;
            letter-spacing: 0.14em;
        }

        .admin-console-title strong {
            color: var(--text-primary);
            font-size: 20px;
            letter-spacing: -0.025em;
        }

        .admin-console-title em {
            overflow: hidden;
            color: var(--text-tertiary);
            font-size: 11px;
            font-style: normal;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .admin-users-entry {
            flex: 0 0 auto;
        }

        .admin-panel-inner .stats-panel {
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 9px;
            margin-bottom: 18px;
        }

        .admin-panel-inner .stat-card {
            display: grid;
            grid-template-columns: 38px minmax(0, 1fr);
            grid-template-rows: auto auto;
            column-gap: 10px;
            align-items: center;
            min-height: 66px;
            padding: 10px 12px;
            text-align: left;
            border: 1px solid var(--border-strong);
        }

        .admin-panel-inner .stat-icon {
            width: 38px;
            height: 38px;
            display: grid;
            grid-row: 1 / 3;
            place-items: center;
            margin: 0;
            border-radius: 11px;
            background: color-mix(in srgb, var(--primary-color) 8%, var(--surface-solid));
            font-size: 18px;
        }

        .admin-panel-inner .stat-value {
            align-self: end;
            font-size: 18px;
            line-height: 1;
        }

        .admin-panel-inner .stat-label {
            align-self: start;
            margin: 3px 0 0;
            font-size: 10px;
        }

        .admin-workspace {
            display: grid;
            grid-template-columns: 210px minmax(0, 1fr);
            gap: 14px;
            align-items: start;
        }

        .admin-sidebar {
            position: sticky;
            top: 18px;
            padding: 11px;
            border: 1px solid var(--border-strong);
            border-radius: 16px;
            background: color-mix(in srgb, var(--primary-color) 3%, var(--surface-solid));
        }

        .admin-sidebar-label {
            padding: 4px 7px 10px;
            color: var(--text-tertiary);
            font-size: 9px;
            font-weight: 800;
            letter-spacing: 0.11em;
            text-transform: uppercase;
        }

        .admin-nav-item {
            width: 100%;
            display: grid;
            grid-template-columns: 31px minmax(0, 1fr);
            align-items: center;
            gap: 9px;
            padding: 9px 8px;
            border: 1px solid transparent;
            border-radius: 11px;
            background: transparent;
            color: var(--text-secondary);
            cursor: pointer;
            text-align: left;
            transition: var(--transition);
        }

        .admin-nav-item + .admin-nav-item {
            margin-top: 3px;
        }

        .admin-nav-item > span:first-child {
            width: 31px;
            height: 31px;
            display: grid;
            place-items: center;
            border-radius: 9px;
            background: color-mix(in srgb, var(--text-tertiary) 8%, var(--surface-solid));
            font-size: 13px;
        }

        .admin-nav-item > span:last-child {
            display: flex;
            flex-direction: column;
            gap: 2px;
            min-width: 0;
        }

        .admin-nav-item strong {
            color: inherit;
            font-size: 11px;
        }

        .admin-nav-item small {
            overflow: hidden;
            color: var(--text-tertiary);
            font-size: 8px;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .admin-nav-item:hover {
            color: var(--text-primary);
            background: var(--surface-hover);
        }

        .admin-nav-item.active {
            color: var(--primary-color);
            border-color: color-mix(in srgb, var(--primary-color) 14%, transparent);
            background: color-mix(in srgb, var(--primary-color) 9%, var(--surface-solid));
        }

        .admin-nav-item.active > span:first-child {
            background: var(--primary-color);
            color: #fff;
            box-shadow: 0 6px 14px color-mix(in srgb, var(--primary-color) 22%, transparent);
        }

        .admin-content-area {
            min-width: 0;
            min-height: 420px;
            padding: 18px;
            border: 1px solid var(--border-strong);
            border-radius: 16px;
            background: color-mix(in srgb, var(--surface-solid) 72%, transparent);
        }

        .admin-content-area .admin-tab-selector {
            display: none;
        }

        .admin-content-area .admin-tab-panel {
            margin: 0;
        }

        .admin-panel-intro {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            margin-bottom: 15px;
            padding-bottom: 14px;
            border-bottom: 1px solid var(--border);
        }

        .admin-panel-intro > span:first-child,
        .admin-card-heading > span:first-child,
        .admin-danger-zone > div:first-child {
            display: flex;
            flex-direction: column;
            gap: 3px;
        }

        .admin-panel-intro strong {
            color: var(--text-primary);
            font-size: 17px;
            letter-spacing: -0.02em;
        }

        .admin-panel-intro small,
        .admin-card-heading small,
        .admin-danger-zone small {
            color: var(--text-tertiary);
            font-size: 10px;
            font-weight: 500;
        }

        .admin-status-chip {
            padding: 4px 9px;
            border: 1px solid rgba(16, 185, 129, 0.16);
            border-radius: 8px;
            background: rgba(16, 185, 129, 0.08);
            color: #059669;
            font-size: 9px;
            font-weight: 750;
        }

        .admin-settings-grid {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 9px;
            margin-bottom: 10px;
        }

        .admin-toggle-card {
            display: grid;
            grid-template-columns: 35px minmax(0, 1fr) auto;
            align-items: center;
            gap: 9px;
            min-height: 78px;
            padding: 12px;
            border: 1px solid var(--border-strong);
            border-radius: 13px;
            background: color-mix(in srgb, var(--surface-solid) 87%, transparent);
            cursor: pointer;
            transition: var(--transition);
        }

        .admin-toggle-card:hover {
            border-color: var(--border-strong);
            transform: translateY(-1px);
            box-shadow: var(--shadow-sm);
        }

        .admin-setting-icon {
            width: 35px;
            height: 35px;
            display: grid;
            place-items: center;
            border-radius: 10px;
            font-size: 13px;
            font-weight: 800;
        }

        .admin-setting-icon.danger {
            background: rgba(244, 63, 94, 0.09);
            color: #e11d48;
        }

        .admin-setting-icon.success {
            background: rgba(16, 185, 129, 0.09);
            color: #059669;
        }

        .admin-setting-icon.warning {
            background: rgba(245, 158, 11, 0.1);
            color: #d97706;
        }

        .admin-setting-copy {
            display: flex;
            flex-direction: column;
            gap: 3px;
            min-width: 0;
        }

        .admin-setting-copy strong {
            color: var(--text-primary);
            font-size: 11px;
        }

        .admin-setting-copy small {
            color: var(--text-tertiary);
            font-size: 9px;
            line-height: 1.45;
        }

        .admin-switch {
            appearance: none;
            -webkit-appearance: none;
            width: 42px !important;
            height: 24px !important;
            flex: 0 0 auto;
            padding: 0 !important;
            border: 1px solid rgba(148, 163, 184, 0.28);
            border-radius: 12px;
            background-color: #cbd5e1;
            background-image: radial-gradient(circle, #fff 0 8px, transparent 8.5px);
            background-position: 2px center;
            background-repeat: no-repeat;
            background-size: 20px 20px;
            cursor: pointer;
            transition: var(--transition);
        }

        .admin-switch:checked {
            border-color: var(--primary-color);
            background-color: var(--primary-color);
            background-position: 20px center;
        }

        .admin-config-grid,
        .admin-management-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px;
        }

        .admin-operation-card {
            min-width: 0;
            padding: 14px;
            border: 1px solid var(--border-strong);
            border-radius: 13px;
            background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
        }

        .admin-card-heading {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 12px;
        }

        .admin-card-heading strong,
        .admin-danger-zone strong {
            color: var(--text-primary);
            font-size: 12px;
        }

        .admin-card-unit {
            padding: 3px 7px;
            border-radius: 7px;
            background: color-mix(in srgb, var(--primary-color) 8%, var(--surface-solid));
            color: var(--primary-color);
            font-size: 9px;
            font-weight: 750;
        }

        .admin-inline-form {
            display: flex;
            align-items: center;
            gap: 7px;
        }

        .admin-inline-form .admin-input {
            min-width: 0;
            flex: 1;
            border-width: 1px;
        }

        .admin-current-value {
            display: block;
            min-height: 16px;
            margin-top: 7px;
            color: var(--text-tertiary) !important;
            font-size: 9px !important;
        }

        .admin-danger-zone {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 18px;
            margin-top: 10px;
            padding: 13px 14px;
            border: 1px solid rgba(244, 63, 94, 0.16);
            border-radius: 13px;
            background: rgba(244, 63, 94, 0.045);
        }

        .admin-danger-actions {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
            justify-content: flex-end;
        }

        .admin-danger-actions .btn-danger {
            min-height: 33px;
            padding: 6px 10px;
            background: rgba(244, 63, 94, 0.08);
            color: #e11d48;
            border: 1px solid rgba(244, 63, 94, 0.18);
            box-shadow: none;
        }

        .admin-danger-actions .btn-danger:hover {
            background: #e11d48;
            color: #fff;
        }

        .admin-operation-card .permission-list {
            max-height: 230px;
            margin-top: 10px;
            padding: 6px;
            background: color-mix(in srgb, var(--primary-color) 2%, var(--surface-solid));
        }

        .admin-operation-card .empty-state {
            padding: 24px 12px;
        }

        .admin-vote-builder {
            max-width: 720px;
        }

        .admin-vote-builder .vote-create-form {
            margin: 0;
        }

        .admin-list-heading {
            margin: 18px 0 9px;
            color: var(--text-secondary);
            font-size: 10px;
            font-weight: 750;
            letter-spacing: 0.06em;
            text-transform: uppercase;
        }

        .admin-vote-list {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 9px;
        }

        @media (max-width: 1080px) {
            .admin-panel-inner .stats-panel {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

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

        @media (max-width: 900px) {
            .admin-workspace {
                grid-template-columns: 1fr;
            }

            .admin-sidebar {
                display: none;
            }

            .admin-content-area .admin-tab-selector {
                display: flex;
                justify-content: space-between;
                margin: 0 0 14px;
                padding-bottom: 12px;
                border-bottom: 1px solid var(--border);
            }

            .admin-content-area .admin-tab-selector select {
                flex: 0 1 260px;
            }

            .admin-danger-zone {
                align-items: flex-start;
                flex-direction: column;
            }

            .admin-danger-actions {
                justify-content: flex-start;
            }
        }

        @media (max-width: 840px) {
            .chat-side-heading {
                display: none;
            }

            .chat-nav-list {
                display: grid;
                grid-template-columns: repeat(3, minmax(0, 1fr));
                padding: 0;
            }

            .chat-nav-item {
                grid-template-columns: 24px minmax(0, 1fr) auto;
                padding: 5px 7px;
            }

            .chat-nav-icon {
                width: 24px;
                height: 24px;
            }

            .chat-left-panel .chat-tab-panel {
                max-height: 150px;
                overflow-y: auto;
            }
        }

        @media (max-width: 680px) {
            .messages .message {
                max-width: 96%;
            }

            .admin-panel-outside {
                padding: 0 8px 24px;
            }

            .admin-panel-inner {
                padding: 14px;
                border-radius: 17px;
            }

            .admin-console-header {
                align-items: flex-start;
                flex-direction: column;
            }

            .admin-users-entry {
                width: 100%;
            }

            .admin-panel-inner .stats-panel {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            .admin-config-grid,
            .admin-management-grid,
            .admin-vote-list {
                grid-template-columns: 1fr;
            }

            .admin-content-area {
                padding: 12px;
            }

            .admin-inline-form {
                align-items: stretch;
                flex-direction: column;
            }

            .admin-inline-form .btn {
                width: 100%;
            }

            .admin-danger-actions {
                width: 100%;
                flex-direction: column;
            }

            .admin-danger-actions .btn {
                width: 100%;
            }
        }

        @media (max-width: 440px) {
            .chat-nav-list {
                grid-template-columns: repeat(3, minmax(0, 1fr));
            }

            .chat-nav-item {
                grid-template-columns: minmax(0, 1fr) auto;
                padding: 7px 8px;
            }

            .chat-nav-icon {
                display: none;
            }

            .chat-nav-label {
                font-size: 11px;
                text-align: center;
            }

            .messages .message {
                max-width: 100%;
            }

            .admin-panel-inner .stat-card {
                grid-template-columns: 34px minmax(0, 1fr);
            }

            .admin-panel-inner .stat-icon {
                width: 34px;
                height: 34px;
            }
        }

        @media (max-width: 560px) {
            .image-modal {
                padding: 8px;
            }

            .file-preview-dialog {
                width: 100%;
                height: 100%;
                border-radius: 16px;
            }

            .file-preview-toolbar {
                min-height: 64px;
                padding: 10px;
            }

            .file-preview-type-icon {
                width: 38px;
                height: 38px;
                border-radius: 10px;
                font-size: 18px;
            }

            .file-preview-title small {
                display: none;
            }

            .preview-download-btn {
                width: 38px;
                padding: 0;
                overflow: hidden;
                font-size: 0;
            }

            .preview-download-btn::before {
                content: '↓';
                font-size: 18px;
            }

            .file-preview-stage {
                padding: 10px;
            }

            .preview-text-card pre {
                padding: 16px;
                font-size: 12px;
            }

            .preview-audio-card {
                width: 100%;
                padding: 24px 18px;
            }
        }

        /* ===== Focused workspace shell ===== */
        [hidden] {
            display: none !important;
        }

        body.chat-active {
            min-height: 100vh;
            min-height: 100dvh;
            padding: 16px 18px 28px;
            align-items: flex-start;
        }

        body.chat-active .container {
            display: block;
            width: min(1440px, 100%);
            max-width: 1440px;
            margin: 0 auto;
            padding: 0;
            border: 0;
            border-radius: 0;
            background: transparent;
            box-shadow: none;
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
        }

        .workspace-header {
            position: sticky;
            top: 12px;
            z-index: 90;
            display: grid;
            grid-template-columns: minmax(220px, 0.8fr) auto minmax(280px, 0.8fr);
            align-items: center;
            gap: 18px;
            min-height: 68px;
            padding: 9px 11px 9px 14px;
            margin-bottom: 12px;
            border: 1px solid var(--border-strong);
            border-radius: 18px;
            background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
            box-shadow: 0 16px 42px rgba(30, 41, 59, 0.11);
            backdrop-filter: blur(22px);
            -webkit-backdrop-filter: blur(22px);
        }

        .theme-dark .workspace-header {
            border-color: var(--border-strong);
        }

        .workspace-brand,
        .workspace-actions,
        .workspace-nav,
        .workspace-user {
            display: flex;
            align-items: center;
        }

        .workspace-brand {
            min-width: 0;
            gap: 10px;
        }

        .workspace-brand-mark {
            width: 42px;
            height: 42px;
            display: grid;
            place-items: center;
            flex: 0 0 auto;
            border-radius: 12px;
            background: linear-gradient(145deg, var(--primary-color), var(--accent));
            color: #fff;
            font-size: 13px;
            font-weight: 850;
            letter-spacing: -0.05em;
            box-shadow: 0 8px 20px color-mix(in srgb, var(--primary-color) 24%, transparent);
        }

        .workspace-brand-copy {
            display: flex;
            min-width: 0;
            flex-direction: column;
            gap: 3px;
        }

        .workspace-brand-copy > strong {
            overflow: hidden;
            color: var(--text-primary);
            font-size: 13px;
            letter-spacing: -0.01em;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .connection-status {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            color: var(--text-tertiary);
            font-size: 10px;
        }

        .connection-status i {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: #f59e0b;
            box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
        }

        .connection-status[data-state="online"] i {
            background: #10b981;
            box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
        }

        .connection-status[data-state="offline"] i {
            background: #ef4444;
            box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
        }

        .workspace-nav {
            justify-self: center;
            gap: 5px;
            padding: 5px;
            border: 1px solid var(--border);
            border-radius: 13px;
            background: color-mix(in srgb, var(--primary-color) 3%, var(--surface-solid));
        }

        .workspace-nav-item {
            min-width: 92px;
            min-height: 42px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 7px;
            padding: 7px 14px;
            border: 0;
            border-radius: 9px;
            background: transparent;
            color: var(--text-secondary);
            cursor: pointer;
            transition: var(--transition);
        }

        .workspace-nav-item:hover {
            color: var(--text-primary);
            background: var(--surface-hover);
        }

        .workspace-nav-item.active {
            background: var(--surface-solid);
            color: var(--primary-color);
            box-shadow: 0 5px 14px rgba(30, 41, 59, 0.09);
        }

        .workspace-nav-item > span {
            font-size: 15px;
        }

        .workspace-nav-item strong {
            font-size: 12px;
        }

        .workspace-actions {
            min-width: 0;
            justify-content: flex-end;
            gap: 8px;
        }

        .workspace-theme-slot .theme-selector {
            position: static;
            display: flex;
            padding: 4px;
            border: 1px solid var(--border);
            background: color-mix(in srgb, var(--surface-solid) 76%, transparent);
            box-shadow: none;
        }

        .workspace-theme-slot .theme-selector > span {
            display: none;
        }

        .workspace-theme-slot .theme-selector select {
            min-width: 104px;
            min-height: 36px;
            padding-top: 5px;
            padding-bottom: 5px;
        }

        .workspace-header .user-info {
            min-width: 0;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 5px 9px 5px 5px;
            margin: 0;
            border: 1px solid var(--border);
            border-radius: 11px;
            background: color-mix(in srgb, var(--surface-solid) 72%, transparent);
        }

        .workspace-header .user-avatar {
            width: 32px;
            height: 32px;
            font-size: 12px;
        }

        .workspace-header .user-name {
            max-width: 110px;
            overflow: hidden;
            font-size: 11px;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .workspace-logout {
            min-height: 40px;
            padding: 7px 12px;
            border: 1px solid rgba(239, 68, 68, 0.14);
            border-radius: 10px;
            background: rgba(239, 68, 68, 0.06);
            color: #dc2626;
            cursor: pointer;
            font-size: 11px;
            font-weight: 700;
        }

        .workspace-logout:hover {
            background: #dc2626;
            color: #fff;
        }

        body.chat-active .workspace-panel {
            display: none !important;
        }

        body.chat-active #chatSection.workspace-panel:not(.is-active),
        body.chat-active #fileSection.workspace-panel:not(.is-active),
        body.chat-active #adminPanel.workspace-panel:not(.is-active) {
            display: none !important;
        }

        body.chat-active .workspace-panel.is-active {
            display: flex !important;
        }

        body.chat-active #chatSection.workspace-panel.is-active {
            display: grid !important;
        }

        body.chat-active #adminPanel.workspace-panel.is-active {
            display: block !important;
        }

        body.chat-active .section {
            height: calc(100vh - 124px);
            height: calc(100dvh - 124px);
            min-height: 620px;
            padding: 18px;
            border-color: var(--border-strong);
            box-shadow: var(--shadow-md), inset 0 1px 0 color-mix(in srgb, var(--surface-solid) 72%, transparent);
        }

        body.chat-active #chatSection {
            grid-template-columns: clamp(300px, 24vw, 340px) minmax(0, 1fr);
            grid-template-rows: auto minmax(0, 1fr);
            grid-template-areas:
                "header header"
                "left right";
            gap: 0 14px;
        }

        #chatSection > h2 {
            grid-area: header;
        }

        .chat-left-panel {
            overflow: hidden;
        }

        .chat-left-panel .chat-tab-panel {
            min-height: 0;
            overflow-y: auto;
            scrollbar-width: thin;
        }

        .chat-right-panel {
            position: relative;
            overflow: hidden;
        }

        .chat-toolbar {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 9px;
        }

        .chat-toolbar .search-box {
            min-width: 220px;
            flex: 1;
            margin: 0;
        }

        .btn-compact {
            min-height: 34px;
            padding: 6px 11px !important;
            font-size: 11px !important;
            box-shadow: none;
        }

        .private-mode-toggle {
            flex: 0 1 auto;
            margin: 0;
            padding: 5px 8px;
            border: 1px solid var(--border);
            border-radius: 11px;
            background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
        }

        .private-mode-toggle label {
            white-space: nowrap;
        }

        .private-mode-toggle select {
            max-width: 150px;
            min-height: 32px;
        }

        .messages {
            min-height: 0;
            overscroll-behavior: contain;
            scroll-behavior: smooth;
        }

        .jump-to-latest {
            position: absolute;
            z-index: 8;
            left: 50%;
            bottom: 104px;
            display: inline-flex;
            align-items: center;
            gap: 7px;
            min-height: 36px;
            padding: 7px 13px;
            border: 1px solid color-mix(in srgb, var(--primary-color) 18%, transparent);
            border-radius: 18px;
            background: var(--surface-solid);
            color: var(--primary-color);
            box-shadow: 0 10px 28px rgba(30, 41, 59, 0.15);
            cursor: pointer;
            font-size: 11px;
            font-weight: 700;
            transform: translateX(-50%);
        }

        .jump-to-latest > span:first-child {
            font-size: 15px;
        }

        .reply-preview {
            position: relative;
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 8px 40px 8px 11px;
            margin-bottom: 7px;
            border-left: 3px solid var(--primary-color);
            border-radius: 9px;
            background: color-mix(in srgb, var(--primary-color) 6%, var(--surface-solid));
            color: var(--text-secondary);
            font-size: 11px;
        }

        .reply-preview #replyText {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .reply-preview button {
            position: absolute;
            top: 50%;
            right: 8px;
            width: 28px;
            height: 28px;
            border: 0;
            border-radius: 8px;
            background: transparent;
            color: var(--text-tertiary);
            cursor: pointer;
            transform: translateY(-50%);
        }

        .input-section {
            flex: 0 0 auto;
        }

        .send-message-btn b {
            display: none;
        }

        .chat-export-dropdown {
            flex: 0 0 auto;
            margin-top: 5px;
        }

        .chat-export-dropdown > .btn {
            min-height: 28px;
            padding: 3px 5px !important;
            color: var(--text-tertiary);
        }

        .message-actions-toggle {
            display: none;
        }

        .message:focus-within .actions {
            display: flex;
        }

        /* Files workspace */
        .file-section {
            flex-direction: column;
            margin-top: 0 !important;
        }

        .section-count {
            margin-left: auto;
            padding: 5px 9px;
            border: 1px solid var(--border);
            border-radius: 9px;
            background: color-mix(in srgb, var(--surface-solid) 72%, transparent);
            color: var(--text-tertiary);
            font-size: 10px;
            font-weight: 700;
        }

        .file-toolbar {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(250px, 0.42fr);
            align-items: stretch;
            gap: 12px;
            margin-bottom: 12px;
        }

        .file-browser-tools {
            display: flex;
            min-width: 0;
            flex-direction: column;
            gap: 8px;
        }

        .file-search-box {
            min-height: 46px;
            margin: 0;
            padding: 6px;
            border: 1px solid var(--border);
            border-radius: 12px;
            background: color-mix(in srgb, var(--surface-solid) 76%, transparent);
        }

        .file-filter-row {
            display: flex;
            align-items: center;
            gap: 7px;
            min-width: 0;
        }

        .file-select-control {
            display: flex;
            min-width: 0;
            flex: 1 1 150px;
            align-items: center;
            gap: 7px;
            min-height: 40px;
            padding: 4px 5px 4px 10px;
            border: 1px solid var(--border);
            border-radius: 11px;
            background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
            color: var(--text-tertiary);
            font-size: 10px;
            font-weight: 700;
        }

        .file-select-control select {
            min-width: 0;
            min-height: 30px;
            flex: 1;
            padding: 3px 24px 3px 7px;
            border: 0;
            background-color: transparent;
            color: var(--text-primary);
            box-shadow: none;
            font-size: 11px;
            font-weight: 650;
        }

        .file-tool-button {
            display: inline-flex;
            min-width: 64px;
            min-height: 40px;
            align-items: center;
            justify-content: center;
            gap: 5px;
            padding: 6px 9px;
            border: 1px solid var(--border);
            border-radius: 11px;
            background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 14px;
            transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
        }

        .file-tool-button b {
            font-size: 10px;
            font-weight: 700;
        }

        .file-tool-button:hover,
        .file-tool-button.active,
        .file-tool-button[aria-pressed="true"] {
            border-color: color-mix(in srgb, var(--primary-color) 28%, transparent);
            background: color-mix(in srgb, var(--primary-color) 10%, var(--surface-solid));
            color: var(--primary-color);
        }

        .file-view-switch {
            display: inline-flex;
            flex: 0 0 auto;
            gap: 4px;
            padding: 3px;
            border: 1px solid var(--border);
            border-radius: 12px;
            background: color-mix(in srgb, var(--text-secondary) 4%, var(--surface-solid));
        }

        .file-view-switch .file-tool-button {
            min-width: 60px;
            min-height: 32px;
            padding-block: 4px;
            border-color: transparent;
            border-radius: 8px;
            background: transparent;
        }

        .file-view-switch .file-tool-button.active {
            background: var(--surface-solid);
            box-shadow: 0 3px 10px color-mix(in srgb, var(--text-primary) 8%, transparent);
        }

        .upload-container,
        .upload-area {
            min-width: 0;
            height: 100%;
        }

        .upload-area {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 11px;
            min-height: 94px;
            padding: 9px 14px;
            margin: 0;
            border-width: 1px;
            border-radius: 13px;
            text-align: left;
        }

        .upload-area .upload-icon {
            width: 38px;
            height: 38px;
            flex: 0 0 auto;
            margin: 0;
            border-radius: 10px;
            font-size: 19px;
        }

        .upload-area.disabled {
            cursor: not-allowed;
            filter: grayscale(0.45);
            opacity: 0.72;
        }

        .upload-area.is-busy .upload-icon {
            animation: uploadPulse 1s ease-in-out infinite alternate;
        }

        @keyframes uploadPulse {
            to { transform: translateY(-3px); }
        }

        .file-list {
            min-height: 0;
            flex: 1;
            overflow-y: auto;
            scrollbar-width: thin;
        }

        .file-item {
            display: grid;
            grid-template-columns: 44px minmax(0, 1fr) auto;
            align-items: center;
            gap: 12px;
            min-height: 68px;
            padding: 10px 12px;
        }

        .file-icon {
            width: 42px;
            height: 42px;
            display: grid;
            place-items: center;
            border-radius: 11px;
            background: color-mix(in srgb, var(--primary-color) 7%, var(--surface-solid));
            font-size: 20px;
        }

        .file-name,
        .file-name-text {
            min-width: 0;
        }

        .file-name-text {
            display: block;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .file-actions {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .file-action-btn {
            min-height: 34px;
            padding: 6px 10px;
            border: 1px solid var(--border-strong);
            border-radius: 9px;
            background: color-mix(in srgb, var(--text-secondary) 5%, var(--surface-solid));
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 10px;
            font-weight: 700;
        }

        .file-action-btn:hover,
        .file-action-btn.primary {
            border-color: color-mix(in srgb, var(--primary-color) 20%, transparent);
            background: color-mix(in srgb, var(--primary-color) 9%, var(--surface-solid));
            color: var(--primary-color);
        }

        .file-action-btn.share {
            color: #7c3aed;
        }

        .file-action-btn.danger {
            color: #dc2626;
        }

        .error-state .empty-state-icon {
            color: #dc2626;
        }

        .file-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
            grid-auto-rows: minmax(min-content, 1fr);
            align-content: start;
            gap: 12px;
            padding: 4px;
            overscroll-behavior: contain;
        }

        .file-list.file-view-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .file-list > .empty-state {
            grid-column: 1 / -1;
            min-height: 180px;
        }

        .file-item {
            min-width: 0;
            height: 100%;
            margin: 0;
            overflow: hidden;
            border: 1px solid var(--border-strong);
            border-radius: 15px;
            background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
            box-shadow: 0 6px 18px color-mix(in srgb, var(--text-primary) 5%, transparent);
            transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
        }

        .file-view-grid .file-item {
            grid-template-columns: minmax(0, 1fr);
            grid-template-rows: 132px minmax(66px, auto) auto;
            align-content: stretch;
            align-items: stretch;
            gap: 0;
            min-height: 0;
            padding: 0;
        }

        .file-item:not(.file-skeleton):hover {
            border-color: color-mix(in srgb, var(--primary-color) 24%, var(--border));
            box-shadow: 0 10px 24px color-mix(in srgb, var(--text-primary) 9%, transparent);
            transform: translateY(-2px);
        }

        .file-visual {
            position: relative;
            display: grid;
            width: 100%;
            min-width: 0;
            place-items: center;
            overflow: hidden;
            border: 0;
            background:
                radial-gradient(circle at 22% 18%, color-mix(in srgb, var(--primary-color) 14%, transparent), transparent 48%),
                color-mix(in srgb, var(--primary-color) 4%, var(--surface-solid));
            color: inherit;
        }

        button.file-visual {
            cursor: pointer;
        }

        .file-view-grid .file-visual {
            height: 132px;
        }

        .file-thumbnail {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.22s ease;
        }

        .file-preview-trigger:hover .file-thumbnail {
            transform: scale(1.035);
        }

        .file-thumbnail.is-hidden,
        .file-thumbnail-fallback.is-hidden {
            display: none;
        }

        .file-category-badge,
        .file-preview-note {
            position: absolute;
            z-index: 2;
            padding: 4px 7px;
            border: 1px solid color-mix(in srgb, var(--surface-solid) 55%, transparent);
            border-radius: 8px;
            background: color-mix(in srgb, var(--surface-solid) 86%, transparent);
            color: var(--text-secondary);
            box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
            backdrop-filter: blur(8px);
            font-size: 9px;
            font-weight: 750;
        }

        .file-category-badge {
            top: 8px;
            left: 8px;
        }

        .file-preview-note {
            right: 8px;
            bottom: 8px;
        }

        .file-icon {
            width: 54px;
            height: 54px;
            border-radius: 15px;
            background: color-mix(in srgb, var(--surface-solid) 72%, transparent);
            box-shadow: 0 5px 16px color-mix(in srgb, var(--text-primary) 7%, transparent);
            font-size: 25px;
        }

        .file-info {
            min-width: 0;
        }

        .file-view-grid .file-info {
            padding: 12px 13px 8px;
        }

        .file-name {
            color: var(--text-primary);
            font-size: 12px;
            font-weight: 750;
            line-height: 1.45;
        }

        .file-name-button {
            display: block;
            width: 100%;
            padding: 0;
            overflow: hidden;
            border: 0;
            background: transparent;
            color: inherit;
            cursor: pointer;
            text-align: left;
        }

        .file-name-button:hover {
            color: var(--primary-color);
        }

        .file-view-grid .file-name-text {
            display: -webkit-box;
            min-height: 34px;
            overflow: hidden;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            text-overflow: ellipsis;
            white-space: normal;
        }

        .file-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 4px 9px;
            margin-top: 5px;
            color: var(--text-tertiary);
            font-size: 9px;
        }

        .file-actions {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
            gap: 6px;
        }

        .file-view-grid .file-actions {
            align-self: end;
            padding: 8px 12px 12px;
            border-top: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
        }

        .file-view-list .file-item {
            grid-template-columns: 64px minmax(0, 1fr) auto;
            align-items: center;
            gap: 12px;
            min-height: 76px;
            height: auto;
            padding: 8px 10px;
        }

        .file-view-list .file-visual {
            width: 60px;
            height: 58px;
            border-radius: 11px;
        }

        .file-view-list .file-icon {
            width: 40px;
            height: 40px;
            border-radius: 10px;
            font-size: 19px;
        }

        .file-view-list .file-category-badge,
        .file-view-list .file-preview-note {
            display: none;
        }

        .file-view-list .file-actions {
            display: flex;
            align-items: center;
        }

        .file-action-btn:disabled {
            cursor: wait;
            opacity: 0.62;
        }

        .file-list.is-loading .file-item:not(.file-skeleton) {
            pointer-events: none;
            opacity: 0.58;
        }

        .file-skeleton {
            pointer-events: none;
        }

        .skeleton-block {
            display: block;
            border-radius: 9px;
            background: linear-gradient(90deg,
                color-mix(in srgb, var(--text-secondary) 7%, transparent) 25%,
                color-mix(in srgb, var(--text-secondary) 13%, transparent) 50%,
                color-mix(in srgb, var(--text-secondary) 7%, transparent) 75%);
            background-size: 200% 100%;
            animation: fileSkeletonPulse 1.2s linear infinite;
        }

        .file-view-grid .file-skeleton-visual {
            width: 100%;
            height: 132px;
            border-radius: 0;
        }

        .file-skeleton-title {
            width: 78%;
            height: 12px;
        }

        .file-skeleton-meta {
            width: 54%;
            height: 9px;
            margin-top: 9px;
        }

        .file-skeleton-actions {
            height: 30px;
            margin: 8px 12px 12px;
        }

        .file-view-list .file-skeleton-visual {
            width: 60px;
            height: 58px;
        }

        .file-view-list .file-skeleton-actions {
            width: 140px;
            margin: 0;
        }

        .pagination[hidden] {
            display: none !important;
        }

        @keyframes fileSkeletonPulse {
            to { background-position: -200% 0; }
        }

        /* Admin as a dedicated workspace */
        body.chat-active .admin-panel-outside {
            width: min(1440px, 100%);
            max-width: 1440px;
            min-height: calc(100vh - 124px);
            min-height: calc(100dvh - 124px);
            padding: 0;
            margin: 0 auto;
        }

        body.chat-active .admin-panel-inner {
            min-height: inherit;
        }

        .admin-panel-outside.is-busy .admin-content-area {
            pointer-events: none;
            opacity: 0.68;
        }

        .admin-panel-outside.is-busy .admin-panel-inner::after {
            content: '正在保存…';
            position: fixed;
            z-index: 120;
            right: 22px;
            bottom: 22px;
            padding: 9px 13px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--surface-solid);
            color: var(--text-secondary);
            box-shadow: var(--shadow-md);
            font-size: 11px;
            font-weight: 700;
        }

        body.workspace-admin .container {
            margin-bottom: 12px;
        }

        body.chat-active .toast {
            top: auto;
            right: 24px;
            bottom: 24px;
        }

        body.workspace-chat .toast {
            bottom: 130px;
        }

        @media (max-width: 1200px) {
            .workspace-header {
                grid-template-columns: minmax(180px, 0.7fr) auto minmax(240px, 0.7fr);
                gap: 10px;
            }

            .workspace-nav-item {
                min-width: 76px;
                padding-inline: 11px;
            }

            .workspace-theme-slot .theme-selector select {
                min-width: 88px;
                width: 88px;
            }

            body.chat-active .section {
                min-height: 600px;
            }
        }

        @media (max-width: 900px) {
            body.chat-active {
                padding: 10px 10px 22px;
            }

            .workspace-header {
                top: 8px;
                grid-template-columns: 1fr auto;
                grid-template-areas:
                    "brand actions"
                    "nav nav";
                gap: 8px 12px;
                padding: 9px;
            }

            .workspace-brand { grid-area: brand; }
            .workspace-actions { grid-area: actions; }
            .workspace-nav {
                grid-area: nav;
                width: 100%;
                justify-self: stretch;
            }

            .workspace-nav-item {
                flex: 1;
            }

            body.chat-active .section {
                height: calc(100vh - 152px);
                height: calc(100dvh - 152px);
            }

            body.chat-active #chatSection {
                grid-template-columns: 1fr;
                grid-template-rows: auto auto minmax(0, 1fr);
                grid-template-areas:
                    "header"
                    "left"
                    "right";
                gap: 0;
            }

            .chat-left-panel {
                max-height: 188px;
                margin-bottom: 10px;
            }

            .chat-nav-list {
                display: flex;
                flex-direction: row;
                gap: 5px;
                overflow-x: auto;
                scrollbar-width: thin;
            }

            .chat-nav-item {
                width: auto;
                min-width: 112px;
                flex: 0 0 112px;
            }

            .chat-left-panel .chat-tab-panel {
                max-height: 116px;
            }

            .file-toolbar {
                grid-template-columns: 1fr;
            }

            .upload-area {
                min-height: 66px;
            }

            body.chat-active .admin-panel-outside {
                min-height: calc(100vh - 152px);
                min-height: calc(100dvh - 152px);
            }

        }

        @media (max-width: 600px) {
            body.chat-active {
                padding: max(6px, env(safe-area-inset-top)) 6px max(12px, env(safe-area-inset-bottom));
            }

            .workspace-header {
                top: max(4px, env(safe-area-inset-top));
                gap: 7px;
                margin-bottom: 7px;
                border-radius: 14px;
            }

            .workspace-brand-mark {
                width: 36px;
                height: 36px;
                border-radius: 10px;
                font-size: 11px;
            }

            .workspace-brand-copy > strong {
                display: none;
            }

            .workspace-theme-slot .theme-selector {
                position: relative;
                padding: 2px;
            }

            .workspace-theme-slot .theme-selector > span {
                position: absolute;
                z-index: 1;
                inset: 0;
                display: grid;
                place-items: center;
                pointer-events: none;
                font-size: 0;
            }

            .workspace-theme-slot .theme-selector > span::before {
                content: '◐';
                color: var(--primary-color);
                font-size: 18px;
                font-weight: 800;
            }

            .workspace-theme-slot .theme-selector select {
                width: 42px;
                min-width: 42px;
                color: transparent;
                background-position: center;
            }

            .workspace-header .user-info {
                max-width: 86px;
                padding-right: 6px;
            }

            .workspace-header .user-name {
                max-width: 42px;
            }

            .workspace-logout {
                min-height: 38px;
                padding-inline: 9px;
            }

            .workspace-nav {
                padding: 3px;
            }

            .workspace-nav-item {
                min-width: 0;
                min-height: 39px;
                padding: 6px 9px;
            }

            body.chat-active .section {
                height: calc(100vh - 139px);
                height: calc(100dvh - 139px);
                min-height: 520px;
                padding: 10px;
                border-radius: 13px;
            }

            .section > h2 {
                min-height: 38px;
                margin-bottom: 8px;
            }

            .section-heading-icon {
                width: 34px;
                height: 34px;
            }

            .chat-left-panel {
                max-height: 164px;
                padding: 7px;
            }

            .chat-nav-list {
                flex-direction: row;
                padding-bottom: 2px;
                scrollbar-width: none;
            }

            .chat-nav-list::-webkit-scrollbar,
            .chat-left-panel .chat-tab-panel::-webkit-scrollbar {
                display: none;
            }

            .chat-nav-item {
                width: auto;
                min-width: 110px;
                flex-basis: 110px;
                grid-template-columns: 22px minmax(0, 1fr) auto;
                gap: 5px;
                padding-inline: 6px;
            }

            .chat-nav-icon {
                display: grid;
                width: 22px;
                height: 22px;
            }

            .chat-nav-label {
                text-align: left;
            }

            .chat-left-panel .chat-tab-panel {
                max-height: 96px;
                scrollbar-width: none;
            }

            .chat-toolbar {
                align-items: stretch;
                flex-direction: column;
                gap: 5px;
            }

            .chat-toolbar .search-box {
                min-width: 0;
            }

            .private-mode-toggle {
                justify-content: space-between;
            }

            .private-mode-toggle select {
                flex: 1;
                max-width: none;
            }

            .messages {
                padding: 8px;
            }

            .messages .message {
                min-width: min(180px, 68%);
                max-width: 92%;
            }

            .message-actions-toggle {
                position: absolute;
                top: 6px;
                right: 7px;
                display: grid;
                width: 30px;
                height: 30px;
                place-items: center;
                border: 0;
                border-radius: 8px;
                background: transparent;
                color: var(--text-tertiary);
                cursor: pointer;
                letter-spacing: 1px;
            }

            .message .header {
                padding-right: 26px;
            }

            .message .actions {
                position: static;
                display: none;
                margin-top: 8px;
                padding-top: 8px;
                border-top: 1px solid var(--border);
                opacity: 1;
            }

            .message.actions-open .actions {
                display: flex;
            }

            .message .action-btn {
                min-height: 32px;
                flex: 1 1 auto;
            }

            .jump-to-latest {
                bottom: 98px;
            }

            .send-message-btn {
                width: 42px;
                min-width: 42px;
                padding: 0 !important;
                border-radius: 12px;
            }

            .send-message-btn span {
                display: none;
            }

            .send-message-btn b {
                display: inline;
                font-size: 17px;
            }

            .file-toolbar {
                gap: 7px;
                margin-bottom: 8px;
            }

            .file-search-box {
                min-height: 46px;
            }

            .upload-area {
                min-height: 58px;
                justify-content: flex-start;
            }

            .file-filter-row {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            .file-select-control,
            .file-tool-button,
            .file-view-switch {
                width: 100%;
            }

            .file-tool-button {
                min-height: 44px;
            }

            .file-view-switch .file-tool-button {
                min-width: 0;
                min-height: 36px;
                flex: 1;
            }

            .file-list {
                grid-template-columns: minmax(0, 1fr);
                padding: 2px;
            }

            .file-view-grid .file-item {
                grid-template-columns: minmax(0, 1fr);
                grid-template-rows: 112px minmax(66px, auto) auto;
                gap: 0;
                padding: 0;
            }

            .file-view-grid .file-visual,
            .file-view-grid .file-skeleton-visual {
                height: 112px;
            }

            .file-view-grid .file-actions {
                grid-column: auto;
            }

            .file-view-list .file-item {
                grid-template-columns: 52px minmax(0, 1fr);
                gap: 8px;
                padding: 8px;
            }

            .file-view-list .file-visual,
            .file-view-list .file-skeleton-visual {
                width: 50px;
                height: 50px;
            }

            .file-view-list .file-actions {
                grid-column: 1 / -1;
                display: grid;
                grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
                width: 100%;
            }

            .file-view-list .file-icon {
                width: 34px;
                height: 34px;
                font-size: 16px;
            }

            .file-action-btn {
                min-height: 38px;
            }

            body.chat-active .admin-panel-outside {
                min-height: calc(100vh - 139px);
                min-height: calc(100dvh - 139px);
            }

            body.chat-active .admin-panel-inner {
                padding: 11px;
                border-radius: 14px;
            }

            body.chat-active .color-picker-panel {
                top: 118px;
                right: 8px;
            }

            body.chat-active .toast {
                top: auto;
                right: 12px;
                bottom: 16px;
                left: auto;
                width: auto;
                max-width: calc(100vw - 24px);
                padding: 10px 14px;
                border-radius: 12px;
            }

            body.workspace-chat .toast {
                bottom: 120px;
            }
        }

        /* 提醒中心、消息回应与通知偏好 */
        .notification-settings-btn {
            position: relative;
            width: 44px;
            height: 44px;
            display: grid;
            place-items: center;
            flex: 0 0 auto;
            border: 1px solid var(--border);
            border-radius: 12px;
            background: color-mix(in srgb, var(--surface-solid) 76%, transparent);
            color: var(--text-primary);
            cursor: pointer;
            transition: var(--transition);
        }

        .notification-settings-btn:hover,
        .notification-settings-btn:focus-visible {
            border-color: color-mix(in srgb, var(--primary-color) 42%, var(--border));
            background: color-mix(in srgb, var(--primary-color) 8%, var(--surface-solid));
        }

        .notification-settings-btn i {
            position: absolute;
            top: 7px;
            right: 7px;
            width: 7px;
            height: 7px;
            border: 2px solid var(--surface-solid);
            border-radius: 50%;
            background: #10b981;
        }

        .workspace-nav-badge {
            min-width: 18px;
            padding: 2px 5px;
            border-radius: 999px;
            background: #ef4444;
            color: #fff;
            font-size: 9px;
            font-style: normal;
            line-height: 1.35;
            text-align: center;
        }

        .channel-unread-badge {
            min-width: 20px;
            padding: 2px 6px;
            margin-left: auto;
            border-radius: 999px;
            background: var(--primary-color);
            color: #fff;
            font-size: 10px;
            font-weight: 800;
            text-align: center;
        }

        .channel-item:has(.channel-unread-badge) .channel-name {
            color: var(--text-primary);
            font-weight: 750;
        }

        .notification-center {
            display: grid;
            gap: 12px;
        }

        .notification-center-summary {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 8px;
        }

        .notification-center-summary > span {
            display: grid;
            gap: 2px;
            padding: 11px;
            border: 1px solid color-mix(in srgb, var(--primary-color) 14%, var(--border));
            border-radius: 12px;
            background: color-mix(in srgb, var(--primary-color) 6%, var(--surface-solid));
        }

        .notification-center-summary strong {
            color: var(--primary-color);
            font-size: 22px;
        }

        .notification-center-summary small,
        .notification-section-heading small {
            color: var(--text-tertiary);
            font-size: 10px;
        }

        .notification-center-actions {
            display: flex;
            gap: 7px;
        }

        .notification-center-actions button {
            min-height: 36px;
            flex: 1;
            border: 1px solid var(--border);
            border-radius: 9px;
            background: var(--surface-solid);
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 11px;
            font-weight: 650;
        }

        .notification-channel-list,
        .notification-mention-list {
            display: grid;
            gap: 6px;
        }

        .notification-channel-list button,
        .notification-mention-list button {
            width: 100%;
            display: grid;
            gap: 3px;
            padding: 9px 10px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--surface-solid);
            color: var(--text-primary);
            cursor: pointer;
            text-align: left;
        }

        .notification-channel-list button {
            grid-template-columns: minmax(0, 1fr) auto;
            align-items: center;
        }

        .notification-channel-list button span,
        .notification-mention-list button > span {
            display: flex;
            min-width: 0;
            justify-content: space-between;
            gap: 6px;
        }

        .notification-channel-list small,
        .notification-mention-list small,
        .notification-mention-list time {
            color: var(--text-tertiary);
            font-size: 10px;
        }

        .notification-channel-list b {
            color: var(--primary-color);
            font-size: 11px;
        }

        .notification-mention-list p {
            display: -webkit-box;
            overflow: hidden;
            margin: 0;
            color: var(--text-secondary);
            font-size: 11px;
            line-height: 1.45;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
        }

        .notification-section-heading {
            display: flex;
            align-items: end;
            justify-content: space-between;
            padding-top: 3px;
        }

        .notification-empty {
            padding: 16px 8px;
            color: var(--text-tertiary);
            font-size: 11px;
            text-align: center;
        }

        .message-reactions {
            position: relative;
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 5px;
            margin-top: 7px;
        }

        .message-reaction-chip,
        .message-reaction-add {
            min-width: 30px;
            min-height: 28px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            padding: 3px 7px;
            border: 1px solid var(--border);
            border-radius: 999px;
            background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
            color: var(--text-secondary);
            cursor: pointer;
        }

        .message-reaction-chip.selected {
            border-color: color-mix(in srgb, var(--primary-color) 48%, var(--border));
            background: color-mix(in srgb, var(--primary-color) 12%, var(--surface-solid));
            color: var(--primary-color);
        }

        .message-reaction-chip b {
            font-size: 10px;
        }

        .message-reaction-add {
            opacity: .62;
        }

        .message:hover .message-reaction-add,
        .message:focus-within .message-reaction-add {
            opacity: 1;
        }

        .message-reaction-picker {
            position: absolute;
            bottom: calc(100% + 6px);
            left: 0;
            z-index: 15;
            display: flex;
            gap: 3px;
            padding: 6px;
            border: 1px solid var(--border);
            border-radius: 12px;
            background: var(--surface-solid);
            box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
        }

        .message.own .message-reaction-picker {
            right: 0;
            left: auto;
        }

        .message-reaction-picker[hidden] {
            display: none;
        }

        .message-reaction-picker button {
            width: 36px;
            height: 36px;
            border: 0;
            border-radius: 8px;
            background: transparent;
            cursor: pointer;
            font-size: 18px;
        }

        .message-reaction-picker button:hover,
        .message-reaction-picker button:focus-visible {
            background: var(--surface-hover);
        }

        .notification-settings-card {
            width: min(520px, calc(100vw - 28px));
            display: grid;
            gap: 14px;
        }

        .notification-settings-card .modal-header > span {
            display: grid;
            gap: 2px;
        }

        .notification-settings-card .modal-header small {
            color: var(--primary-color);
            font-size: 10px;
            font-weight: 750;
            letter-spacing: .08em;
            text-transform: uppercase;
        }

        .notification-permission-card,
        .notification-setting-row,
        .notification-dnd-card {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 14px;
            padding: 13px 14px;
            border: 1px solid var(--border);
            border-radius: 13px;
            background: color-mix(in srgb, var(--surface-solid) 90%, transparent);
        }

        .notification-permission-card > span,
        .notification-setting-row > span,
        .notification-setting-toggle > span {
            display: grid;
            gap: 3px;
        }

        .notification-permission-card small,
        .notification-setting-row small,
        .notification-setting-toggle small {
            color: var(--text-tertiary);
            font-size: 11px;
        }

        .notification-setting-row select,
        .notification-dnd-times input {
            min-height: 40px;
            border: 1px solid var(--border);
            border-radius: 9px;
            background: var(--surface-solid);
            color: var(--text-primary);
        }

        .notification-setting-toggle input[type="checkbox"] {
            width: 22px;
            height: 22px;
            accent-color: var(--primary-color);
        }

        .notification-dnd-card {
            align-items: stretch;
            flex-direction: column;
        }

        .notification-dnd-card > label {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }

        .notification-dnd-times {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px;
        }

        .notification-dnd-times label {
            display: grid;
            gap: 5px;
            color: var(--text-secondary);
            font-size: 11px;
        }

        @media (max-width: 900px) {
            .workspace-actions .notification-settings-btn {
                width: 40px;
                height: 40px;
            }
        }

        @media (max-width: 600px) {
            .notification-settings-card {
                max-height: calc(100dvh - 24px);
                overflow-y: auto;
            }

            .notification-permission-card,
            .notification-setting-row {
                align-items: stretch;
                flex-direction: column;
            }

            .notification-setting-row select {
                width: 100%;
            }

            .notification-setting-toggle {
                align-items: center;
                flex-direction: row;
            }

            .message-reaction-picker {
                position: fixed;
                right: max(12px, env(safe-area-inset-right));
                bottom: max(72px, calc(env(safe-area-inset-bottom) + 58px));
                left: max(12px, env(safe-area-inset-left));
                justify-content: space-around;
            }

            .message.own .message-reaction-picker {
                right: max(12px, env(safe-area-inset-right));
                left: max(12px, env(safe-area-inset-left));
            }
        }

        /* 持久化私信工作区 */
        .private-section { display: none; }

        body.chat-active #privateSection.workspace-panel:not(.is-active) {
            display: none !important;
        }

        body.chat-active #privateSection.workspace-panel.is-active {
            display: flex !important;
            min-height: 0;
            flex-direction: column;
            overflow: hidden;
        }

        #privateSection > h2 {
            flex: 0 0 auto;
        }

        .private-shell {
            display: grid;
            min-width: 0;
            min-height: 0;
            flex: 1 1 auto;
            grid-template-columns: clamp(280px, 25vw, 340px) minmax(0, 1fr);
            overflow: hidden;
            border: 1px solid var(--border-strong);
            border-radius: 18px;
            background: color-mix(in srgb, var(--surface-solid) 94%, transparent);
            box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
        }

        .private-sidebar {
            display: flex;
            min-width: 0;
            min-height: 0;
            flex-direction: column;
            border-right: 1px solid var(--border-strong);
            background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
        }

        .private-sidebar-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 16px 16px 10px;
        }

        .private-sidebar-head > div {
            display: grid;
            min-width: 0;
            gap: 2px;
        }

        .private-sidebar-head strong {
            color: var(--text-primary);
            font-size: 15px;
        }

        .private-sidebar-head small,
        .private-recipient-search > span {
            color: var(--text-tertiary);
            font-size: 10px;
        }

        .private-new-toggle {
            display: grid;
            width: 40px;
            height: 40px;
            flex: 0 0 auto;
            place-items: center;
            border: 1px solid color-mix(in srgb, var(--primary-color) 25%, var(--border));
            border-radius: 12px;
            background: color-mix(in srgb, var(--primary-color) 8%, var(--surface-solid));
            color: var(--primary-color);
            cursor: pointer;
            font-size: 20px;
        }

        .private-recipient-search {
            display: grid;
            gap: 6px;
            padding: 4px 16px 12px;
        }

        .private-recipient-search label {
            color: var(--text-secondary);
            font-size: 10px;
            font-weight: 700;
        }

        .private-recipient-search > div {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 6px;
        }

        .private-recipient-search input {
            width: 100%;
            min-width: 0;
            min-height: 42px;
            padding: 0 11px;
            border: 1px solid var(--border);
            border-radius: 11px;
            background: var(--surface-solid);
            color: var(--text-primary);
            outline: none;
        }

        .private-recipient-search input:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 15%, transparent);
        }

        .private-recipient-search button,
        .private-load-conversations,
        .private-load-history {
            min-height: 42px;
            padding: 0 13px;
            border: 0;
            border-radius: 11px;
            background: var(--primary-color);
            color: #fff;
            cursor: pointer;
            font-size: 11px;
            font-weight: 750;
        }

        .private-recipient-search button:disabled,
        .private-load-history:disabled,
        .private-composer button:disabled {
            cursor: wait;
            opacity: 0.65;
        }

        .private-guest-warning {
            display: grid;
            gap: 3px;
            margin: 0 12px 10px;
            padding: 10px 11px;
            border: 1px solid rgba(245, 158, 11, 0.28);
            border-radius: 12px;
            background: rgba(245, 158, 11, 0.09);
            color: var(--text-secondary);
            font-size: 10px;
            line-height: 1.5;
        }

        .private-guest-warning strong {
            color: #d97706;
            font-size: 11px;
        }

        .private-conversation-list {
            min-height: 0;
            flex: 1 1 auto;
            overflow: auto;
            padding: 2px 8px 10px;
            scrollbar-width: thin;
        }

        .private-list-state {
            display: grid;
            min-height: 150px;
            place-content: center;
            justify-items: center;
            gap: 8px;
            padding: 20px;
            color: var(--text-tertiary);
            font-size: 11px;
            line-height: 1.6;
            text-align: center;
        }

        .private-list-state button {
            min-height: 38px;
            padding: 0 15px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--surface-solid);
            color: var(--primary-color);
            cursor: pointer;
        }

        .private-loading-dot {
            width: 20px;
            height: 20px;
            border: 2px solid color-mix(in srgb, var(--primary-color) 20%, transparent);
            border-top-color: var(--primary-color);
            border-radius: 50%;
            animation: private-spin 0.8s linear infinite;
        }

        @keyframes private-spin { to { transform: rotate(360deg); } }

        .private-conversation-item {
            position: relative;
            display: grid;
            width: 100%;
            min-width: 0;
            min-height: 68px;
            grid-template-columns: 42px minmax(0, 1fr) auto;
            align-items: center;
            gap: 10px;
            margin: 2px 0;
            padding: 9px;
            border: 1px solid transparent;
            border-radius: 13px;
            background: transparent;
            color: var(--text-primary);
            cursor: pointer;
            text-align: left;
        }

        .private-conversation-item:hover {
            background: var(--surface-hover);
        }

        .private-conversation-item.active {
            border-color: color-mix(in srgb, var(--primary-color) 18%, var(--border));
            background: color-mix(in srgb, var(--primary-color) 9%, var(--surface-solid));
        }

        .private-list-avatar,
        .private-peer-avatar {
            position: relative;
            display: grid;
            width: 42px;
            height: 42px;
            place-items: center;
            border-radius: 13px;
            background: linear-gradient(145deg, var(--primary-color), var(--accent));
            color: #fff;
            font-size: 14px;
            font-weight: 800;
        }

        .private-list-avatar i {
            position: absolute;
            right: -1px;
            bottom: -1px;
            width: 11px;
            height: 11px;
            border: 2px solid var(--surface-solid);
            border-radius: 50%;
            background: #94a3b8;
        }

        .private-list-avatar i.online { background: #22c55e; }

        .private-list-copy {
            display: grid;
            min-width: 0;
            gap: 5px;
        }

        .private-list-copy > span {
            display: flex;
            min-width: 0;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }

        .private-list-copy strong,
        .private-list-copy small {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .private-list-copy strong { font-size: 12px; }
        .private-list-copy small { color: var(--text-tertiary); font-size: 10px; }
        .private-list-copy time { flex: 0 0 auto; color: var(--text-tertiary); font-size: 8px; }

        .private-list-unread {
            display: grid;
            min-width: 20px;
            height: 20px;
            padding: 0 5px;
            place-items: center;
            border-radius: 999px;
            background: #ef4444;
            color: #fff;
            font-size: 9px;
        }

        .private-load-conversations {
            margin: 0 12px 12px;
            border: 1px solid var(--border);
            background: var(--surface-solid);
            color: var(--primary-color);
        }

        .private-chat {
            position: relative;
            min-width: 0;
            min-height: 0;
            overflow: hidden;
            background:
                radial-gradient(circle at 82% 0%, color-mix(in srgb, var(--primary-color) 10%, transparent), transparent 38%),
                color-mix(in srgb, var(--surface-solid) 94%, transparent);
        }

        .private-empty,
        .private-chat-placeholder {
            display: grid;
            height: 100%;
            place-content: center;
            justify-items: center;
            gap: 7px;
            padding: 24px;
            color: var(--text-tertiary);
            text-align: center;
        }

        .private-empty > span,
        .private-chat-placeholder > span {
            display: grid;
            width: 54px;
            height: 54px;
            place-items: center;
            border-radius: 18px;
            background: color-mix(in srgb, var(--primary-color) 10%, var(--surface-solid));
            color: var(--primary-color);
            font-size: 24px;
        }

        .private-empty strong,
        .private-chat-placeholder strong { color: var(--text-primary); font-size: 14px; }
        .private-empty small,
        .private-chat-placeholder small { max-width: 360px; line-height: 1.6; }

        .private-active {
            display: grid;
            height: 100%;
            min-width: 0;
            min-height: 0;
            grid-template-rows: auto auto minmax(0, 1fr) auto auto;
            overflow: hidden;
        }

        .private-active[hidden],
        .private-empty[hidden],
        .private-guest-warning[hidden] { display: none !important; }

        .private-chat-head {
            display: flex;
            min-width: 0;
            align-items: center;
            gap: 11px;
            padding: 12px 16px;
            border-bottom: 1px solid var(--border-strong);
            background: color-mix(in srgb, var(--surface-solid) 86%, transparent);
            backdrop-filter: blur(14px);
            grid-row: 1;
        }

        .private-peer-copy {
            display: grid;
            min-width: 0;
            gap: 2px;
        }

        .private-peer-copy strong {
            overflow: hidden;
            color: var(--text-primary);
            font-size: 13px;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .private-peer-copy small { color: var(--text-tertiary); font-size: 10px; }
        .private-peer-copy small.online { color: #16a34a; }

        .private-mobile-back {
            display: none;
            width: 40px;
            height: 40px;
            place-items: center;
            border: 1px solid var(--border);
            border-radius: 11px;
            background: var(--surface-solid);
            color: var(--text-primary);
            cursor: pointer;
        }

        .private-load-history {
            justify-self: center;
            min-height: 32px;
            margin: 7px 0 0;
            padding-inline: 13px;
            border: 1px solid var(--border);
            background: var(--surface-solid);
            color: var(--primary-color);
            grid-row: 2;
        }

        .private-messages {
            display: flex;
            min-width: 0;
            min-height: 0;
            flex-direction: column;
            gap: 10px;
            overflow: auto;
            padding: 18px clamp(14px, 3vw, 34px);
            scrollbar-width: thin;
            grid-row: 3;
            overscroll-behavior: contain;
        }

        .private-message-bubble {
            position: relative;
            width: fit-content;
            max-width: min(74%, 680px);
            align-self: flex-start;
            padding: 10px 12px 8px;
            border: 1px solid var(--border);
            border-radius: 7px 16px 16px 16px;
            background: var(--surface-solid);
            color: var(--text-primary);
            box-shadow: 0 5px 16px rgba(15, 23, 42, 0.06);
            overflow-wrap: anywhere;
        }

        .private-message-bubble.own {
            align-self: flex-end;
            border-color: color-mix(in srgb, var(--primary-color) 22%, transparent);
            border-radius: 16px 7px 16px 16px;
            background: color-mix(in srgb, var(--primary-color) 12%, var(--surface-solid));
        }

        .private-message-bubble.recalled { color: var(--text-tertiary); }

        .private-message-author {
            display: flex;
            align-items: center;
            gap: 7px;
            margin-bottom: 4px;
            color: var(--primary-color);
            font-size: 10px;
            font-weight: 750;
        }

        .private-message-author span {
            color: var(--text-tertiary);
            font-size: 8px;
            font-weight: 600;
        }

        .private-message-text {
            font-size: 13px;
            line-height: 1.58;
            white-space: pre-wrap;
        }

        .private-message-text em { font-size: 11px; }

        .private-message-bubble footer {
            display: flex;
            justify-content: flex-end;
            gap: 7px;
            margin-top: 5px;
            color: var(--text-tertiary);
            font-size: 8px;
        }

        .private-message-status { color: var(--primary-color); font-weight: 700; }

        .private-reply-quote {
            display: grid;
            gap: 2px;
            margin-bottom: 7px;
            padding: 7px 9px;
            border-left: 3px solid var(--primary-color);
            border-radius: 8px;
            background: color-mix(in srgb, var(--primary-color) 7%, transparent);
            color: var(--text-secondary);
            font-size: 10px;
        }

        .private-message-actions {
            position: absolute;
            z-index: 2;
            top: -15px;
            right: 8px;
            display: flex;
            gap: 3px;
            padding: 3px;
            border: 1px solid var(--border);
            border-radius: 9px;
            background: var(--surface-solid);
            box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
            opacity: 0;
            pointer-events: none;
            transform: translateY(4px);
            transition: opacity 0.15s ease, transform 0.15s ease;
        }

        .private-message-bubble:hover .private-message-actions,
        .private-message-bubble:focus-within .private-message-actions {
            opacity: 1;
            pointer-events: auto;
            transform: translateY(0);
        }

        .private-message-actions button {
            min-height: 28px;
            padding: 0 8px;
            border: 0;
            border-radius: 6px;
            background: transparent;
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 9px;
        }

        .private-message-actions button:hover { background: var(--surface-hover); color: var(--primary-color); }

        .private-compose-context {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 8px 16px;
            border-top: 1px solid var(--border);
            background: color-mix(in srgb, var(--primary-color) 5%, var(--surface-solid));
            grid-row: 4;
        }

        .private-compose-context[hidden] { display: none; }

        .private-compose-context > span {
            display: grid;
            min-width: 0;
            gap: 2px;
        }

        .private-compose-context strong { color: var(--primary-color); font-size: 10px; }
        .private-compose-context small { overflow: hidden; color: var(--text-tertiary); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
        .private-compose-context button { border: 0; background: none; color: var(--text-tertiary); cursor: pointer; font-size: 18px; }

        .private-composer {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            align-items: center;
            gap: 8px;
            min-height: 70px;
            padding: 12px 16px max(12px, env(safe-area-inset-bottom));
            border-top: 1px solid var(--border-strong);
            background: color-mix(in srgb, var(--surface-solid) 90%, transparent);
            grid-row: 5;
        }

        .private-composer input {
            width: 100%;
            height: 46px;
            min-width: 0;
            min-height: 46px;
            max-height: 46px;
            padding: 0 14px;
            border: 1px solid var(--border);
            border-radius: 14px;
            background: var(--surface-solid);
            color: var(--text-primary);
            font-size: 13px;
            outline: none;
        }

        .private-composer input:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 14%, transparent);
        }

        .private-composer button {
            min-width: 76px;
            min-height: 46px;
            padding: 0 16px;
            border: 0;
            border-radius: 14px;
            background: linear-gradient(135deg, var(--primary-color), var(--accent));
            color: #fff;
            cursor: pointer;
            font-size: 12px;
            font-weight: 800;
        }

        .private-composer {
            grid-template-columns: minmax(0, 1fr);
            align-items: stretch;
            gap: 9px;
            min-height: 0;
        }

        .private-composer-tools,
        .private-composer-main {
            display: flex;
            min-width: 0;
            align-items: center;
            gap: 8px;
        }

        .private-composer-main > input {
            flex: 1;
        }

        .private-composer-main > button {
            flex: 0 0 auto;
        }

        .private-composer .private-tool-button {
            display: grid;
            width: 36px;
            min-width: 36px;
            min-height: 36px;
            padding: 0;
            place-items: center;
            border: 1px solid var(--border);
            border-radius: 11px;
            background: var(--surface-solid);
            color: var(--text-secondary);
            box-shadow: none;
            font-size: 17px;
        }

        .private-composer .private-tool-button:hover,
        .private-composer .private-tool-button[aria-expanded="true"] {
            border-color: color-mix(in srgb, var(--primary-color) 38%, var(--border));
            background: color-mix(in srgb, var(--primary-color) 9%, var(--surface-solid));
            color: var(--primary-color);
        }

        .private-composer-hint {
            overflow: hidden;
            color: var(--text-tertiary);
            font-size: 10px;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .private-emoji-wrap {
            position: relative;
        }

        .private-emoji-panel {
            position: absolute;
            z-index: 40;
            bottom: calc(100% + 10px);
            left: 0;
            width: min(336px, calc(100vw - 42px));
            max-height: 310px;
            overflow: hidden;
            border: 1px solid var(--border-strong);
            border-radius: 15px;
            background: color-mix(in srgb, var(--surface-solid) 97%, transparent);
            box-shadow: 0 16px 44px rgba(15, 23, 42, .2);
            backdrop-filter: blur(16px);
        }

        .private-emoji-panel[hidden] {
            display: none;
        }

        .private-emoji-panel-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 11px 12px;
            border-bottom: 1px solid var(--border);
        }

        .private-emoji-panel-head strong {
            color: var(--text-primary);
            font-size: 12px;
        }

        .private-emoji-panel-head small {
            color: var(--text-tertiary);
            font-size: 9px;
        }

        .private-emoji-grid {
            display: grid;
            max-height: 252px;
            grid-template-columns: repeat(8, minmax(0, 1fr));
            gap: 3px;
            overflow: auto;
            padding: 9px;
        }

        .private-composer .private-emoji-grid button {
            display: grid;
            min-width: 0;
            min-height: 36px;
            padding: 0;
            place-items: center;
            border: 0;
            border-radius: 9px;
            background: transparent;
            color: inherit;
            box-shadow: none;
            font-size: 20px;
        }

        .private-composer .private-emoji-grid button:hover,
        .private-composer .private-emoji-grid button:focus-visible {
            background: var(--surface-hover);
        }

        .private-attachment-drafts {
            display: flex;
            min-width: 0;
            gap: 7px;
            overflow-x: auto;
            padding: 1px 0 3px;
            scrollbar-width: thin;
        }

        .private-attachment-drafts[hidden] {
            display: none;
        }

        .private-attachment-draft {
            position: relative;
            display: grid;
            min-width: 190px;
            max-width: 260px;
            grid-template-columns: auto minmax(0, 1fr) auto auto;
            align-items: center;
            gap: 7px;
            overflow: hidden;
            padding: 8px 9px;
            border: 1px solid var(--border);
            border-radius: 11px;
            background: var(--surface-solid);
        }

        .private-attachment-draft.is-ready {
            border-color: color-mix(in srgb, #16a34a 42%, var(--border));
        }

        .private-attachment-draft.is-failed {
            border-color: color-mix(in srgb, #ef4444 44%, var(--border));
        }

        .private-attachment-draft > span:nth-child(2) {
            display: grid;
            min-width: 0;
            gap: 2px;
        }

        .private-attachment-draft strong,
        .private-attachment-draft small {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .private-attachment-draft strong {
            color: var(--text-primary);
            font-size: 10px;
        }

        .private-attachment-draft small {
            color: var(--text-tertiary);
            font-size: 8px;
        }

        .private-attachment-draft > i {
            position: absolute;
            right: 0;
            bottom: 0;
            left: 0;
            height: 2px;
            background: var(--primary-color);
        }

        .private-composer .private-attachment-draft > button {
            min-width: 28px;
            min-height: 28px;
            padding: 0 6px;
            border: 0;
            border-radius: 7px;
            background: var(--surface-hover);
            color: var(--text-secondary);
            box-shadow: none;
            font-size: 9px;
        }

        .private-message-attachments {
            display: grid;
            width: min(360px, 62vw);
            max-width: 100%;
            gap: 7px;
            margin-top: 7px;
        }

        .private-attachment-file,
        .private-attachment-media {
            overflow: hidden;
            border: 1px solid color-mix(in srgb, var(--primary-color) 18%, var(--border));
            border-radius: 12px;
            background: color-mix(in srgb, var(--surface-solid) 86%, transparent);
        }

        .private-attachment-file {
            display: grid;
            grid-template-columns: auto minmax(0, 1fr);
            align-items: center;
            gap: 10px;
            padding: 10px;
            color: inherit;
            text-decoration: none;
        }

        .private-attachment-file > span:first-child {
            display: grid;
            width: 38px;
            height: 38px;
            place-items: center;
            border-radius: 10px;
            background: color-mix(in srgb, var(--primary-color) 10%, var(--surface-solid));
            color: var(--primary-color);
            font-size: 18px;
        }

        .private-attachment-file > span:last-child,
        .private-attachment-media > a {
            display: grid;
            min-width: 0;
            gap: 2px;
        }

        .private-attachment-file strong,
        .private-attachment-media > a span {
            overflow: hidden;
            color: var(--text-primary);
            font-size: 11px;
            font-weight: 750;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .private-attachment-file small,
        .private-attachment-media > a small {
            color: var(--text-tertiary);
            font-size: 9px;
        }

        .private-attachment-media > button,
        .private-attachment-media > video {
            display: block;
            width: 100%;
            min-width: 0;
            max-height: 260px;
            padding: 0;
            border: 0;
            background: #0f172a;
        }

        .private-attachment-media > button {
            cursor: zoom-in;
        }

        .private-attachment-media img {
            display: block;
            width: 100%;
            max-height: 260px;
            object-fit: contain;
        }

        .private-attachment-media.is-error > button {
            min-height: 96px;
        }

        .private-attachment-media.is-error img {
            display: none;
        }

        .private-attachment-media.is-error > button::after {
            content: '图片加载失败';
            color: #fff;
            font-size: 11px;
        }

        .private-attachment-media > audio {
            display: block;
            width: calc(100% - 16px);
            margin: 9px 8px 0;
        }

        .private-attachment-media > a {
            padding: 8px 10px 9px;
            text-decoration: none;
        }

        @media (max-width: 900px) {
            .private-shell { grid-template-columns: minmax(250px, 32vw) minmax(0, 1fr); }
            .private-message-bubble { max-width: 82%; }
        }

        @media (max-width: 600px) {
            body.chat-active #privateSection.workspace-panel.is-active {
                height: calc(100dvh - 152px);
                min-height: 0;
                padding: 10px;
            }

            #privateSection > h2 { margin-bottom: 8px; }

            .private-shell {
                position: relative;
                display: block;
                border-radius: 15px;
            }

            .private-sidebar,
            .private-chat {
                position: absolute;
                inset: 0;
            }

            .private-chat {
                display: none;
                background: var(--surface-solid);
            }

            .private-shell.conversation-open .private-sidebar { display: none; }
            .private-shell.conversation-open .private-chat { display: block; }
            .private-mobile-back { display: grid; }
            .private-chat-head { padding: 8px 10px; }
            .private-peer-avatar { width: 38px; height: 38px; }
            .private-messages { padding: 15px 10px; }
            .private-message-bubble { max-width: 88%; }
            .private-message-actions { position: static; margin-bottom: 7px; opacity: 1; pointer-events: auto; transform: none; box-shadow: none; }
            .private-message-actions button { min-height: 34px; }
            .private-composer { padding: 9px max(9px, env(safe-area-inset-right)) max(9px, env(safe-area-inset-bottom)) max(9px, env(safe-area-inset-left)); }
            .private-composer button { min-width: 64px; }
            .private-composer .private-tool-button { min-width: 40px; min-height: 40px; }
            .private-composer-hint { display: none; }
            .private-emoji-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
            .private-message-attachments { width: min(320px, 72vw); }
        }

        @media (prefers-reduced-motion: reduce) {
            .private-loading-dot { animation: none; }
            .private-message-actions { transition: none; }
        }

        @media (hover: none), (pointer: coarse) {
            .workspace-nav-item,
            .workspace-logout,
            .emoji-picker-btn,
            .input-section .btn,
            .pagination-btn {
                min-height: 44px;
            }

            .message .actions {
                opacity: 1;
            }
        }

        /* 跨频道搜索、上传任务与文件协作 */
        .global-search-panel {
            position: absolute;
            z-index: 30;
            top: 46px;
            right: 0;
            left: 0;
            display: flex;
            max-height: min(560px, calc(100% - 58px));
            flex-direction: column;
            overflow: hidden;
            border: 1px solid color-mix(in srgb, var(--primary-color) 22%, var(--border));
            border-radius: 15px;
            background: color-mix(in srgb, var(--surface-solid) 96%, transparent);
            box-shadow: 0 18px 48px rgba(15, 23, 42, 0.2);
            backdrop-filter: blur(18px);
        }

        .global-search-panel[hidden],
        .file-details-layer[hidden],
        .upload-task-center[hidden],
        .file-batch-toolbar[hidden] {
            display: none;
        }

        .global-search-filters {
            display: grid;
            grid-template-columns: minmax(110px, .8fr) minmax(130px, 1fr) repeat(2, minmax(132px, .8fr)) 36px;
            gap: 8px;
            padding: 12px;
            border-bottom: 1px solid var(--border);
        }

        .global-search-filters label {
            display: flex;
            min-width: 0;
            flex-direction: column;
            gap: 4px;
            color: var(--text-tertiary);
            font-size: 9px;
            font-weight: 750;
        }

        .global-search-filters input,
        .global-search-filters select {
            width: 100%;
            min-height: 36px;
            min-width: 0;
            padding: 7px 9px;
            border: 1px solid var(--border);
            border-radius: 9px;
            background: var(--surface-solid);
            color: var(--text-primary);
        }

        .global-search-close {
            width: 36px;
            height: 36px;
            align-self: end;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: transparent;
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 20px;
        }

        .global-search-status {
            padding: 9px 13px;
            color: var(--text-secondary);
            font-size: 11px;
        }

        .global-search-results {
            display: flex;
            min-height: 0;
            flex-direction: column;
            gap: 5px;
            overflow-y: auto;
            padding: 0 9px 9px;
        }

        .global-search-result {
            display: grid;
            gap: 4px;
            width: 100%;
            padding: 10px 11px;
            border: 1px solid transparent;
            border-radius: 11px;
            background: color-mix(in srgb, var(--primary-color) 4%, var(--surface-solid));
            color: var(--text-primary);
            cursor: pointer;
            text-align: left;
        }

        .global-search-result:hover,
        .global-search-result:focus-visible {
            border-color: color-mix(in srgb, var(--primary-color) 38%, var(--border));
            background: color-mix(in srgb, var(--primary-color) 9%, var(--surface-solid));
            outline: none;
        }

        .global-search-result-head {
            display: flex;
            justify-content: space-between;
            gap: 12px;
            color: var(--text-secondary);
            font-size: 10px;
        }

        .global-search-result-author {
            color: var(--primary-color);
            font-size: 10px;
            font-weight: 800;
        }

        .global-search-result-text {
            display: -webkit-box;
            overflow: hidden;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            font-size: 12px;
            line-height: 1.5;
        }

        .global-search-more {
            margin: 0 10px 10px;
        }

        .message.search-target {
            animation: search-target-pulse .85s ease 2;
            box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 55%, transparent) !important;
        }

        @keyframes search-target-pulse {
            50% { transform: scale(1.012); }
        }

        .upload-task-center {
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
            margin: 0 0 12px;
            overflow: hidden;
            border: 1px solid var(--border);
            border-radius: 14px;
            background: color-mix(in srgb, var(--surface-solid) 86%, transparent);
        }

        .upload-task-header,
        .file-batch-toolbar {
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 10px 12px;
        }

        .upload-task-header > span {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .upload-task-header small {
            color: var(--text-tertiary);
        }

        .upload-task-list {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            gap: 7px;
            max-height: 260px;
            overflow-y: auto;
            padding: 0 10px 10px;
        }

        .upload-task {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 6px 10px;
            align-items: center;
            padding: 9px;
            border: 1px solid var(--border);
            border-radius: 11px;
            background: var(--surface-solid);
        }

        .upload-task > div:first-child {
            display: flex;
            min-width: 0;
            flex-direction: column;
        }

        .upload-task strong,
        .upload-task small {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .upload-task small,
        .upload-task-state {
            color: var(--text-tertiary);
            font-size: 9px;
        }

        .upload-task button {
            min-width: 48px;
            min-height: 32px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: transparent;
            color: var(--text-secondary);
            cursor: pointer;
        }

        .upload-task-progress {
            height: 5px;
            overflow: hidden;
            border-radius: 999px;
            background: color-mix(in srgb, var(--text-tertiary) 15%, transparent);
        }

        .upload-task-progress i {
            display: block;
            height: 100%;
            border-radius: inherit;
            background: var(--primary-color);
            transition: width .15s linear;
        }

        .upload-task.is-success .upload-task-progress i { background: #22c55e; }
        .upload-task.is-failed .upload-task-progress i { background: #ef4444; }

        .file-batch-toolbar {
            margin-bottom: 10px;
            flex-wrap: wrap;
            border: 1px solid color-mix(in srgb, var(--primary-color) 24%, var(--border));
            border-radius: 13px;
            background: color-mix(in srgb, var(--primary-color) 6%, var(--surface-solid));
        }

        .file-select-page {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            cursor: pointer;
        }

        .file-batch-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-left: auto;
        }

        .file-item {
            position: relative;
        }

        .file-item.is-selected {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color) 24%, transparent);
        }

        .file-card-selectors {
            position: absolute;
            z-index: 5;
            top: 8px;
            right: 8px;
            display: flex;
            gap: 5px;
        }

        .file-select-check,
        .file-favorite-btn {
            display: grid;
            width: 32px;
            height: 32px;
            place-items: center;
            border: 1px solid color-mix(in srgb, var(--surface-solid) 55%, var(--border));
            border-radius: 9px;
            background: color-mix(in srgb, var(--surface-solid) 91%, transparent);
            color: var(--text-secondary);
            box-shadow: 0 3px 9px rgba(15, 23, 42, .12);
            cursor: pointer;
            backdrop-filter: blur(8px);
        }

        .file-select-check input {
            width: 16px;
            height: 16px;
            accent-color: var(--primary-color);
        }

        .file-favorite-btn {
            font-size: 18px;
        }

        .file-favorite-btn.active {
            border-color: color-mix(in srgb, #f59e0b 55%, var(--border));
            color: #f59e0b;
        }

        .file-collab-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 4px 9px;
            margin-top: 6px;
            color: var(--text-tertiary);
            font-size: 9px;
        }

        .file-tag-preview,
        .file-details-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
            margin-top: 6px;
        }

        .file-tag-preview span,
        .file-details-tags span {
            max-width: 100%;
            overflow: hidden;
            padding: 2px 6px;
            border-radius: 999px;
            background: color-mix(in srgb, var(--primary-color) 10%, transparent);
            color: var(--primary-color);
            font-size: 8px;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .file-details-layer {
            position: fixed;
            z-index: 12000;
            inset: 0;
            display: flex;
            justify-content: flex-end;
            background: rgba(15, 23, 42, .42);
            opacity: 0;
            transition: opacity .18s ease;
        }

        .file-details-layer.is-open { opacity: 1; }

        .file-details-drawer {
            display: flex;
            width: min(460px, 94vw);
            height: 100%;
            flex-direction: column;
            overflow: hidden;
            background: var(--surface-solid);
            color: var(--text-primary);
            box-shadow: -16px 0 48px rgba(15, 23, 42, .22);
            transform: translateX(24px);
            transition: transform .18s ease;
        }

        .file-details-layer.is-open .file-details-drawer { transform: translateX(0); }

        .file-details-drawer > header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 14px;
            padding: max(16px, env(safe-area-inset-top)) 18px 14px;
            border-bottom: 1px solid var(--border);
        }

        .file-details-drawer > header span {
            display: flex;
            min-width: 0;
            flex-direction: column;
        }

        .file-details-drawer > header strong {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .file-details-drawer > header small { color: var(--text-tertiary); }

        .file-details-drawer > header button {
            width: 40px;
            height: 40px;
            flex: 0 0 auto;
            border: 1px solid var(--border);
            border-radius: 11px;
            background: transparent;
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 22px;
        }

        .file-details-content {
            display: flex;
            min-height: 0;
            flex: 1;
            flex-direction: column;
            gap: 15px;
            overflow-y: auto;
            padding: 16px 18px max(18px, env(safe-area-inset-bottom));
        }

        .file-details-preview {
            display: grid;
            min-height: 170px;
            place-items: center;
            gap: 8px;
            overflow: hidden;
            border: 1px solid var(--border);
            border-radius: 14px;
            background: color-mix(in srgb, var(--primary-color) 5%, var(--surface-solid));
            color: var(--text-primary);
        }

        button.file-details-preview { width: 100%; padding: 0; cursor: pointer; }
        .file-details-preview > span:first-child { font-size: 42px; }
        .file-details-preview.image { position: relative; }
        .file-details-preview.image img { width: 100%; height: 220px; object-fit: contain; }
        .file-details-preview.image span { position: absolute; right: 10px; bottom: 10px; padding: 5px 8px; border-radius: 8px; background: rgba(15,23,42,.7); color: white; font-size: 10px; }

        .file-details-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 8px;
            margin: 0;
        }

        .file-details-grid div {
            min-width: 0;
            padding: 10px;
            border: 1px solid var(--border);
            border-radius: 10px;
        }

        .file-details-grid dt { color: var(--text-tertiary); font-size: 9px; }
        .file-details-grid dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: 11px; font-weight: 750; }

        .file-details-field {
            display: flex;
            flex-direction: column;
            gap: 6px;
            font-size: 11px;
            font-weight: 750;
        }

        .file-details-field textarea,
        .file-details-field input {
            width: 100%;
            padding: 10px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--surface-solid);
            color: var(--text-primary);
            resize: vertical;
        }

        .file-details-field textarea { min-height: 96px; }
        .file-details-field small { color: var(--text-tertiary); font-size: 9px; font-weight: 500; }
        .file-details-field [readonly] { background: color-mix(in srgb, var(--text-tertiary) 7%, var(--surface-solid)); }

        .file-details-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: auto;
        }

        @media (max-width: 900px) {
            .global-search-panel { top: 46px; max-height: calc(100% - 52px); }
            .global-search-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
            .global-search-close { position: absolute; top: 8px; right: 8px; }
            .global-search-filters label:first-child { padding-right: 38px; }
            .file-batch-actions { width: 100%; margin-left: 0; }
            .file-batch-actions .btn { flex: 1 1 auto; }
            .upload-task-list { grid-template-columns: minmax(0, 1fr); }
        }

        @media (max-width: 600px) {
            #fileSection,
            #fileSection.is-active {
                overflow-x: hidden;
            }
            #fileSection > * {
                min-width: 0;
                max-width: 100%;
            }
            .global-search-panel { position: fixed; z-index: 10000; inset: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom)); max-height: none; }
            .global-search-filters { grid-template-columns: minmax(0, 1fr); padding-top: 48px; }
            .global-search-filters label:first-child { padding-right: 0; }
            .file-batch-toolbar { align-items: flex-start; }
            .file-batch-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
            .file-details-drawer { width: 100vw; }
            .file-details-grid { grid-template-columns: minmax(0, 1fr); }
            .file-details-actions { display: grid; grid-template-columns: 1fr; }
            .upload-task { grid-template-columns: minmax(0, 1fr) auto; }
        }

        @media (prefers-reduced-motion: reduce) {
            .message.search-target { animation: none; }
            .file-details-layer,
            .file-details-drawer,
            .upload-task-progress i { transition: none; }
        }

        /* 顶部私信工作区 */
        .workspace-nav-item {
            position: relative;
        }

        .workspace-nav-badge {
            position: absolute;
            top: 3px;
            right: 4px;
            display: grid;
            min-width: 17px;
            height: 17px;
            padding: 0 4px;
            place-items: center;
            border: 2px solid var(--surface-solid);
            border-radius: 999px;
            background: #ef4444;
            color: white;
            font-size: 8px;
            font-style: normal;
            font-weight: 800;
            line-height: 1;
        }

        .workspace-nav-badge[hidden] {
            display: none;
        }

        body.workspace-private .toast {
            bottom: 120px;
        }

        @media (max-width: 600px) {
            .workspace-nav-item {
                gap: 4px;
                padding-inline: 5px;
            }

            .workspace-nav-item strong {
                font-size: 11px;
            }
        }

        /* 管理安全中心 */
        #adminTabSecurity .admin-panel-intro {
            margin-bottom: 20px;
        }

        #adminTabSecurity .admin-operation-card + .admin-operation-card {
            margin-top: 20px;
        }

        .security-backup-card,
        .security-trash-card,
        .security-audit-card {
            display: grid;
            gap: 18px;
            padding: 18px;
        }

        .security-backup-card .admin-card-heading,
        .security-trash-card .admin-card-heading,
        .security-audit-card .admin-card-heading {
            margin-bottom: 0;
            padding-bottom: 14px;
            border-bottom: 1px solid var(--border);
        }

        .security-toolbar {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            align-items: center;
            min-width: 0;
            padding: 12px;
            border: 1px solid var(--border);
            border-radius: 12px;
            background: color-mix(in srgb, var(--primary-color) 3%, var(--surface-solid));
        }

        .security-check {
            display: inline-flex;
            min-height: 44px;
            align-items: center;
            gap: 9px;
            padding: 0 13px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--surface-hover);
            cursor: pointer;
        }

        .security-check input {
            width: 18px;
            height: 18px;
        }

        .security-audit-filters .admin-input:first-child {
            min-width: 0;
        }

        .security-audit-filters {
            display: grid;
            grid-template-columns: minmax(260px, 1fr) minmax(150px, 180px) auto;
            align-items: center;
        }

        .security-audit-filters select,
        .security-audit-filters .btn {
            width: 100%;
        }

        .security-list {
            display: grid;
            gap: 10px;
            min-width: 0;
        }

        .security-list > .empty-state {
            min-height: 116px;
            margin: 0;
            padding: 22px 16px;
            border: 1px dashed var(--border-strong);
            border-radius: 12px;
            background: color-mix(in srgb, var(--surface-solid) 72%, transparent);
        }

        .security-item {
            display: flex;
            min-width: 0;
            align-items: flex-start;
            gap: 14px;
            padding: 14px 15px;
            border: 1px solid var(--border-strong);
            border-radius: 12px;
            background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
        }

        .security-backup-card .security-item {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            align-items: center;
        }

        .security-item-main {
            display: grid;
            min-width: 0;
            flex: 1;
            gap: 3px;
        }

        .security-item-main strong,
        .security-item-main span,
        .security-item-main small {
            min-width: 0;
            overflow-wrap: anywhere;
        }

        .security-item-main span,
        .security-item-main small {
            color: var(--text-secondary);
        }

        .security-item-main small {
            font-size: 12px;
        }

        .security-item-actions {
            display: flex;
            min-width: 0;
            flex-wrap: wrap;
            justify-content: flex-end;
            gap: 7px;
        }

        .security-backup-card .security-item-actions {
            display: grid;
            grid-template-columns: repeat(4, minmax(68px, auto));
        }

        .audit-result {
            display: inline-grid;
            min-width: 48px;
            min-height: 28px;
            place-items: center;
            border-radius: 999px;
            font-size: 12px;
            font-weight: 750;
        }

        .audit-result.success {
            background: rgba(34, 197, 94, .14);
            color: #15803d;
        }

        .audit-result.failed {
            background: rgba(239, 68, 68, .14);
            color: #dc2626;
        }

        .security-pagination {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            min-height: 42px;
            padding-top: 12px;
            border-top: 1px solid var(--border);
            color: var(--text-secondary);
            font-size: 13px;
        }

        .security-pagination:empty {
            display: none;
        }

        .storage-usage-summary {
            display: grid;
            gap: 6px;
            margin-top: 10px;
        }

        .storage-usage-row {
            display: flex;
            min-width: 0;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 7px 9px;
            border-radius: 8px;
            background: var(--surface-hover);
        }

        .storage-usage-row b,
        .storage-usage-row small {
            min-width: 0;
            overflow-wrap: anywhere;
        }

        .storage-usage-row.is-exceeded {
            outline: 1px solid rgba(239, 68, 68, .4);
            color: #dc2626;
        }

        .trash-summary {
            color: var(--text-secondary);
            font-size: 13px;
            font-weight: 700;
        }

        @media (max-width: 1100px) {
            .security-backup-card .security-item {
                grid-template-columns: minmax(0, 1fr);
                align-items: stretch;
            }

            .security-backup-card .security-item-actions {
                grid-template-columns: repeat(2, minmax(92px, 1fr));
            }

            .security-audit-filters {
                grid-template-columns: minmax(0, 1fr) minmax(140px, 180px);
            }

            .security-audit-filters .btn {
                grid-column: 1 / -1;
                justify-self: start;
                width: auto;
                min-width: 110px;
            }
        }

        @media (max-width: 600px) {
            #adminTabSecurity .admin-operation-card + .admin-operation-card {
                margin-top: 14px;
            }

            .security-backup-card,
            .security-trash-card,
            .security-audit-card {
                gap: 14px;
                padding: 14px;
            }

            .security-audit-filters {
                grid-template-columns: minmax(0, 1fr);
            }

            .security-audit-filters .btn {
                grid-column: auto;
                width: 100%;
            }

            .security-toolbar > *,
            .security-audit-filters select,
            .security-audit-filters .admin-input:first-child {
                width: 100%;
                flex-basis: 100%;
            }

            .security-item {
                align-items: flex-start;
                flex-wrap: wrap;
            }

            .security-item-actions {
                width: 100%;
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            .security-item-actions .btn {
                width: 100%;
            }
        }

        /* 用户状态、服务器健康与断点续传 */
        .user-status-control {
            min-height: 34px;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 8px;
            border: 0;
            border-radius: 8px;
            background: transparent;
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 10px;
            white-space: nowrap;
        }

        .user-status-control:hover,
        .user-status-control:focus-visible {
            background: var(--surface-hover);
            color: var(--text-primary);
        }

        .user-status-control i,
        .user-status-options i,
        .admin-presence-dot,
        .status-dot[data-status] {
            width: 9px;
            height: 9px;
            display: inline-block;
            flex: 0 0 auto;
            border-radius: 50%;
            background: #22c55e;
            box-shadow: 0 0 0 3px rgba(34, 197, 94, .12);
        }

        .user-status-control i[data-status="busy"],
        .user-status-options i[data-status="busy"],
        .admin-presence-dot[data-status="busy"],
        .status-dot[data-status="busy"],
        .private-list-avatar i[data-status="busy"] {
            background: #ef4444 !important;
            box-shadow: 0 0 0 3px rgba(239, 68, 68, .12) !important;
        }

        .user-status-control i[data-status="away"],
        .user-status-options i[data-status="away"],
        .admin-presence-dot[data-status="away"],
        .status-dot[data-status="away"],
        .private-list-avatar i[data-status="away"] {
            background: #f59e0b !important;
            box-shadow: 0 0 0 3px rgba(245, 158, 11, .12) !important;
        }

        .user-status-control i[data-status="dnd"],
        .user-status-options i[data-status="dnd"],
        .admin-presence-dot[data-status="dnd"],
        .status-dot[data-status="dnd"],
        .private-list-avatar i[data-status="dnd"] {
            background: #8b5cf6 !important;
            box-shadow: 0 0 0 3px rgba(139, 92, 246, .12) !important;
        }

        .online-user-copy {
            min-width: 0;
            display: grid;
            flex: 1;
            gap: 1px;
        }

        .online-user-copy strong,
        .online-user-copy small {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .online-user-copy strong {
            color: var(--text-primary);
            font-size: 12px;
        }

        .online-user-copy small {
            color: var(--text-tertiary);
            font-size: 9px;
        }

        .user-status-card {
            width: min(520px, calc(100vw - 28px));
            display: grid;
            gap: 14px;
        }

        .user-status-card .modal-header > span {
            display: grid;
            gap: 2px;
        }

        .user-status-card .modal-header small {
            color: var(--primary-color);
            font-size: 10px;
            font-weight: 750;
            letter-spacing: .08em;
        }

        .user-status-options {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 8px;
        }

        .user-status-options button {
            min-height: 68px;
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 11px 12px;
            border: 1px solid var(--border);
            border-radius: 12px;
            background: var(--surface-solid);
            color: var(--text-primary);
            cursor: pointer;
            text-align: left;
            transition: var(--transition);
        }

        .user-status-options button:hover,
        .user-status-options button.selected {
            border-color: color-mix(in srgb, var(--primary-color) 48%, var(--border));
            background: color-mix(in srgb, var(--primary-color) 8%, var(--surface-solid));
        }

        .user-status-options button.selected {
            box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color) 11%, transparent);
        }

        .user-status-options button > span {
            display: grid;
            gap: 3px;
        }

        .user-status-options small,
        .user-status-message-field small {
            color: var(--text-tertiary);
            font-size: 10px;
        }

        .user-status-message-field {
            display: grid;
            gap: 7px;
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 650;
        }

        .user-status-message-field input {
            width: 100%;
            min-height: 44px;
            padding: 9px 11px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--surface-solid);
            color: var(--text-primary);
        }

        .private-list-avatar i[data-status="busy"],
        .private-list-avatar i[data-status="away"],
        .private-list-avatar i[data-status="dnd"] {
            border-color: var(--surface-solid);
        }

        .health-overall-status {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 10px;
            border-radius: 999px;
            background: rgba(148, 163, 184, .12);
            color: var(--text-secondary);
            font-size: 11px;
            font-weight: 750;
        }

        .health-overall-status::before {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: #94a3b8;
            content: '';
        }

        .health-overall-status[data-status="healthy"] {
            background: rgba(34, 197, 94, .12);
            color: #16a34a;
        }

        .health-overall-status[data-status="healthy"]::before {
            background: #22c55e;
        }

        .health-overall-status[data-status="warning"] {
            background: rgba(245, 158, 11, .14);
            color: #d97706;
        }

        .health-overall-status[data-status="warning"]::before {
            background: #f59e0b;
        }

        .health-metric-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 12px;
            margin-bottom: 14px;
        }

        .health-metric-card {
            min-width: 0;
            display: grid;
            gap: 7px;
            padding: 16px;
            border: 1px solid var(--border);
            border-radius: 14px;
            background: color-mix(in srgb, var(--surface-solid) 90%, transparent);
            box-shadow: var(--shadow-sm);
        }

        .health-metric-card > span,
        .health-metric-card small {
            overflow: hidden;
            color: var(--text-tertiary);
            font-size: 10px;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .health-metric-card strong {
            overflow: hidden;
            color: var(--text-primary);
            font-size: clamp(18px, 2vw, 26px);
            letter-spacing: -.03em;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .health-warning-list {
            display: grid;
            gap: 8px;
            margin-top: 12px;
        }

        .health-ok-state,
        .health-warning-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px;
            border-radius: 11px;
        }

        .health-ok-state {
            background: rgba(34, 197, 94, .09);
            color: #16a34a;
        }

        .health-warning-item {
            background: rgba(245, 158, 11, .11);
            color: #d97706;
        }

        .health-ok-state > span,
        .health-warning-item > span {
            width: 25px;
            height: 25px;
            display: grid;
            place-items: center;
            flex: 0 0 auto;
            border-radius: 8px;
            background: currentColor;
            color: #fff;
            font-weight: 850;
        }

        .health-ok-state p,
        .health-warning-item p {
            display: grid;
            gap: 2px;
            margin: 0;
        }

        .health-ok-state small {
            color: var(--text-tertiary);
            font-size: 10px;
        }

        .upload-task.is-failed .upload-task-progress i {
            background: #f59e0b;
        }

        .upload-task.is-failed .upload-task-state::after {
            margin-left: 4px;
            color: #f59e0b;
            content: '· 可续传';
            font-size: 9px;
        }

        @media (max-width: 1200px) {
            .health-metric-grid {
                grid-template-columns: repeat(3, minmax(0, 1fr));
            }
        }

        @media (max-width: 900px) {
            .health-metric-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            .workspace-header .user-status-control span {
                display: none;
            }
        }

        @media (max-width: 600px) {
            .health-metric-grid,
            .user-status-options {
                grid-template-columns: 1fr;
            }

            .health-panel-intro {
                align-items: flex-start;
            }

            .user-status-card {
                max-height: calc(100dvh - 24px);
                overflow-y: auto;
            }
        }
