:root {
    --primary: #5b6cf9;
    --primary-dark: #4656d6;
    --primary-light: #eef0ff;
    --bg: #f7f8fc;
    --text: #1f2335;
    --dark: #1f2335;
    --muted: #6b7280;
    --border: #e5e7eb;
    --success: #059669;
    --success-bg: #d1fae5;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --warning: #f59e0b;
    --sidebar-bg: #1e2337;
    --sidebar-text: #a0a7c0;
    --radius: 16px;
    --radius-sm: 12px;
    --radius-lg: 20px;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.03);
}

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

html {
    font-size: 16px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    min-height: 100vh;
    line-height: 1.6;
}

.front-page {
    display: flex;
    flex-direction: column;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

/* ========== 按钮 ========== */
.btn {
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.btn-gradient,
.btn-primary-custom,
.btn-login {
    background: var(--primary);
    border: none;
    color: #fff;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-gradient:hover,
.btn-primary-custom:hover,
.btn-login:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(91, 108, 249, 0.3);
}

.btn-gradient:disabled,
.btn-primary-custom:disabled,
.btn-login:disabled {
    background: #c7c9d6;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

.btn-light {
    background: #f3f4f6;
    border-color: #f3f4f6;
    color: var(--text);
}

.btn-light:hover {
    background: #e5e7eb;
    border-color: #e5e7eb;
    color: var(--text);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

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

.btn-outline-secondary {
    color: var(--muted);
    border-color: var(--border);
}

.btn-outline-secondary:hover {
    background: #f3f4f6;
    border-color: var(--border);
    color: var(--text);
}

.btn-outline-danger {
    color: var(--danger);
    border-color: var(--danger);
}

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

.btn-outline-warning {
    color: #b45309;
    border-color: #f59e0b;
}

.btn-outline-warning:hover {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}

/* 按钮与文字垂直对齐 */
.btn,
button {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.page-header .btn {
    flex-shrink: 0;
}

.section-header .btn {
    flex-shrink: 0;
}

/* ========== 表单 ========== */
.form-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border-radius: 10px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    font-size: 0.95rem;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(91, 108, 249, 0.15);
}

.form-control::placeholder {
    color: #adb5bd;
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}

.form-text {
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 0.4rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 0;
    min-height: auto;
    margin-bottom: 1rem;
}

.form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0;
    border-color: var(--border);
    flex-shrink: 0;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* form-switch 开关样式 */
.form-switch {
    padding-left: 2.75em;
}

.form-switch .form-check-input {
    width: 2.5em;
    height: 1.3em;
    margin-left: -2.75em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    background-position: left center;
    border-radius: 2em;
    transition: background-position 0.15s ease-in-out, background-color 0.15s ease-in-out;
    background-color: #dee2e6;
    cursor: pointer;
}

.form-switch .form-check-input:checked {
    background-position: right center;
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-switch .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(91, 108, 249, 0.15);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(91, 108, 249, 0.15);
}

.form-check-label {
    font-size: 0.95rem;
    color: var(--text);
}

/* 统一表单元素间距 */
.form-group,
.mb-form {
    margin-bottom: 1.25rem;
}

/* ========== 卡片 ========== */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    background: #fff;
    overflow: hidden;
}

.card-body {
    padding: 1.5rem;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
    padding: 1.25rem 1.5rem;
}

.card-header h5,
.card-header h6 {
    font-weight: 700;
}

/* 卡片内容区块间距统一 */
.card-body .section-title {
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

/* 表格内联按钮组间距 */
.table td .btn + .btn {
    margin-left: 0.35rem;
}

/* 下拉选择框样式增强 */
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(91, 108, 249, 0.15);
}

/* ========== 前台首页 ========== */
.front-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
}

.front-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.front-brand i {
    color: var(--primary);
    font-size: 1.5rem;
}

.front-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.front-hero {
    text-align: center;
    max-width: 520px;
}

.front-hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.front-hero p {
    font-size: 1.1rem;
    color: var(--muted);
    line-height: 1.8;
    margin-bottom: 40px;
}

.front-hero .btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 40px;
    font-size: 1.1rem;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(91, 108, 249, 0.28);
}

.front-hero .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(91, 108, 249, 0.35);
}

.front-hero .btn-login i {
    font-size: 1.3rem;
}

.front-features {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 52px;
    flex-wrap: wrap;
}

.front-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.95rem;
}

.front-feature i {
    color: var(--primary);
    font-size: 1.1rem;
}

.admin-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d1d5db;
    display: inline-block;
    transition: 0.2s;
}

.admin-dot:hover {
    background: var(--primary);
}

.front-footer {
    padding: 28px 24px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* ========== 登录卡片（前台/后台通用） ========== */
.login-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 420px;
    padding: 44px;
}

.login-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    margin-bottom: 24px;
}

.login-card h4 {
    font-size: 1.5rem;
    font-weight: 700;
}

.login-card .btn-login {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border-radius: 10px;
}

.login-divider {
    position: relative;
    margin: 1.5rem 0;
    text-align: center;
}

