/* 书法点评 · 电脑端管理后台 */

:root {
  --orange: #ff8f1f;
  --orange-d: #ff7a00;
  --green: #1fa87a;
  --blue: #2b7fe0;
  --purple: #8e5cd8;
  --red: #e0342c;
  --text: #1f2329;
  --sub: #6b7178;
  --muted: #9aa0a6;
  --line: #edeff2;
  --bg: #f4f5f7;
  --card: #fff;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.05);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ============ 登录 ============ */

.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ffa53d 0%, #ff7a00 100%);
  padding: 20px;
}

.login-box {
  width: 100%; max-width: 400px;
  background: #fff; border-radius: 20px;
  padding: 44px 40px;
  box-shadow: 0 12px 48px rgba(0,0,0,.18);
}

.login-logo { font-size: 52px; text-align: center; }
.login-box h1 { font-size: 22px; text-align: center; margin: 14px 0 6px; }
.login-sub { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 30px; }

.login-box .field { margin-bottom: 18px; }
.login-box .field label { display: block; font-size: 13px; color: var(--sub); margin-bottom: 8px; }
.login-box .field input {
  width: 100%; height: 44px;
  border: 1px solid #e3e6ea; border-radius: 8px;
  padding: 0 14px; outline: none; transition: .15s;
}
.login-box .field input:focus { border-color: var(--orange); }

.login-err {
  color: var(--red); font-size: 13px;
  min-height: 20px; margin-bottom: 6px;
}

.login-box .btn-primary { width: 100%; height: 46px; font-size: 16px; }

.login-tip {
  font-size: 12px; color: var(--muted);
  text-align: center; margin-top: 20px;
  background: #fff8ef; padding: 10px; border-radius: 8px;
}

/* ============ 按钮 ============ */

