:root {
    /* 主色调 */
    --primary-blue: #2563eb;
    --primary-blue-dark: #1d4ed8;
    --accent-pink: #ec4899;
    --accent-purple: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    /* 背景色 */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #f1f5f9;

    /* 文字色 */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    /* 边框色 */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-strong: #94a3b8;

    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* 圆角 */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* 过渡动画 */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-sidebar: #1e293b;

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --border-light: #334155;
    --border-medium: #475569;
    --border-strong: #64748b;
}

[data-theme="dark"] .user-info-bar {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(236, 72, 153, 0.15));
    border-bottom-color: var(--border-medium);
}

[data-theme="dark"] .system-stats .stat-item {
    background: var(--bg-secondary);
    border-color: var(--border-medium);
}

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 页面切换动画 */
.page-transition {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease-in-out;
}

.page-enter {
    opacity: 1;
    transform: translateY(0);
}

.page-exit {
    opacity: 0;
    transform: translateY(-20px);
}

body {
    position: relative;
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    transition: var(--transition);
}

/* 现代化导航栏 */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 64px;
}

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

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-btn,
select.nav-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn:hover,
select.nav-btn:hover {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

#userGreeting {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 主布局容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.content {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* 现代化侧边栏 */
.sidebar {
    flex: 0 0 320px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    padding: 24px;
    position: sticky;
    top: 88px;
    box-shadow: var(--shadow-sm);
}

.main-content {
    flex: 1;
    min-width: 0;
}

.main-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.user-list-section {
    padding: 1.5rem;
}

.section {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin-bottom: 0;
}

.section:hover {
    box-shadow: none;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

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

.section-header>div {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* 现代化表单 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group .button-group {
    margin-top: 0.36em;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

input,
textarea,
select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

/* 现代化按钮 */
button {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#refreshBtn {
    white-space: nowrap;
    min-width: 120px;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-blue-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-primary);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.btn-success {
    background: var(--success);
    color: white;
}

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

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-small {
    padding: 0.5rem 0.1rem;
    font-size: 0.75rem;
}

.button-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.button-group button {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 现代化用户卡片网格 - 保留原有结构 */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.user-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-light);
    position: relative;
}

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

/* 卡片顶部区域 */
.card-top {
    position: relative;
    height: 140px;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-purple));
    overflow: visible;
}

.card-background {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.card-top.not-live .card-background {
    filter: grayscale(100%);
    opacity: 0.7;
}

.user-card:hover .card-background {
    transform: scale(1.05);
}

/* 粉丝勋章 */
.medal-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-purple));
    color: white;
    padding: 0.325rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 20;
    box-shadow: var(--shadow-md);
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 直播状态指示器 */
.live-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.325rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 50;
}

.live-status.live {
    background: var(--error);
    color: white;
}

.live-status.offline {
    background: var(--text-muted);
    color: white;
}

/* 头像容器 */
.avatar-container {
    position: absolute;
    bottom: -2rem;
    left: 1.5rem;
    width: 4rem;
    height: 4rem;
    border: 4px solid var(--bg-card);
    border-radius: 50%;
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    overflow: hidden;
    transition: var(--transition);
}

.user-card:hover .avatar-container {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

.avatar-link {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    text-decoration: none;
    cursor: pointer;
    position: relative;
}

.user-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 101;
}

/* 直播标题 */
.live-title {
    position: absolute;
    bottom: -2.5rem;
    left: 6rem;
    right: 1.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    font-size: 0.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    min-height: 2rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    max-width: calc(100% - 7.5rem);
    z-index: 200;
    font-weight: 500;
}

.live-title.live {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(251, 191, 36, 0.1));
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

.live-title.offline {
    background: var(--bg-secondary);
    border-color: var(--border-light);
    color: var(--text-secondary);
}

.live-title.scrollable .scroll-content {
    display: inline-block;
    white-space: nowrap;
    animation: scrollLiveTitle 8s linear infinite;
    padding-right: 1.25rem;
}

.live-title.scrollable:hover .scroll-content {
    animation-play-state: paused;
}

@keyframes scrollLiveTitle {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-100% + 120px));
    }
}

