:root {
    --primary: #0d9488;
    --primary-light: #14b8a6;
    --primary-dark: #0f766e;
    --primary-color: #0d9488;
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --bg-primary: #fafaf9;
    --bg-secondary: #f5f5f4;
    --bg-card: #ffffff;
    --bg-hover: #f5f5f4;
    --bg-input: #ffffff;
    --text-primary: #1c1917;
    --text-secondary: #57534e;
    --text-muted: #a8a29e;
    --border: #e7e5e4;
    --border-color: #e7e5e4;
    --border-light: #f5f5f4;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

[data-theme="dark"] {
    --primary: #14b8a6;
    --primary-light: #2dd4bf;
    --primary-dark: #0d9488;
    --primary-color: #14b8a6;
    --accent: #fbbf24;
    --accent-light: #fcd34d;
    --bg-primary: #1c1917;
    --bg-secondary: #292524;
    --bg-card: #292524;
    --bg-hover: #3f3f46;
    --bg-input: #1c1917;
    --text-primary: #fafaf9;
    --text-secondary: #a8a29e;
    --text-muted: #78716c;
    --border: #44403c;
    --border-color: #44403c;
    --border-light: #292524;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -4px rgba(0,0,0,0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.4), 0 8px 10px -6px rgba(0,0,0,0.3);
}

[data-theme="dark"] select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a8a29e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-theme="dark"] .filter-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a8a29e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-theme="dark"] .admin-role-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23a8a29e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

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

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    -webkit-appearance: none;
    appearance: none;
}

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

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px 12px;
    padding-right: 32px;
    cursor: pointer;
}

input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
    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='%23666' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px 14px;
    padding-right: 36px;
    cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="week"]::-webkit-calendar-picker-indicator {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    margin-left: -30px;
    padding: 0 10px;
    opacity: 0.01;
    cursor: pointer;
    width: 36px;
    height: 36px;
}
::-webkit-calendar-picker-indicator:hover {
    background: transparent;
}

input[type="color"] {
    padding: 4px;
    min-height: 40px;
}
input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
}

input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="checkbox"],
input[type="radio"] {
    width: 16px;
    height: 16px;
    padding: 0;
    cursor: pointer;
    accent-color: var(--primary);
}

button {
    font-family: inherit;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 50%, #115e59 100%);
    z-index: 0;
}

[data-theme="dark"] .login-bg {
    background: linear-gradient(135deg, #0f3d3e 0%, #0a2e2f 50%, #061f20 100%);
}

.login-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255,255,255,0.05) 0%, transparent 30%);
}

.login-particles {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle, rgba(255,255,255,0.15) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: particles 20s linear infinite;
}

@keyframes particles {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50px); }
}

.login-box {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 48px 40px;
    animation: slideUp 0.6s ease;
}

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

/* 登录页公告面板：贴左边缘，登录框保持屏幕正中 */
.login-announcement-panel {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    max-width: 380px;
    width: 100%;
}

.login-announcement-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 32px 32px;
    box-shadow: var(--shadow-xl);
    color: #ffffff;
    animation: slideUp 0.6s ease;
}

[data-theme="dark"] .login-announcement-card {
    background: rgba(7, 32, 33, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.login-announcement-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    padding: 6px 14px;
    margin-bottom: 20px;
}

.login-announcement-badge svg {
    width: 16px;
    height: 16px;
}

.login-announcement-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 14px;
}

.login-announcement-content {
    font-size: 0.98rem;
    line-height: 1.8;
    opacity: 0.9;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 260px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.login-announcement-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.82rem;
    opacity: 0.75;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

@media (max-width: 1280px) {
    .login-announcement-panel {
        display: none;
    }
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.logo-icon {
    width: 56px;
    height: 56px;
    color: var(--primary);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.logo-wrapper h1 {
    font-family: 'Noto Serif SC', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.05em;
}

.login-tagline {
    color: var(--text-muted);
    font-size: 0.95rem;
    letter-spacing: 0.1em;
}

.login-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

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

.tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.tab-icon {
    width: 18px;
    height: 18px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form .form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-form .form-group label svg {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

.auth-form .form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all var(--transition-base);
    background: var(--bg-input);
    color: var(--text-primary);
    -webkit-appearance: none;
    appearance: none;
}

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

.auth-form .form-group input::placeholder {
    color: var(--text-muted);
}

.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--text-primary);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.remember-me label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
}

.error-message {
    padding: 12px 16px;
    background: #fef2f2;
    color: #dc2626;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 16px;
    border-left: 3px solid #dc2626;
}

[data-theme="dark"] .error-message {
    background: rgba(220, 38, 38, 0.15);
    color: #f87171;
    border-left-color: #f87171;
}

.banned-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fca5a5;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    animation: bannedShake 0.5s ease-in-out;
}

[data-theme="dark"] .banned-notice {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15) 0%, rgba(220, 38, 38, 0.2) 100%);
    border-color: rgba(248, 113, 113, 0.3);
}

@keyframes bannedShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-2px); }
    80% { transform: translateX(2px); }
}

.banned-notice svg {
    width: 24px;
    height: 24px;
    color: #dc2626;
    flex-shrink: 0;
    margin-top: 2px;
}

.banned-notice-content {
    flex: 1;
}

.banned-notice-title {
    font-weight: 600;
    color: #991b1b;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.banned-notice-message {
    font-size: 0.85rem;
    color: #b91c1c;
    line-height: 1.5;
}

.banned-notice-reason {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #fca5a5;
    font-size: 0.82rem;
    line-height: 1.5;
}

.banned-reason-label {
    color: #991b1b;
    font-weight: 600;
}

.banned-reason-text {
    color: #b91c1c;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary svg {
    width: 18px;
    height: 18px;
}

.forgot-password-link {
    text-align: center;
    margin-top: 16px;
}

.link-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.link-btn:hover {
    color: var(--primary-dark);
    background: var(--bg-tertiary);
}

.reset-hint {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 20px;
    text-align: center;
}

