/* 惊鸿创科代理商CRM —— 主题源自品牌 LOGO（黑底 + 蓝黄白绿红五色流线） */
:root {
  --brand-blue: #2196ED;
  --brand-yellow: #F5A800;
  --brand-green: #3DBE7B;
  --brand-red: #E63946;
  --ink: #17181A;
  --ink-soft: #2A2C30;
  --bg: #F4F5F7;
  --card: #FFFFFF;
  --line: #E4E6EB;
  --text: #1F2329;
  --text-2: #646A73;
  --text-3: #8F959E;
  --danger: #E63946;
  --ok: #3DBE7B;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(23,24,26,.06), 0 4px 16px rgba(23,24,26,.05);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
a { color: var(--brand-blue); text-decoration: none; }

.boot-loading { display: flex; align-items: center; justify-content: center; height: 100vh; color: var(--text-3); font-size: 15px; }

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 20% -10%, #23252B 0%, var(--ink) 55%), var(--ink);
  padding: 24px;
}
.login-card {
  width: 400px; max-width: 100%; background: var(--card); border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35); padding: 36px 34px 30px;
}
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-logo img { width: 72px; height: 72px; border-radius: 16px; }
.login-logo .sys-name { font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: .5px; }
.login-logo .sys-sub { font-size: 12px; color: var(--text-3); letter-spacing: 2px; }
.login-tabs { display: flex; background: var(--bg); border-radius: 8px; padding: 4px; margin-bottom: 18px; }
.login-tabs button {
  flex: 1; border: 0; background: transparent; padding: 8px 0; border-radius: 6px;
  color: var(--text-2); font-size: 14px;
}
.login-tabs button.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
  outline: none; background: #fff; color: var(--text); transition: border .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand-blue); }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.field .err { font-size: 12px; color: var(--danger); margin-top: 4px; }
.otp-row { display: flex; gap: 8px; }
.otp-row input { flex: 1; }
.btn {
  border: 0; border-radius: 8px; padding: 9px 16px; font-size: 14px;
  background: var(--bg); color: var(--text); transition: filter .15s, opacity .15s;
}
.btn:hover { filter: brightness(.96); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand-blue); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-danger { background: #FDECEE; color: var(--danger); }
.btn-ok { background: #E6F7EF; color: #1F8A5A; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; padding: 11px 0; font-size: 15px; }
.login-err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 4px 0 10px; }
.login-foot { margin-top: 16px; text-align: center; font-size: 12px; color: var(--text-3); }

/* ---------- 绑定页 ---------- */
.bind-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 20% -10%, #23252B 0%, var(--ink) 55%), var(--ink);
  padding: 24px;
}
.bind-card { width: 420px; max-width: 100%; background: var(--card); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.35); padding: 34px; }
.bind-card h2 { font-size: 18px; margin-bottom: 6px; }
.bind-card p { font-size: 13px; color: var(--text-2); margin-bottom: 18px; line-height: 1.6; }