.login-divider hr {
    margin: 0;
    color: var(--border);
}

.login-divider span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 0 12px;
    color: var(--muted);
    font-size: 0.85rem;
}

/* ========== 后台侧边栏 ========== */
.admin-wrapper {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 260px;
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
}

.sidebar .brand {
    padding: 0 22px 26px;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.sidebar .brand i {
    color: var(--primary);
    font-size: 1.4rem;
}

.sidebar .nav {
    flex: 1;
    padding: 0 12px;
}

.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: 13px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 4px;
    font-size: 0.95rem;
    font-weight: 500;
}

.sidebar .nav-link i {
    width: 22px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff;
    background: rgba(91, 108, 249, 0.15);
}

.sidebar-footer {
    padding: 16px 22px;
    color: #6b7280;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 0 12px;
}

.sidebar-footer .nav-link {
    margin: 0;
    padding: 10px 0;
    color: #9ca3af;
}

.sidebar-footer .nav-link:hover {
    background: transparent;
    color: #fff;
}

.main-content {
    margin-left: 260px;
    flex: 1;
    min-height: 100vh;
    padding: 30px;
    padding-bottom: 60px;
}

.admin-topbar {
    display: none;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
}

.page-header h4,
.page-header h5 {
    font-weight: 700;
    margin-bottom: 0;
}

/* ========== 统计卡片 ========== */
.stat-card {
    border: none;
    border-radius: 16px;
    transition: transform 0.2s;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card .card-body {
    padding: 1.25rem;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

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

/* ========== 表格卡片 ========== */
.table-card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.table-card .card-body {
    padding: 0;
}

.table-card .table {
    margin-bottom: 0;
}

.table-card .table thead th {
    font-weight: 600;
    letter-spacing: 0.3px;
    background: #f8f9fa;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
}

.table-card .table tbody td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
}

.table-card .table tbody tr {
    transition: background 0.15s;
}

.table-card .table tbody tr:hover {
    background: #f8f9ff;
}

/* ========== 区块标题 ========== */
.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.section-title i {
    color: var(--primary);
    font-size: 1.15rem;
}

/* ========== 用户中心 ========== */
.user-navbar {
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    padding: 14px 0;
}

.user-navbar .navbar-brand {
    font-weight: 700;
    color: var(--text) !important;
    font-size: 1.15rem;
}

.user-navbar .navbar-brand i {
    color: var(--primary);
}

.user-navbar .navbar-text {
    font-size: 0.95rem;
}

.user-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-radius: 16px;
    border: none;
    box-shadow: 0 8px 24px rgba(91, 108, 249, 0.22);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.user-avatar {
    width: 68px;
    height: 68px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    margin-right: 18px;
    flex-shrink: 0;
}

.user-card h4,
.user-card h5 {
    color: #fff;
    font-weight: 700;
    margin-bottom: 6px;
}

.user-card h4 {
    font-size: 1.4rem;
}

.user-card p {
    font-size: 0.95rem;
    margin-bottom: 0;
    opacity: 0.85;
}

.uid-badge,
.level-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}

.level-badge i {
    font-size: 0.9rem;
}

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

.user-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    margin-bottom: 16px;
}

.rank-badge,
.group-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.rank-badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--rank-color, #fff);
}

.exp-bar-wrap {
    margin-top: 6px;
}

.exp-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 6px;
}

.exp-bar-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.exp-bar-fill {
    height: 100%;
    background: #fff;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.exp-summary-card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: #fff;
}

.exp-summary-card .exp-bar-bg {
    height: 10px;
    background: var(--primary-light);
    border-radius: 5px;
    overflow: hidden;
}

.exp-summary-card .exp-bar-fill {
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 5px;
}

.drag-col {
    width: 40px;
    text-align: center;
    cursor: grab;
}

.drag-handle {
    color: var(--muted);
    display: inline-flex;
    padding: 6px;
    border-radius: 6px;
    transition: 0.15s;
}

.drag-handle:hover {
    background: #f3f4f6;
    color: var(--primary);
}

.drag-handle:active {
    cursor: grabbing;
}

.sortable-ghost {
    background: #f8f9ff;
    opacity: 0.6;
}

.sortable-ghost td {
    border-top: 2px dashed var(--primary);
    border-bottom: 2px dashed var(--primary);
}

.rule-card,
.project-card {
    background: #fff;
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    height: 100%;
    animation: fadeInUp 0.4s ease both;
}

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

.rule-card:hover,
.project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(91, 108, 249, 0.12);
}

.project-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    color: inherit;
}

.project-card.locked {
    opacity: 0.7;
    filter: grayscale(0.3);
    pointer-events: none;
}

.rule-icon,
.project-icon,
.list-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.rule-icon {
    background: var(--primary);
    color: #fff;
}

.project-icon {
    background: var(--primary-light);
    color: var(--primary);
}

.list-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.section-header h5 {
    font-weight: 700;
    margin-bottom: 0;
    font-size: 1.15rem;
}

/* ========== 子项目管理 ========== */
.project-list-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

