/* 京京在线 · 订单与试听系统 —— 温馨柔和的视觉风格 */
:root {
  --bg: #f6f7fb; --panel: #ffffff; --line: #e8ebf2; --text: #2b3040; --muted: #7a8296;
  --primary: #4f46e5; --primary-dark: #4338ca; --danger: #e05a5a; --ok: #2fa472; --warn: #e0962e;
  --sidebar: #2a2f4a;
  --brand: #4f46e5; --brand-soft: #eef0ff; --bad: #d34848;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #f7f8fc 0%, var(--bg) 100%); color: var(--text); font-size: 14px; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
a { color: var(--primary); text-decoration: none; }

/* 顶部栏 / 布局 / 侧边栏 */
.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; height: 56px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; box-shadow: 0 1px 8px rgba(42, 47, 74, .05); }
.brand { font-weight: 700; font-size: 16px; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.brand-dot { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--primary), #6c63f0);
  color: #fff; font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(79, 70, 229, .25); }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; overflow: hidden; display: inline-flex;
  align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 2px 6px rgba(42,47,74,.15); }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.topbar-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.layout { display: flex; min-height: calc(100vh - 56px); }
.sidebar { width: 180px; background: linear-gradient(180deg, #2a2f4a 0%, #343a5c 100%);
  padding: 14px 0; flex-shrink: 0; }
.sidebar a { display: block; padding: 11px 22px; color: #c3c9dd; text-decoration: none;
  cursor: pointer; border-left: 3px solid transparent; font-size: 13.5px;
  transition: background .15s, color .15s; }
.sidebar a:hover { background: #3c4268; color: #fff; }
.sidebar a.active { color: #fff; background: #3c4268; border-left-color: #8b93ff; font-weight: 600; }
.side-group { padding: 16px 22px 6px; color: #8a91ad; font-size: 11px; letter-spacing: 2px; }
.side-link-out { margin-top: 16px; border-top: 1px solid #3c4268; color: #8b93ff !important; font-size: 12.5px !important; }
.content { flex: 1; padding: 22px; min-width: 0; }

/* 卡片 / 表格 */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(42, 47, 74, .05); }
.card h3 { margin: 0 0 12px; font-size: 15px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: #6b7288; font-weight: 600; white-space: nowrap; background: #f7f8fc; }
tr:hover td { background: #fafbff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.neg { color: var(--danger); } .pos { color: var(--ok); }
.empty { padding: 28px; text-align: center; color: var(--muted); font-size: 13px; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
  border: none; border-radius: 9px; background: linear-gradient(135deg, var(--primary), #6c63f0);
  color: #fff; font-weight: 500; box-shadow: 0 3px 8px rgba(79, 70, 229, .22); transition: transform .1s, box-shadow .15s; }
.btn:hover { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); box-shadow: 0 5px 12px rgba(79, 70, 229, .3); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.secondary, .btn.ghost { background: var(--brand-soft); color: var(--primary); box-shadow: none; }
.btn.secondary:hover, .btn.ghost:hover { background: #e2e4ff; box-shadow: none; }
.btn.danger { background: var(--danger); box-shadow: 0 3px 8px rgba(224, 90, 90, .22); }
.btn.small { padding: 4px 11px; font-size: 13px; }
.btn.gray { background: #eef0f5; color: var(--muted); box-shadow: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 徽标 / 标签 */
.badge { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 12px; }
.badge.blue { background: #e8e9ff; color: var(--primary-dark); }
.badge.green { background: #e0f5ec; color: var(--ok); }
.badge.red { background: #fde8e8; color: var(--danger); }
.badge.gray { background: #eef0f5; color: var(--muted); }
.badge.amber { background: #fdf0d9; color: var(--warn); }

/* 侧栏「待审核」徽标（已改用顶栏 pill-count，保留兼容） */
.side-badge { float: right; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: #e0962e; color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.side-badge.zero { background: #4c526e; color: #aab0c8; }
/* 顶栏待审核快捷提示 */
.pending-pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 14px;
  border-radius: 20px; background: #fdf0d9; color: #b4751d; font-size: 13px; font-weight: 600;
  text-decoration: none; border: 1px solid #f3d9a8; }
.pending-pill:hover { background: #fbe6bd; }
.pending-pill.zero { background: #e2f7ee; color: var(--ok); border-color: #c2e9d6; }
.pending-pill .pill-count { display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  background: #e05a5a; color: #fff; font-size: 13px; font-weight: 700; }
.pending-pill .pill-count::before { content: "（"; }
.pending-pill .pill-count::after { content: "）"; }
.pending-pill.zero .pill-count { background: #2fa472; color: #fff; }
.tag { display: inline-block; padding: 1px 9px; border-radius: 20px; font-size: 12px;
  background: var(--brand-soft); color: var(--primary); }
.tag.ok { background: #e0f5ec; color: var(--ok); }
.tag.warn { background: #fdf0d9; color: #c77d1a; }
.tag.bad { background: #fde8e8; color: var(--danger); }
.tag.gray { background: #eef0f5; color: var(--muted); }

/* 标题 / 提示 / 表单 */
h1 { font-size: 20px; font-weight: 700; margin: 4px 0 16px; color: var(--text); }
h2 { font-size: 16px; font-weight: 700; margin: 22px 0 12px; color: var(--text);
  padding-left: 10px; border-left: 4px solid var(--primary); }
.muted { color: var(--muted); font-size: 12px; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.field { flex: 1; min-width: 150px; }
.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13px; }
.flash.ok { background: #e2f7ee; color: var(--ok); }
.flash.bad { background: #fdeaea; color: var(--danger); }

/* KPI / 网格(订单系统看板) */
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  box-shadow: 0 1px 3px rgba(42, 47, 74, .05); transition: box-shadow .15s; }
.kpi:hover { box-shadow: 0 6px 16px rgba(79, 70, 229, .1); }
.kpi .lab { color: var(--muted); font-size: 12px; }
.kpi .val { font-size: 22px; font-weight: 700; margin-top: 6px; color: var(--primary); }
.kpi .val-note { font-size: 14px; font-weight: 600; color: var(--muted); }
.kpi .sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.money-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.money-line span { font-size: 12px; color: var(--muted); }
.money-line b { font-size: 20px; font-weight: 700; }

/* 页头 / 区块标题 */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.page-head h1 { margin-top: 0; margin-bottom: 4px; }
.page-head p { margin: 0; }
.section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-title h2 { margin-top: 0; }
.section-title p { margin-top: 0; }

/* 经营看板板块分区 */
.board-sec { margin-bottom: 26px; padding: 22px; border: 1px solid var(--line); border-radius: 18px;
  background: #ffffff; box-shadow: 0 1px 4px rgba(42,47,74,.04); }
.board-sec:last-child { margin-bottom: 0; }
.board-title { display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.board-title h2 { margin: 0; border-left: none; padding-left: 0; font-size: 19px; }
.board-title p { margin: 3px 0 0; }
.board-num { flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px;
  color: #fff; font-size: 18px; font-weight: 700; display: inline-flex; align-items: center;
  justify-content: center; box-shadow: 0 3px 10px rgba(42,47,74,.18); }
/* 三大板块区分底色：流水=蓝紫 / 试听=青绿 / 流失=橙红 */
.board-sec.sec-flow { background: linear-gradient(180deg, #f4f5ff 0%, #ffffff 100%); border-color: #e3e5fb; }
.board-sec.sec-flow .board-title { border-bottom-color: #dfe1f9; }
.board-sec.sec-trial { background: linear-gradient(180deg, #f0faf5 0%, #ffffff 100%); border-color: #d4ede0; }
.board-sec.sec-trial .board-title { border-bottom-color: #cfe8db; }
.board-sec.sec-churn { background: linear-gradient(180deg, #fef6ee 0%, #ffffff 100%); border-color: #f5e3cc; }
.board-sec.sec-churn .board-title { border-bottom-color: #f0dec4; }
.board-num.num-flow { background: linear-gradient(135deg, #4f46e5, #6c63f0); }
.board-num.num-trial { background: linear-gradient(135deg, #0ea56f, #2fc48a); }
.board-num.num-churn { background: linear-gradient(135deg, #e07f2e, #f0a04a); }

/* 试听登记专用 */
.trial-wide .content { padding: 16px; }
.lesson-options { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lesson-option { display: grid; grid-template-columns: 2fr 1.2fr 1.3fr auto; gap: 20px; align-items: center;
  padding: 13px 15px; color: var(--text); border-bottom: 1px solid var(--line); background: #fff; }
.lesson-option:last-child { border-bottom: 0; }
.lesson-option:hover { background: var(--brand-soft); }
.lesson-option span, .lesson-option small { display: block; }
.lesson-option small { color: var(--muted); font-size: 12px; }
.lesson-main { min-width: 0; }
.lesson-main span { white-space: normal; }
.lesson-option strong { color: var(--primary); white-space: nowrap; }
.selected-lesson { border-left: 4px solid var(--primary); }
.fact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 20px; }
.fact-grid > div { min-width: 0; }
.fact-grid .wide { grid-column: span 2; }
.fact-grid b, .fact-grid span { display: block; white-space: normal; overflow-wrap: anywhere; }
.fact-grid b { font-size: 14px; }
.notice { padding: 12px 14px; background: #fdf6e3; color: #9a6a1a; border-radius: 10px; margin: 16px 0 0; }
.submit-bar { display: flex; align-items: center; gap: 16px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.submit-bar.highlight { justify-content: center; padding: 20px 0 4px; border-top: none; }
.btn-primary-big { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 48px; border: none; border-radius: 12px; font-size: 17px; font-weight: 700; letter-spacing: 1px;
  color: #fff; cursor: pointer; background: linear-gradient(135deg, #2563eb, #6c63f0);
  box-shadow: 0 6px 20px rgba(37, 99, 235, .32); transition: transform .12s, box-shadow .15s; }
.btn-primary-big:hover { transform: translateY(-2px); box-shadow: 0 9px 26px rgba(37, 99, 235, .4); }
.btn-primary-big:active { transform: translateY(0); }
.wrap-cell { white-space: normal; min-width: 160px; }

/* 周视图 */
.week-meeting { border-top: 3px solid #7594c2; }
.week-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.week-key { display: inline-flex; flex-direction: column; padding: 5px 12px; border-radius: 6px; font-size: 12px;
  border: 1px solid transparent; }
.week-key small { font-size: 11px; color: var(--muted); }
.week-key.current { border-color: var(--primary); font-weight: 600; }
.week-chip { display: inline-block; border-radius: 4px; padding: 1px 6px; font-size: 11px; margin-bottom: 4px; }
.week-1 { background: #eef3fc; } .week-2 { background: #edf7f2; } .week-3 { background: #fff5e6; }
.week-4 { background: #f5effa; } .week-5 { background: #eef7f8; } .week-6 { background: #f6f1ed; }
.week-0 { background: #f1f2f4; }

/* 试听进展 */
.trial-table td { vertical-align: top; }
.trial-table .wrap-cell { min-width: 130px; max-width: 230px; }
.progress-pills { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.status-pill { background: #f1f3f6; padding: 4px 10px; border-radius: 16px; font-size: 12px; color: #59636e; }
.status-pill b { margin-left: 4px; }
.status-已转化 { background: #e0f5ec; color: var(--ok); }
.status-未转化, .status-已取消 { background: #f1f2f6; color: #8a8f9c; }
.status-待二次试听, .status-跟进中 { background: #fdf0d9; color: #9a6a1a; }
.timeline { border-left: 2px solid #d8e2ef; margin-left: 8px; padding-left: 20px; }
.timeline-item { position: relative; padding: 0 0 20px; }
.timeline-item:before { content: ''; position: absolute; left: -26px; top: 5px; width: 8px; height: 8px;
  background: var(--primary); border-radius: 50%; }
.timeline-item .muted { margin-left: 12px; }
.timeline-item p { margin: 5px 0; white-space: pre-wrap; }
.conversion { border-top: 3px solid #2d8a76; }
.legacy-card { border-left: 3px solid #c4913b; }
.legacy-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--line); }
.bar { height: 8px; border-radius: 4px; background: var(--primary); display: inline-block; vertical-align: middle; }

/* 登录页 */
.login-box { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%);
  width: 340px; background: #fff; border-radius: 12px; padding: 26px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .2); }
.login-box h3 { margin: 0 0 14px; text-align: center; }

/* 响应式 */
@media (max-width: 1050px) {
  .fact-grid { grid-template-columns: repeat(2, 1fr); }
  .lesson-option { grid-template-columns: 1.7fr 1fr 1fr auto; gap: 10px; }
}
@media (max-width: 760px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .content { padding: 12px; }
  .sidebar { width: 130px; }
  table { font-size: 12px; }
  th, td { white-space: normal; }
  .page-head, .section-title, .submit-bar { flex-direction: column; align-items: flex-start; }
  .fact-grid { grid-template-columns: 1fr; }
  .fact-grid .wide { grid-column: span 1; }
  .lesson-option { grid-template-columns: 1fr auto; }
  .lesson-option > span:nth-child(2), .lesson-option > span:nth-child(3) { grid-column: 1; }
  .week-legend { display: grid; grid-template-columns: 1fr 1fr; }
  .week-key { padding: 5px 8px; }
}
