/* dancesr 后台样式 - 自写 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: #333;
    background: #f4f6f9;
    -webkit-font-smoothing: antialiased;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 登录页 ===== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-box { width: 380px; max-width: 92vw; background: #fff; border-radius: 8px; padding: 32px 28px; box-shadow: 0 12px 40px rgba(0,0,0,0.2); }
.login-header { text-align: center; margin-bottom: 24px; }
.login-header h1 { font-size: 20px; color: #1f2937; margin-bottom: 4px; }
.login-header p { font-size: 13px; color: #6b7280; }
.login-form .form-group { margin-bottom: 16px; }
.login-form label { display: block; font-size: 13px; color: #374151; margin-bottom: 6px; }
.login-form input { width: 100%; padding: 9px 12px; font-size: 14px; border: 1px solid #d1d5db; border-radius: 4px; outline: none; }
.login-form input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.login-form .btn-block { width: 100%; }
.login-msg { margin-top: 12px; color: #dc2626; font-size: 13px; min-height: 18px; }

/* ===== 后台布局 ===== */
.admin-wrapper { display: flex; min-height: 100vh; }
.sidebar { width: 160px; background: #1f2937; color: #cbd5e1; display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; overflow-y: auto; z-index: 100; }
.sidebar-logo { padding: 18px 12px; font-size: 15px; color: #fff; font-weight: 600; border-bottom: 1px solid #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-nav { flex: 1; padding: 8px 0; }
.menu-group { border-bottom: 1px solid #374151; }
.menu-title { padding: 10px 16px; cursor: pointer; display: flex; align-items: center; gap: 8px; user-select: none; }
.menu-title:hover { background: #374151; }
.menu-icon { display: inline-block; width: 16px; text-align: center; opacity: 0.7; font-family: FontAwesome; font-style: normal; font-size: 14px; line-height: 1; }
/* 菜单图标映射（Font Awesome 4.7 unicode） */
.icon-home::before     { content: "\f015"; }  /* 工作台 */
.icon-student::before  { content: "\f19d"; }  /* 学员 */
.icon-edu::before      { content: "\f02d"; }  /* 教务 */
.icon-schedule::before { content: "\f073"; }  /* 排课考勤 */
.icon-fin::before      { content: "\f157"; }  /* 财务 */
.icon-interact::before { content: "\f086"; }  /* 家校互动 */
.icon-crm::before      { content: "\f201"; }  /* 招生CRM */
.icon-sys::before      { content: "\f013"; }  /* 系统管理 */
.menu-arrow { margin-left: auto; transition: transform .2s; }
.menu-group.open .menu-arrow { transform: rotate(180deg); }
.menu-sub { display: none; padding: 4px 0 6px; background: #111827; }
.menu-group.open .menu-sub { display: block; }
.menu-link { display: block; padding: 8px 16px 8px 40px; color: #9ca3af; font-size: 13px; }
.menu-link:hover { background: #1f2937; color: #fff; text-decoration: none; }
.menu-link.active { background: #2563eb; color: #fff; }
.menu-link.top { padding-left: 16px; }

.main-area { margin-left: 160px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { height: 56px; background: #fff; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; padding: 0 16px; position: sticky; top: 0; z-index: 50; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-right { margin-left: auto; font-size: 13px; color: #6b7280; }
.user-name { color: #1f2937; font-weight: 500; }
.user-role { background: #e0e7ff; color: #4338ca; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.btn-icon { background: none; border: none; cursor: pointer; color: #6b7280; font-size: 16px; padding: 6px 8px; border-radius: 4px; }
.btn-icon:hover { background: #f3f4f6; color: #1f2937; }

.content { padding: 20px; flex: 1; }
.footer { padding: 12px 20px; text-align: center; color: #9ca3af; font-size: 12px; border-top: 1px solid #e5e7eb; background: #fff; }

/* ===== 页面元素 ===== */
.page-header { margin-bottom: 16px; }
.page-header h2 { font-size: 18px; color: #1f2937; margin-bottom: 4px; }
.page-header p { color: #6b7280; font-size: 13px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border-left: 4px solid #2563eb; }
.stat-blue { border-left-color: #3b82f6; }
.stat-green { border-left-color: #10b981; }
.stat-orange { border-left-color: #f59e0b; }
.stat-purple { border-left-color: #8b5cf6; }
.stat-num { font-size: 28px; font-weight: 600; color: #1f2937; }
.stat-label { font-size: 13px; color: #6b7280; margin-top: 4px; }

.page-section { background: #fff; border-radius: 8px; padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.section-title { font-size: 15px; font-weight: 500; color: #1f2937; padding-bottom: 8px; border-bottom: 1px solid #e5e7eb; margin-bottom: 12px; }
.section-body { padding-top: 4px; }
.todo-list { list-style: none; }
.todo-list li { padding: 6px 0; color: #6b7280; font-size: 13px; }
.todo-list li:before { content: "•"; color: #9ca3af; margin-right: 6px; }

/* ===== 表单与表格通用 ===== */
.btn { display: inline-block; padding: 6px 14px; border: 1px solid transparent; border-radius: 4px; cursor: pointer; font-size: 13px; line-height: 1.5; background: #fff; color: #374151; }
.btn:hover { opacity: .85; }
.btn-primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-default { background: #fff; border-color: #d1d5db; color: #374151; }
.btn-sm { padding: 3px 8px; font-size: 12px; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: #374151; margin-bottom: 6px; }
.form-control { width: 100%; padding: 7px 10px; font-size: 13px; border: 1px solid #d1d5db; border-radius: 4px; outline: none; }
.form-control:focus { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,0.1); }
textarea.form-control { min-height: 80px; resize: vertical; }
select.form-control { background: #fff; }
.form-remark { font-size: 12px; color: #9ca3af; margin-top: 4px; }

.toolbar { margin-bottom: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar .search-input { width: 240px; }
.toolbar .spacer { flex: 1; }

table.data-table { width: 100%; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border-collapse: collapse; }
table.data-table th, table.data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
table.data-table th { background: #f8fafc; color: #475569; font-weight: 600; }
table.data-table tr:hover td { background: #f9fafb; }
table.data-table .actions a { margin-right: 8px; }

.pagination { margin-top: 12px; display: flex; gap: 4px; justify-content: flex-end; }
.pagination a, .pagination span { padding: 4px 10px; border: 1px solid #d1d5db; border-radius: 4px; font-size: 13px; background: #fff; }
.pagination .current { background: #2563eb; color: #fff; border-color: #2563eb; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: #e0e7ff; color: #4338ca; }
.tag-success { background: #d1fae5; color: #065f46; }
.tag-warn { background: #fef3c7; color: #92400e; }
.tag-info { background: #dbeafe; color: #1e40af; }
.tag-warning { background: #fef3c7; color: #92400e; }
.tag-default { background: #f3f4f6; color: #6b7280; }
.tag-danger { background: #fee2e2; color: #991b1b; }

.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: none; align-items: center; justify-content: center; z-index: 999; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 8px; width: 480px; max-width: 92vw; max-height: 92vh; overflow: auto; }
.modal-header { padding: 14px 16px; border-bottom: 1px solid #e5e7eb; font-weight: 600; }
.modal-body { padding: 16px; }
.modal-footer { padding: 12px 16px; border-top: 1px solid #e5e7eb; text-align: right; }
.modal-close { float: right; cursor: pointer; color: #9ca3af; font-size: 18px; }

.tabs { border-bottom: 1px solid #e5e7eb; margin-bottom: 16px; }
.tabs .tab { display: inline-block; padding: 8px 16px; cursor: pointer; color: #6b7280; border-bottom: 2px solid transparent; }
.tabs .tab.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 500; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.empty { text-align: center; color: #9ca3af; padding: 32px 0; font-size: 13px; }

/* 排课周视图 */
.schedule-grid { width: 100%; border-collapse: collapse; background: #fff; }
.schedule-grid th, .schedule-grid td { border: 1px solid #e5e7eb; padding: 6px; vertical-align: top; min-width: 100px; min-height: 60px; font-size: 12px; }
.schedule-grid th { background: #f8fafc; padding: 8px; }
.schedule-cell { min-height: 60px; }
.schedule-item { background: #dbeafe; color: #1e40af; padding: 4px 6px; border-radius: 3px; margin-bottom: 4px; font-size: 11px; cursor: pointer; }
.schedule-item:hover { background: #bfdbfe; }

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; }
    .sidebar.show { transform: translateX(0); }
    .main-area { margin-left: 0; }
    .stats-grid { grid-template-columns: 1fr; }
}

/* 帮助文档（admin/help、platform/help 共用，来源 docs/user-guide.md） */
.help-doc { max-width: 900px; font-size: 14px; line-height: 1.75; color: #1f2937; }
.help-doc h1 { font-size: 22px; margin: 8px 0 16px; }
.help-doc h2 { font-size: 18px; margin: 28px 0 12px; padding-bottom: 8px; border-bottom: 1px solid #e5e7eb; }
.help-doc h3 { font-size: 15px; margin: 20px 0 8px; color: #111827; }
.help-doc h4 { font-size: 14px; margin: 16px 0 6px; }
.help-doc p { margin: 8px 0; }
.help-doc ul, .help-doc ol { margin: 8px 0; padding-left: 24px; }
.help-doc li { margin: 4px 0; }
.help-doc blockquote { margin: 12px 0; padding: 10px 14px; background: #f0f7ff; border-left: 4px solid #3b82f6; border-radius: 0 6px 6px 0; color: #1e40af; }
.help-doc blockquote p { margin: 0; }
.help-doc table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; background: #fff; }
.help-doc th, .help-doc td { border: 1px solid #e5e7eb; padding: 8px 10px; text-align: left; vertical-align: top; }
.help-doc th { background: #f9fafb; font-weight: 600; white-space: nowrap; }
.help-doc tr:nth-child(even) td { background: #fafafa; }
.help-doc hr { border: none; border-top: 1px solid #e5e7eb; margin: 24px 0; }
.help-doc code { background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 4px; padding: 1px 5px; font-size: 12px; color: #b45309; word-break: break-all; }
