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

:root {
    /* 主色调 */
    --primary: #667eea;
    --primary-dark: #5568d3;
    --primary-light: #7c8ff0;
    --secondary: #764ba2;
    --secondary-dark: #6a3a8f;
    
    /* 功能色 */
    --success: #10b981;
    --success-dark: #059669;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --info: #3b82f6;
    --info-dark: #2563eb;
    
    /* 中性色 */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* 过渡 */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 200ms ease-in-out;
    --transition-slow: 300ms ease-in-out;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: var(--spacing-md);
    color: var(--gray-800);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    /* 让侧边栏和主内容在桌面端并排显示 */
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-lg);
}

.header {
    background: white;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header h1 {
    color: var(--gray-800);
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.user-badge {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

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

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: translateY(1px);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--danger-dark) 0%, var(--danger) 100%);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-dark) 100%);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, var(--warning-dark) 0%, var(--warning) 100%);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-info {
    background: linear-gradient(135deg, var(--info) 0%, var(--info-dark) 100%);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, var(--info-dark) 0%, var(--info) 100%);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--success-dark) 0%, var(--success) 100%);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--gray-600) 0%, var(--gray-700) 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--gray-700) 0%, var(--gray-600) 100%);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 登录页面 */
.login-container {
    max-width: 440px;
    margin: 80px auto;
    background: white;
    padding: var(--spacing-2xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUp 0.5s ease-out;
}

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

.login-container h2 {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    color: var(--gray-800);
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    color: var(--gray-700);
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all var(--transition-base);
    background: white;
    color: var(--gray-800);
    font-family: inherit;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--gray-300);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray-400);
}

.form-group small {
    display: block;
    margin-top: var(--spacing-xs);
    color: var(--gray-500);
    font-size: 12px;
}

/* 主内容区 */
.main-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.main-content.active {
    display: block;
}

/* 主内容包装容器，占据除侧边栏外的剩余宽度 */
.main-content-wrapper {
    flex: 1;
    min-width: 0; /* 防止内容把布局挤爆 */
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

/* 普通管理员菜单布局优化（更紧凑） */
.menu-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-md);
}

.menu-card {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all var(--transition-slow);
    text-align: center;
    border: 1px solid var(--gray-100);
    position: relative;
    overflow: hidden;
}

.menu-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-slow);
}

.menu-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.menu-card:hover::before {
    transform: scaleX(1);
}

.menu-card h3 {
    color: var(--gray-800);
    margin-bottom: var(--spacing-sm);
    font-size: 20px;
    font-weight: 600;
}

