* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #4a6cf7;
    --primary-hover: #3a5ce5;
    --sidebar-bg: #1a1a2e;
    --sidebar-active: #2a2a4a;
    --border: #e0e0e0;
    --text-main: #1a1a2e;
    --text-muted: #888;
    --bg: #f0f2f5;
    --success: #27ae60;
    --danger: #e74c3c;
    --purple: #9b59b6;
}
body { font-family: -apple-system, "Microsoft YaHei", "Segoe UI", sans-serif; background: var(--bg); color: var(--text-main); font-size: 14px; }

/* 登录页 */
.login-page { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg, #1a1a2e 0%, #2a2a4a 100%); }
.login-box { background: #fff; padding: 48px 40px; border-radius: 16px; width: 400px; box-shadow: 0 8px 32px rgba(0,0,0,0.15); text-align: center; }
.login-box h1 { font-size: 26px; color: var(--text-main); margin-bottom: 6px; }
.login-subtitle { color: var(--text-muted); margin-bottom: 32px; font-size: 14px; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--sidebar-bg); color: #ccc; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; }
.sidebar-header { padding: 24px 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.logo { font-size: 28px; color: var(--primary); }
.sidebar-title { font-size: 16px; font-weight: 700; color: #fff; }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 24px; color: #aaa; text-decoration: none; font-size: 14px; transition: all .2s; }
.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: var(--primary); border-left: 3px solid var(--primary); }
.nav-icon { font-size: 18px; width: 20px; text-align: center; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08); }
.user-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.user-name { color: #ddd; font-size: 13px; }
.user-role { background: var(--primary); color: #fff; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.btn-logout { color: #e74c3c; text-decoration: none; font-size: 13px; }
.main-content { flex: 1; margin-left: 220px; display: flex; flex-direction: column; }
.topbar { background: #fff; padding: 16px 32px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.page-title { font-size: 18px; font-weight: 600; }
.content-body { padding: 24px 32px; flex: 1; }

/* 卡片 */
.card { background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); margin-bottom: 24px; overflow: hidden; }
.card-header { padding: 16px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 24px; }

/* 统计卡片 */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 12px; padding: 24px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.stat-num { font-size: 32px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.stat-label { color: var(--text-muted); font-size: 13px; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-control { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; transition: border-color .2s; font-family: inherit; }
.form-control:focus { border-color: var(--primary); outline: none; }
.form-inline { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.hint { color: var(--text-muted); font-size: 12px; font-weight: 400; }
.score-textarea { font-family: "Consolas", "Courier New", monospace; font-size: 15px; line-height: 1.8; }
.form-actions { display: flex; align-items: center; gap: 12px; padding-top: 8px; }
.checkbox-label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.checkbox-label input { width: 16px; height: 16px; }

/* 按钮 */
.btn { padding: 8px 20px; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; transition: all .2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #e8e8e8; color: #555; }
.btn-secondary:hover { background: #ddd; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-block { width: 100%; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.table th { background: #f8f8f8; font-weight: 600; color: #555; }
.table-sm th, .table-sm td { padding: 6px 12px; font-size: 13px; }
.table tbody tr:hover { background: #fafafa; }
.empty { text-align: center; color: var(--text-muted); padding: 24px; }

/* 标签 */
.tag { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.tag-green { background: #e6f9ed; color: #27ae60; }
.tag-blue { background: #e8f0fe; color: #4a6cf7; }
.tag-gray { background: #eee; color: #888; }
.tag-purple { background: #f5e8f9; color: #9b59b6; }

/* 提示 */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.alert-success { background: #e6f9ed; color: #27ae60; }
.alert-error { background: #fee; color: #c0392b; }

/* 分页 */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.page-link { padding: 6px 12px; border: 1px solid #ddd; border-radius: 6px; text-decoration: none; color: #555; font-size: 13px; }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 弹窗 */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); z-index: 200; display: flex; justify-content: center; align-items: center; }
.modal-box { background: #fff; border-radius: 12px; padding: 32px; width: 420px; max-width: 90%; }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }

/* 文档 */
.docs-body h4 { margin: 24px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--primary); color: var(--text-main); font-size: 16px; }
.docs-body h4:first-child { margin-top: 0; }
.docs-body p { margin-bottom: 10px; line-height: 1.8; color: #555; }
.docs-body ul { margin: 8px 0 16px 24px; }
.docs-body li { margin-bottom: 6px; line-height: 1.6; }
.docs-body code { background: #f0f0f4; padding: 2px 6px; border-radius: 4px; font-family: "Consolas", monospace; font-size: 13px; color: #c0392b; }
.docs-body pre { background: #1a1a2e; color: #ddd; padding: 16px; border-radius: 8px; overflow-x: auto; margin: 8px 0 16px; }
.docs-body pre code { background: none; color: inherit; padding: 0; }

/* 五线谱预览 */
.staff-preview-wrap { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 16px; overflow-x: auto; }
.staff-preview-wrap canvas { display: block; width: 100%; min-width: 600px; }
.btn-info { background: #17a2b8; color: #fff; border: none; padding: 8px 20px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.btn-info:hover { background: #138496; }