.back-to-login {
    text-align: center;
    margin-top: 16px;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    color: var(--primary);
}

.brand-text h1 {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.brand-tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    overflow: hidden;
    flex-shrink: 0;
}

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

.user-avatar svg {
    width: 20px;
    height: 20px;
}

.username {
    font-weight: 500;
    color: var(--text-primary);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-logout:hover {
    background: #fee2e2;
    color: #dc2626;
}

.btn-logout svg {
    width: 16px;
    height: 16px;
}

.main-content {
    flex: 1;
    display: flex;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    padding: 24px 32px;
    gap: 24px;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.section-header svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.section-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.birthday-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 280px;
    overflow-y: auto;
}

.birthday-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.birthday-item:hover {
    background: #ecfdf5;
    transform: translateX(4px);
}

.birthday-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    overflow: hidden;
}

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

.birthday-info {
    flex: 1;
}

.birthday-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.birthday-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.birthday-countdown {
    padding: 4px 10px;
    background: var(--accent);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.empty-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 20px 0;
}

.stats-panel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-card.gender-male .stat-number {
    color: #3b82f6;
}

.stat-card.gender-female .stat-number {
    color: #ec4899;
}

.stat-card.upcoming-birthday .stat-number {
    color: var(--accent);
}

.gender-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chart-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-bar .bar-label {
    width: 24px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.chart-bar .bar-fill {
    flex: 1;
    height: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.chart-bar .bar-fill::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--percentage);
    border-radius: 6px;
    transition: width 0.8s ease;
}

.chart-bar.male .bar-fill::after {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.chart-bar.female .bar-fill::after {
    background: linear-gradient(90deg, #ec4899, #f472b6);
}

.content-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.search-wrapper {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-wrapper svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.search-wrapper input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    background: var(--bg-card);
    transition: all var(--transition-base);
}

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

.filter-group {
    display: flex;
    gap: 10px;
}

.filter-select {
    padding: 12px 16px 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background: var(--bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 16px center;
    background-size: 12px 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    min-width: 120px;
    -webkit-appearance: none;
    appearance: none;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.toolbar-right {
    display: flex;
    gap: 10px;
}

.btn-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-toolbar:hover {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-md);
}

.btn-toolbar svg {
    width: 18px;
    height: 18px;
}

.btn-toolbar.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
}

.btn-toolbar.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
}

.student-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    color: var(--text-muted);
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.student-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    cursor: pointer;
    animation: fadeInUp 0.4s ease;
}

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

.student-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    position: relative;
    height: 120px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    overflow: hidden;
}

.card-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%);
}

.card-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    background-image: 
        radial-gradient(circle, white 1px, transparent 1px);
    background-size: 20px 20px;
}

.card-avatar {
    position: absolute;
    bottom: -40px;
    left: 20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-card);
    padding: 4px;
    box-shadow: var(--shadow-lg);
}

.card-avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    font-weight: 600;
    overflow: hidden;
}

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

.card-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.badge-male {
    background: rgba(59, 130, 246, 0.9);
    color: white;
}

.badge-female {
    background: rgba(236, 72, 153, 0.9);
    color: white;
}

.badge-birthday {
    background: rgba(245, 158, 11, 0.9);
    color: white;
    display: flex;
    align-items: center;
    gap: 4px;
}

.badge-birthday svg {
    width: 12px;
    height: 12px;
}

.card-body {
    padding: 48px 20px 20px;
}

.card-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.card-class {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.card-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    font-size: 0.85rem;
}

.card-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.card-info-item svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.card-info-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.tag {
    padding: 4px 10px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 20px;
    font-size: 0.75rem;
}

.app-footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition-base);
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
}

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

.modal-body {
    padding: 24px 28px;
    max-height: calc(90vh - 160px);
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 28px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.modal-close:hover {
    background: #fee2e2;
    color: #dc2626;
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-form {
    padding: 24px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.form-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 20px;
    margin-bottom: 16px;
}

.form-row:has(.avatar-upload) {
    display: grid;
    grid-template-columns: 140px 1fr;
}

.avatar-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid var(--border);
    transition: all var(--transition-base);
}

.avatar-preview:hover {
    border-color: var(--primary);
}

.avatar-preview svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
}

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

.btn-upload {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-upload:hover {
    background: var(--primary);
    color: white;
}

.btn-upload svg {
    width: 16px;
    height: 16px;
}

.form-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-form .form-group {
    margin-bottom: 16px;
}

.modal-form .form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.required {
    color: #dc2626;
}

.modal-form .form-group input:not([type="checkbox"]):not([type="radio"]),
.modal-form .form-group select,
.modal-form .form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    transition: all var(--transition-base);
    background: var(--bg-card);
}

.modal-form .form-group input:not([type="checkbox"]):not([type="radio"]):focus,
.modal-form .form-group select:focus,
.modal-form .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.1);
}

.modal-form .form-group input[type="checkbox"],
.modal-form .form-group input[type="radio"] {
    width: 18px;
    height: 18px;
    padding: 0;
    margin-right: 8px;
    accent-color: var(--primary);
    cursor: pointer;
}

.modal-form .form-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
}

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

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    margin-top: 20px;
}

.footer-right {
    display: flex;
    gap: 10px;
}

.btn-secondary {
    padding: 12px 24px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

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

.btn-danger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    background: #fef2f2;
    color: #dc2626;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-danger:hover {
    background: #fee2e2;
}

.btn-danger svg {
    width: 16px;
    height: 16px;
}

.export-modal .modal-content {
    max-width: 480px;
}

.export-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 24px;
}

.export-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px 24px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
}

.export-option:hover {
    border-color: var(--primary);
    background: #ecfdf5;
}

.export-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    color: var(--primary);
}

.export-icon svg {
    width: 28px;
    height: 28px;
}

.export-title {
    font-weight: 600;
    color: var(--text-primary);
}

.export-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.import-area {
    padding: 24px;
}

.import-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 24px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-base);
}

.import-drop-zone.drag-over {
    border-color: var(--primary);
    background: #ecfdf5;
}