.menu-card p {
    color: var(--gray-600);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* 功能页面 */
.function-page {
    display: none;
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.3s ease-out;
    border: 1px solid var(--gray-100);
}

.function-page.active {
    display: block;
}

.function-page h2 {
    color: var(--gray-800);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 3px solid;
    border-image: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%) 1;
    font-size: 26px;
    font-weight: 700;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.form-group-full {
    grid-column: 1 / -1;
}

/* Card 组件 */
.card {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    margin-bottom: var(--spacing-lg);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card h3 {
    color: var(--gray-800);
    margin-bottom: var(--spacing-md);
    font-size: 20px;
    font-weight: 600;
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--gray-100);
}

.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    font-size: 14px;
    line-height: 1.6;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border-color: var(--success);
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: var(--danger);
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-color: var(--info);
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: var(--warning);
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    margin-top: var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.table-container.virtual-scroll {
    overflow-y: auto;
}

.virtual-spacer td {
    padding: 0 !important;
    border: 0 !important;
}

tbody tr.virtual-spacer:hover {
    background: transparent;
    box-shadow: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 600px;
}

.messages-table {
    table-layout: fixed;
}

.messages-table th,
.messages-table td {
    vertical-align: top;
}

.messages-table .msg-cell-index,
.messages-table .msg-cell-select {
    text-align: center;
}

.messages-table .msg-cell-group,
.messages-table .msg-cell-user,
.messages-table .msg-cell-content {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.messages-table .messages-content-preview {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    white-space: normal;
    line-height: 1.4;
    max-height: calc(1.4em * 3);
}

.messages-table .msg-cell-actions {
    min-width: 260px;
}

.admin-actions-table {
    table-layout: fixed;
    min-width: 1060px;
}

.admin-actions-table th,
.admin-actions-table td {
    vertical-align: top;
}

.admin-actions-view-switch {
    display: inline-flex;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
}

.admin-actions-view-switch .btn {
    border: none;
    border-radius: 0;
    margin: 0;
    min-width: 68px;
    padding: 6px 12px;
}

.admin-actions-view-switch .btn + .btn {
    border-left: 1px solid #d1d5db;
}

.admin-actions-view-switch .btn.is-active {
    background: #1d4ed8;
    color: #fff;
}

.admin-actions-col-time,
.admin-actions-cell-time {
    width: 102px;
}

.admin-actions-col-target,
.admin-actions-cell-target {
    width: 150px;
}

.admin-actions-col-summary,
.admin-actions-cell-summary {
    width: 126px;
}

.admin-actions-col-reason,
.admin-actions-cell-reason {
    width: 205px;
}

.admin-actions-col-last-msg,
.admin-actions-cell-last-msg {
    width: 176px;
}

.admin-actions-col-source,
.admin-actions-cell-source {
    width: 175px;
}

.admin-actions-col-actions,
.admin-actions-cell-actions {
    width: 132px;
}

.admin-actions-table.is-comfortable {
    min-width: 1170px;
}

.admin-actions-table.is-comfortable .admin-actions-col-time,
.admin-actions-table.is-comfortable .admin-actions-cell-time {
    width: 108px;
}

.admin-actions-table.is-comfortable .admin-actions-col-target,
.admin-actions-table.is-comfortable .admin-actions-cell-target {
    width: 160px;
}

.admin-actions-table.is-comfortable .admin-actions-col-summary,
.admin-actions-table.is-comfortable .admin-actions-cell-summary {
    width: 140px;
}

.admin-actions-table.is-comfortable .admin-actions-col-reason,
.admin-actions-table.is-comfortable .admin-actions-cell-reason {
    width: 220px;
}

.admin-actions-table.is-comfortable .admin-actions-col-last-msg,
.admin-actions-table.is-comfortable .admin-actions-cell-last-msg {
    width: 190px;
}

.admin-actions-table.is-comfortable .admin-actions-col-source,
.admin-actions-table.is-comfortable .admin-actions-cell-source {
    width: 210px;
}

.admin-actions-table.is-comfortable .admin-actions-col-actions,
.admin-actions-table.is-comfortable .admin-actions-cell-actions {
    width: 142px;
}

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

.admin-actions-table.is-comfortable th,
.admin-actions-table.is-comfortable td {
    padding: 10px 12px;
}

.admin-actions-cell-time {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.admin-actions-target-wrap,
.admin-actions-source-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.admin-actions-target-main,
.admin-actions-source-main {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-actions-target-user {
    text-decoration: underline dotted;
    cursor: help;
}

.admin-actions-target-sub,
.admin-actions-source-sub {
    color: #6b7280;
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-actions-op-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.admin-actions-op-top {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    min-width: 0;
}

.admin-actions-action-chip,
.admin-actions-status-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.admin-actions-op-duration {
    color: #6b7280;
    font-size: 11px;
    line-height: 1.25;
}

.admin-actions-table.is-compact .admin-actions-source-wrap {
    gap: 2px;
}

.admin-actions-table.is-compact .admin-actions-source-sub {
    display: none;
}

.admin-actions-table.is-compact .admin-actions-target-sub {
    font-size: 10px;
}

.admin-actions-tone-danger {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

.admin-actions-tone-warning {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

.admin-actions-tone-success {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #166534;
}

.admin-actions-tone-muted {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #4b5563;
}

.admin-actions-tone-neutral {
    background: #eff6ff;
    border-color: #dbeafe;
    color: #1d4ed8;
}

.admin-actions-cell-reason,
.admin-actions-cell-last-msg,
.admin-actions-cell-source {
    max-width: 0;
    font-size: inherit;
    line-height: 1.45;
}

.admin-actions-reason-wrap {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
}

.admin-actions-reason-text {
    display: -webkit-box;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.45;
    max-height: calc(1.45em * 2);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.admin-actions-reason-wrap .btn {
    flex: 0 0 auto;
}

.admin-actions-last-msg-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    width: 100%;
}

.admin-actions-last-msg-text {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
}

.admin-actions-last-msg-time {
    color: #999;
    font-size: 11px;
    line-height: 1.2;
}

.admin-actions-last-msg-loading,
.admin-actions-last-msg-empty,
.admin-actions-last-msg-error {
    display: inline-block;
    font-size: 12px;
}

.admin-actions-last-msg-loading,
.admin-actions-last-msg-empty {
    color: #999;
}

.admin-actions-last-msg-error {
    color: #dc3545;
}

.admin-actions-row-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.admin-actions-cell-actions .btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.2;
}

.admin-actions-table.is-compact .admin-actions-action-chip,
.admin-actions-table.is-compact .admin-actions-status-chip {
    padding: 1px 6px;
    font-size: 10px;
}

.admin-actions-table.is-compact .admin-actions-op-duration {
    font-size: 10px;
}

th, td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

th {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

tbody tr {
    transition: all var(--transition-fast);
}

tbody tr:hover {
    background: var(--gray-50);
    box-shadow: var(--shadow-sm);
}

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

.action-buttons {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--gray-600);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.loading p {
    margin-top: var(--spacing-md);
    font-size: 14px;
    color: var(--gray-500);
}

.skeleton-table {
    table-layout: fixed;
}

.skeleton-table tbody tr:hover {
    background: transparent;
    box-shadow: none;
}

.skeleton-table td {
    padding: var(--spacing-md);
}

.skeleton-line {
    display: block;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        rgba(229, 231, 235, 0.75) 0%,
        rgba(243, 244, 246, 0.95) 45%,
        rgba(229, 231, 235, 0.75) 100%
    );
    background-size: 220% 100%;
    animation: skeletonShimmer 1.2s ease-in-out infinite;
}

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

.spinner {
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* 返回按钮 */
.back-btn {
    margin-bottom: var(--spacing-lg);
}

.back-btn .btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.stat-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

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

.stat-card h3 {
    font-size: clamp(28px, 3.1vw, 36px);
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    position: relative;
    z-index: 1;
}

.stat-card-groups h3 {
    font-size: clamp(26px, 2.8vw, 34px);
}

.stat-card p {
    opacity: 0.95;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    z-index: 1;
    margin: 0;
}

/* 统计表格辅助样式 */
.stats-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: var(--spacing-md);
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.stats-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #4b5563;
}

.stats-sort-select {
    padding: 6px 8px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
}

.stats-sort-order {
    padding: 6px 10px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: #f8fafc;
    font-size: 12px;
    cursor: pointer;
    color: #475569;
}

.stats-sort-order:hover {
    background: #eef2ff;
}

.group-title {
    font-weight: 600;
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-table .group-title {
    max-width: 18ch;
}

#menuDetailedStats .stats-table .group-title {
    max-width: 14ch;
}

.group-id {
    color: #666;
    font-size: 0.85em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.group-links {
    margin-top: 4px;
    margin-left: 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.82em;
    color: #666;
}

.group-links-cell {
    vertical-align: top;
    text-align: left;
    min-width: 140px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.group-links-cell .group-links {
    margin: 0;
    align-items: flex-start;
    font-size: 0.9em;
    gap: 6px;
}

.stats-table th,
.stats-table td {
    vertical-align: middle;
}

.stats-table td {
    padding-top: 10px;
    padding-bottom: 10px;
}

.stats-table-container table {
    table-layout: fixed;
}

.stats-table-compact th:nth-child(1),
.stats-table-compact td:nth-child(1) {
    width: 34%;
}

.stats-table-compact th:nth-child(2),
.stats-table-compact td:nth-child(2) {
    width: 34%;
}

.stats-table-compact th:nth-child(3),
.stats-table-compact td:nth-child(3) {
    width: 32%;
}

.stats-table-legacy th:nth-child(1),
.stats-table-legacy td:nth-child(1) {
    width: 26%;
}

.stats-table-legacy th:nth-child(2),
.stats-table-legacy td:nth-child(2) {
    width: 20%;
}

.stats-table-legacy th:nth-child(3),
.stats-table-legacy td:nth-child(3) {
    width: 14%;
}

.stats-table-legacy th:nth-child(4),
.stats-table-legacy td:nth-child(4),
.stats-table-legacy th:nth-child(5),
.stats-table-legacy td:nth-child(5) {
    width: 10%;
}

.stats-table-legacy th:nth-child(6),
.stats-table-legacy td:nth-child(6),
.stats-table-legacy th:nth-child(7),
.stats-table-legacy td:nth-child(7) {
    width: 10%;
}

.stats-table .member-count-cell {
    text-align: center;
}

.stats-table .member-count-value {
    font-weight: 600;
    font-size: 1.05em;
}

.stats-table .member-count-updated {
    font-size: 0.82em;
    color: #6b7280;
}

.stats-table .stats-number-cell {
    text-align: center;
    font-weight: 600;
    color: #1f2937;
}

.dashboard-new-groups-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    min-width: 760px;
}

.dashboard-new-groups-table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.dashboard-new-groups-table th:nth-child(1),
.dashboard-new-groups-table td:nth-child(1) {
    width: 8%;
}

.dashboard-new-groups-table th:nth-child(2),
.dashboard-new-groups-table td:nth-child(2) {
    width: 30%;
}

.dashboard-new-groups-table th:nth-child(3),
.dashboard-new-groups-table td:nth-child(3) {
    width: 12%;
}

.dashboard-new-groups-table th:nth-child(4),
.dashboard-new-groups-table td:nth-child(4) {
    width: 10%;
}

.dashboard-new-groups-table th:nth-child(5),
.dashboard-new-groups-table td:nth-child(5) {
    width: 16%;
}

.dashboard-new-groups-table th:nth-child(6),
.dashboard-new-groups-table td:nth-child(6) {
    width: 24%;
}

.dashboard-new-groups-name-cell {
    min-width: 0;
    max-width: 0;
}

.dashboard-new-groups-name-wrap {
    min-width: 0;
    max-width: 100%;
    display: flex;
    align-items: center;
}

.dashboard-new-groups-name {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.dashboard-new-groups-name-wrap .js-long-text-open {
    cursor: pointer;
}

.dashboard-new-groups-id {
    display: block;
    margin-top: 2px;
    color: #666;
    font-size: 0.82em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.group-links-empty {
    color: #999;
}

.group-link-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 0;
}

.group-link-anchor {
    color: #334155;
    text-decoration: none;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.group-link-line-invite .group-link-anchor {
    color: #475569;
    font-weight: 500;
}

.group-link-anchor:hover {
    text-decoration: underline;
}

.copy-link-button {
    border: 1px solid #d9e2f2;
    background: #ffffff;
    color: #475569;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    min-width: 50px;
    cursor: pointer;
    flex-shrink: 0;
}

.copy-link-button:hover {
    background: #edf4ff;
    border-color: #c3d6f7;
    color: #1d4ed8;
}

.group-manage-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.group-manage-link-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.group-manage-link-anchor {
    color: #334155;
    text-decoration: none;
    font-weight: 600;
}

.group-manage-link-anchor:hover {
    text-decoration: underline;
}

.group-manage-link-label {
    color: #334155;
    font-weight: 700;
}

.group-manage-copy-btn {
    border: 1px solid #d9e2f2;
    background: #ffffff;
    color: #475569;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 14px;
    cursor: pointer;
    flex-shrink: 0;
}

.group-manage-copy-btn:hover {
    background: #edf4ff;
    border-color: #c3d6f7;
    color: #1d4ed8;
}

.group-metrics-cell {
    vertical-align: top;
}

.group-metrics {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.group-metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 4px;
    border-bottom: 1px dashed #e4e9f2;
}

.group-metric-row:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.group-metric-label {
    color: #64748b;
    font-size: 0.82em;
}

.group-metric-value {
    color: #111827;
    font-weight: 700;
}

.group-metric-updated {
    color: #8b95a1;
    font-size: 0.78em;
    margin-top: 1px;
}

/* 群组选择复选框样式 */
.group-checkbox {
    cursor: pointer;
    margin-right: var(--spacing-sm);
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* 消息分页批量选择复选框 */
.msg-select,
#selectAllMessages {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    transform: scale(1.2);
}

#groupListContainer label,
#blacklistGroupListContainer label,
#whitelistGroupListContainer label,
#muteGroupListContainer label,
#deleteGroupListContainer label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--gray-200);
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
    margin: 2px 0;
}

#groupListContainer label:hover,
#blacklistGroupListContainer label:hover,
#whitelistGroupListContainer label:hover,
#muteGroupListContainer label:hover,
#deleteGroupListContainer label:hover {
    background: var(--gray-50);
    transform: translateX(4px);
}

#groupListContainer label:last-child,
#blacklistGroupListContainer label:last-child,
#whitelistGroupListContainer label:last-child,
#muteGroupListContainer label:last-child,
#deleteGroupListContainer label:last-child {
    border-bottom: none;
}

/* 权限范围提示样式 */
.permission-hint {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #90caf9;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg) var(--spacing-xl);
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.3s ease-in;
}

.permission-hint-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: background-color var(--transition-fast);
}

.permission-hint-content:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    padding: 4px;
    margin: -4px;
}

.toggle-icon {
    transition: transform var(--transition-base);
    user-select: none;
}

.group-list-detail {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 400px;
        transform: translateY(0);
    }
}

.group-list-items {
    animation: fadeIn 0.3s ease-out;
}

#groupListItems {
    max-width: 100%;
    overflow-x: hidden;
}

#groupListItems .js-permission-group-log {
    min-width: 0;
    overflow: hidden;
}

#groupListItems .js-permission-group-log > div:first-child {
    line-height: 1.35;
    word-break: break-all;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.35em * 2);
}

.permission-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    width: 100%;
}

.permission-group-card {
    padding: 12px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #d7e2f3;
    cursor: pointer;
    min-width: 0;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.permission-group-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.08);
}

.permission-group-name {
    font-weight: 600;
    margin-bottom: 6px;
    color: #1f2937;
    line-height: 1.35;
    word-break: break-all;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.35em * 2);
}

.permission-group-meta {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.45;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.permission-group-meta code {
    background: #f1f5f9;
    padding: 1px 4px;
    border-radius: 4px;
}

.permission-group-actions {
    margin-top: 10px;
    text-align: center;
}

/* 侧边栏导航样式 */
.sidebar {
    display: none;  /* 暂时隐藏侧边菜单 */
    width: 250px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-md);
    position: sticky;
    top: var(--spacing-md);
    max-height: calc(100vh - var(--spacing-md) * 2);
    /* display: flex; */
    flex-direction: column;
    transition: width var(--transition-base);
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: var(--spacing-md);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-header h3 {
    display: none;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--gray-600);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    overflow-y: auto;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--gray-700);
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    white-space: nowrap;
}

.nav-item:hover {
    background: var(--gray-100);
    color: var(--primary);
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.nav-item.active:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-lg);
}