/* ========== 错误页 ========== */
.error-card {
    background: #fff;
    border-radius: 24px;
    padding: 52px;
    text-align: center;
    max-width: 460px;
    width: 90%;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.error-icon {
    width: 88px;
    height: 88px;
    border-radius: 22px;
    margin: 0 auto 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-size: 2.4rem;
}

.error-code {
    font-size: 5rem;
    font-weight: 900;
    line-height: 1;
    opacity: 0.06;
    position: absolute;
    top: 20px;
    right: 28px;
}

/* ========== 提示框 ========== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    max-width: calc(100vw - 48px);
}

.app-toast {
    background: #fff;
    border-radius: 12px;
    min-width: 280px;
    max-width: 100%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border: none;
}

.app-toast .toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-toast .toast-icon.success {
    background: var(--success-bg);
    color: var(--success);
}

.app-toast .toast-icon.danger {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ========== 弹窗 ========== */
.modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.12);
}

.modal-header {
    background: var(--primary);
    color: #fff;
    border-bottom: none;
    padding: 1.25rem 1.5rem;
    border-radius: 20px 20px 0 0;
}

.modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.modal-body {
    padding: 1.75rem;
}

.modal-footer {
    border-top: none;
    padding: 0 1.75rem 1.75rem;
}

.modal-body .form-group,
.modal-body .mb-3 {
    margin-bottom: 1.25rem;
}

.modal-body .form-group:last-child,
.modal-body .mb-3:last-child {
    margin-bottom: 0;
}

/* ========== 加载动画 ========== */
.spin {
    display: inline-block;
    animation: spin 1s linear infinite;
}

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

/* ========== 其他通用组件 ========== */
.key-mask {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px 14px;
    word-break: break-all;
    font-size: 0.9rem;
    color: var(--text);
    border: 1px solid var(--border);
}

.badge {
    font-weight: 600;
    padding: 0.45em 0.75em;
    display: inline-flex;
    align-items: center;
}

/* 表格内按钮垂直对齐 */
.table td .btn {
    vertical-align: middle;
}

/* 管理页内容区块间距 */
.card + .card {
    margin-top: 1rem;
}

/* 配置页开关与标签对齐 */
.form-switch .form-check-label {
    padding-top: 0.15em;
}

.alert {
    border-radius: 12px;
    border: none;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
}

.alert-light {
    background: #f9fafb;
    border: 1px solid var(--border);
}

code {
    color: var(--primary-dark);
    background: var(--primary-light);
    padding: 0.15em 0.4em;
    border-radius: 6px;
    font-size: 0.9em;
}

/* ========== 子项目内页 ========== */
.subproject-topbar {
    background: #fff;
    padding: 16px 28px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subproject-main {
    max-width: 760px;
    margin: 40px auto;
    padding: 0 24px;
}

/* ========== 间距工具 ========== */
.gap-2-5 {
    gap: 0.75rem;
}

/* ========== 响应式 ========== */
@media (max-width: 992px) {
    .main-content {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .admin-topbar {
        display: flex;
        background: var(--sidebar-bg);
        color: #fff;
        padding: 14px 20px;
        justify-content: space-between;
        align-items: center;
    }

    .admin-topbar .brand {
        font-weight: 700;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .admin-topbar .brand i {
        color: var(--primary);
    }

    .front-hero h1 {
        font-size: 2rem;
    }

    .front-topbar {
        padding: 16px 20px;
    }

    .login-card {
        padding: 32px 24px;
        margin: 0 16px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 576px) {
    .front-hero h1 {
        font-size: 1.8rem;
    }

    .front-features {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }

    .error-card {
        padding: 36px 24px;
    }
}

/* ========== API Key 列表 ========== */
.key-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.key-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.key-list-item .key-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.key-list-item .key-mask {
    margin: 0;
    padding: 6px 10px;
    font-size: 0.85rem;
}

/* ========== 快捷入口 ========== */
.quick-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: var(--radius);
    color: var(--dark);
    text-decoration: none;
    transition: all .15s;
    box-shadow: var(--shadow-sm);
}

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

/* ========== 邀请码 ========== */
.invite-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.invite-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 8px;
    font-size: .875rem;
    color: #6c757d;
}

.quota-card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: #fff;
}

.quota-progress-bg {
    height: 8px;
    background: var(--primary-light);
    border-radius: 4px;
    overflow: hidden;
}

.quota-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.invite-item {
    background: #fff;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: box-shadow .15s, transform .15s;
}

.invite-item:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.invite-item.expired {
    opacity: .7;
    border-left-color: #9ca3af;
    background: #f8f9fa;
}

.invite-code {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(91, 108, 249, .08);
    padding: 6px 12px;
    border-radius: 8px;
}

.invite-copy {
    background: transparent;
    border: none;
    color: var(--primary);
    padding: 0 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: color .15s;
}

.invite-copy:hover {
    color: var(--primary-dark);
}

/* ========== 政策卡片 ========== */
.policy-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}

.policy-value code {
    font-size: 0.95rem;
}