/* ---------- 主框架 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; background: linear-gradient(180deg, #1B1C20 0%, #17181A 100%);
  color: #B9BDC6; display: flex; flex-direction: column; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; }
.side-brand img { width: 36px; height: 36px; border-radius: 9px; }
.side-brand .t1 { color: #fff; font-size: 15px; font-weight: 700; letter-spacing: .3px; }
.side-brand .t2 { font-size: 11px; color: #7C828C; }
.nav { flex: 1; padding: 8px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  color: #B9BDC6; font-size: 14px; margin-bottom: 2px; cursor: pointer; border: 0; background: transparent; width: 100%; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--brand-blue); color: #fff; font-weight: 600; }
.nav-item .ico { width: 18px; text-align: center; }
.side-foot { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; }
.side-foot .who { color: #E8EAEE; margin-bottom: 8px; line-height: 1.5; }
.side-foot .who small { color: #7C828C; }
.side-foot button { width: 100%; background: rgba(255,255,255,.08); color: #C9CDD4; border: 0; border-radius: 7px; padding: 7px 0; font-size: 13px; }
.side-foot button:hover { background: rgba(255,255,255,.14); color: #fff; }

.main { flex: 1; min-width: 0; padding: 22px 26px 40px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.page-head h1 { font-size: 20px; font-weight: 700; }
.page-head .sub { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 卡片与统计 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; position: relative; overflow: hidden; }
.stat-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand-blue); }
.stat-card.c-yellow::before { background: var(--brand-yellow); }
.stat-card.c-green::before { background: var(--brand-green); }
.stat-card.c-red::before { background: var(--brand-red); }
.stat-card.c-dark::before { background: var(--ink); }
.stat-card .label { font-size: 13px; color: var(--text-2); }
.stat-card .value { font-size: 24px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-card .unit { font-size: 13px; font-weight: 400; color: var(--text-3); margin-left: 2px; }

.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.panel h3 { font-size: 15px; margin-bottom: 12px; }
.panel .desc { font-size: 12px; color: var(--text-3); margin-bottom: 12px; }

/* 表格 */
.table-wrap { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
th { text-align: left; padding: 11px 14px; background: #F8F9FB; color: var(--text-2); font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { padding: 11px 14px; border-bottom: 1px solid #F0F1F4; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #FAFBFC; }
.td-num { font-variant-numeric: tabular-nums; text-align: right; }
.th-num { text-align: right; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; line-height: 18px; }
.tag-blue { background: #E8F4FD; color: #1479C4; }
.tag-green { background: #E6F7EF; color: #1F8A5A; }
.tag-yellow { background: #FFF6E5; color: #B27300; }
.tag-red { background: #FDECEE; color: #D0303C; }
.tag-gray { background: #F1F2F4; color: #646A73; }
.tag-dark { background: var(--ink); color: #fff; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty-tip { padding: 40px 0; text-align: center; color: var(--text-3); }
.mono { font-family: Consolas, Menlo, monospace; font-size: 12.5px; }

/* 工具条 */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar select, .toolbar input {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; outline: none;
}
.toolbar input:focus, .toolbar select:focus { border-color: var(--brand-blue); }

/* 余额柱/折扣徽标 */
.balance-num { font-weight: 700; font-variant-numeric: tabular-nums; }
.discount-badge { display: inline-block; background: #FFF6E5; color: #B27300; border-radius: 6px; padding: 2px 8px; font-weight: 600; font-size: 12.5px; }

/* 提货开单 */
.order-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1080px) { .order-grid { grid-template-columns: 1fr; } }
.pick-list { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #F0F1F4; }
.pick-row:last-child { border-bottom: 0; }
.pick-row .info { flex: 1; min-width: 0; }
.pick-row .info .n { font-weight: 600; }
.pick-row .info .s { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.pick-row input[type=number] { width: 76px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; text-align: right; }
.order-sum { position: sticky; top: 0; }
.sum-line { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.sum-line.total { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 12px; font-size: 17px; font-weight: 700; }

/* 通知 */
.notice-item { border-bottom: 1px solid #F0F1F4; padding: 14px 4px; }
.notice-item:last-child { border-bottom: 0; }
.notice-item .n-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.notice-item .n-title { font-weight: 700; font-size: 14.5px; }
.notice-item .n-time { font-size: 12px; color: var(--text-3); margin-left: auto; }
.notice-item .n-body { font-size: 13.5px; color: var(--text-2); line-height: 1.7; white-space: pre-wrap; }

/* 课件 */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.file-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.file-card .f-ico { width: 40px; height: 40px; border-radius: 9px; background: #E8F4FD; color: #1479C4; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.file-card .f-ico.pdf { background: #FDECEE; color: #D0303C; }
.file-card .f-ico.doc { background: #E8F4FD; color: #1479C4; }
.file-card .f-ico.xls { background: #E6F7EF; color: #1F8A5A; }
.file-card .f-ico.img { background: #FFF6E5; color: #B27300; }
.file-card .f-ico.zip { background: #F1F2F4; color: #646A73; }
.file-card .f-info { flex: 1; min-width: 0; }
.file-card .f-name { font-weight: 600; word-break: break-all; }
.file-card .f-meta { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.file-card .f-acts { display: flex; gap: 6px; margin-top: 8px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,16,18,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 14px; width: 480px; max-width: 100%; max-height: 90vh; overflow: auto; box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.modal-lg { width: 640px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.modal-head h3 { font-size: 16px; }
.modal-close { border: 0; background: transparent; font-size: 20px; color: var(--text-3); line-height: 1; }
.modal-body { padding: 16px 20px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 20px; }

/* Toast */
#toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: rgba(23,24,26,.92); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13.5px; box-shadow: 0 6px 24px rgba(0,0,0,.25); animation: tin .2s; max-width: 80vw; }
.toast.err { background: rgba(214,48,60,.95); }
.toast.ok { background: rgba(31,138,90,.95); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* 管理员入口 */
.admin-card { border-top: 4px solid var(--brand-blue); }
.switch-role-btn {
  width: 100%; margin-bottom: 8px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08);
  color: #fff; font-size: 13px; cursor: pointer; transition: background .15s;
}
.switch-role-btn:hover { background: rgba(255,255,255,.18); }
.admin-entry-tag {
  display: inline-block; background: var(--ink); color: #fff; font-size: 12px;
  letter-spacing: 3px; padding: 5px 16px; border-radius: 20px; margin-top: 2px;
}
.bind-card.admin-card h2 { color: var(--ink); }

/* 移动端 */
@media (max-width: 768px) {  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .side-brand { padding: 10px 14px; }
  .nav { display: flex; overflow-x: auto; padding: 6px 8px; flex: 1; }
  .nav-item { white-space: nowrap; width: auto; }
  .side-foot { border-top: 0; padding: 8px 12px; display: flex; align-items: center; gap: 8px; }
  .side-foot button { width: auto; padding: 6px 14px; }
  .main { padding: 16px 14px 40px; }
}
