:root {
 --bg: #f3f5f7;
 --panel: #ffffff;
 --panel-strong: #fff;
 --text: #1f2937;
 --muted: #6b7280;
 --line: #e5e7eb;
 --primary: #1677ff;
 --primary-soft: #e8f3ff;
 --accent: #fa8c16;
 --accent-soft: #fff3e8;
 --sidebar-bg: #001529;
 --sidebar-text: rgba(255, 255, 255, 0.82);
 --sidebar-muted: rgba(255, 255, 255, 0.52);
 /* 状态胶囊仅蓝/橙：成功类标签改用蓝系，避免第三色 */
 --success-soft: #e8f3ff;
 --success-text: #1677ff;
 --pill-blue-bg: #e8f3ff;
 --pill-blue-text: #1677ff;
 --pill-orange-bg: #fff3e8;
 --pill-orange-text: #fa8c16;
}

* {
 box-sizing: border-box;
}

body {
 margin: 0;
 font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
 background: var(--bg);
 color: var(--text);
}

.shell {
 min-height: 100vh;
 position: relative;
}

.sidebar {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    padding: 24px 18px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    overflow: hidden;
    position: fixed;
    left: 0;
    top: 0;
    width: 220px;
    z-index: 40;
    transition: transform 180ms ease, opacity 180ms ease;
    border-right: 1px solid #0b1f33;
}

.brand {
 display: flex;
 gap: 14px;
 align-items: center;
 margin-bottom: 22px;
 flex-shrink: 0;
}