/* 开播时间显示 */
.live-time-display {
    position: absolute;
    bottom: 0;
    right: 3px;
    padding: 0.25rem 0.5rem;
    color: #bb178f;
    font-size: 0.75rem;
    z-index: 150;
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.925rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.live-time-display span {
    font-weight: 700;
    text-shadow: 2px 1px 4px white;
}

/* 卡片底部内容 */
.card-bottom {
    padding: 3rem 1.5rem 1.5rem;
    background: var(--bg-card);
}

.user-basic-info {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.user-info-left {
    flex: 1;
    min-width: 0;
}

.user-card .user-name {
    font-size: 1.0rem;
    font-weight: 600;
    color: var(--accent-pink);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-uid {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* 用户统计信息 */
.user-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-stats .stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    flex-direction: row;
}

.user-stats .stat-item:hover {
    background: rgba(37, 99, 235, 0.15);
    transform: translateX(2px);
}

.stat-label {
    padding-right: 18px;
    font-size: 0.85em;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 500;
    order: 1;
}

.stat-value {
    font-size: 1em;
    font-weight: bold;
    color: var(--primary-blue);
    order: 2;
}

.user-stats .stat-item:last-child .stat-value {
    color: var(--success);
}

.user-stats .stat-item:nth-child(2) .stat-value {
    color: var(--accent-purple);
}

.user-stats .stat-item:nth-child(3) .stat-value {
    color: var(--text-primary);
}

/* 用户操作按钮 */
.user-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.user-actions button {
    flex: 1;
}

/* 预览卡片特殊样式 */
.preview-card {
    background: linear-gradient(135deg, rgba(254, 243, 199, 0.1), rgba(253, 230, 138, 0.1)) !important;
    border: 2px dashed var(--warning);
}

/* 现代化模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-card);
    margin: 10% auto;
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 400px;
    position: relative;
    border: 1px solid var(--border-light);
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
}

/* 信息栏样式 */
.user-info-bar {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info-bar {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(236, 72, 153, 0.1));
    border-bottom: 1px solid var(--border-light);
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.guest-notice {
    display: none !important;
}

/* 系统统计显示 */
.system-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.system-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.system-stats .stat-item:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
}

.system-stats .stat-item strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* 用户问候语样式 */
#userGreetingContainer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-primary);
}

#currentUsername {
    color: var(--primary-blue);
    font-weight: 600;
}

#userRole {
    background: var(--primary-blue);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

/* 在线人数动画 */
.online-count {
    transition: var(--transition);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
}

.online-increase {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--success);
    animation: pulse-green 1s ease-in-out;
}

.online-decrease {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--error);
    animation: pulse-red 1s ease-in-out;
}

@keyframes pulse-green {
    0% {
        background-color: rgba(16, 185, 129, 0.2);
    }

    50% {
        background-color: rgba(16, 185, 129, 0.5);
    }

    100% {
        background-color: rgba(16, 185, 129, 0.2);
    }
}

@keyframes pulse-red {
    0% {
        background-color: rgba(239, 68, 68, 0.2);
    }

    50% {
        background-color: rgba(239, 68, 68, 0.5);
    }

    100% {
        background-color: rgba(239, 68, 68, 0.2);
    }
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.spinner {
    border: 3px solid var(--border-light);
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* 消息提示 */
.error,
.success,
.info {
    padding: 1rem;
    border-radius: var(--radius-lg);
    margin: 1rem 0;
    font-size: 0.875rem;
}

.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.info {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.2);
    color: var(--primary-blue);
}

/* 加载更多容器 */
.load-more-container {
    text-align: center;
    margin-top: 2rem;
}

.load-more-container button {
    width: auto;
    padding: 0.875rem 2rem;
}

/* 页脚样式 */
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    text-align: center;
}

.footer-content p {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer-content a {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.footer-content a:hover {
    color: var(--primary-blue-dark);
    background: rgba(37, 99, 235, 0.1);
}

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

.login-hint {
    margin-top: 1.25rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-align: center;
}

.login-hint p {
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .users-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .user-info-bar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        text-align: center;
    }

    .system-stats {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .main-card {
        border-radius: var(--radius-lg);
    }

    .user-info-bar {
        padding: 1rem;
    }

    .user-list-section {
        padding: 1rem;
    }

    .system-stats {
        gap: 0.75rem;
    }

    .system-stats .stat-item {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }

    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
}

@media (max-width: 576px) {
    .system-stats {
        flex-direction: column;
        gap: 0.5rem;
    }

    .system-stats .stat-item {
        width: 100%;
        justify-content: center;
    }

    #userGreetingContainer {
        flex-direction: column;
        gap: 0.5rem;
    }
}