.import-drop-zone svg {
    width: 48px;
    height: 48px;
    color: var(--primary);
}

.import-drop-zone p {
    color: var(--text-muted);
    margin: 0;
}

.import-preview {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.import-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.import-record-count {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
}

.import-preview-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.import-preview-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.import-preview-name {
    font-weight: 500;
    color: var(--text-primary);
}

.import-preview-info {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.import-preview-more {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 8px;
}

.import-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.import-error {
    padding: 12px 16px;
    background: #fef2f2;
    color: #dc2626;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--text-primary);
    color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

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

.toast.success {
    background: #059669;
}

.toast.error {
    background: #dc2626;
}

.toast.disabled-toast {
    background: #f59e0b;
    font-weight: 500;
}

.toast.info {
    background: var(--primary);
}

.toast.warning {
    background: #f59e0b;
    color: white;
}

[data-theme="dark"] .toast {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.6), 0 4px 6px -4px rgba(0,0,0,0.5);
}

[data-theme="dark"] .toast.info {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

[data-theme="dark"] .toast.success {
    background: #10b981;
    color: white;
}

[data-theme="dark"] .toast.error {
    background: #ef4444;
    color: white;
}

[data-theme="dark"] .toast.disabled-toast {
    background: #f59e0b;
    color: white;
}

[data-theme="dark"] .toast.warning {
    background: #f59e0b;
    color: white;
}

@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
        padding: 16px;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
    }

    .sidebar-section {
        min-width: 280px;
    }

    .birthday-list {
        flex-direction: row;
        overflow-x: auto;
        max-height: none;
    }

    .birthday-item {
        flex-direction: column;
        text-align: center;
        min-width: 100px;
    }

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

    .app-header {
        padding: 12px 20px;
    }

    .view-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .chat-layout {
        height: calc(100vh - 220px);
    }

    .chat-sidebar {
        width: 200px;
    }

    .chat-room-header {
        flex-wrap: wrap;
    }

    .chat-header-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 12px 16px;
    }
    
    .brand-tagline {
        display: none;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-left {
        flex-direction: column;
    }
    
    .search-wrapper {
        max-width: none;
    }
    
    .filter-group {
        flex-wrap: wrap;
    }
    
    .toolbar-right {
        justify-content: flex-end;
    }
    
    .student-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-row-inner {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .export-options {
        grid-template-columns: 1fr;
    }
}

/* ==================== 导航 Tab ==================== */
.view-tabs {
    display: flex;
    gap: 4px;
    padding: 0 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.view-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.view-tab svg {
    width: 20px;
    height: 20px;
}

.view-tab:hover {
    color: var(--primary);
    background: var(--bg-secondary);
}

.view-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* ==================== 聊天室 ==================== */
.chat-layout {
    display: flex;
    gap: 0;
    flex: 1;
    width: 100%;
    height: calc(100vh - 200px);
    min-height: 500px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.chat-sidebar {
    width: 240px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    overflow: hidden;
    min-height: 0;
}

.chat-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-room-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 8px;
    min-height: 120px;
}

.chat-room-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s ease;
    color: var(--text-secondary);
    font-size: 14px;
}

.chat-room-item:hover {
    background: var(--border-light);
}

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

.chat-room-item .room-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.chat-online-users {
    border-top: 1px solid var(--border);
    padding: 12px 8px;
    max-height: 200px;
    overflow-y: auto;
}

.chat-online-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px 8px;
}

.chat-online-header h4 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.online-count {
    font-size: 0.8rem;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.online-users-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.online-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.online-user-item:hover {
    background: var(--border-light);
}

.online-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-online {
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.status-offline {
    background: #9ca3af;
}

.online-username {
    color: var(--text-primary);
    font-size: 0.85rem;
}

.role-badge {
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.role-badge-admin {
    background: #fef3c7;
    color: #92400e;
}

.role-badge-super {
    background: #fee2e2;
    color: #991b1b;
}

.online-last-active {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.online-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 16px 0;
}

.online-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

.online-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.online-page-header h2 {
    font-size: 1.5rem;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.online-page-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.online-stats {
    display: flex;
    gap: 16px;
}

.online-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 24px;
    text-align: center;
    min-width: 100px;
}

.online-stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.online-stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

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

.online-filter-group {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
}

.online-filter-btn {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.online-filter-btn:hover {
    background: var(--bg-hover);
}

.online-filter-btn.active {
    background: var(--primary);
    color: white;
}

.online-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.online-search-wrapper svg {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.online-search-wrapper input {
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 240px;
    outline: none;
    transition: border-color 0.2s;
}

.online-search-wrapper input:focus {
    border-color: var(--primary);
}

.global-online-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.global-online-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.global-online-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.global-online-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.global-online-avatar svg {
    width: 22px;
    height: 22px;
    color: var(--text-muted);
}

.global-online-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.global-online-status-dot.online {
    background: #22c55e;
}

.global-online-status-dot.offline {
    background: #9ca3af;
}

.global-online-info {
    flex: 1;
    min-width: 0;
}

.global-online-username {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.global-online-rooms {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-online-last-active {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.chat-room-item.active .room-icon {
    background: rgba(255,255,255,0.3);
}

.chat-room-item .room-info {
    flex: 1;
    min-width: 0;
}

.chat-room-item .room-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-room-item .room-meta {
    font-size: 12px;
    opacity: 0.7;
}

.chat-room-item .room-delete-btn {
    opacity: 0;
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: opacity 0.2s;
}

.chat-room-item:hover .room-delete-btn {
    opacity: 0.7;
}

.chat-room-item .room-delete-btn:hover {
    opacity: 1;
    background: rgba(239,68,68,0.1);
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-room-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.chat-room-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chat-room-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.chat-search-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    gap: 8px;
    border: 1px solid var(--border);
}

.chat-search-wrapper svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.chat-search-wrapper input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    width: 150px;
    color: var(--text-primary);
}

.chat-search-wrapper input::placeholder {
    color: var(--text-muted);
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-announcement {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: var(--radius-md);
    border-left: 4px solid #f59e0b;
    margin-bottom: 8px;
}

.chat-announcement svg {
    width: 18px;
    height: 18px;
    color: #d97706;
    flex-shrink: 0;
    margin-top: 2px;
}

.chat-announcement span {
    font-size: 13px;
    color: #92400e;
    line-height: 1.5;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-secondary);
}

.chat-msg {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    word-break: break-word;
}

.chat-msg.own {
    align-self: flex-end;
    background: var(--primary);
    color: white;
}

.chat-msg.own .chat-msg-author {
    color: rgba(255,255,255,0.85);
}

.chat-msg.own .chat-msg-time {
    color: rgba(255,255,255,0.6);
}

.chat-msg-author {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
}

.chat-msg-content {
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.chat-msg-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: right;
}

.chat-msg-actions {
    margin-top: 4px;
    text-align: right;
}

.chat-msg-delete {
    font-size: 11px;
    background: none;
    border: none;
    color: rgba(239,68,68,0.7);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.chat-msg-delete:hover {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
}

.chat-msg-copy-id {
    font-size: 11px;
    background: none;
    border: none;
    color: rgba(59,130,246,0.7);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 4px;
}

.chat-msg-copy-id:hover {
    background: rgba(59,130,246,0.1);
    color: #3b82f6;
}

.chat-msg.own .chat-msg-delete {
    color: rgba(255,255,255,0.6);
}

.chat-msg.own .chat-msg-delete:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

.chat-msg.own .chat-msg-copy-id {
    color: rgba(255,255,255,0.6);
}

.chat-msg.own .chat-msg-copy-id:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

.chat-input-area {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.chat-input-area input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input-area input:focus {
    border-color: var(--primary);
}

.btn-send {
    padding: 10px 18px;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--primary-dark);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

.btn-leave-room {
    background: #ef4444;
}

.btn-leave-room:hover {
    background: #dc2626;
}

/* ==================== 加密工具（大声密谋） ==================== */
.cipher-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
}

.cipher-header {
    text-align: center;
    margin-bottom: 24px;
}

.cipher-header h2 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 8px;
}

.cipher-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.cipher-settings {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.cipher-setting-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cipher-setting-row label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.cipher-setting-row input,
.cipher-setting-row select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.cipher-setting-row input:focus,
.cipher-setting-row select:focus {
    border-color: var(--primary);
}

.cipher-checkbox-row {
    flex-direction: row;
    align-items: center;
    gap: 20px;
    grid-column: 1 / -1;
}

.cipher-checkbox-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    cursor: pointer;
}

.cipher-key-area {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.cipher-key-area label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.cipher-key-area input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.cipher-key-area input:focus {
    border-color: var(--primary);
}

.cipher-ecc-section {
    margin-bottom: 16px;
}

.cipher-ecc-section:last-child {
    margin-bottom: 0;
}

.cipher-ecc-keys {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 12px;
}

.cipher-ecc-keys input {
    flex: 1;
}

.cipher-ecc-keys .btn-icon {
    flex-shrink: 0;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.cipher-ecc-keys .btn-icon:hover {
    background: var(--border);
}

.cipher-ecc-keys .btn-download-key {
    background: var(--primary);
    color: white;
}

.cipher-ecc-keys .btn-download-key:hover {
    background: var(--primary-dark);
}

.cipher-key-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.cipher-key-input-row input {
    flex: 1;
}

.cipher-key-input-row .btn-upload-key {
    flex-shrink: 0;
    background: var(--primary);
    color: white;
}

.cipher-key-input-row .btn-upload-key:hover {
    background: var(--primary-dark);
}

.cipher-key-input-row .btn-use-key {
    flex-shrink: 0;
    background: #6366f1;
    color: white;
}

.cipher-key-input-row .btn-use-key:hover {
    background: #4f46e5;
}

.cipher-textarea-group {
    margin-bottom: 16px;
}

.cipher-textarea-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.cipher-char-count {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

.cipher-textarea-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    resize: vertical;
    box-sizing: border-box;
}

.cipher-textarea-group textarea:focus {
    border-color: var(--primary);
}

.cipher-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 16px;
}

.cipher-buttons button {
    min-width: 100px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

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

@media (max-width: 768px) {
    .view-tabs {
        padding: 0 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .view-tab {
        padding: 10px 12px;
        font-size: 13px;
        white-space: nowrap;
    }

    .view-tab svg {
        width: 18px;
        height: 18px;
    }

    .app-header {
        padding: 10px 12px;
    }

    .brand-icon {
        width: 32px;
        height: 32px;
    }

    .brand-text h1 {
        font-size: 1.2rem;
    }

    .brand-tagline {
        display: none;
    }

    .main-content {
        padding: 12px;
        gap: 12px;
    }

    .chat-layout {
        flex-direction: column;
        height: auto;
        min-height: 400px;
    }

    .chat-sidebar {
        width: 100%;
        max-height: 300px;
        min-height: 150px;
        border-right: none;
        border-bottom: 1px solid var(--border);
        flex-shrink: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .chat-main {
        min-height: 350px;
    }

    .chat-room-header {
        flex-wrap: wrap;
        padding: 12px;
        gap: 8px;
    }

    .chat-room-header h3 {
        font-size: 15px;
    }

    .chat-header-actions {
        flex-wrap: wrap;
        gap: 6px;
    }

    .chat-search-wrapper input {
        width: 100px;
    }

    .chat-messages {
        padding: 12px;
    }

    .chat-input-area {
        padding: 10px 12px;
    }

    .chat-input-area input {
        font-size: 13px;
    }

    .btn-send {
        padding: 8px 12px;
        font-size: 13px;
    }

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

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left {
        flex-direction: column;
    }

    .search-wrapper {
        max-width: none;
    }

    .filter-group {
        flex-wrap: wrap;
    }

    .toolbar-right {
        justify-content: flex-end;
    }

    .student-grid {
        grid-template-columns: 1fr;
    }

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

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

    .modal-content {
        max-height: 95vh;
        margin: 10px;
    }

    .admin-container {
        padding: 12px;
    }

    .admin-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .admin-tabs {
        flex-wrap: wrap;
        gap: 4px;
    }

    .admin-tab {
        padding: 8px 12px;
        font-size: 13px;
    }

    .admin-table {
        font-size: 12px;
    }

    .admin-table th,
    .admin-table td {
        padding: 8px 10px;
    }

    .about-page {
        padding: 16px;
    }

    .about-header {
        margin-bottom: 24px;
    }

    .about-header h2 {
        font-size: 22px;
    }

    .about-stats {
        flex-direction: column;
        gap: 12px;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .about-card {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 8px 10px;
    }

    .brand-icon {
        width: 28px;
        height: 28px;
    }

    .brand-text h1 {
        font-size: 1rem;
    }

    .header-right {
        gap: 8px;
    }

    .view-tabs {
        padding: 0 4px;
    }

    .view-tab {
        padding: 8px 10px;
        font-size: 12px;
    }

    .view-tab span {
        display: none;
    }

    .view-tab svg {
        width: 20px;
        height: 20px;
    }

    .main-content {
        padding: 8px;
    }

    .chat-sidebar {
        max-height: 220px;
    }

    .chat-room-header {
        padding: 10px;
    }

    .chat-room-header h3 {
        font-size: 14px;
    }

    .chat-search-wrapper {
        display: none;
    }

    .chat-messages {
        padding: 8px;
    }

    .chat-msg {
        max-width: 85%;
        font-size: 13px;
    }

    .chat-input-area {
        padding: 8px 10px;
    }

    .admin-table {
        font-size: 11px;
    }

    .admin-table th,
    .admin-table td {
        padding: 6px 8px;
    }

    .modal-content {
        margin: 5px;
        padding: 0;
    }

    .modal-header {
        padding: 12px;
    }

    .modal-header h2 {
        font-size: 16px;
    }

    .modal-body {
        padding: 12px;
    }

    .modal-actions {
        padding: 0 12px 12px;
    }

    .feedback-form textarea {
        font-size: 13px;
    }

    .announcement-modal-content {
        max-width: 95vw;
        max-height: 85vh;
    }

    .announcement-modal-header,
    .announcement-modal-body,
    .announcement-modal-footer {
        padding: 12px;
    }
}

/* ==================== 管理面板 ==================== */
.admin-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px;
}

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

.admin-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.admin-header .btn-primary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
}

.admin-header .btn-primary svg {
    width: 18px;
    height: 18px;
}

.admin-table-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table thead {
    background: var(--bg-secondary);
}

.admin-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr:hover {
    background: var(--bg-secondary);
}

.admin-role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.admin-role-badge.user {
    background: #e0e7ff;
    color: #4338ca;
}

.admin-role-badge.admin {
    background: #fef3c7;
    color: #92400e;
}

.admin-role-badge.super_admin {
    background: #fee2e2;
    color: #991b1b;
}

.admin-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.admin-status-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.admin-status-badge.banned {
    background: #fecaca;
    color: #991b1b;
}

.admin-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.admin-action-btn {
    padding: 5px 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.admin-action-btn:hover {
    background: var(--bg-secondary);
}

.admin-action-btn.danger {
    color: #dc2626;
    border-color: #fecaca;
}

.admin-action-btn.danger:hover {
    background: #fee2e2;
}

.admin-action-btn.warn {
    color: #d97706;
    border-color: #fde68a;
}

.admin-action-btn.warn:hover {
    background: #fef3c7;
}

.admin-action-btn.success {
    color: #059669;
    border-color: #bbf7d0;
}

.admin-action-btn.success:hover {
    background: #d1fae5;
}

.admin-action-btn.info {
    color: #2563eb;
    border-color: #bfdbfe;
}

.admin-action-btn.info:hover {
    background: #dbeafe;
}

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

.admin-role-select {
    padding: 4px 24px 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: var(--bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 6px center;
    background-size: 10px 10px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.admin-tabs {
    display: flex;
    gap: 4px;
    margin-right: 16px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-md);
}

.admin-tab {
    padding: 6px 14px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

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

.admin-tab.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.admin-log-type {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    background: #e5e7eb;
    color: #374151;
}

.btn-undo {
    padding: 4px 12px;
    font-size: 0.8rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-undo:hover {
    background: #2563eb;
}

/* ==================== 新增管理面板样式 ==================== */

/* 通用 section 容器 */
.admin-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}

.admin-section-header {
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
}

.admin-section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.admin-section-body {
    padding: 18px;
}

.admin-section-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ==================== 权限管理 ==================== */
.perm-section {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: var(--bg-card);
}

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

.perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.perm-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: background 0.2s;
}

.perm-grid label:hover {
    background: #e5e7eb;
}

.perm-grid input[type="checkbox"] {
    accent-color: var(--primary);
    cursor: pointer;
}

.perm-requests-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.perm-request-item {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
}

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

.perm-request-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.perm-request-username {
    font-weight: 600;
    color: var(--text-primary);
}

.perm-request-type {
    font-size: 0.8rem;
    padding: 2px 8px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    border-radius: 4px;
}

.perm-request-status {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-approved {
    background: #d1fae5;
    color: #065f46;
}

.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.status-ignored {
    background: #e5e7eb;
    color: #4b5563;
}

.perm-request-perms {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.perm-request-reason {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.5;
}

.perm-request-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.perm-request-review {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: 8px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

.perm-request-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ==================== 群聊介入 ==================== */
.intervention-results {
    margin-top: 14px;
    max-height: 380px;
    overflow-y: auto;
}

.iv-room-card {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-card);
}

.iv-room-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.iv-room-card.active {
    border-color: var(--primary);
    background: rgba(13, 148, 136, 0.06);
}

.iv-room-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.iv-room-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
    align-items: center;
}

.iv-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: #e5e7eb;
    color: #374151;
}

.iv-type-public { background: #d1fae5; color: #065f46; }
.iv-type-password_protected { background: #fef3c7; color: #92400e; }
.iv-type-invite_only { background: #ede9fe; color: #5b21b6; }

.intervention-actions {
    margin-top: 16px;
    padding: 14px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: var(--border-light);
}

.intervention-actions h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: var(--text-primary);
}

.intervention-btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-toolbar {
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-toolbar:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-danger {
    padding: 10px 16px;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #b91c1c;
}

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

/* 介入消息列表 */
.iv-msg-list, .iv-mem-list {
    max-height: 60vh;
    overflow-y: auto;
    padding: 4px;
}

.iv-msg-item {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
}

.iv-msg-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 12px;
}

.iv-msg-user {
    color: var(--primary);
    font-weight: 600;
}

.iv-msg-time {
    color: var(--text-muted);
}

.iv-msg-content {
    color: var(--text-primary);
    font-size: 14px;
    word-break: break-word;
}

.iv-msg-delete {
    font-size: 11px;
    background: none;
    border: none;
    color: rgba(239,68,68,0.7);
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
}

.iv-msg-delete:hover {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
}
.iv-msg-word-break {
    word-break: break-word;
}

/* 介入成员列表 */
.iv-mem-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

.iv-mem-name {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 100px;
}

.iv-mem-role {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: #e5e7eb;
    color: #374151;
}

.iv-mem-role.super_admin { background: #fee2e2; color: #991b1b; }
.iv-mem-role.admin { background: #fef3c7; color: #92400e; }

.iv-mem-active {
    color: var(--text-muted);
    margin-left: auto;
    font-size: 12px;
}

/* ==================== 背景设置 ==================== */
.backgrounds-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.bg-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
}

.bg-thumb {
    width: 100%;
    height: 100px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
}

.bg-thumb:hover {
    transform: scale(1.04);
}

.bg-info {
    padding: 8px 10px;
    flex: 1;
}

.bg-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bg-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.bg-item .btn-danger {
    margin: 8px 10px 10px;
}

/* 宽模态框 */
.modal-content-wide {
    max-width: 720px;
    width: 90%;
}

/* 用户AI配置弹窗 - 加宽 */
#userAIConfigModal .modal-content {
    max-width: 720px;
    width: 90%;
}

/* AI 配置下拉框宽度 */
.ai-admin-config-form select.form-input {
    width: 100%;
    min-width: 0;
}

/* 房间列表类型徽章 */
.chat-room-item .room-meta .iv-badge {
    margin-right: 6px;
}

/* 全局背景层 */
#global-bg-layer {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

/* 房间类型图标 */
.room-name {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 表单行（用于新管理面板） */
.admin-section-body .form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
    grid-template-columns: none;
}

.admin-section-body .form-row .form-group {
    flex: 1;
    min-width: 160px;
}

.admin-section-body .form-row input[type="file"] {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    min-width: 200px;
}

.settings-page {
    flex: 1;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 24px;
}

.settings-header {
    margin-bottom: 24px;
}

.settings-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.settings-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.settings-sections {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.settings-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    flex-shrink: 0;
}

.settings-card-icon svg {
    width: 20px;
    height: 20px;
}

.settings-card-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 2px 0;
    color: var(--text-primary);
}

.settings-card-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.settings-card-body {
    padding: 20px;
}

.settings-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 8px 0 20px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.settings-avatar-preview {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid var(--border-color);
    transition: border-color var(--transition-base);
    flex-shrink: 0;
}

.settings-avatar-preview:hover {
    border-color: var(--primary-color);
}

.settings-avatar-preview svg {
    width: 40px;
    height: 40px;
    color: var(--text-muted);
}

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

.settings-avatar-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.settings-avatar-upload-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.settings-avatar-upload-btn svg {
    width: 16px;
    height: 16px;
}

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

.settings-info-row + .settings-info-row {
    border-top: 1px solid var(--border-color);
}

.settings-info-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.settings-info-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.settings-form-group {
    margin-bottom: 16px;
}

.settings-form-group:last-of-type {
    margin-bottom: 20px;
}

.settings-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.settings-form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

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

.settings-btn-primary {
    width: 100%;
    padding: 10px 16px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.settings-btn-primary:hover {
    opacity: 0.9;
}

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

.theme-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.theme-option {
    cursor: pointer;
    border-radius: 12px;
    padding: 8px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

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

.theme-option.active {
    border-color: var(--primary-color);
}

.theme-preview {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.theme-preview-bar {
    height: 24px;
    background: var(--primary-color);
}

.theme-preview-content {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.theme-preview-card {
    height: 12px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.06);
}

.theme-preview-dark .theme-preview-card {
    background: rgba(255, 255, 255, 0.1);
}

.theme-preview-light {
    background: #ffffff;
}

.theme-preview-light .theme-preview-content {
    background: #fafaf9;
}

.theme-preview-dark {
    background: #1c1917;
}

.theme-preview-dark .theme-preview-content {
    background: #292524;
}

.theme-preview-dark .theme-preview-card {
    background: rgba(255, 255, 255, 0.08);
}

.theme-preview-auto {
    position: relative;
    background: linear-gradient(90deg, #ffffff 50%, #1c1917 50%);
}

.theme-preview-auto .theme-preview-content {
    background: linear-gradient(90deg, #fafaf9 50%, #292524 50%);
}

.theme-preview-auto .theme-preview-card {
    background: linear-gradient(90deg, rgba(0,0,0,0.06) 50%, rgba(255,255,255,0.08) 50%);
}

.theme-option-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.settings-danger .settings-card-icon {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.settings-btn-danger {
    width: 100%;
    padding: 10px 16px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.settings-btn-danger:hover {
    opacity: 0.9;
}

@media (max-width: 640px) {
    .settings-page {
        padding: 16px;
    }
    .settings-card-header {
        padding: 16px;
    }
    .settings-card-body {
        padding: 16px;
    }
}

.about-page {
    flex: 1;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 8px 4px 32px;
}

.about-header {
    text-align: center;
    margin-bottom: 40px;
}

.about-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    color: var(--primary-color);
}

.about-logo svg {
    width: 100%;
    height: 100%;
}

.about-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.about-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.about-version {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
}

.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.about-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.about-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: rgba(var(--primary-color), 0.1);
    color: var(--primary-color);
    margin-bottom: 16px;
}

.about-card-icon svg {
    width: 24px;
    height: 24px;
}

.about-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.about-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 版本更新管理面板（管理Tab页） */
.version-display {
    margin-top: 8px;
}

.version-current {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

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

.version-number {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

.version-changelog {
    margin-bottom: 12px;
}

.version-changelog-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.version-changelog-body {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.8;
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.version-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 10px;
}

/* ==================== 网盘 ==================== */
.netdisk-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}
.netdisk-header,
.share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.netdisk-header h2,
.share-header h2 {
    margin: 0;
    font-size: 22px;
}
.netdisk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.netdisk-pathbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    min-height: 36px;
}
.netdisk-pathbar .crumb {
    cursor: pointer;
    color: var(--accent, #3b82f6);
    padding: 2px 4px;
    border-radius: 4px;
}
.netdisk-pathbar .crumb:hover {
    background: var(--bg-secondary);
}
.netdisk-pathbar .sep {
    color: var(--text-muted);
}
.netdisk-list {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}
.netdisk-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s;
}
.netdisk-item:last-child {
    border-bottom: none;
}
.netdisk-item:hover {
    background: var(--bg-secondary);
}
.netdisk-item.deselected {
    opacity: 0.5;
}
.netdisk-item .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text-secondary);
}
.netdisk-item.folder .icon {
    color: #eab308;
}
.netdisk-item .name {
    flex: 1;
    font-size: 14px;
    word-break: break-all;
}
.netdisk-item .meta {
    color: var(--text-muted);
    font-size: 12px;
    flex-shrink: 0;
}
.netdisk-item .ops {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.netdisk-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}
.netdisk-status {
    margin-top: 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    min-height: 18px;
}
.item-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
}
.item-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent, #3b82f6);
    color: var(--accent, #3b82f6);
}
.share-sub {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 16px;
}
.share-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
}
.load-entry {
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.7;
}
.share-item .share-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    word-break: break-all;
}
.share-item .share-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.share-item .share-code {
    font-family: var(--font-mono, monospace);
    color: var(--accent, #3b82f6);
}
.share-item .ops {
    display: flex;
    gap: 8px;
}
.share-picker-title {
    font-size: 13px;
    color: var(--text-muted);
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
}
#share-picker .netdisk-item.selected {
    background: var(--accent-soft, rgba(59,130,246,0.1));
}

.about-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.about-list li {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
}

.about-list li:last-child {
    border-bottom: none;
}

.about-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 20px;
}

.about-stat-item {
    text-align: center;
}

.about-stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.about-stat-value {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.about-changelog-section {
    margin-bottom: 40px;
}

.about-changelog-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    max-width: 900px;
    margin: 0 auto;
}

.about-changelog-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.about-changelog-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: rgba(var(--primary-color), 0.1);
    color: var(--primary-color);
    flex-shrink: 0;
}

.about-changelog-icon svg {
    width: 24px;
    height: 24px;
}

.about-changelog-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.about-changelog-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.about-changelog-body {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.8;
    background: var(--bg-secondary);
    padding: 20px 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.about-changelog-empty {
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
    padding: 16px;
}

.about-changelog-meta {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
}

.feedback-form {
    margin-top: 12px;
}

.feedback-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
}

.feedback-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.feedback-form button {
    margin-top: 12px;
    width: 100%;
}

.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feedback-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border);
}

.feedback-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.feedback-username {
    font-weight: 600;
    color: var(--text-primary);
}

.feedback-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

.feedback-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.feedback-reply {
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 12px;
    border-left: 3px solid var(--primary);
}

.feedback-reply-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.feedback-reply-by {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}

.feedback-reply-time {
    font-size: 12px;
    color: var(--text-muted);
}

.feedback-reply-content {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

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

.announcements-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.announcement-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border);
}

.announcement-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.announcement-header h4 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}

.announcement-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.announcement-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

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

.announcement-item .badge {
    font-size: 11px;
    padding: 2px 8px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    border-radius: var(--radius-sm);
}

.announcement-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.announcement-modal.hidden {
    display: none;
}

.announcement-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.announcement-modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.announcement-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.announcement-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.announcement-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.announcement-modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.announcement-modal-body {
    padding: 20px;
}

.announcement-modal-body p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.announcement-modal-meta {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.announcement-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    justify-content: flex-end;
}

.chat-private-header {
    padding: 12px 16px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.private-chat-list {
    padding: 0 0 8px 0;
    flex-shrink: 0;
    max-height: 200px;
    overflow-y: auto;
}

.private-chat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    font-size: 14px;
}

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

.private-empty {
    padding: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* ==================== 深色模式适配 ==================== */
[data-theme="dark"] .admin-role-badge.user {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

[data-theme="dark"] .admin-role-badge.admin {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

[data-theme="dark"] .admin-role-badge.super_admin {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

[data-theme="dark"] .admin-status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

[data-theme="dark"] .admin-status-badge.banned {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

[data-theme="dark"] .admin-action-btn.danger {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
}

[data-theme="dark"] .admin-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

[data-theme="dark"] .admin-action-btn.warn {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.3);
}

[data-theme="dark"] .admin-action-btn.warn:hover {
    background: rgba(251, 191, 36, 0.1);
}

[data-theme="dark"] .admin-action-btn.success {
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.3);
}

[data-theme="dark"] .admin-action-btn.success:hover {
    background: rgba(16, 185, 129, 0.1);
}

[data-theme="dark"] .admin-action-btn.info {
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.3);
}

[data-theme="dark"] .admin-action-btn.info:hover {
    background: rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .admin-log-type {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
}

[data-theme="dark"] .btn-undo {
    background: #3b82f6;
    color: white;
}

[data-theme="dark"] .btn-undo:hover {
    background: #2563eb;
}

[data-theme="dark"] .iv-mem-role {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
}

[data-theme="dark"] .iv-mem-role.super_admin {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

[data-theme="dark"] .iv-mem-role.admin {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

[data-theme="dark"] .cipher-setting-row input,
[data-theme="dark"] .cipher-setting-row select,
[data-theme="dark"] .cipher-key-area input,
[data-theme="dark"] .cipher-textarea-group textarea {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] input[type="checkbox"] {
    background: var(--bg-input);
    border-color: var(--border);
}

[data-theme="dark"] input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

/* ==================== 深色模式补全：在线列表角色徽章 ==================== */
[data-theme="dark"] .role-badge-admin {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

[data-theme="dark"] .role-badge-super {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* ==================== 深色模式补全：房间类型徽章 ==================== */
[data-theme="dark"] .iv-type-public {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

[data-theme="dark"] .iv-type-password_protected {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

[data-theme="dark"] .iv-type-invite_only {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

/* ==================== 深色模式补全：代码块/预览文本 ==================== */
[data-theme="dark"] .ai-message-content pre,
[data-theme="dark"] .ai-message-content code {
    background: rgba(0, 0, 0, 0.3);
    color: #e5e7eb;
}

[data-theme="dark"] .ai-error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

/* ==================== 深色模式补全：导入错误提示 ==================== */
[data-theme="dark"] .import-error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-left-color: #f87171;
}

/* ==================== 深色模式补全：select 下拉选项 ==================== */
[data-theme="dark"] select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* ==================== 深色模式补全：日期/数字输入框占位符 ==================== */
[data-theme="dark"] input[type="date"]::-webkit-datetime-edit,
[data-theme="dark"] input[type="time"]::-webkit-datetime-edit {
    color: var(--text-primary);
}

[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-text,
[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-year-field,
[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-month-field,
[data-theme="dark"] input[type="date"]::-webkit-datetime-edit-day-field {
    color: var(--text-primary);
}

/* ==================== AI 管理面板 ==================== */
.ai-admin-config-form {
    max-width: 600px;
}

.ai-admin-config-form .form-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 16px;
    margin-bottom: 16px;
    align-items: center;
}

.ai-admin-config-form .form-row label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.ai-admin-config-form .form-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
}

.ai-admin-config-form .form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

[data-theme="dark"] .ai-admin-config-form .form-input {
    background: var(--bg-card);
}

/* ==================== AI 助手 ==================== */
.ai-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.ai-header {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.ai-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.ai-config-bar {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.ai-config-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ai-config-item label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.ai-config-item input,
.ai-config-item select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    background: var(--bg-card);
    color: var(--text-primary);
    min-width: 200px;
}

.ai-config-item input:focus,
.ai-config-item select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.ai-chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.ai-messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-welcome {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.ai-welcome-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: var(--primary);
}

.ai-welcome h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.ai-welcome p {
    font-size: 0.9rem;
    line-height: 1.6;
}

.ai-message {
    display: flex;
    gap: 12px;
    max-width: 100%;
}

.ai-message.user {
    flex-direction: row-reverse;
}

.ai-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
}

.ai-message.user .ai-message-avatar {
    background: var(--primary);
    color: white;
}

.ai-message.assistant .ai-message-avatar {
    background: var(--bg-hover);
    color: var(--primary);
    border: 1px solid var(--border);
}

.ai-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    line-height: 1.6;
    word-wrap: break-word;
}

.ai-message.user .ai-message-content {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message.assistant .ai-message-content {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.ai-message-content pre {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 8px 0;
    font-size: 0.85rem;
}

.ai-message-content code {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: monospace;
}

.ai-message-content pre code {
    background: none;
    padding: 0;
}

.ai-message-content p {
    margin: 0 0 8px;
}

.ai-message-content p:last-child {
    margin-bottom: 0;
}

.ai-input-area {
    padding: 12px 0 20px;
    border-top: 1px solid var(--border);
}

.ai-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 8px 12px;
}

.ai-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.ai-input-wrapper textarea {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    font-size: 0.9rem;
    line-height: 1.5;
    max-height: 120px;
    min-height: 24px;
    padding: 4px 0;
    color: var(--text-primary);
    font-family: inherit;
}

.ai-input-wrapper textarea::placeholder {
    color: var(--text-muted);
}

.ai-send-btn,
.ai-stop-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.ai-send-btn {
    background: var(--primary);
    color: white;
}

.ai-send-btn:hover {
    background: var(--primary-dark);
}

.ai-stop-btn {
    background: #ef4444;
    color: white;
}

.ai-stop-btn:hover {
    background: #dc2626;
}

.ai-send-btn svg,
.ai-stop-btn svg {
    width: 18px;
    height: 18px;
}

.ai-input-hint {
    display: flex;
    justify-content: space-between;
    padding: 6px 12px 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-status.loading::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: ai-spin 0.8s linear infinite;
}

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

.ai-error {
    color: #ef4444;
    font-size: 0.85rem;
    padding: 8px 12px;
    background: #fef2f2;
    border-radius: var(--radius-md);
    margin: 8px 0;
}

[data-theme="dark"] .ai-error {
    background: rgba(239, 68, 68, 0.1);
}

@media (max-width: 768px) {
    .ai-container {
        padding: 0 12px;
        height: calc(100vh - 100px);
    }

    .ai-config-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .ai-config-item input,
    .ai-config-item select {
        min-width: auto;
        width: 100%;
    }

    .ai-message-content {
        max-width: 90%;
    }
}

/* ==================== 意见反馈独立页 ==================== */
.feedback-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 16px;
}

.feedback-page-header {
    margin-bottom: 32px;
}

.feedback-page-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.feedback-page-header p {
    font-size: 14px;
    color: var(--text-muted);
}

.feedback-page-body {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.feedback-submit-section h3,
.feedback-history-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.feedback-submit-section .feedback-form button {
    width: auto;
    padding: 10px 24px;
}