.brand-mark {
 width: 46px;
 height: 46px;
 border-radius: 14px;
 background: linear-gradient(145deg, #4096ff, #0958d9);
 color: #fff;
 display: grid;
 place-items: center;
 font-weight: 700;
 font-size: 18px;
}

.brand-title {
 font-size: 20px;
 font-weight: 700;
 color: #fff;
}

.brand-subtitle {
 font-size: 12px;
 color: var(--sidebar-muted);
}

.role-switcher {
 margin-bottom: 18px;
 padding: 14px;
 border: 1px solid rgba(255, 255, 255, 0.08);
 border-radius: 14px;
 background: rgba(255, 255, 255, 0.04);
}

.role-title {
 font-size: 12px;
 color: var(--sidebar-muted);
 margin-bottom: 10px;
}

.role-btn {
 width: 100%;
 padding: 10px 12px;
 border-radius: 10px;
 border: 1px solid rgba(255, 255, 255, 0.08);
 background: rgba(255, 255, 255, 0.02);
 color: var(--sidebar-text);
 text-align: left;
 cursor: pointer;
 font-size: 13px;
 margin-bottom: 6px;
 transition: all 0.2s;
}

.role-btn:last-child {
 margin-bottom: 0;
}

.role-btn:hover {
 background: rgba(255, 255, 255, 0.1);
}

.role-btn.active {
 background: #1677ff;
 color: #fff;
 border-color: #1677ff;
}

.sidebar-scroll {
 overflow-y: auto;
 overflow-x: hidden;
 min-height: 0;
 margin-right: -6px;
 padding-right: 6px;
 padding-bottom: 8px;
 scrollbar-width: thin;
 scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.sidebar-scroll::-webkit-scrollbar {
 width: 6px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
 background: rgba(255, 255, 255, 0.22);
 border-radius: 3px;
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover {
 background: rgba(255, 255, 255, 0.32);
}

.sidebar-menu {
 display: flex;
 flex-direction: column;
 gap: 4px;
}

.menu-section {
 margin-bottom: 6px;
 border-radius: 10px;
 overflow: hidden;
 background: rgba(255, 255, 255, 0.03);
}

.menu-section.expanded {
 background: rgba(255, 255, 255, 0.05);
 border: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-section.collapsed a {
 display: none !important;
}

.menu-title {
 font-size: 12px;
 color: var(--sidebar-muted);
 padding: 10px 12px;
 font-weight: 600;
 letter-spacing: 0.02em;
 display: flex;
 align-items: center;
 justify-content: space-between;
 cursor: pointer;
 border-radius: 8px;
 margin-bottom: 2px;
 transition: all 0.2s ease;
}

.menu-title:hover {
 color: var(--sidebar-text);
 background: rgba(255, 255, 255, 0.06);
}

.sidebar-menu a {
 display: block;
 padding: 10px 12px 10px 24px;
 color: var(--sidebar-text);
 text-decoration: none;
 transition: all 0.15s;
 font-size: 13px;
 border-radius: 0;
 margin: 0;
}

.sidebar-menu a:hover {
 background: rgba(255, 255, 255, 0.08);
 color: #fff;
}

.sidebar-menu a.active {
 background: rgba(22, 119, 255, 0.15);
 color: #1677ff;
 font-weight: 500;
}

.sidebar-note {
 margin-top: 24px;
 padding-top: 18px;
 border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-page-title {
 font-size: 14px;
 font-weight: 700;
 color: #fff;
 margin-bottom: 6px;
}

.sidebar-page-subtitle {
 font-size: 12px;
 color: var(--sidebar-muted);
 line-height: 1.5;
}

.sidebar-demo-tip {
 margin-top: 12px;
 background: rgba(250, 140, 22, 0.14);
 border-color: rgba(250, 140, 22, 0.35);
 color: #ffd591;
 padding: 10px 12px;
 border-radius: 12px;
 font-size: 12px;
}

.sidebar-footer {
 flex-shrink: 0;
 margin-top: 12px;
 padding-top: 18px;
 border-top: 1px solid rgba(255, 255, 255, 0.08);
 background: var(--sidebar-bg);
 position: relative;
 z-index: 2;
}

.btn-logout {
 width: 100%;
 padding: 10px 12px;
 border-radius: 10px;
 border: 1px solid rgba(255, 255, 255, 0.08);
 background: rgba(255, 255, 255, 0.02);
 color: var(--sidebar-muted);
 text-align: center;
 cursor: pointer;
 font-size: 13px;
 transition: all 0.2s;
}

.btn-logout:hover {
 background: rgba(255, 255, 255, 0.1);
 color: var(--sidebar-text);
}

.content {
    padding: 28px;
    margin-left: 220px;
    transition: margin-left 180ms ease;
}

.page-content {
    padding: 20px;
    margin-left: 240px;
    transition: margin-left 180ms ease;
    min-height: 100vh;
    background: var(--bg);
}

.grid {
 display: grid;
 gap: 18px;
}

.grid.cols-2 {
 grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
 grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.card h2,
.card h3 {
 margin: 0 0 10px;
}

.card-title {
 font-size: 18px;
 font-weight: 700;
 margin-bottom: 12px;
}

.metric {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.metric.blue {
    color: #1677ff;
}

.metric.red {
    color: #f5222d;
}

.metric.green {
    color: #52c41a;
}

.metric-label {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.tag {
 display: inline-block;
 padding: 6px 10px;
 border-radius: 999px;
 background: var(--accent-soft);
 color: var(--accent);
 font-size: 12px;
 margin-right: 8px;
}

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

.list-item {
 padding: 14px;
 border: 1px solid var(--line);
 border-radius: 12px;
 background: #fff;
}

.list-title {
 font-weight: 700;
 margin-bottom: 4px;
}

.list-meta {
 display: flex;
 justify-content: space-between;
 gap: 12px;
 align-items: center;
}

.muted {
 color: var(--muted);
 font-size: 13px;
}

/* Admin Shell */
.admin-shell {
    padding: 0;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
}

/* Admin Header */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.admin-breadcrumb {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
}

.admin-title {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.admin-toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Page Header */
.page-header {
 display: flex;
 justify-content: space-between;
 align-items: center;
 margin-bottom: 24px;
 flex-wrap: wrap;
 gap: 16px;
}

.page-title {
 font-size: 24px;
 font-weight: 700;
 color: var(--text);
 margin: 0;
}

.page-breadcrumb {
 font-size: 13px;
 color: var(--muted);
 margin-bottom: 4px;
}

.page-subtitle {
 font-size: 14px;
 color: var(--muted);
 margin-top: 4px;
}

/* Stats Grid */
.stats-grid {
 display: grid;
 grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
 gap: 18px;
 margin-bottom: 24px;
}

.stat-card {
 background: #fff;
 border: 1px solid var(--line);
 border-radius: 16px;
 padding: 22px;
 box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.stat-card .stat-label {
 font-size: 13px;
 color: var(--muted);
 margin-bottom: 8px;
}

.stat-card .stat-value {
 font-size: 28px;
 font-weight: 700;
 color: var(--primary);
}

/* Buttons */
.btn {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 gap: 8px;
 padding: 10px 16px;
 border-radius: 10px;
 font-size: 14px;
 font-weight: 500;
 cursor: pointer;
 transition: all 0.2s;
 border: none;
 text-decoration: none;
}

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

.btn-primary:hover {
 background: #0958d9;
}

.btn-secondary {
 background: var(--accent);
 color: #fff;
}

.btn-outline {
 background: transparent;
 border: 1px solid var(--line);
 color: var(--text);
}

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

/* Tables */
.table-wrap {
 background: #fff;
 border: 1px solid var(--line);
 border-radius: 14px;
 overflow: hidden;
}

.table {
 width: 100%;
 border-collapse: collapse;
}

.table th,
.table td {
 padding: 14px 16px;
 text-align: left;
 border-bottom: 1px solid var(--line);
 font-size: 14px;
}

.table th {
 background: #fafafa;
 color: var(--muted);
 font-weight: 600;
}

.table tbody tr:hover {
 background: #fafafa;
}

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

/* Badges */
.badge {
 display: inline-flex;
 align-items: center;
 gap: 4px;
 padding: 5px 10px;
 border-radius: 999px;
 font-size: 12px;
 font-weight: 500;
}

.badge-primary {
 background: var(--primary-soft);
 color: var(--primary);
}

.badge-success {
 background: var(--pill-blue-bg);
 color: var(--pill-blue-text);
}

.badge-warning {
 background: var(--pill-orange-bg);
 color: var(--pill-orange-text);
}

.badge-muted,
.badge-danger,
.badge-secondary {
 background: var(--pill-orange-bg);
 color: var(--pill-orange-text);
}

/* Toolbar */
.toolbar {
 display: flex;
 gap: 12px;
 align-items: center;
 flex-wrap: wrap;
}

.tool-chip {
 padding: 8px 14px;
 border: 1px solid var(--line);
 border-radius: 10px;
 background: #fff;
 font-size: 13px;
 color: var(--muted);
 cursor: pointer;
 transition: all 0.2s;
}

.tool-chip:hover,
.tool-chip.active {
 border-color: var(--primary);
 color: var(--primary);
 background: var(--primary-soft);
}

/* Dashboard Stats */
.stat-row {
 display: grid;
 grid-template-columns: repeat(6, 1fr);
 gap: 16px;
 margin-bottom: 24px;
}

.stat-item {
 background: linear-gradient(145deg, rgba(31, 95, 91, 0.95), rgba(44, 107, 104, 0.9));
 color: #fff;
 border-radius: 20px;
 padding: 20px;
 box-shadow: 0 12px 32px rgba(31, 95, 91, 0.18);
}

.stat-item.green { background: linear-gradient(145deg, #52c41a, #389e0d); }
.stat-item.blue { background: linear-gradient(145deg, #1677ff, #0958d9); }
.stat-item.orange { background: linear-gradient(145deg, #fa8c16, #d97706); }
.stat-item.purple { background: linear-gradient(145deg, #722ed1, #531dab); }
.stat-item.red { background: linear-gradient(145deg, #f5222d, #cf1322); }

.stat-item-label {
 font-size: 13px;
 opacity: 0.85;
 margin-bottom: 8px;
}

.stat-item-value {
 font-size: 28px;
 font-weight: 700;
}

.stat-item-change {
 font-size: 12px;
 opacity: 0.8;
 margin-top: 6px;
}

/* Content Grid */
.content-grid {
 display: grid;
 grid-template-columns: 1.2fr 0.8fr;
 gap: 20px;
 margin-bottom: 24px;
}

.panel {
 background: #fff;
 border: 1px solid var(--line);
 border-radius: 16px;
 overflow: hidden;
}

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

.panel-title {
 font-size: 15px;
 font-weight: 700;
 color: var(--text);
}

.panel-body {
 padding: 20px;
}

/* Chart Placeholder */
.chart-placeholder {
 height: 200px;
 background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
 border-radius: 12px;
 display: flex;
 flex-direction: column;
 align-items: center;
 justify-content: center;
 color: var(--muted);
 border: 1px dashed var(--line);
}

.chart-placeholder i {
 font-size: 2.5rem;
 margin-bottom: 10px;
 opacity: 0.5;
}

/* Rank List */
.rank-list {
 display: flex;
 flex-direction: column;
 gap: 12px;
}

.rank-item {
 display: flex;
 align-items: center;
 gap: 12px;
 padding: 12px;
 border-radius: 12px;
 background: var(--bg);
 transition: all 0.2s;
}

.rank-item:hover {
 background: var(--primary-soft);
}

.rank-num {
 width: 24px;
 height: 24px;
 border-radius: 6px;
 background: var(--primary);
 color: #fff;
 display: flex;
 align-items: center;
 justify-content: center;
 font-size: 12px;
 font-weight: 700;
}

.rank-num.top3 {
 background: linear-gradient(145deg, #ffd700, #ffb347);
 color: #333;
}

.rank-info {
 flex: 1;
}

.rank-name {
 font-weight: 600;
 font-size: 14px;
 color: var(--text);
}

.rank-meta {
 font-size: 12px;
 color: var(--muted);
}

.rank-value {
 font-weight: 700;
 color: var(--primary);
}

/* Bottom Grid */
.bottom-grid {
 display: grid;
 grid-template-columns: repeat(2, 1fr);
 gap: 20px;
}

/* Timeline */
.timeline-item {
 display: flex;
 gap: 12px;
 padding: 14px;
 border-left: 3px solid var(--primary);
 background: #fff;
 border-radius: 12px;
 margin-bottom: 12px;
}

.timeline-dot {
 width: 10px;
 height: 10px;
 border-radius: 50%;
 background: var(--primary);
 margin-top: 4px;
 flex-shrink: 0;
}

.timeline-content {
 flex: 1;
}

.timeline-title {
 font-weight: 600;
 font-size: 13px;
 color: var(--text);
 margin-bottom: 4px;
}

.timeline-desc {
 font-size: 12px;
 color: var(--muted);
}

/* Notice Item */
.notice-item {
 display: flex;
 gap: 12px;
 padding: 12px 0;
 border-bottom: 1px solid var(--line);
}

.notice-item:last-child {
 border-bottom: none;
}

.notice-icon {
 width: 36px;
 height: 36px;
 border-radius: 10px;
 background: var(--primary-soft);
 color: var(--primary);
 display: flex;
 align-items: center;
 justify-content: center;
 flex-shrink: 0;
}

.notice-icon.warn {
 background: var(--accent-soft);
 color: var(--accent);
}

.notice-content {
 flex: 1;
}

.notice-title {
 font-size: 13px;
 font-weight: 600;
 color: var(--text);
}

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

/* Forms */
.form-group {
 margin-bottom: 18px;
}

.form-label {
 display: block;
 font-size: 14px;
 font-weight: 500;
 color: var(--text);
 margin-bottom: 8px;
}

.form-control {
 width: 100%;
 padding: 10px 14px;
 border: 1px solid var(--line);
 border-radius: 10px;
 font-size: 14px;
 color: var(--text);
 background: #fff;
 transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
 outline: none;
 border-color: var(--primary);
 box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
}

/* Permission Banner */
.permission-banner {
 display: flex;
 justify-content: space-between;
 gap: 12px;
 align-items: center;
 padding: 14px 18px;
 border: 1px solid #dbeafe;
 border-radius: 14px;
 background: #f5f9ff;
 color: #1d4ed8;
 margin-bottom: 18px;
}

.permission-role {
 font-weight: 700;
}

.permission-list {
 font-size: 13px;
 color: #4b5563;
}

/* Demo Hint */
.demo-hint {
 padding: 10px 14px;
 border-radius: 12px;
 background: #fffbe6;
 color: #ad6800;
 font-size: 13px;
 border: 1px solid #ffe58f;
 margin-bottom: 18px;
}

/* Login Page */
body.login-page {
 min-height: 100vh;
 display: flex;
 align-items: center;
 justify-content: center;
 font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* Dashboard Header */
.dashboard-header {
 display: flex;
 justify-content: space-between;
 align-items: center;
 margin-bottom: 24px;
 flex-wrap: wrap;
 gap: 16px;
}

.dashboard-title {
 font-size: 24px;
 font-weight: 700;
 color: var(--text);
}

.dashboard-subtitle {
 font-size: 14px;
 color: var(--muted);
 margin-top: 4px;
}

.header-actions {
 display: flex;
 gap: 12px;
}

.quick-chip {
 padding: 8px 14px;
 border-radius: 999px;
 border: 1px solid var(--line);
 background: #fff;
 font-size: 13px;
 color: var(--muted);
 cursor: pointer;
 transition: all 0.2s;
}

.quick-chip:hover,
.quick-chip.active {
 border-color: var(--primary);
 color: var(--primary);
 background: var(--primary-soft);
}

/* Quick Chips for Toolbar */
.chip {
 padding: 6px 12px;
 border-radius: 999px;
 border: 1px solid var(--line);
 background: #fff;
 font-size: 12px;
 color: var(--muted);
 cursor: pointer;
}

.chip.active {
 border-color: var(--primary);
 color: var(--primary);
 background: var(--primary-soft);
}

/*
 * Modal — 须与 Bootstrap 5 一致：
 * - 半透明遮罩由 .modal-backdrop（z-index ~1050）渲染，.modal 本体必须透明，否则叠双层且观感异常；
 * - .modal 的 z-index 必须高于 backdrop（Bootstrap 默认约 1055），否则遮罩会盖住对话框导致按钮无法点击；
 * - 勿对 .modal.show 使用 flex 居中替代 Bootstrap 的布局，否则会与 .modal-dialog-centered 叠加产生整块拉伸空白。
 */
.modal {
 position: fixed;
 top: 0;
 left: 0;
 z-index: 1055;
 width: 100%;
 height: 100%;
 overflow-x: hidden;
 overflow-y: auto;
 outline: 0;
 background: transparent !important;
 display: none;
}

.modal.show {
 display: block;
}

.modal-dialog {
 position: relative;
 width: auto;
 margin: 1.75rem auto;
 max-width: 500px;
 background: transparent;
 max-height: calc(100vh - 3.5rem);
 overflow-y: auto;
}

.modal-content {
 background: #fff;
 border-radius: 16px;
 border: none;
 box-shadow: 0 12px 40px rgba(15, 23, 42, 0.15);
 overflow: hidden;
}

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

.modal-title {
 font-size: 18px;
 font-weight: 700;
 margin: 0;
}

.modal-body {
 padding: 22px;
}

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

/* 删除/通用确认：原生 dialog.showModal()，顶层居中，::backdrop 不受页面布局干扰 */
dialog.kotoba-confirm-dialog {
 border: none;
 padding: 0;
 margin: auto;
 max-width: min(400px, calc(100vw - 2rem));
 width: calc(100vw - 2rem);
 background: transparent;
 color: inherit;
}

dialog.kotoba-confirm-dialog::backdrop {
 background: rgba(15, 23, 42, 0.48);
}

/* 无原生 dialog.showModal 或与 Toast 并存时的确认/提示兜底（视觉与上方 dialog 一致） */
.kotoba-fallback-layer {
 position: fixed;
 inset: 0;
 z-index: 2147483000;
 display: flex;
 align-items: center;
 justify-content: center;
 padding: 1rem;
 background: rgba(15, 23, 42, 0.48);
 box-sizing: border-box;
}

.kotoba-fallback-layer .kotoba-confirm-dialog__inner {
 width: min(400px, calc(100vw - 2rem));
 max-height: min(560px, calc(100vh - 2rem));
 overflow: auto;
}

.kotoba-confirm-dialog__inner {
 background: #fff;
 border-radius: 14px;
 box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
 overflow: hidden;
}

.kotoba-confirm-dialog__head {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 10px;
 padding: 16px 18px 0;
}

.kotoba-confirm-dialog__title {
 margin: 0;
 font-size: 17px;
 font-weight: 700;
 color: var(--text);
}

.kotoba-confirm-dialog__x {
 border: none;
 background: transparent;
 font-size: 22px;
 line-height: 1;
 color: var(--muted);
 cursor: pointer;
 padding: 2px 6px;
 border-radius: 6px;
}

.kotoba-confirm-dialog__x:hover {
 color: var(--text);
 background: #f3f4f6;
}

.kotoba-confirm-dialog__body {
 margin: 0;
 padding: 12px 18px 4px;
 font-size: 14px;
 line-height: 1.55;
 color: #4b5563;
}

.kotoba-confirm-dialog__actions {
 display: flex;
 justify-content: flex-end;
 gap: 10px;
 padding: 16px 18px 18px;
 flex-wrap: wrap;
}

.btn-close {
 background: none;
 border: none;
 font-size: 1.5rem;
 cursor: pointer;
 color: var(--muted);
}

/* Status indicators：完整规则见文件末尾「Kotoba 状态胶囊」 */

/* Demo Tip */
.demo-tip {
 margin-top: 10px;
 padding: 10px 12px;
 border-radius: 12px;
 background: #fffbe6;
 color: #ad6800;
 font-size: 13px;
 border: 1px solid #ffe58f;
}

/* Responsive */
@media (max-width: 1200px) {
 .stat-row { grid-template-columns: repeat(3, 1fr); }
 .content-grid { grid-template-columns: 1fr; }
 .bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
 .sidebar {
 width: 280px;
 transform: translateX(-100%);
 opacity: 0;
 }

 .sidebar.show {
 transform: translateX(0);
 opacity: 1;
 }

 .page-content,
 .content {
 padding: 18px;
 margin-left: 0;
 }
}

@media (max-width: 768px) {
 .stat-row { grid-template-columns: repeat(2, 1fr); }
 .stats-grid { grid-template-columns: 1fr; }
}

/* ========================================
   仪表盘页面增强样式
   ======================================== */

/* 渐变背景卡片悬浮效果 */
.stat-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

/* 面板悬浮效果 */
.panel {
    transition: box-shadow 0.3s ease;
}

.panel:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

/* 卡片数字动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-item {
    animation: fadeInUp 0.5s ease forwards;
}

.stat-item:nth-child(1) { animation-delay: 0.1s; }
.stat-item:nth-child(2) { animation-delay: 0.15s; }
.stat-item:nth-child(3) { animation-delay: 0.2s; }
.stat-item:nth-child(4) { animation-delay: 0.25s; }
.stat-item:nth-child(5) { animation-delay: 0.3s; }
.stat-item:nth-child(6) { animation-delay: 0.35s; }

/* 数字跳动动画 */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-item-value {
    animation: countUp 0.6s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

/* 顶部信息栏悬浮效果 */
.dashboard-topbar {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-topbar:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.3);
}

/* 环形进度指示器 */
.progress-ring {
    width: 60px;
    height: 60px;
    position: relative;
}

.progress-ring-circle {
    fill: none;
    stroke-width: 6;
    stroke-linecap: round;
}

.progress-ring-bg {
    stroke: var(--line);
}

.progress-ring-progress {
    stroke: var(--primary);
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 1s ease;
}

/* 数据加载占位动画 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

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

/* 工具提示样式增强 */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: #333;
    color: #fff;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* 徽章样式增强 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background: var(--primary-soft);
    color: var(--primary);
}

.badge-success {
    background: var(--pill-blue-bg);
    color: var(--pill-blue-text);
}

.badge-warning {
    background: var(--pill-orange-bg);
    color: var(--pill-orange-text);
}

.badge-danger {
    background: var(--pill-orange-bg);
    color: #d4380d;
}

.badge-secondary {
    background: var(--pill-orange-bg);
    color: var(--pill-orange-text);
}

/* 图表图例自定义样式 */
.chart-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 12px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
}

.chart-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* 数字变化指示器 */
.trend-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
}

.trend-indicator.up {
    background: var(--pill-blue-bg);
    color: var(--pill-blue-text);
}

.trend-indicator.down {
    background: var(--pill-orange-bg);
    color: var(--pill-orange-text);
}

.trend-indicator.neutral {
    background: var(--pill-blue-bg);
    color: #69b1ff;
}

/* 会员权益页面样式 */
body.benefits-page {
    background: #f3f5f7;
}

.benefit-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.benefit-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #4b5563;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.benefit-tab:hover {
    border-color: #1677ff;
    color: #1677ff;
}

.benefit-tab.active {
    background: #1677ff;
    border-color: #1677ff;
    color: #fff;
}

.benefit-panel {
    display: none;
}

.benefit-panel.active {
    display: block;
}

.benefit-intro {
    margin-bottom: 16px;
    padding: 18px 20px;
}

.benefit-intro-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 6px;
}

.benefit-section {
    margin-bottom: 16px;
    padding: 18px 20px;
}

.benefit-section .card-title {
    margin-bottom: 14px;
}

.benefit-tag-subtle {
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
    margin-left: 8px;
}

.benefit-grid {
    display: grid;
    gap: 14px;
}

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

.benefit-item {
    padding: 16px;
    border: 1px solid #eef2f6;
    border-radius: 10px;
    background: #fafbfc;
    height: 100%;
}

.benefit-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #e8f3ff;
    color: #1677ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 10px;
}

.benefit-item-icon.partner {
    background: #f0fdf4;
    color: #16a34a;
}

.benefit-item-title {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 6px;
}

.benefit-item-desc {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.55;
}

.benefit-tier-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.benefit-tier {
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    height: 100%;
}

.benefit-tier.highlight {
    border-color: #1677ff;
    background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
    box-shadow: 0 2px 8px rgba(22, 119, 255, 0.08);
}

.benefit-tier-label {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}

.benefit-tier.highlight .benefit-tier-label {
    background: #e8f3ff;
    color: #1677ff;
}

.benefit-tier-name {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px;
}

.benefit-tier-list {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.65;
}

.benefit-tier-list li + li {
    margin-top: 6px;
}

.benefit-rules {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.benefit-rule {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #eef2f6;
    border-radius: 8px;
    background: #fafbfc;
    font-size: 13px;
}

.benefit-rule .rule-key {
    flex-shrink: 0;
    font-weight: 600;
    color: #374151;
    min-width: 72px;
}

.benefit-rule .rule-val {
    color: #6b7280;
}

.benefit-rule .rule-param {
    font-style: normal;
    font-weight: 700;
    color: #1677ff;
}

.benefit-relation {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.relation-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.55;
}

.relation-item i {
    color: #16a34a;
    margin-top: 2px;
    flex-shrink: 0;
}

.benefit-footer {
    padding: 18px 20px;
}

.student-benefits-link {
    color: #1677ff;
    text-decoration: none;
    font-weight: 500;
}

.student-benefits-link:hover {
    color: #0958d9;
    text-decoration: underline;
}

@media (max-width: 1200px) {
    .benefit-grid.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .benefit-tier-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .benefit-grid.cols-4,
    .benefit-rules {
        grid-template-columns: 1fr;
    }
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.cta-row {
    margin-top: 16px;
}

.btn.ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
}

.btn.ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

/* 检索区列表标题：与学员管理「学员列表」一致 */
.admin-panel-head .card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
}

/* ========== Kotoba 状态胶囊：全站仅蓝 / 橙（药丸、字重与参考图一致）========== */
html body .status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    background: var(--pill-blue-bg);
    color: var(--pill-blue-text);
    border: none;
}

html body .status.warn,
html body .status.new,
html body .status.invalid,
html body .status.rejected {
    background: var(--pill-orange-bg);
    color: var(--pill-orange-text);
}

/* 非激活/结束态：橙系 */
html body .status.muted {
    background: var(--pill-orange-bg);
    color: var(--pill-orange-text);
}

/* 空占位（如「—」）：浅蓝字，仍为蓝系 */
html body .status.subtle {
    background: var(--pill-blue-bg);
    color: #69b1ff;
}

html body .status.success,
html body .status.processing,
html body .status.resolved,
html body .status.completed,
html body .status.done {
    background: var(--pill-blue-bg);
    color: var(--pill-blue-text);
}

html body .priority-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

html body .priority-tag.high,
html body .priority-tag.medium {
    background: var(--pill-orange-bg);
    color: #d46b08;
}

html body .priority-tag.high {
    color: #d4380d;
}

html body .priority-tag.low {
    background: var(--pill-blue-bg);
    color: var(--pill-blue-text);
}

html body .student-status {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--pill-blue-bg);
    color: var(--pill-blue-text);
    white-space: nowrap;
}

html body .student-status.good {
    background: var(--pill-blue-bg);
    color: var(--pill-blue-text);
}

html body .student-status.muted {
 color: #6b7280;
 background: #f3f4f6;
}

html body .student-status.warn {
    background: var(--pill-orange-bg);
    color: var(--pill-orange-text);
}

html body .status-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

html body .status-onshelf,
html body .status-recruiting {
    background: var(--pill-blue-bg);
    color: var(--pill-blue-text);
}

html body .status-pending {
    background: var(--pill-orange-bg);
    color: var(--pill-orange-text);
}

/* 列表「来源」等标签：仅蓝/橙两档 */
html body .source-tag {
    border-radius: 999px;
    font-weight: 500;
    background: var(--pill-blue-bg);
    color: var(--pill-blue-text);
}

html body .source-tag.phone,
html body .source-tag.app {
    background: var(--pill-orange-bg);
    color: var(--pill-orange-text);
}

html body .source-tag.wechat,
html body .source-tag.web {
    background: var(--pill-blue-bg);
    color: var(--pill-blue-text);
}

html body .badge-muted {
    background: var(--pill-orange-bg) !important;
    color: var(--pill-orange-text) !important;
}

html body .badge-primary,
html body .badge-success {
    background: var(--pill-blue-bg) !important;
    color: var(--pill-blue-text) !important;
}

html body .badge-warning {
    background: var(--pill-orange-bg) !important;
    color: var(--pill-orange-text) !important;
}