.nav-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.nav-text {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.sidebar.collapsed .nav-text {
    display: none;
}

.nav-divider {
    height: 1px;
    background: var(--gray-200);
    margin: var(--spacing-sm) 0;
}

.sidebar.collapsed .nav-divider {
    margin: var(--spacing-xs) var(--spacing-md);
}

.permission-icon {
    font-size: 28px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.permission-text {
    flex: 1;
}

.permission-text strong {
    display: block;
    color: #1976D2;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.permission-text p {
    color: #424242;
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
}

.permission-text span {
    color: #1976D2;
    font-weight: 700;
}

/* 群组列表提示样式 */
.group-list-hint {
    animation: fadeIn 0.3s ease-in;
}

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

/* 响应式优化 */
@media (max-width: 1024px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding: var(--spacing-sm);
    }
    
    .login-container {
        margin: var(--spacing-xl) auto;
        padding: var(--spacing-xl);
    }
    
    .header {
        padding: var(--spacing-md);
    }
    
    .header h1 {
        font-size: 22px;
    }
    
    .function-page {
        padding: var(--spacing-md);
    }
    
    .menu-grid,
    .menu-grid.compact {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stats-controls {
        justify-content: flex-start;
    }

    .group-links {
        margin-left: 8px;
    }
    
    .menu-card {
        padding: var(--spacing-lg);
    }
    
    .table-container {
        font-size: 12px;
    }
    
    th, td {
        padding: var(--spacing-sm);
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .permission-group-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .group-log-toolbar {
        align-items: stretch;
    }

    .group-log-select {
        min-width: 0;
        width: 100%;
    }

    .group-log-summary-name {
        max-width: 100%;
    }

    .snapshots-range-toolbar {
        align-items: stretch;
    }

    .snapshots-range-toolbar select {
        width: 100%;
        min-width: 0;
    }

    .snapshots-group-picker {
        max-width: 100%;
    }

    .snapshots-action-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .snapshots-action-target strong {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .login-container {
        margin: var(--spacing-md) auto;
        padding: var(--spacing-lg);
    }
    
    .login-container h2 {
        font-size: 24px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .function-page h2 {
        font-size: 22px;
    }
    
    .user-info {
        width: 100%;
        justify-content: space-between;
    }
}

/* 同步管理员操作下拉菜单样式 */
.sync-actions-dropdown {
    position: relative;
    display: inline-block;
}

.sync-actions-button {
    width: auto;
    min-width: 120px;
    padding: 6px 12px;
    border: 1px solid #667eea;
    border-radius: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    text-align: center;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
    white-space: nowrap;
}

.sync-actions-button:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3a8f 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.sync-actions-button:after {
    content: '▼';
    font-size: 0.7em;
    margin-left: 8px;
    transition: transform 0.2s;
    color: white;
}

.sync-actions-button.open:after {
    transform: rotate(180deg);
}

.sync-actions-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    margin-top: 2px;
    display: none;
    padding: 8px 0;
}

.sync-actions-menu.open {
    display: block;
}

.sync-actions-menu-item {
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    font-size: 0.9em;
}

.sync-actions-menu-item:hover {
    background: #f8f9fa;
}

.sync-actions-menu-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.sync-actions-menu-item label {
    cursor: pointer;
    margin: 0;
    flex: 1;
    user-select: none;
}

/* 额外的工具类 */
.btn-full-width {
    width: 100%;
}

.divider {
    margin: var(--spacing-lg) 0;
    text-align: center;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid var(--gray-300);
}

.divider span {
    background: white;
    padding: 0 var(--spacing-md);
    color: var(--gray-500);
    position: relative;
    font-size: 14px;
}

.telegram-login-panel {
    border: 1px solid #dbeafe;
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.telegram-login-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--spacing-sm);
}

.telegram-login-subtitle {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: var(--spacing-md);
}

.telegram-login-widget {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
}

.telegram-widget-loading {
    font-size: 13px;
    color: var(--gray-600);
}

.telegram-widget-retry-btn {
    margin-top: var(--spacing-sm);
}

.bind-notice {
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-lg);
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 4px solid var(--warning);
    border-radius: var(--radius-lg);
}

.bind-notice-header {
    font-size: 16px;
    font-weight: 700;
    color: #9a3412;
    margin-bottom: var(--spacing-sm);
}

.bind-notice-footnote {
    margin-top: var(--spacing-sm);
    font-size: 12px;
    color: #7c6f4d;
}

body.needs-tg-bind .menu-grid,
body.needs-tg-bind #permissionHint,
body.needs-tg-bind #menuDetailedStats {
    display: none !important;
}

.form-section {
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.form-section h3 {
    margin-top: 0;
    color: var(--gray-800);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.toolbar {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-lg);
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.toolbar-label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 14px;
}

.group-list-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    background: white;
}

.group-list-container.compact {
    max-height: 200px;
}

.error-message {
    margin-top: var(--spacing-md);
    color: var(--danger);
    display: none;
    font-size: 14px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: #fef2f2;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--danger);
}

.info-box {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--gray-100);
    border-radius: var(--radius-md);
    color: var(--gray-600);
    font-size: 0.9em;
    line-height: 1.6;
}

.info-box strong {
    color: var(--gray-800);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

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

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

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* 选择文本样式 */
::selection {
    background: var(--primary);
    color: white;
}

::-moz-selection {
    background: var(--primary);
    color: white;
}

/* 群组标签样式优化 */
.group-tag {
    display: inline-block;
    margin: 4px 6px 4px 0;
    padding: 8px 24px 8px 12px;
    max-width: 280px;
    box-sizing: border-box;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.4;
    position: relative;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.group-tag:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.group-tag strong {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--gray-800);
    font-weight: 600;
}

.group-tag small {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--gray-600);
    font-size: 11px;
}

.group-tag button {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    font-weight: bold;
}

.group-tag button:hover {
    background: var(--danger-dark);
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

/* 白名单标签样式 */
.group-tag.whitelist-tag {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-color: #81c784;
}

.group-tag.whitelist-tag:hover {
    border-color: var(--success);
}

/* 黑/白名单群组标签紧凑样式 */
.group-tag.group-tag-compact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 22px 5px 8px;
    max-width: 220px;
    margin: 2px 4px 2px 0;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.25;
}

