/* 机房管理系统 - 用户后台通用样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    background: #f8fafc;
    color: #1e293b;
}

body.dark {
    background: #0f172a;
    color: #e2e8f0;
}

/* 布局 */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 220px;
    background: #0f172a;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: width 0.3s;
}

.sidebar.collapsed {
    width: 64px;
}

.sidebar-header {
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    border-bottom: 1px solid #1e293b;
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    background: #22c55e;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 15px;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-title {
    display: none;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px;
}

.menu-group {
    margin-bottom: 16px;
}

.menu-group-title {
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    padding: 8px 12px 4px;
    letter-spacing: 0.5px;
}

.sidebar.collapsed .menu-group-title {
    display: none;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.menu-item:hover {
    background: #1e293b;
    color: #e2e8f0;
}

.menu-item.active {
    background: #22c55e;
    color: #fff;
}

.menu-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.menu-item .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.menu-item .text {
    white-space: nowrap;
}

.sidebar.collapsed .menu-item .text {
    display: none;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid #1e293b;
}

.sidebar-toggle {
    width: 100%;
    padding: 8px;
    background: transparent;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    background: #1e293b;
    color: #e2e8f0;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 220px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s;
}

.sidebar.collapsed+.main-content {
    margin-left: 64px;
}

/* 顶部栏 */
.header {
    height: 56px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

body.dark .header {
    background: #1e293b;
    border-bottom-color: #334155;
}

.header-left {
    color: #64748b;
    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

body.dark .header-btn {
    background: #334155;
    border-color: #475569;
    color: #94a3b8;
}

.header-btn:hover {
    border-color: #22c55e;
    color: #22c55e;
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.user-dropdown:hover {
    background: #f1f5f9;
}

body.dark .user-dropdown:hover {
    background: #334155;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    z-index: 100;
    display: none;
}

body.dark .user-dropdown-menu {
    background: #1e293b;
    border-color: #334155;
}

.user-dropdown-menu.show {
    display: block;
}

.user-dropdown-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #475569;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

body.dark .user-dropdown-menu-item {
    color: #cbd5e1;
}

.user-dropdown-menu-item:hover {
    background: #f1f5f9;
}

body.dark .user-dropdown-menu-item:hover {
    background: #334155;
}

.user-dropdown-menu-item:first-child {
    border-radius: 8px 8px 0 0;
}

.user-dropdown-menu-item:last-child {
    border-radius: 0 0 8px 8px;
}

.user-dropdown-menu-item.danger {
    color: #ef4444;
}

.user-dropdown-menu-item.danger:hover {
    background: #fef2f2;
}

body.dark .user-dropdown-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.user-dropdown-wrapper {
    position: relative;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.user-name {
    font-weight: 500;
    color: #1e293b;
}

body.dark .user-name {
    color: #f1f5f9;
}

/* 页面内容 */
.page-content {
    flex: 1;
    padding: 24px;
}

/* 面包屑 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 13px;
}

.breadcrumb a {
    color: #22c55e;
    text-decoration: none;
}

.breadcrumb span {
    color: #64748b;
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.page-title {
    font-size: 22px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

body.dark .page-title {
    color: #f1f5f9;
}

.page-desc {
    font-size: 14px;
    color: #64748b;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
}

body.dark .btn {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

.btn:hover {
    border-color: #22c55e;
    color: #22c55e;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-primary {
    background: #22c55e;
    border-color: #22c55e;
    color: #fff;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-success {
    background: #22c55e;
    border-color: #22c55e;
    color: #fff;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-danger {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}

.btn-warning:hover {
    background: #d97706;
}

/* 统计卡片 */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid #e2e8f0;
}

body.dark .stat-card {
    background: #1e293b;
    border-color: #334155;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: #dbeafe;
    color: #22c55e;
}

.stat-icon.green {
    background: #dcfce7;
    color: #22c55e;
}

.stat-icon.orange {
    background: #ffedd5;
    color: #f97316;
}

.stat-icon.purple {
    background: #f3e8ff;
    color: #a855f7;
}

body.dark .stat-icon.blue {
    background: rgba(59, 130, 246, 0.2);
}

body.dark .stat-icon.green {
    background: rgba(34, 197, 94, 0.2);
}

body.dark .stat-icon.orange {
    background: rgba(249, 115, 22, 0.2);
}

body.dark .stat-icon.purple {
    background: rgba(168, 85, 247, 0.2);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

body.dark .stat-value {
    color: #f1f5f9;
}

.stat-label {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

body.dark .card {
    background: #1e293b;
    border-color: #334155;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}

body.dark .card-header {
    border-bottom-color: #334155;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.dark .card-title {
    color: #f1f5f9;
}

.card-body {
    padding: 20px;
}

/* 全局统计 */
.global-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.global-stat-item {
    text-align: center;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

body.dark .global-stat-item {
    background: #0f172a;
    border-color: #334155;
}

.global-stat-value {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.global-stat-value.blue {
    color: #22c55e;
}

.global-stat-value.cyan {
    color: #06b6d4;
}

.global-stat-value.orange {
    color: #f97316;
}

.global-stat-value.green {
    color: #22c55e;
}

.global-stat-value.purple {
    color: #a855f7;
}

.global-stat-value.red {
    color: #ef4444;
}

.global-stat-label {
    font-size: 12px;
    color: #64748b;
}

/* 表格 */
table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

body.dark table th,
body.dark table td {
    border-bottom-color: #334155;
}

table th {
    font-weight: 500;
    color: #64748b;
    font-size: 13px;
    background: #f8fafc;
}

body.dark table th {
    background: #0f172a;
    color: #94a3b8;
}

table tbody tr:hover {
    background: #f8fafc;
}

body.dark table tbody tr:hover {
    background: #0f172a;
}

/* 中文注释：卡密管理中“使用者”名称使用普通文本样式，去掉下划线并保持与同列文本一致颜色。 */
.used-by-link,
.used-by-link:visited,
.used-by-link:hover,
.used-by-link:active {
    color: inherit;
    text-decoration: none;
}

/* 标签 */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.tag-success {
    background: #dcfce7;
    color: #16a34a;
}

.tag-danger {
    background: #fef2f2;
    color: #dc2626;
}

.tag-warning {
    background: #fef3c7;
    color: #d97706;
}

.tag-info {
    background: #dbeafe;
    color: #2563eb;
}

body.dark .tag-success {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

body.dark .tag-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

body.dark .tag-warning {
    background: rgba(234, 179, 8, 0.2);
    color: #fbbf24;
}

body.dark .tag-info {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #94a3b8;
}

.empty-state .icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: #cbd5e1;
}

/* 通用隐藏 */
.hidden {
    display: none !important;
}

/* 模态框覆盖层 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay .modal {
    background: #fff;
    border-radius: 12px;
    width: auto;
    min-width: 480px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: block;
    position: relative;
    inset: auto;
}

body.dark .modal-overlay .modal {
    background: #1e293b;
}

/* 模态框（旧样式，兼容） */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

body.dark .modal-content {
    background: #1e293b;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}

body.dark .modal-header {
    border-bottom-color: #334155;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

body.dark .modal-close:hover {
    background: #334155;
    color: #e2e8f0;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
}

body.dark .modal-footer {
    border-top-color: #334155;
}

/* 表单 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 6px;
}

body.dark .form-group label {
    color: #94a3b8;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #1e293b;
    transition: border-color 0.2s;
}

body.dark .form-group input,
body.dark .form-group select,
body.dark .form-group textarea {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #22c55e;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-bar select {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: #475569;
}

body.dark .filter-bar select {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

/* 分页容器 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #475569;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

body.dark .pagination button {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

.pagination button:hover:not(:disabled) {
    border-color: #22c55e;
    color: #22c55e;
}

.pagination button.active {
    background: #22c55e;
    border-color: #22c55e;
    color: #fff;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 统一分页组件样式（用户端覆盖） */
.pagination-wrapper {
    background: transparent;
}

body.dark .pagination-wrapper {
    background: transparent;
}

.pagination-total {
    color: #64748b;
}

body.dark .pagination-total {
    color: #94a3b8;
}

.pagination-total strong {
    color: #22c55e;
}

.pagination-sizes {
    color: #64748b;
}

body.dark .pagination-sizes {
    color: #94a3b8;
}

.pagination-sizes select {
    border-color: #e2e8f0;
    background: #fff;
    color: #334155;
}

body.dark .pagination-sizes select {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

.pagination-sizes select:hover,
.pagination-sizes select:focus {
    border-color: #22c55e;
}

.pagination-btn {
    background: transparent;
    color: #475569;
}

body.dark .pagination-btn {
    background: transparent;
    color: #e2e8f0;
}

.pagination-btn:hover:not(:disabled):not(.current) {
    color: #22c55e;
}

.pagination-btn:disabled {
    color: #94a3b8;
}

body.dark .pagination-btn:disabled {
    color: #64748b;
}

.pagination-btn.current {
    background: #22c55e;
    color: #fff;
}

.pagination-ellipsis {
    color: #94a3b8;
}

.pagination-jumper {
    display: none;
}

/* 代码框 */
.code-box {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

body.dark .code-box {
    background: #334155;
}

/* 消息提示 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    animation: slideIn 0.3s ease;
    width: fit-content;
    max-width: 90vw;
}

.message.success {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #86efac;
}

.message.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 搜索栏 */
.search-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* 表单控件 */
.form-control {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #1e293b;
    transition: border-color 0.2s;
}

body.dark .form-control {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

.form-control:focus {
    outline: none;
    border-color: #22c55e;
}

.form-control::placeholder {
    color: #94a3b8;
}

/* 表格容器 */
.table-container {
    overflow-x: auto;
}

/* 加载和空状态 */
.empty,
.loading {
    text-align: center;
    padding: 32px;
    color: #94a3b8;
}

/* 按钮组 */
.btn-group {
    display: flex;
    gap: 6px;
}

/* 统计卡片（用户详情） */
.stat-card-mini {
    text-align: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

body.dark .stat-card-mini {
    background: #0f172a;
    border-color: #334155;
}

.stat-card-mini .label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.stat-card-mini .value {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

body.dark .stat-card-mini .value {
    color: #f1f5f9;
}

.stat-card-mini .sub {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

/* 更多按钮样式 */
.btn-warning {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-info {
    background: #06b6d4;
    border-color: #06b6d4;
    color: #fff;
}

.btn-info:hover {
    background: #0891b2;
}

/* 更多统计图标颜色 */
.stat-icon.cyan {
    background: #cffafe;
    color: #06b6d4;
}

.stat-icon.red {
    background: #fee2e2;
    color: #ef4444;
}

.stat-icon.gray {
    background: #f1f5f9;
    color: #64748b;
}

body.dark .stat-icon.cyan {
    background: rgba(6, 182, 212, 0.2);
}

body.dark .stat-icon.red {
    background: rgba(239, 68, 68, 0.2);
}

body.dark .stat-icon.gray {
    background: rgba(100, 116, 139, 0.2);
}

/* 交易记录筛选按钮 */
.trans-filter-btn {
    border: 1px solid #e2e8f0;
    background: #fff;
}

.trans-filter-btn.active {
    background: #22c55e;
    color: #fff;
    border-color: #22c55e;
}

.trans-filter-btn:hover:not(.active) {
    background: #f1f5f9;
}

body.dark .trans-filter-btn {
    background: #334155;
    border-color: #475569;
}

body.dark .trans-filter-btn:hover:not(.active) {
    background: #475569;
}

/* 默认标签 */
.tag-default {
    background: #f1f5f9;
    color: #64748b;
}

body.dark .tag-default {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
}

/* 导出文本框 */
.export-textarea {
    width: 100%;
    height: 200px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    color: #1e293b;
    resize: vertical;
}

body.dark .export-textarea {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

/* 手机端汉堡菜单按钮（默认隐藏） */
.mobile-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

body.dark .mobile-menu-btn {
    background: #334155;
    border-color: #475569;
    color: #94a3b8;
}

.mobile-menu-btn:hover {
    border-color: #22c55e;
    color: #22c55e;
}

/* 手机端侧边栏关闭按钮（默认隐藏） */
.sidebar-close-btn {
    display: none;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 6px;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.sidebar-close-btn:hover {
    background: #1e293b;
    color: #fff;
}

/* 手机端侧边栏遮罩（默认隐藏） */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* 响应式 */
@media (max-width: 1200px) {
    .stat-cards {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .global-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {

    /* 手机端侧边栏改为抽屉式 */
    .sidebar {
        position: fixed;
        left: -260px;
        width: 260px;
        z-index: 200;
        transition: left 0.3s ease;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .sidebar.mobile-open .sidebar-title,
    .sidebar.mobile-open .menu-group-title,
    .sidebar.mobile-open .menu-item .text {
        display: block;
    }

    .sidebar-close-btn {
        display: flex;
    }

    .sidebar-footer {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    /* 统计卡片 */
    .stat-cards {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-value {
        font-size: 18px;
    }

    .stat-label {
        font-size: 12px;
    }

    /* 全局统计 */
    .global-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .global-stat-item {
        padding: 12px 8px;
    }

    .global-stat-value {
        font-size: 18px;
    }

    /* 页面头部 - 标题左侧、按钮右侧同行 */
    .page-header {
        flex-direction: row;
        gap: 8px;
        align-items: flex-start;
        justify-content: space-between;
    }

    .page-title {
        font-size: 18px;
    }

    /* 页面内容区 */
    .page-content {
        padding: 16px;
    }

    /* 卡片 */
    .card-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .card-body {
        padding: 16px;
    }

    .card-title {
        font-size: 14px;
    }

    /* 按钮 */
    .btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .btn-group {
        flex-wrap: wrap;
    }

    /* 搜索栏 */
    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-bar .form-control {
        width: 100% !important;
    }

    .search-bar .btn {
        width: 100%;
        justify-content: center;
    }

    /* 表格 */
    table th,
    table td {
        padding: 10px 12px;
        font-size: 13px;
        white-space: nowrap;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -16px;
        padding: 0 16px;
    }

    .card-body {
        position: relative;
    }

    /* 手机端隐藏不重要的表格列 */
    .hide-on-mobile {
        display: none !important;
    }

    /* 模态框 */
    .modal-overlay .modal {
        width: 95vw !important;
        min-width: unset;
        max-height: 85vh;
        margin: 16px;
    }

    .modal-header {
        padding: 12px 16px;
    }

    .modal-header h3 {
        font-size: 15px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .modal-footer .btn {
        flex: 1;
        min-width: 80px;
        justify-content: center;
    }

    /* 用户详情弹窗内的统计网格 */
    .detail-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    /* 用户详情弹窗内的按钮组 */
    .modal-header .btn-group,
    .modal-header>div {
        flex-wrap: wrap;
        gap: 6px !important;
    }

    .modal-header .btn-sm {
        padding: 4px 8px;
        font-size: 12px;
    }

    /* 表单 */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
    }

    /* 分页 */
    .pagination {
        flex-wrap: wrap;
        gap: 6px;
    }

    .pagination button {
        padding: 8px 12px;
    }

    /* 顶部栏 */
    .header {
        padding: 0 16px;
    }

    .header-left {
        display: none;
    }

    .user-name {
        display: none;
    }

    /* 面包屑 */
    .breadcrumb {
        font-size: 12px;
        margin-bottom: 12px;
    }

    /* 财务统计弹窗按钮组 */
    .finance-period-btn {
        flex: 1;
        min-width: calc(33% - 8px);
        text-align: center;
        justify-content: center;
    }

    /* 卡密管理筛选栏 */
    .cards-filter {
        flex-wrap: wrap;
        gap: 8px;
    }

    .cards-filter select {
        flex: 1;
        min-width: 100px;
    }

    .cards-filter #batchActionsArea {
        width: 100%;
        margin-left: 0 !important;
        margin-top: 8px;
        padding-left: 0 !important;
        padding-top: 8px;
        border-left: none !important;
        border-top: 1px solid #e2e8f0;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    body.dark .cards-filter #batchActionsArea {
        border-top-color: #334155;
    }

    /* 用户列表 - 手机端隐藏表格，显示卡片 */
    .users-table-desktop {
        display: none !important;
    }

    .users-cards {
        display: flex !important;
    }

    /* 授权配置弹窗 - 手机端隐藏表格，显示卡片 */
    .price-table-desktop {
        display: none !important;
    }

    .price-cards-mobile {
        display: flex !important;
    }

    /* 机房授权弹窗 - 手机端隐藏表格，显示卡片 */
    .licenses-table-desktop {
        display: none !important;
    }

    .licenses-cards-mobile {
        display: flex !important;
    }

    .rooms-table-desktop {
        display: none !important;
    }

    .rooms-cards-mobile {
        display: flex !important;
    }

    /* 手机端显示/隐藏 */
    .show-on-mobile {
        display: inline !important;
    }

    .hide-on-mobile {
        display: none !important;
    }
}

/* 用户卡片列表样式（默认隐藏，手机端显示） */
.users-cards {
    display: none;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.user-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

body.dark .user-card {
    background: #1e293b;
    border-color: #334155;
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
}

body.dark .user-card-header {
    border-bottom-color: #334155;
}

.user-card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #1d4ed8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.user-card-info {
    flex: 1;
    min-width: 0;
}

.user-card-name {
    font-weight: 600;
    font-size: 15px;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark .user-card-name {
    color: #f1f5f9;
}

.user-card-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px 16px;
    background: #f8fafc;
}

body.dark .user-card-stats {
    background: #0f172a;
}

.user-card-stat {
    text-align: center;
}

.user-card-stat .stat-value {
    font-weight: 700;
    font-size: 16px;
    color: #1e293b;
}

body.dark .user-card-stat .stat-value {
    color: #f1f5f9;
}

.user-card-stat .stat-label {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.user-card-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #f1f5f9;
}

body.dark .user-card-actions {
    border-top-color: #334155;
}

.user-card-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 12px;
    padding: 8px 10px;
}

/* 授权价格卡片样式（默认隐藏，手机端显示） */
.price-cards-mobile {
    display: none;
    flex-direction: column;
    gap: 10px;
    padding: 0;
}

.price-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

body.dark .price-card {
    background: #1e293b;
    border-color: #334155;
}

.price-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

body.dark .price-card-header {
    background: #0f172a;
    border-bottom-color: #334155;
}

.price-card-title {
    font-weight: 700;
    font-size: 14px;
    color: #1e293b;
}

body.dark .price-card-title {
    color: #f1f5f9;
}

.price-card-body {
    display: flex;
    flex-direction: column;
}

.price-card-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.2s;
}

.price-card-item:last-child {
    border-bottom: none;
}

body.dark .price-card-item {
    background: #1e293b;
    border-bottom-color: #334155;
}

.price-card-item:hover {
    background: #f8fafc;
}

body.dark .price-card-item:hover {
    background: #334155;
}

.price-card-item:active {
    background: #f1f5f9;
}

body.dark .price-card-item:active {
    background: #475569;
}

.price-card-item-label {
    font-size: 13px;
    color: #475569;
    font-weight: 500;
}

body.dark .price-card-item-label {
    color: #94a3b8;
}

.price-card-item-value {
    font-weight: 700;
    font-size: 14px;
    color: #22c55e;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.price-card-item-value.disabled {
    color: #94a3b8;
    font-weight: 500;
}

.price-card-item-value.empty {
    color: #cbd5e1;
    font-weight: 400;
    font-size: 12px;
}

/* 授权码卡片样式（手机端） */
.licenses-cards-mobile,
.rooms-cards-mobile {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.license-card,
.room-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

body.dark .license-card,
body.dark .room-card {
    background: #1e293b;
    border-color: #334155;
}

.license-card-header,
.room-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    gap: 8px;
}

body.dark .license-card-header,
body.dark .room-card-header {
    background: #0f172a;
    border-bottom-color: #334155;
}

.license-code {
    font-size: 11px;
    color: #22c55e;
    background: #eff6ff;
    padding: 4px 8px;
    border-radius: 4px;
    word-break: break-all;
}

body.dark .license-code {
    background: rgba(59, 130, 246, 0.2);
}

.license-card-body,
.room-card-body {
    padding: 10px 12px;
}

.license-card-row,
.room-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 13px;
}

.license-card-row .label,
.room-card-row .label {
    color: #64748b;
}

body.dark .license-card-row .label,
body.dark .room-card-row .label {
    color: #94a3b8;
}

.license-card-row .value,
.room-card-row .value {
    color: #1e293b;
    font-weight: 500;
}

body.dark .license-card-row .value,
body.dark .room-card-row .value {
    color: #f1f5f9;
}

.license-card-actions {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
}

body.dark .license-card-actions {
    border-top-color: #334155;
}

.license-card-actions .btn {
    flex: 1;
    min-width: 70px;
    justify-content: center;
    font-size: 11px;
    padding: 6px 8px;
}

/* 手机端显示/隐藏控制 */
.show-on-mobile {
    display: none;
}

@media (max-width: 480px) {

    /* 超小屏幕 */
    .stat-cards {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
        gap: 10px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
    }

    .stat-icon svg {
        width: 18px !important;
        height: 18px !important;
    }

    .stat-value {
        font-size: 16px;
    }

    .stat-label {
        font-size: 11px;
    }

    /* 全局统计 */
    .global-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .global-stat-value {
        font-size: 16px;
    }

    .global-stat-label {
        font-size: 11px;
    }

    /* 按钮组 */
    .btn-group {
        width: 100%;
    }

    .btn-group .btn {
        flex: 1;
        justify-content: center;
    }

    /* 模态框内统计卡片 */
    .stat-card-mini {
        padding: 10px;
    }

    .stat-card-mini .value {
        font-size: 16px;
    }

    /* 财务统计日期选择器 */
    #customDateRange>div {
        flex-direction: column;
        gap: 8px;
    }

    #customDateRange .form-control {
        width: 100% !important;
    }

    /* 表格强制横向滚动 */
    .table-container {
        margin: 0 -16px;
        padding: 0 16px;
    }
}

/* 卡密卡片样式（默认隐藏，手机端显示） */
.cards-cards-mobile {
    display: none;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.recharge-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

body.dark .recharge-card {
    background: #1e293b;
    border-color: #334155;
}

.recharge-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

body.dark .recharge-card-header {
    background: #0f172a;
    border-bottom-color: #334155;
}

.recharge-card-header input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.recharge-card-code {
    flex: 1;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    color: #22c55e;
    word-break: break-all;
}

body.dark .recharge-card-code {
    color: #60a5fa;
}

.recharge-card-body {
    padding: 12px 14px;
}

.recharge-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.recharge-card-row:not(:last-child) {
    border-bottom: 1px solid #f1f5f9;
}

body.dark .recharge-card-row:not(:last-child) {
    border-bottom-color: #334155;
}

.recharge-card-row .label {
    color: #64748b;
}

body.dark .recharge-card-row .label {
    color: #94a3b8;
}

.recharge-card-row .value {
    color: #1e293b;
    font-weight: 500;
}

body.dark .recharge-card-row .value {
    color: #f1f5f9;
}

.recharge-card-row .value.amount {
    color: #22c55e;
    font-weight: 700;
    font-size: 15px;
}

.recharge-card-actions {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid #f1f5f9;
}

body.dark .recharge-card-actions {
    border-top-color: #334155;
}

.recharge-card-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 12px;
    padding: 8px 10px;
}

/* 卡密页面 - 手机端按钮组（默认隐藏） */
.cards-btn-group-mobile {
    display: none;
    align-items: center;
    gap: 8px;
}

.cards-more-dropdown {
    position: relative;
}

.cards-more-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    min-width: 160px;
    z-index: 200;
    overflow: hidden;
    animation: cardsMenuSlideIn 0.15s ease-out;
}

@keyframes cardsMenuSlideIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.dark .cards-more-menu {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.cards-more-menu.show {
    display: block;
}

.cards-more-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

body.dark .cards-more-item {
    color: #cbd5e1;
}

.cards-more-item:hover {
    background: #f1f5f9;
}

body.dark .cards-more-item:hover {
    background: #334155;
}

.cards-more-item:active {
    background: #e2e8f0;
}

body.dark .cards-more-item:active {
    background: #475569;
}

.cards-more-item:not(:last-child) {
    border-bottom: 1px solid #f1f5f9;
}

body.dark .cards-more-item:not(:last-child) {
    border-bottom-color: #334155;
}

/* 手机端显示卡密卡片 */
@media (max-width: 768px) {
    .cards-table-desktop {
        display: none !important;
    }

    .cards-cards-mobile {
        display: flex !important;
    }

    /* 桌面端按钮组隐藏，手机端按钮组显示 */
    .cards-btn-group-desktop {
        display: none !important;
    }

    .cards-btn-group-mobile {
        display: flex !important;
    }

    /* 模态框中modal-content适配手机 */
    .modal-content {
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 90vh;
    }
}

/* ===== 用户后台特有样式 ===== */

/* 仪表盘容器 */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 统计卡片网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stats-grid .stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s, transform 0.2s;
}

.stats-grid .stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

body.dark .stats-grid .stat-card {
    background: #1e293b;
    border-color: #334155;
}

.stats-grid .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.stats-grid .stat-info {
    flex: 1;
}

.stats-grid .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

body.dark .stats-grid .stat-value {
    color: #f1f5f9;
}

.stats-grid .stat-label {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}

/* 区块卡片 */
.section-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

body.dark .section-card {
    background: #1e293b;
    border-color: #334155;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}

body.dark .section-header {
    border-bottom-color: #334155;
}

.section-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

body.dark .section-header h3 {
    color: #f1f5f9;
}

/* 快捷操作 */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 20px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: #475569;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.quick-action-btn:hover {
    background: #22c55e;
    border-color: #22c55e;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

body.dark .quick-action-btn {
    background: #0f172a;
    border-color: #334155;
    color: #94a3b8;
}

body.dark .quick-action-btn:hover {
    background: #22c55e;
    border-color: #22c55e;
    color: #fff;
}

/* 机房列表 */
.room-list {
    padding: 16px 20px;
}

.room-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.room-list-item:last-child {
    border-bottom: none;
}

body.dark .room-list-item {
    border-bottom-color: #334155;
}

.room-list-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.room-list-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.room-list-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
}

body.dark .room-list-name {
    color: #f1f5f9;
}

.room-list-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.room-list-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
}

.room-list-status.online {
    color: #22c55e;
}

.room-list-status.offline {
    color: #ef4444;
}

.room-list-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* 活动列表 */
.activity-list {
    padding: 16px 20px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.activity-item:last-child {
    border-bottom: none;
}

body.dark .activity-item {
    border-bottom-color: #334155;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #dbeafe;
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

body.dark .activity-icon {
    background: rgba(59, 130, 246, 0.2);
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: 13px;
    color: #1e293b;
    line-height: 1.5;
}

body.dark .activity-text {
    color: #e2e8f0;
}

.activity-time {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

/* 授权状态徽章 */
.license-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

body.dark .license-badge {
    background: #334155;
    border-color: #475569;
    color: #94a3b8;
}

.license-badge.valid {
    background: #dcfce7;
    color: #16a34a;
    border-color: #86efac;
}

body.dark .license-badge.valid {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.3);
}

.license-badge.invalid {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fca5a5;
}

body.dark .license-badge.invalid {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

.license-badge.expired {
    background: #fef3c7;
    color: #d97706;
    border-color: #fcd34d;
}

body.dark .license-badge.expired {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

/* 加载占位符 */
.loading-placeholder {
    text-align: center;
    padding: 32px;
    color: #94a3b8;
    font-size: 14px;
}

/* 空状态改进 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.empty-state i {
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 14px;
    margin: 0;
}

.empty-state a {
    color: #22c55e;
    text-decoration: none;
}

.empty-state a:hover {
    text-decoration: underline;
}

/* 表单标签 */
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 6px;
}

body.dark .form-label {
    color: #94a3b8;
}

/* 用户后台响应式 */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard {
        gap: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stats-grid .stat-card {
        padding: 16px;
        gap: 12px;
    }

    .stats-grid .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stats-grid .stat-value {
        font-size: 20px;
    }

    .stats-grid .stat-label {
        font-size: 12px;
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 16px;
    }

    .quick-action-btn {
        padding: 16px 12px;
        font-size: 12px;
    }

    .section-header {
        padding: 12px 16px;
    }

    .section-header h3 {
        font-size: 14px;
    }

    .room-list,
    .activity-list {
        padding: 12px 16px;
    }

    .license-badge span {
        display: none;
    }

    .license-badge {
        padding: 6px 8px;
    }
}

@media (max-width: 480px) {
    .stats-grid .stat-card {
        padding: 12px;
        gap: 10px;
    }

    .stats-grid .stat-icon {
        width: 36px;
        height: 36px;
    }

    .stats-grid .stat-icon svg {
        width: 18px !important;
        height: 18px !important;
    }

    .stats-grid .stat-value {
        font-size: 18px;
    }

    .quick-actions {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 12px;
    }

    .quick-action-btn {
        padding: 14px 10px;
        font-size: 11px;
        gap: 8px;
    }
}

/* ========== 表格标题栏 ========== */
.table-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

body.dark .table-header-bar {
    background: #1e293b;
    border-bottom-color: #334155;
}

.table-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

body.dark .table-title {
    color: #f1f5f9;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-actions .btn-sm {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.table-actions .btn-sm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.selection-info {
    font-size: 13px;
    color: #64748b;
    padding: 0 8px;
}

.selection-info strong {
    color: #22c55e;
    font-weight: 600;
}

body.dark .selection-info {
    color: #94a3b8;
}