.btn-primary {
  background: var(--orange); color: #fff;
  height: 44px; padding: 0 24px;
  border: none; border-radius: 8px;
  font-size: 15px; font-weight: 600;
  transition: .15s;
}
.btn-primary:hover { background: var(--orange-d); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.btn-sm { height: 36px; padding: 0 16px; font-size: 13px; }

.btn-ghost {
  background: #fff; color: var(--sub);
  height: 36px; padding: 0 16px;
  border: 1px solid #e3e6ea; border-radius: 8px;
  font-size: 13px; transition: .15s;
}
.btn-ghost:hover { border-color: var(--orange); color: var(--orange); }

.btn-mini {
  background: #fff4e8; color: var(--orange);
  border: none; border-radius: 6px;
  padding: 6px 12px; font-size: 12px;
}
.btn-mini:hover { background: #ffe6c2; }

.btn-logout {
  width: calc(100% - 28px); margin: 0 14px 14px;
  height: 34px; background: #fff;
  border: 1px solid #e3e6ea; border-radius: 8px;
  color: var(--sub); font-size: 13px;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* ============ 布局 ============ */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px; flex: none;
  background: #23262b; color: #fff;
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid #333;
}
.brand-logo { font-size: 26px; }
.brand-text { font-size: 16px; font-weight: 700; line-height: 1.2; }
.brand-text small {
  display: block; font-size: 11px;
  font-weight: 400; opacity: .6;
}

.menu { flex: 1; padding: 12px 0; overflow-y: auto; }

.menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px;
  color: #b8bdc4; cursor: pointer;
  font-size: 14px; transition: .15s;
  border-left: 3px solid transparent;
}
.menu-item:hover { background: #2d3137; color: #fff; }
.menu-item.active {
  background: #2d3137; color: #fff;
  border-left-color: var(--orange);
}
.mi-ico { width: 20px; text-align: center; }

.user-box {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 10px;
  border-top: 1px solid #333;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--orange); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600;
}
.user-name { font-size: 14px; font-weight: 600; }
.user-role { font-size: 11px; opacity: .6; }

.main { flex: 1; margin-left: 220px; display: flex; flex-direction: column; }

.topbar {
  height: 60px; background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 10;
}
.topbar h2 { font-size: 18px; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.refresh-hint { font-size: 12px; color: var(--muted); }

.content { padding: 24px; flex: 1; }
.page { display: none; }
.page.active { display: block; }

/* ============ 面板 ============ */

.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.panel-head {
  display: flex; align-items: center;
  margin-bottom: 18px;
}
.panel-head h3 { font-size: 16px; font-weight: 600; }
.panel-sub { font-size: 12px; color: var(--muted); margin-left: 12px; }
.panel-head .btn-mini { margin-left: auto; }

/* ============ 工具栏 ============ */

.toolbar {
  display: flex; align-items: center;
  margin-bottom: 18px; gap: 12px;
}
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar .btn-primary { margin-left: auto; }

.select, .input-sm {
  height: 36px; padding: 0 12px;
  border: 1px solid #e3e6ea; border-radius: 8px;
  background: #fff; outline: none;
}
.select:focus, .input-sm:focus { border-color: var(--orange); }
.input-sm { width: 200px; }

/* ============ KPI ============ */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px; margin-bottom: 20px;
}
.kpi {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  border-left: 3px solid var(--orange);
}
.kpi:nth-child(2) { border-left-color: var(--green); }
.kpi:nth-child(3) { border-left-color: var(--blue); }
.kpi:nth-child(4) { border-left-color: var(--purple); }
.kpi:nth-child(5) { border-left-color: var(--orange); }
.kpi:nth-child(6) { border-left-color: var(--red); }
.kpi-num { font-size: 30px; font-weight: 700; }
.kpi-lab { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ============ 图表 ============ */

.chart {
  display: flex; align-items: flex-end;
  height: 220px; gap: 12px;
  padding-top: 20px;
}
.bar-col {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  height: 100%;
}
.bar-val { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.bar {
  width: 34px;
  background: linear-gradient(180deg, #ffa53d, #ff7a00);
  border-radius: 6px 6px 0 0;
  min-height: 4px; transition: height .3s;
}
.bar-lab { font-size: 12px; color: var(--muted); margin-top: 10px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.stat-box {
  background: #f7f8fa; border-radius: 10px;
  padding: 18px; text-align: center;
}
.stat-num { font-size: 26px; font-weight: 700; }
.stat-lab { font-size: 12px; color: var(--muted); margin-top: 6px; }

.rate-block { margin-top: 22px; }
.rate-head {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--sub); margin-bottom: 8px;
}
.rate-bar { height: 10px; background: #f0f1f3; border-radius: 5px; overflow: hidden; }
.rate-in {
  height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, #ffa53d, #ff7a00);
  transition: width .4s;
}

/* ============ 卡片网格（校区） ============ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.campus-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.cc-head { display: flex; align-items: center; margin-bottom: 12px; }
.cc-name { font-size: 17px; font-weight: 700; }
.badge {
  font-size: 11px; padding: 3px 10px;
  border-radius: 10px; margin-left: auto;
}
.badge.active { background: #e6f7ef; color: #12a05f; }
.badge.closed { background: #f2f3f5; color: var(--muted); }

.cc-line { font-size: 13px; color: var(--sub); margin-top: 7px; }

.cc-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin: 16px 0;
  background: #f7f8fa; border-radius: 10px; padding: 14px 0;
}
.cc-stats > div { text-align: center; }
.cc-stats .n { font-size: 20px; font-weight: 700; color: var(--green); }
.cc-stats .l { font-size: 11px; color: var(--muted); margin-top: 3px; }

.cc-ops { display: flex; gap: 8px; }

/* ============ 表格 ============ */

.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; padding: 10px 12px;
  background: #f7f8fa; color: var(--sub);
  font-weight: 600; white-space: nowrap;
}
.table td {
  padding: 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table tbody tr:hover { background: #fafbfc; }
.table .empty-row {
  text-align: center; color: var(--muted);
  padding: 50px 0;
}

.ops { display: flex; gap: 6px; }

.link-btn {
  background: none; border: none;
  color: var(--orange); font-size: 12px;
  padding: 2px 4px;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--red); }

.tag-pill {
  display: inline-block;
  font-size: 11px; padding: 3px 9px;
  border-radius: 10px;
}
.tag-pill.pending { background: #fff1e0; color: var(--orange); }
.tag-pill.reviewed { background: #e6f7ef; color: #12a05f; }

.thumb-sm {
  width: 40px; height: 40px; border-radius: 6px;
  object-fit: cover; background: #f0f1f3;
}

/* ============ 学员汇总 ============ */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px; margin-bottom: 18px;
}

/* ============ 弹窗 ============ */

.modal { position: fixed; inset: 0; z-index: 100; }
.modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.modal-box {
  position: relative;
  width: 520px; max-width: 92vw;
  margin: 12vh auto 0;
  background: #fff; border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: pop .2s ease-out;
}
@keyframes pop {
  from { transform: translateY(-16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-head {
  display: flex; align-items: center;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 17px; font-weight: 600; }
.modal-close {
  margin-left: auto; background: none; border: none;
  font-size: 26px; color: var(--muted); line-height: 1;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 22px; max-height: 60vh; overflow-y: auto; }
.modal-foot {
  display: flex; gap: 12px; justify-content: flex-end;
  padding: 16px 22px; border-top: 1px solid var(--line);
}
.modal-foot .btn-primary, .modal-foot .btn-ghost { height: 38px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fg-item { display: flex; flex-direction: column; }
.fg-item.full { grid-column: 1 / -1; }
.fg-item label { font-size: 13px; color: var(--sub); margin-bottom: 7px; }
.fg-item input, .fg-item select, .fg-item textarea {
  height: 40px; padding: 0 12px;
  border: 1px solid #e3e6ea; border-radius: 8px;
  outline: none; background: #fff;
}
.fg-item textarea { height: 80px; padding: 10px 12px; resize: vertical; }
.fg-item input:focus, .fg-item select:focus { border-color: var(--orange); }

.form-tip { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ============ 服务信息 ============ */

.info-list { font-size: 13px; }
.info-row {
  display: flex; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: var(--sub); }
.info-row span:last-child { font-weight: 600; }

/* ============ Toast ============ */

.toast {
  position: fixed; top: 30px; left: 50%;
  transform: translateX(-50%) translateY(-70px);
  background: #23262b; color: #fff;
  padding: 12px 24px; border-radius: 8px;
  font-size: 14px; z-index: 200;
  transition: transform .25s;
  max-width: 80vw;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }

/* ============ 响应式 ============ */

@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .brand-text, .user-info, .menu-item span:not(.mi-ico) { display: none; }
  .main { margin-left: 64px; }
  .menu-item { justify-content: center; }
  .form-grid { grid-template-columns: 1fr; }
}
/* ============ 面板底部操作区 ============ */

.panel-foot {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.panel-foot .hint,
.panel .hint {
  font-size: 12px;
  color: #9aa0a6;
  margin-top: 12px;
  line-height: 1.6;
}

.form-tip {
  font-size: 11px;
  color: #9aa0a6;
  margin-top: 5px;
}