.group-tag.group-tag-compact strong {
    display: inline-block;
    margin: 0;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-tag.group-tag-compact small {
    display: inline-block;
    margin: 0;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
}

.group-tag.group-tag-compact button {
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    font-size: 11px;
}

/* 黑名单群组折叠容器 */
.blacklist-groups-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.blacklist-groups-visible,
.blacklist-groups-collapsed {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.blacklist-toggle-btn {
    background: none !important;
    border: none !important;
    padding: 4px 8px !important;
    font-size: 12px !important;
    color: var(--primary) !important;
    cursor: pointer;
    text-decoration: none !important;
    transition: all var(--transition-base);
    align-self: flex-start;
    margin-top: 4px;
}

.blacklist-toggle-btn:hover {
    color: var(--primary-dark) !important;
    text-decoration: underline !important;
}

.blacklist-toggle-btn .toggle-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.blacklist-toggle-btn .toggle-text::before {
    content: '▼';
    font-size: 10px;
    transition: transform var(--transition-base);
}

.blacklist-toggle-btn.expanded .toggle-text::before {
    transform: rotate(180deg);
}

/* 搜索框容器优化 */
.search-container {
    background: white;
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-lg);
}

.search-container .search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.search-container .search-icon {
    position: absolute;
    left: 12px;
    color: var(--gray-400);
    pointer-events: none;
    font-size: 16px;
}

.search-container input[type="text"] {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all var(--transition-base);
    background: var(--gray-50);
}

.search-container input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-container .search-tip {
    display: block;
    margin-top: 8px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
}

/* 群组操作日志：筛选与标题展示 */
.group-log-toolbar {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.group-log-toolbar-label {
    font-weight: 600;
    white-space: nowrap;
}

.group-log-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #334155;
    font-size: 13px;
    white-space: nowrap;
}

.group-log-toggle input[type="checkbox"] {
    margin: 0;
}

.group-log-select {
    min-width: 260px;
    flex: 1;
    max-width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

#groupLogPage,
#groupLogContent {
    overflow-x: hidden;
}

.group-log-summary {
    margin-bottom: 15px;
    padding: 10px 12px;
    background: #f5f5f5;
    border-radius: 6px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.group-log-summary-name {
    font-weight: 700;
    min-width: 0;
    max-width: min(72vw, 900px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-log-summary-meta {
    color: #334155;
    font-weight: 600;
}

.group-log-summary-count {
    color: #666;
}

/* 群组快照与操作恢复 */
.snapshots-intro strong {
    color: #1f2937;
}

.snapshots-range-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.snapshots-range-toolbar label {
    font-weight: 600;
    color: #1f2937;
}

.snapshots-range-toolbar select {
    min-width: 160px;
    padding: 8px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: #fff;
}

.snapshots-range-hint {
    color: #64748b;
    font-size: 13px;
}

.snapshots-records-hint {
    margin: 4px 0 12px;
    color: #64748b;
    font-size: 13px;
}

.snapshots-group-picker {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 560px;
}

.snapshots-group-search-wrap {
    position: relative;
}

.snapshots-group-search {
    width: 100%;
    padding: 8px 34px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.snapshots-group-search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

.snapshots-group-select {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    min-height: 220px;
    padding: 8px 10px;
}

.snapshots-group-count {
    color: #666;
    font-size: 13px;
}

.snapshots-summary {
    margin-bottom: 16px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.snapshots-summary-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.snapshots-count-ban {
    color: #b91c1c;
}

.snapshots-count-mute {
    color: #c2410c;
}

.snapshots-summary-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.snapshots-select-all-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #334155;
    font-size: 13px;
}

.snapshots-selected-count {
    color: #475569;
    font-size: 13px;
    font-weight: 600;
}

.snapshots-actions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.snapshots-action-card {
    padding: 14px;
}

.snapshots-action-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.snapshots-action-check-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.snapshots-action-type {
    padding: 4px 8px;
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.snapshots-action-body {
    color: #475569;
    font-size: 13px;
    line-height: 1.45;
}

.snapshots-action-target {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.snapshots-action-target strong {
    display: inline-block;
    max-width: min(48vw, 260px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1f2937;
}

.snapshots-action-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.snapshots-action-reason-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 最近消息分页栏：页码信息与翻页控件同一行 */
.messages-pagination-bar {
    margin: 10px 0;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
}

.messages-pagination-info {
    min-width: 0;
    flex: 1;
    color: #1e293b;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.messages-pagination-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.messages-page-jump {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.messages-page-jump #pageInput {
    width: 58px;
    text-align: center;
}

/* 增强版搜索容器 */
.search-container-enhanced {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg);
}

.search-input-wrapper-enhanced {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.search-input-wrapper-enhanced .search-icon {
    position: absolute;
    left: 16px;
    color: var(--gray-400);
    pointer-events: none;
    font-size: 18px;
    z-index: 1;
}

.search-input-wrapper-enhanced input[type="text"] {
    flex: 1;
    min-width: 300px;
    padding: 14px 16px 14px 48px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: all var(--transition-base);
    background: var(--gray-50);
    color: var(--gray-800);
}

.search-input-wrapper-enhanced input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.search-input-wrapper-enhanced input[type="text"]::placeholder {
    color: var(--gray-400);
}

.search-input-wrapper-enhanced .btn-sm {
    padding: 12px 20px;
    font-size: 14px;
    border-radius: var(--radius-md);
    white-space: nowrap;
    transition: all var(--transition-base);
}

.search-input-wrapper-enhanced .btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* 表格行优化 */
.table-row-hover {
    transition: all var(--transition-fast);
}

.table-row-hover:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, white 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 统计徽章样式 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.badge-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    color: white;
}

.badge-danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-dark) 100%);
    color: white;
}

.badge-info {
    background: linear-gradient(135deg, var(--info) 0%, var(--info-dark) 100%);
    color: white;
}

/* 操作按钮组优化 */
.action-buttons-group {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    align-items: center;
}

/* 工具栏优化 */
.toolbar-enhanced {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    padding: var(--spacing-md);
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    margin-bottom: var(--spacing-lg);
}

/* 表单区域优化 */
.form-section-enhanced {
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-xl);
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.form-section-enhanced:hover {
    box-shadow: var(--shadow-md);
}

.form-section-enhanced h3 {
    margin-top: 0;
    margin-bottom: var(--spacing-lg);
    color: var(--gray-800);
    font-size: 20px;
    font-weight: 600;
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--gray-100);
}

/* 群组列表容器优化 */
.group-list-container-enhanced {
    max-height: 300px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    background: white;
    box-shadow: var(--shadow-sm);
}

.group-list-item {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-xs);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: white;
}

.group-list-item:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.group-list-item input[type="checkbox"] {
    margin-right: var(--spacing-sm);
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
    flex: 0 0 auto;
}

.group-list-item > div {
    flex: 1 1 auto;
    min-width: 0;
}

.group-list-item strong {
    display: block;
    min-width: 0;
}

.group-list-item .group-list-item-text {
    flex: 1 1 auto;
    min-width: 0;
}

.group-list-item .group-list-item-title {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--gray-800);
    line-height: 1.35;
}

.group-list-item .group-list-item-id {
    display: block;
    margin-top: 3px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #666;
    font-size: 12px;
}

/* Bot Token 开关卡片（启用 + 登录选择） */
.bot-token-option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.bot-token-option-card {
    position: relative;
    display: block;
    cursor: pointer;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 12px 64px 12px 12px;
    transition: all var(--transition-base);
    min-height: 84px;
}

.bot-token-option-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.bot-token-option-card.is-active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.bot-token-option-card input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.bot-token-option-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.bot-token-option-title {
    color: var(--gray-800);
    font-size: 14px;
    font-weight: 700;
}

.bot-token-option-state {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.bot-token-option-state.is-active {
    background: rgba(16, 185, 129, 0.18);
    color: var(--success-dark);
}

.bot-token-option-desc {
    color: var(--gray-600);
    font-size: 12px;
    line-height: 1.45;
}

.bot-token-option-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    width: 42px;
    height: 24px;
    margin-top: -12px;
    border-radius: var(--radius-full);
    background: var(--gray-300);
    transition: all var(--transition-base);
}

.bot-token-option-toggle::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
    transition: transform var(--transition-base);
}

.bot-token-option-card.is-active .bot-token-option-toggle {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.bot-token-option-card.is-active .bot-token-option-toggle::after {
    transform: translateX(18px);
}

.bot-token-domain-wrap.is-disabled {
    opacity: 0.62;
}

.bot-token-domain-wrap.is-disabled input {
    background: var(--gray-100);
    border-color: var(--gray-200);
    cursor: not-allowed;
}

.bot-token-domain-hint {
    display: block;
    margin-top: var(--spacing-xs);
    font-size: 12px;
    color: var(--gray-500);
}

.bot-token-domain-hint.is-active {
    color: #0c4a6e;
}

.bot-notice-template-preview-wrap {
    margin-top: 10px;
    margin-bottom: 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: #f8fafc;
    padding: 10px 12px;
}

.bot-notice-template-preview-title {
    font-size: 12px;
    color: var(--gray-600);
    font-weight: 700;
    margin-bottom: 6px;
}

.bot-notice-template-preview {
    margin: 0;
    max-height: 170px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 12px;
    line-height: 1.5;
    color: #334155;
}

.bot-notice-template-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 860px) {
    .bot-token-option-grid {
        grid-template-columns: 1fr;
    }

    .bot-notice-template-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Bot Token 群组列表（横排展示） */
.bot-token-groups-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.bot-token-groups-search {
    flex: 1;
    min-width: 220px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.bot-token-groups-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
}

.bot-token-groups-sort {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.bot-token-groups-summary {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.bot-token-groups-table {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.bot-token-groups-row {
    display: grid;
    grid-template-columns: minmax(180px, 2fr) minmax(170px, 1.8fr) 90px 180px 170px;
    gap: 10px;
    align-items: center;
    padding: 9px 12px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
}

.bot-token-groups-row > div {
    min-width: 0;
}

.bot-token-groups-row:last-child {
    border-bottom: none;
}

.bot-token-groups-header {
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 700;
    font-size: 12px;
}

.bot-token-groups-name {
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bot-token-groups-account {
    color: var(--gray-700);
}

.bot-token-groups-account > div:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bot-token-groups-sub {
    color: var(--gray-500);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bot-token-groups-members {
    font-weight: 700;
    color: var(--gray-900);
}

.bot-token-groups-perm {
    color: var(--gray-700);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bot-token-groups-joined {
    color: var(--gray-700);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bot-token-groups-empty {
    color: var(--gray-400);
}

@media (max-width: 960px) {
    .bot-token-groups-row {
        grid-template-columns: minmax(160px, 2fr) minmax(150px, 1.6fr) 70px 150px 150px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .bot-token-groups-header {
        display: none;
    }

    .bot-token-groups-row {
        grid-template-columns: 1fr 1fr;
        gap: 6px 10px;
        align-items: flex-start;
    }

    .bot-token-groups-members,
    .bot-token-groups-perm,
    .bot-token-groups-joined {
        font-size: 12px;
    }
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--gray-500);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-state-text {
    font-size: 16px;
    font-weight: 500;
}

/* 数据看板样式 */
.dashboard-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    color: white;
    text-align: center;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity var(--transition-base);
}

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

.dashboard-card:hover::before {
    opacity: 1;
}

.dashboard-card-icon {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.9;
}

.dashboard-card-label {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 500;
    line-height: 1.35;
}

.dashboard-card-value {
    font-size: clamp(24px, 2.3vw, 32px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}

.dashboard-card-groups .dashboard-card-value {
    font-size: clamp(22px, 2vw, 30px);
}

.dashboard-card-small {
    background: white;
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    text-align: center;
    transition: all var(--transition-base);
}

.dashboard-card-small:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.dashboard-card-small-icon {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--primary);
}

.dashboard-card-small-label {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 8px;
    font-weight: 500;
}

.dashboard-card-small-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.2;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    animation: fadeIn var(--transition-base);
}

.modal-content {
    background-color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp var(--transition-base);
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    flex: 1;
}

body.login-modal-open {
    overflow: hidden;
}

.login-totp-modal {
    z-index: 1300;
}

.login-totp-content {
    width: min(460px, calc(100vw - 28px));
    max-height: none;
    overflow: visible;
}

.login-totp-header {
    background: linear-gradient(135deg, #0f7fcf 0%, #0f5ea6 100%);
}

.login-totp-body {
    padding: 20px 20px 18px;
}

.login-totp-subtitle {
    margin: 0 0 10px 0;
    color: var(--gray-700);
    font-size: 14px;
    line-height: 1.5;
}

.login-totp-code-input {
    text-align: center;
    letter-spacing: 0.32em;
    font-size: 22px;
    font-weight: 700;
}

.login-totp-code-input::placeholder {
    letter-spacing: 0;
    font-size: 14px;
    font-weight: 400;
}

.login-totp-error {
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #b91c1c;
    font-size: 13px;
    line-height: 1.45;
}

.login-totp-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.login-totp-actions .btn {
    min-width: 96px;
}

@media (max-width: 480px) {
    .login-totp-content {
        width: calc(100vw - 16px);
    }

    .login-totp-body {
        padding: 16px 14px;
    }

    .login-totp-code-input {
        font-size: 20px;
    }

    .login-totp-actions {
        flex-direction: column-reverse;
    }

    .login-totp-actions .btn {
        width: 100%;
    }
}

/* 媒体占位符样式 */
.media-placeholder {
    user-select: none;
    transition: all var(--transition-base);
}

.media-placeholder:hover {
    transform: scale(1.02);
}

.media-placeholder:active {
    transform: scale(0.98);
}

/* 延迟加载的头像样式 */
img.lazy-avatar {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

img.lazy-avatar[src] {
    opacity: 1;
}

img.lazy-avatar:not([src]) {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
}

/* 选项卡样式 */
.tabs {
    display: flex;
    gap: var(--spacing-sm);
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: var(--spacing-sm);
    flex-wrap: wrap;
}

.user-actions-intro {
    color: var(--gray-600);
    font-size: 14px;
    margin-bottom: 14px;
}

.user-actions-guide-card {
    margin-bottom: 16px;
    padding: 14px 16px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    border: 1px solid #dbe8ff;
    box-shadow: none;
}

.user-actions-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.user-actions-step {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 600;
}

.user-actions-step .step-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.user-actions-rules {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ua-rule-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: var(--radius-full);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
}

.ua-rule-badge.ua-rule-danger {
    background: #fff2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.ua-rule-badge.ua-rule-warning {
    background: #fff8e8;
    color: #9a6700;
    border-color: #fde68a;
}

.ua-rule-badge.ua-rule-info {
    background: #eef7ff;
    color: #075985;
    border-color: #bfdbfe;
}

.tab-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    transition: all var(--transition-fast);
    position: relative;
}

.tab-btn:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.tab-btn.active {
    color: var(--primary);
    background: var(--gray-50);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px 2px 0 0;
}

.user-actions-tabs .tab-btn {
    font-weight: 700;
    letter-spacing: 0.2px;
}

.user-actions-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    align-items: stretch;
}

.user-actions-tabs .tab-btn {
    display: flex;
    align-items: center;
    min-height: 40px;
    width: 100%;
    text-align: center;
    justify-content: center;
}

/* 用户操作区块样式 */
.user-action-section {
    animation: fadeIn 0.18s ease-in-out;
    margin-top: 12px;
}

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

.user-action-main {
    display: grid;
    gap: 12px;
}

.user-action-side {
    min-width: 0;
}

.user-action-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 14px;
    box-shadow: var(--shadow-sm);
}

.user-action-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--gray-800);
    font-size: 15px;
    font-weight: 700;
}

.ua-step-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    background: #e6eeff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
}

.user-action-sticky {
    position: sticky;
    top: 12px;
}

.action-rule-banner {
    border-radius: var(--radius-md);
    padding: 9px 11px;
    margin-bottom: 10px;
    font-size: 13px;
    border: 1px solid transparent;
}

.action-rule-banner.action-rule-banner-danger {
    background: #fff4f4;
    color: #991b1b;
    border-color: #fecaca;
}

.action-rule-banner.action-rule-banner-warning {
    background: #fffaeb;
    color: #854d0e;
    border-color: #fde68a;
}

.user-action-groups-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.group-search-input {
    min-width: 200px;
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 13px;
}

.group-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.12);
}

.ua-search-field {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.ua-search-field input {
    flex: 1;
    min-width: 0;
}

.ua-search-confirm-btn {
    white-space: nowrap;
}

.ua-search-results {
    margin-top: 6px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-sm);
    max-height: 220px;
    overflow-y: auto;
}

.ua-search-result-item {
    width: 100%;
    border: none;
    background: #fff;
    text-align: left;
    padding: 9px 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: background-color var(--transition-fast);
}

.ua-search-result-item:last-child {
    border-bottom: none;
}

.ua-search-result-item:hover,
.ua-search-result-item:focus {
    background: #f7faff;
    outline: none;
}

.ua-search-result-main {
    display: block;
    color: var(--gray-800);
    font-size: 13px;
    font-weight: 700;
}

.ua-search-result-sub {
    display: block;
    margin-top: 2px;
    color: var(--gray-600);
    font-size: 12px;
}

.ua-search-results-empty {
    padding: 9px 10px;
    color: var(--gray-500);
    font-size: 12px;
}

.user-action-inline-rail {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(240px, 1fr);
    gap: 12px;
    align-items: stretch;
}

.user-action-inline-col {
    min-width: 0;
}

.user-action-inline-col .form-row {
    grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
}

.user-action-inline-col .form-row-tight {
    margin-bottom: 0;
}

.user-action-inline-col-reason {
    display: flex;
    align-items: stretch;
}

.kick-reason-col {
    max-width: none;
}

.user-action-reason-block.user-action-reason-block-inline {
    width: 100%;
    margin-top: 0;
}

.user-action-reason-block.user-action-reason-block-inline .user-action-reason-input {
    min-height: 106px;
}

.kick-compact-row {
    align-items: end;
}

.kick-compact-row .user-target-main {
    min-width: 0;
}

.kick-delete-compact {
    max-width: none;
}

.kick-delete-compact label {
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-700);
}

.kick-delete-compact .compact-select {
    min-height: 40px;
    padding: 8px 32px 8px 10px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 10px;
    border-color: #c7d2fe;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.kick-delete-compact .compact-select:focus {
    border-color: #4f80ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.user-action-reason-block {
    margin-top: 2px;
}

.user-action-reason-block label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.user-action-reason-input {
    min-height: 84px;
    border: 1px solid #c7d2fe !important;
    border-radius: 10px;
    padding: 10px 12px;
    line-height: 1.55;
    color: var(--gray-800);
    resize: vertical;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
    background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
}

.user-action-reason-input:hover {
    border-color: #9db0f3 !important;
}

.user-action-reason-input:focus {
    border-color: #4f80ff !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14) !important;
    background: #fff;
}

.user-action-reason-input::placeholder {
    color: #94a3b8;
}

.user-action-reason-meta {
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: var(--gray-500);
}

.reason-meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid transparent;
}

.reason-meta-badge-neutral {
    background: #f3f4f6;
    color: #4b5563;
    border-color: #e5e7eb;
}

.reason-meta-badge-required {
    background: #fff8e8;
    color: #9a6700;
    border-color: #fde68a;
}

.reason-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    height: 24px;
    border-radius: 999px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

@media (max-width: 1320px) {
    .user-action-inline-rail {
        grid-template-columns: 1fr;
    }

    .user-action-inline-col .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .kick-delete-compact {
        max-width: none;
    }

    .kick-delete-compact .compact-select {
        min-height: 44px;
    }

    .user-action-reason-block.user-action-reason-block-inline .user-action-reason-input {
        min-height: 96px;
    }
}

.user-action-inline-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.selected-count-text {
    color: var(--gray-600);
    font-size: 13px;
    font-weight: 600;
}

.user-action-group-hint {
    margin-bottom: 8px;
    padding: 8px 10px;
    background: #eef6ff;
    border-left: 4px solid #3b82f6;
    border-radius: 4px;
    font-size: 12px;
    color: #1d4ed8;
}

.field-hint {
    margin-top: 8px;
    font-size: 12px;
}

.field-hint.field-hint-warning {
    color: #b45309;
}

.switch-like-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 600;
}

.duration-chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 4px 0 8px;
}

.duration-chip {
    border: 1px solid var(--gray-300);
    background: #fff;
    color: var(--gray-700);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.duration-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.operation-preview {
    margin-top: 0;
    border-radius: var(--radius-md);
    border: 1px dashed #cbd5e1;
    background: #fafcff;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--gray-700);
}

.operation-preview.empty {
    color: var(--gray-500);
}

.operation-preview strong {
    color: var(--gray-800);
}

.operation-preview-title {
    color: var(--gray-700);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}

.preview-list {
    margin: 8px 0 0;
    padding-left: 18px;
}

.preview-list li {
    margin: 2px 0;
}

.user-action-submit-row {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.user-action-result {
    margin-top: 10px;
    min-height: 2px;
}

.group-list-item.is-selected {
    border-color: var(--primary);
    background: #edf2ff;
    box-shadow: inset 0 0 0 1px rgba(102, 126, 234, 0.2);
}

.user-action-section .group-list-item:hover,
.user-action-section #muteGroupListContainer label:hover,
.user-action-section #deleteGroupListContainer label:hover {
    transform: none;
}

@media (max-width: 1180px) {
    .user-action-workspace {
        grid-template-columns: 1fr;
    }

    .user-action-sticky {
        position: static;
        top: auto;
    }
}

@media (max-width: 768px) {
    .user-actions-steps {
        grid-template-columns: 1fr 1fr;
    }

    .user-actions-tabs {
        grid-template-columns: 1fr;
    }

    .user-action-card {
        padding: 12px;
    }

    .user-action-card-title {
        font-size: 14px;
    }

    .group-search-input {
        min-width: 100%;
    }
}

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

/* 警告提示框 */
.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
}

/* 按钮-警告色 */
.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-dark) 100%);
    color: white;
    border: none;
}

.btn-warning:hover {
    background: linear-gradient(135deg, var(--warning-dark) 0%, #b45309 100%);
    transform: translateY(-1px);
}

/* Telegram-inspired blue-white theme refresh */
:root {
    --font-ui: "SF Pro Display", "Segoe UI Variable Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --primary: #229ed9;
    --primary-dark: #187eb0;
    --primary-light: #63c8ef;
    --secondary: #2f78b8;
    --secondary-dark: #215d8f;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-soft: #f3f9fd;
    --surface-muted: #eaf4fb;
    --line-subtle: #d7e8f3;
    --line-strong: #b9d5e8;
    --shadow-sm: 0 10px 24px rgba(16, 70, 108, 0.06);
    --shadow-md: 0 18px 38px rgba(16, 70, 108, 0.09);
    --shadow-lg: 0 24px 52px rgba(13, 60, 93, 0.13);
    --shadow-xl: 0 34px 72px rgba(10, 54, 86, 0.16);
    --primary-rgb: 34, 158, 217;
}

body {
    font-family: var(--font-ui);
    position: relative;
    isolation: isolate;
    background:
        radial-gradient(circle at top left, rgba(var(--primary-rgb), 0.20), transparent 32%),
        radial-gradient(circle at bottom right, rgba(72, 181, 238, 0.16), transparent 28%),
        linear-gradient(180deg, #ecf7fd 0%, #f8fbfe 58%, #edf5fb 100%);
    color: #14324c;
}

body::before,
body::after {
    content: "";
    position: fixed;
    pointer-events: none;
    z-index: -1;
    border-radius: 50%;
}

body::before {
    top: -120px;
    right: -70px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.16) 0%, rgba(var(--primary-rgb), 0) 72%);
    animation: telegramFloat 14s ease-in-out infinite;
}

body::after {
    left: -120px;
    bottom: -150px;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(47, 120, 184, 0.14) 0%, rgba(47, 120, 184, 0) 74%);
    animation: telegramFloat 18s ease-in-out infinite reverse;
}

.header,
.login-container,
.function-page,
.card,
.menu-card,
.search-container,
.search-container-enhanced,
.toolbar-enhanced,
.form-section,
.dashboard-card-small,
.modal-content,
.table-container {
    background: var(--surface);
    border: 1px solid var(--line-subtle);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(18px);
}

.header,
.function-page,
.card,
.menu-card,
.dashboard-card-small {
    position: relative;
    overflow: hidden;
}

.header::before,
.function-page::before,
.card::before,
.menu-card::before,
.dashboard-card-small::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.95) 0%, rgba(99, 200, 239, 0.9) 100%);
}

.header h1,
.login-container h2 {
    background: linear-gradient(135deg, #0f608f 0%, #229ed9 55%, #66caef 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-badge {
    background: linear-gradient(135deg, #1a8cc6 0%, #229ed9 58%, #53c0eb 100%);
    box-shadow: 0 14px 28px rgba(var(--primary-rgb), 0.18);
}

.btn {
    border-radius: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.btn::before {
    background: rgba(255, 255, 255, 0.16);
}

.btn-primary {
    background: linear-gradient(135deg, #229ed9 0%, #187eb0 100%);
    box-shadow: 0 16px 28px rgba(var(--primary-rgb), 0.22);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #187eb0 0%, #229ed9 100%);
    box-shadow: 0 20px 34px rgba(var(--primary-rgb), 0.26);
}

.btn-secondary {
    background: linear-gradient(180deg, #ffffff 0%, #eef6fb 100%);
    color: #1e5d86;
    border: 1px solid var(--line-strong);
    box-shadow: none;
}

.btn-secondary:hover {
    background: linear-gradient(180deg, #ffffff 0%, #e7f3fb 100%);
    color: #0f567f;
    border-color: rgba(var(--primary-rgb), 0.35);
}

.btn-info {
    background: linear-gradient(135deg, #37a9e3 0%, #238bc2 100%);
}

.btn-info:hover {
    background: linear-gradient(135deg, #238bc2 0%, #37a9e3 100%);
}

.login-container {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 251, 255, 0.96) 100%);
    border-color: rgba(var(--primary-rgb), 0.18);
}

.telegram-login-panel {
    border: 1px solid rgba(var(--primary-rgb), 0.22);
    background: linear-gradient(135deg, #edf8ff 0%, #f8fcff 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), var(--shadow-sm);
}

.telegram-login-title {
    color: #145881;
}

.telegram-login-subtitle,
.divider span,
.loading p,
.empty-state {
    color: #57758e;
}

.divider::before {
    border-top-color: rgba(47, 120, 184, 0.18);
}

.divider span {
    background: rgba(255, 255, 255, 0.95);
}

.form-group input,
.form-group select,
.form-group textarea,
.search-container input[type="text"],
.search-input-wrapper-enhanced input[type="text"],
.snapshots-range-toolbar select,
.group-search-input {
    background: #f8fbfe;
    border-color: var(--line-subtle);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover,
.search-container input[type="text"]:hover,
.search-input-wrapper-enhanced input[type="text"]:hover,
.snapshots-range-toolbar select:hover,
.group-search-input:hover {
    border-color: var(--line-strong);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.search-container input[type="text"]:focus,
.search-input-wrapper-enhanced input[type="text"]:focus,
.snapshots-range-toolbar select:focus,
.group-search-input:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.14);
}

.toolbar,
.toolbar-enhanced,
.group-log-toolbar,
.snapshots-range-toolbar,
.bot-token-groups-toolbar,
.user-action-groups-toolbar {
    gap: 12px;
}

.search-container,
.search-container-enhanced,
.toolbar-enhanced,
.form-section {
    background: linear-gradient(180deg, #f8fbfe 0%, #f1f8fd 100%);
}

.menu-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 250, 254, 0.96) 100%);
}

.menu-card::before {
    height: 5px;
    background: linear-gradient(90deg, #1e92ce 0%, #63c8ef 100%);
}

.menu-card:hover,
.card:hover,
.function-page:hover,
.dashboard-card-small:hover {
    border-color: rgba(var(--primary-rgb), 0.22);
}

.function-page {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 251, 255, 0.96) 100%);
}

.function-page h2 {
    border-image: linear-gradient(90deg, #1a8cc6 0%, #53c0eb 100%) 1;
}

.card h3 {
    border-bottom-color: #e5f1f9;
}

.table-container {
    background: rgba(255, 255, 255, 0.76);
    border-color: var(--line-strong);
}

table {
    background: transparent;
}

th {
    background: linear-gradient(180deg, #f2f9fe 0%, #e2f0fa 100%);
    color: #2c546d;
    text-transform: none;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--line-subtle);
}

td {
    background: rgba(255, 255, 255, 0.7);
}

tbody tr:hover,
.table-row-hover:hover {
    background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.08) 0%, rgba(255, 255, 255, 0.98) 72%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.stat-card {
    background: linear-gradient(135deg, #157bae 0%, #229ed9 55%, #67cbed 100%);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar {
    background: linear-gradient(180deg, #0f507b 0%, #176faa 62%, #229ed9 100%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 30px 60px rgba(15, 80, 123, 0.28);
}

.sidebar-header {
    border-bottom-color: rgba(255, 255, 255, 0.14);
}

.sidebar-header h3,
.nav-item,
.sidebar-toggle {
    color: rgba(255, 255, 255, 0.84);
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    transform: translateX(6px);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.12) 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 18px 30px rgba(7, 37, 59, 0.18);
}

.nav-divider {
    background: rgba(255, 255, 255, 0.16);
}

.dashboard-card {
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 22px 44px rgba(18, 96, 145, 0.22);
    background: linear-gradient(135deg, #157cae 0%, #229ed9 58%, #64c9ef 100%);
}

.dashboard-card::before {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 66%);
    opacity: 1;
}

.dashboard-card::after {
    content: "";
    position: absolute;
    right: -22px;
    bottom: -58px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0) 72%);
}

.dashboard-card--interactive {
    cursor: pointer;
}

.dashboard-card--ocean {
    background: linear-gradient(135deg, #0f699d 0%, #1d8ec7 58%, #54c1ea 100%);
}

.dashboard-card--royal {
    background: linear-gradient(135deg, #215ca3 0%, #337ec6 58%, #6ab2ef 100%);
}

.dashboard-card--sky {
    background: linear-gradient(135deg, #1a8ec1 0%, #32ace0 58%, #7bd8f7 100%);
}

.dashboard-card--glacier {
    background: linear-gradient(135deg, #0f7aa8 0%, #2996cf 58%, #92d7f7 100%);
}

.dashboard-card--navy {
    background: linear-gradient(135deg, #0f4978 0%, #1d73ae 58%, #42a6de 100%);
}

.dashboard-card-small {
    background: linear-gradient(180deg, #ffffff 0%, #f4f9fd 100%);
}

.dashboard-card-small-icon {
    color: #1d8ec7;
}

.modal {
    background-color: rgba(10, 34, 53, 0.42);
}

.modal-content {
    border-color: rgba(var(--primary-rgb), 0.16);
}

.modal-header {
    background: linear-gradient(135deg, #0f699d 0%, #229ed9 100%);
}

.badge-primary {
    background: linear-gradient(135deg, #1d8ec7 0%, #229ed9 100%);
}

.status-badge.online {
    background: #dbf4e7;
}

.status-badge.offline {
    background: #fbe8ea;
}

.group-list-item.is-selected {
    background: #edf7ff;
    box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.22);
}

@keyframes telegramFloat {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(0, 20px, 0) scale(1.06);
    }
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .header,
    .function-page,
    .card,
    .menu-card,
    .login-container {
        border-radius: 18px;
    }

    .dashboard-card {
        padding: 20px 18px;
    }
}

/* Telegram-inspired window and template refinement */
.function-page {
    padding: clamp(22px, 2.6vw, 34px);
    border-radius: 28px;
    box-shadow: 0 30px 68px rgba(10, 54, 82, 0.14);
}

.function-page::after {
    content: "";
    position: absolute;
    inset: 56px 24px 24px;
    border-radius: 24px;
    border: 1px dashed rgba(var(--primary-rgb), 0.12);
    pointer-events: none;
}

.function-page > * {
    position: relative;
    z-index: 1;
}

.function-page h2 {
    margin-bottom: 8px;
    font-size: clamp(24px, 3vw, 30px);
    letter-spacing: -0.02em;
}

.function-page > h2 + p {
    margin: 0 0 22px;
    color: #64839c;
    font-size: 14px;
    line-height: 1.7;
    max-width: 760px;
}

.back-btn {
    margin: -2px 0 18px;
    display: flex;
    align-items: center;
}

.back-btn .btn {
    padding: 10px 16px;
    border-radius: 999px;
    border-color: rgba(var(--primary-rgb), 0.18);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 24px rgba(16, 77, 115, 0.08);
}

.card,
.search-container,
.search-container-enhanced,
.form-section {
    border-radius: 24px;
}

.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 249, 253, 0.96) 100%);
    border-color: rgba(var(--primary-rgb), 0.14);
}

.card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 14px;
}

.toolbar,
.toolbar-enhanced,
.group-log-toolbar,
.snapshots-range-toolbar,
.bot-token-groups-toolbar,
.user-action-groups-toolbar,
.messages-pagination-bar {
    padding: 14px 16px;
    border-radius: 20px;
    border: 1px solid rgba(var(--primary-rgb), 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(240, 248, 253, 0.9) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.toolbar-group {
    gap: 8px 10px;
}

.toolbar-label,
.group-log-toolbar-label,
.snapshots-range-toolbar label {
    color: #1f5d85;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.info-box,
.bind-notice,
.alert.alert-info,
.alert.alert-warning {
    border-radius: 20px;
    border-width: 1px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.info-box {
    background: linear-gradient(180deg, #f6fbff 0%, #eef7fd 100%);
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    color: #547289;
}

.bind-notice {
    background: linear-gradient(180deg, #f6fbff 0%, #eef8fe 100%);
    border-color: rgba(var(--primary-rgb), 0.16);
    box-shadow: 0 18px 34px rgba(19, 90, 132, 0.1);
}

.bind-notice-header {
    color: #145b84;
}

.alert.alert-info {
    background: linear-gradient(180deg, #f4fafe 0%, #e9f5fd 100%);
    border-color: rgba(var(--primary-rgb), 0.16);
    color: #245f85;
}

.alert.alert-warning {
    background: linear-gradient(180deg, #fff9eb 0%, #fff3d8 100%);
    border-color: rgba(229, 169, 73, 0.26);
    color: #8d6414;
}

.loading,
.empty-state {
    min-height: 180px;
    padding: 28px 24px;
    border-radius: 22px;
    border: 1px dashed rgba(var(--primary-rgb), 0.16);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(241, 248, 253, 0.86) 100%);
}

.empty-state-icon {
    color: #229ed9;
}

.table-container {
    border-radius: 24px;
    overflow: auto;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 18px 34px rgba(19, 90, 132, 0.08);
}

.table-container table {
    border-collapse: separate;
    border-spacing: 0;
}

.table-container thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    backdrop-filter: blur(12px);
}

.table-container tbody tr:nth-child(even) {
    background: rgba(245, 250, 254, 0.82);
}

.table-container tbody tr:hover {
    background: rgba(226, 241, 251, 0.92);
}

.messages-pagination-bar {
    margin-top: 14px;
}

.modal {
    padding: 24px;
}

.modal-content {
    width: min(960px, calc(100vw - 32px));
    max-height: min(90vh, 920px);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 36px 88px rgba(7, 35, 55, 0.26);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(243, 249, 253, 0.97) 100%);
}

.modal-header {
    position: relative;
    min-height: 82px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

.modal-header::after {
    content: "";
    position: absolute;
    right: -36px;
    top: -34px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 72%);
    pointer-events: none;
}

.modal-header h3 {
    position: relative;
    z-index: 1;
    font-size: 22px;
    letter-spacing: -0.02em;
}

.modal-close {
    position: relative;
    z-index: 1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.24);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.24);
    transform: translateY(-1px);
}

.modal-body {
    padding: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 100%),
        linear-gradient(180deg, #f9fcff 0%, #f2f8fc 100%);
}

.modal-body > form {
    display: grid;
    gap: 18px;
}

.modal-body > form .form-row,
.modal-body > form .form-group,
.modal-body > form .form-group-full {
    margin-bottom: 0;
}

.modal-body .toolbar-group {
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.68);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.modal-body pre,
.modal-body code {
    border-radius: 14px;
}

.modal-body pre {
    background: linear-gradient(180deg, #eff7fc 0%, #e7f2fa 100%);
    border: 1px solid rgba(var(--primary-rgb), 0.12);
}

@media (max-width: 768px) {
    .function-page {
        padding: 18px;
        border-radius: 22px;
    }

    .function-page::after {
        display: none;
    }

    .toolbar,
    .toolbar-enhanced,
    .group-log-toolbar,
    .snapshots-range-toolbar,
    .bot-token-groups-toolbar,
    .user-action-groups-toolbar,
    .messages-pagination-bar {
        padding: 12px;
        border-radius: 18px;
    }

    .modal {
        padding: 12px;
    }

    .modal-content {
        width: calc(100vw - 16px);
        border-radius: 24px;
    }

    .modal-header,
    .modal-body {
        padding: 18px;
    }
}

/* Telegram-inspired page detail refinement */
.surface-banner {
    margin: 12px 0 16px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(var(--primary-rgb), 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.surface-banner code {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    color: #175d87;
    border: 1px solid rgba(var(--primary-rgb), 0.12);
}

.surface-banner-primary {
    background: linear-gradient(180deg, #eef8ff 0%, #e4f2fd 100%);
    color: #245f85;
}

.surface-banner-muted {
    background: linear-gradient(180deg, #fbfdff 0%, #f1f7fb 100%);
    color: #536f84;
}

#menuPage .menu-grid {
    gap: 18px;
}

.menu-card {
    min-height: 172px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    text-align: left;
}

.menu-card::after {
    content: "";
    position: absolute;
    right: -40px;
    bottom: -54px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(34, 158, 217, 0.14) 0%, rgba(34, 158, 217, 0) 72%);
}

.menu-card h3,
.menu-card p {
    position: relative;
    z-index: 1;
}

.menu-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 19px;
}

.menu-card p {
    max-width: 28ch;
    color: #5f7d93;
}

#messagesPage .toolbar {
    align-items: center;
}

#messagesPage #connectionStatus {
    margin-left: auto;
}

#messagesPage #selectedCount {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    color: #4f7088;
}

#messagesPage #messagesContent,
#groupLogContent,
#groupsManageContent,
#blacklistContent,
#whitelistContent,
#collaboratorsListContent,
#adminsListContent,
#adminActionsContent,
#menuStatsContent,
#statsContent {
    margin-top: 16px;
    padding: 14px;
    border-radius: 24px;
    border: 1px solid rgba(var(--primary-rgb), 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(242, 248, 252, 0.92) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 16px 30px rgba(17, 82, 122, 0.07);
}

#messagesPage #messagesContent {
    min-height: 260px;
}

#messagesPage #systemHealth small {
    color: inherit;
    font-size: 13px;
}

#messagesPage #consumerStatus {
    color: #56758b;
    font-size: 13px;
}

#groupLogPage .group-log-toolbar,
#messagesPage #paginationBar,
#statsGroupManageSection .toolbar-enhanced {
    margin-top: 14px;
}

.user-actions-tabs {
    padding: 8px;
    margin-bottom: 18px;
    border-radius: 22px;
    border: 1px solid rgba(var(--primary-rgb), 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(240, 247, 252, 0.94) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.user-actions-tabs .tab-btn {
    min-height: 46px;
    border-radius: 16px;
    border: 1px solid transparent;
    background: transparent;
    color: #4b6a82;
    box-shadow: none;
}

.user-actions-tabs .tab-btn:hover {
    transform: none;
    background: rgba(var(--primary-rgb), 0.08);
    color: #165d86;
}

.user-actions-tabs .tab-btn.active {
    background: linear-gradient(135deg, #229ed9 0%, #187eb0 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 16px 28px rgba(var(--primary-rgb), 0.22);
}

.user-actions-tabs .tab-btn.active::after {
    display: none;
}

.user-action-workspace {
    gap: 18px;
}

.user-action-card {
    padding: 18px;
    border-radius: 24px;
    border-color: rgba(var(--primary-rgb), 0.13);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 250, 254, 0.95) 100%);
    box-shadow: 0 18px 34px rgba(17, 82, 122, 0.08);
}

.user-action-card-title {
    margin-bottom: 14px;
    color: #1f577d;
}

.ua-step-dot {
    background: linear-gradient(135deg, #ddf1fb 0%, #c5e7f8 100%);
    color: #0f689b;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.user-action-sticky {
    top: 18px;
}

.action-rule-banner {
    padding: 11px 12px;
    border-radius: 16px;
    line-height: 1.55;
}

.group-list-container-enhanced {
    border-radius: 20px;
    border-color: rgba(var(--primary-rgb), 0.14);
    background: linear-gradient(180deg, #fbfdff 0%, #f2f8fd 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.group-list-item {
    border-radius: 14px;
    border-color: #d8e7f2;
}

.group-list-item:hover {
    background: #f1f8fd;
    border-color: rgba(var(--primary-rgb), 0.26);
    box-shadow: 0 10px 20px rgba(17, 82, 122, 0.06);
}

.ua-search-results {
    border-radius: 18px;
    border-color: rgba(var(--primary-rgb), 0.12);
    box-shadow: 0 18px 30px rgba(17, 82, 122, 0.1);
}

.ua-search-result-item {
    padding: 11px 12px;
}

.user-action-group-hint,
.field-hint.field-hint-warning {
    border-radius: 14px;
    border-left: none;
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    background: linear-gradient(180deg, #f7fbff 0%, #ecf5fc 100%);
}

.field-hint.field-hint-warning {
    padding: 10px 12px;
    color: #a06310;
    border-color: rgba(218, 157, 67, 0.26);
    background: linear-gradient(180deg, #fff8ea 0%, #fff2db 100%);
}

.selected-count-text,
.reason-count-pill {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.selected-count-text {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(var(--primary-rgb), 0.12);
}

.duration-chip {
    padding: 7px 12px;
    border-color: #d3e4ef;
    background: linear-gradient(180deg, #ffffff 0%, #f1f8fc 100%);
}

.duration-chip:hover {
    background: linear-gradient(180deg, #ffffff 0%, #e7f4fc 100%);
    box-shadow: 0 10px 18px rgba(17, 82, 122, 0.08);
}

.operation-preview {
    border-radius: 18px;
    border-style: solid;
    border-color: rgba(var(--primary-rgb), 0.12);
    background: linear-gradient(180deg, #fbfdff 0%, #eff7fc 100%);
    padding: 14px 15px;
    line-height: 1.65;
}

.operation-preview-title {
    color: #1f5d85;
    font-size: 13px;
    letter-spacing: 0.01em;
}

.user-action-submit-row {
    margin-top: 14px;
}

@media (max-width: 980px) {
    #messagesPage #connectionStatus {
        margin-left: 0;
    }

    .menu-card {
        min-height: 154px;
    }

    #messagesPage #messagesContent,
    #groupLogContent,
    #groupsManageContent,
    #blacklistContent,
    #whitelistContent,
    #collaboratorsListContent,
    #adminsListContent,
    #adminActionsContent,
    #menuStatsContent,
    #statsContent {
        padding: 12px;
        border-radius: 20px;
    }

    .user-actions-tabs {
        border-radius: 18px;
    }

    .user-action-card,
    .group-list-container-enhanced {
        border-radius: 20px;
    }
}

/* Telegram-inspired palette rebalance */
:root {
    --primary: #3390ec;
    --primary-dark: #2d7fd1;
    --primary-light: #dcebfb;
    --secondary: #5d7fa3;
    --secondary-dark: #496988;
    --surface: rgba(255, 255, 255, 0.97);
    --surface-soft: #f7fafe;
    --surface-muted: #eef4f9;
    --line-subtle: #dbe6f0;
    --line-strong: #c7d6e4;
    --shadow-sm: 0 8px 20px rgba(16, 52, 82, 0.05);
    --shadow-md: 0 14px 32px rgba(16, 52, 82, 0.08);
    --shadow-lg: 0 18px 42px rgba(16, 52, 82, 0.1);
    --shadow-xl: 0 28px 56px rgba(12, 43, 70, 0.14);
    --primary-rgb: 51, 144, 236;
}

body {
    background:
        radial-gradient(circle at top left, rgba(var(--primary-rgb), 0.08), transparent 28%),
        linear-gradient(180deg, #f5f8fc 0%, #edf3f8 100%);
    color: #19364f;
}

body::before {
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.08) 0%, rgba(var(--primary-rgb), 0) 72%);
}

body::after {
    background: radial-gradient(circle, rgba(79, 129, 175, 0.08) 0%, rgba(79, 129, 175, 0) 74%);
}

.header,
.login-container,
.function-page,
.card,
.menu-card,
.search-container,
.search-container-enhanced,
.toolbar-enhanced,
.form-section,
.dashboard-card-small,
.modal-content,
.table-container {
    background: var(--surface);
    border-color: var(--line-subtle);
    box-shadow: var(--shadow-md);
}

.header::before,
.function-page::before,
.card::before,
.menu-card::before,
.dashboard-card-small::before {
    height: 3px;
    background: rgba(var(--primary-rgb), 0.88);
}

.header h1,
.login-container h2 {
    background: none;
    -webkit-text-fill-color: initial;
    color: #1b4f7d;
}

.user-badge {
    background: #3390ec;
    box-shadow: 0 12px 24px rgba(var(--primary-rgb), 0.18);
}

.btn-primary {
    background: linear-gradient(180deg, #43a1f4 0%, #3390ec 100%);
    box-shadow: 0 12px 22px rgba(var(--primary-rgb), 0.2);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #3b99ee 0%, #2f87df 100%);
    box-shadow: 0 14px 26px rgba(var(--primary-rgb), 0.22);
}

.btn-info {
    background: linear-gradient(180deg, #57aae9 0%, #4098df 100%);
}

.btn-info:hover {
    background: linear-gradient(180deg, #4da3e4 0%, #378dd4 100%);
}

.btn-secondary {
    background: #ffffff;
    color: #25577e;
    border-color: var(--line-strong);
}

.btn-secondary:hover {
    background: #f7fbff;
    color: #1d4f76;
}

.login-container,
.function-page,
.card,
.menu-card,
.search-container,
.search-container-enhanced,
.toolbar-enhanced,
.form-section,
.table-container,
.modal-content,
.surface-banner-primary,
.surface-banner-muted,
.info-box,
.bind-notice,
.alert.alert-info,
.alert.alert-warning,
.user-action-card,
.group-list-container-enhanced,
.operation-preview,
#messagesPage #messagesContent,
#groupLogContent,
#groupsManageContent,
#blacklistContent,
#whitelistContent,
#collaboratorsListContent,
#adminsListContent,
#adminActionsContent,
#menuStatsContent,
#statsContent {
    background-image: none;
}

.telegram-login-panel,
.search-container,
.search-container-enhanced,
.toolbar,
.toolbar-enhanced,
.group-log-toolbar,
.snapshots-range-toolbar,
.bot-token-groups-toolbar,
.user-action-groups-toolbar,
.messages-pagination-bar,
.surface-banner-muted,
.info-box,
.group-list-container-enhanced,
.operation-preview {
    background-color: var(--surface-soft);
}

.telegram-login-panel {
    border-color: rgba(var(--primary-rgb), 0.18);
}

.menu-card::after,
.dashboard-card::after,
.modal-header::after {
    opacity: 0.45;
}

.menu-card {
    background-color: #ffffff;
}

.menu-card::before {
    background: rgba(var(--primary-rgb), 0.9);
}

.menu-card p {
    color: #6b859a;
}

.function-page {
    background-color: #ffffff;
    box-shadow: 0 24px 52px rgba(16, 52, 82, 0.1);
}

.function-page::after {
    border-color: rgba(var(--primary-rgb), 0.09);
}

.function-page h2,
.toolbar-label,
.group-log-toolbar-label,
.snapshots-range-toolbar label,
.bind-notice-header,
.operation-preview-title,
.user-action-card-title {
    color: #25577e;
}

.function-page > h2 + p,
.loading p,
.empty-state,
#messagesPage #consumerStatus {
    color: #68839a;
}

.card {
    border-color: rgba(var(--primary-rgb), 0.1);
}

.card h3 {
    border-bottom-color: #e6edf4;
}

.table-container {
    background-color: #ffffff;
}

th {
    background: #f4f8fc;
    color: #34546d;
    border-bottom-color: #dce6ef;
}

td {
    background: rgba(255, 255, 255, 0.92);
}

tbody tr:hover,
.table-row-hover:hover,
.table-container tbody tr:hover {
    background: #eef5fb;
    box-shadow: none;
}

.table-container tbody tr:nth-child(even) {
    background: rgba(247, 250, 253, 0.94);
}

.stat-card,
.dashboard-card {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 18px 34px rgba(25, 73, 114, 0.16);
}

.stat-card {
    background: linear-gradient(180deg, #459ce8 0%, #317fcf 100%);
}

.dashboard-card {
    background: linear-gradient(180deg, #4b9fe7 0%, #377fcb 100%);
}

.dashboard-card--ocean {
    background: linear-gradient(180deg, #4e9ae0 0%, #3b80c5 100%);
}

.dashboard-card--royal {
    background: linear-gradient(180deg, #5c8fd3 0%, #446fab 100%);
}

.dashboard-card--sky {
    background: linear-gradient(180deg, #57a9df 0%, #4188c4 100%);
}

.dashboard-card--glacier {
    background: linear-gradient(180deg, #5d99c8 0%, #4879a1 100%);
}

.dashboard-card--navy {
    background: linear-gradient(180deg, #4a78ad 0%, #365987 100%);
}

.dashboard-card::before {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 62%);
}

.dashboard-card-small {
    background-color: #ffffff;
}

.sidebar {
    background: linear-gradient(180deg, #22384f 0%, #284765 100%);
    box-shadow: 0 24px 44px rgba(19, 41, 61, 0.22);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.modal {
    background-color: rgba(18, 33, 47, 0.34);
}

.modal-content {
    background-color: #ffffff;
}

.modal-header {
    background: linear-gradient(180deg, #4197e7 0%, #327fcf 100%);
}

.modal-body {
    background-color: #f7fafe;
}

.modal-body pre {
    background: #eef5fb;
}

.surface-banner-primary,
.alert.alert-info,
.user-action-group-hint {
    background-color: #eef6fd;
    color: #2d5e84;
    border-color: rgba(var(--primary-rgb), 0.12);
}

.alert.alert-warning,
.field-hint.field-hint-warning {
    background-color: #fff5df;
    color: #9a6917;
    border-color: rgba(214, 165, 79, 0.26);
}

.loading,
.empty-state {
    background-color: #f8fbfe;
    border-color: rgba(var(--primary-rgb), 0.12);
}

.user-actions-tabs {
    background-color: var(--surface-soft);
}

.user-actions-tabs .tab-btn.active {
    background: #3390ec;
    box-shadow: 0 10px 22px rgba(var(--primary-rgb), 0.18);
}

.ua-step-dot {
    background: #e4f0fb;
    color: #1b6ca2;
}

.duration-chip,
.selected-count-text,
.reason-count-pill,
#messagesPage #selectedCount,
.surface-banner code,
.back-btn .btn {
    background: #ffffff;
}

.duration-chip:hover {
    background: #f3f9ff;
}
