/* views */

/* ---------- dashboard ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 10%, rgba(255, 248, 238, .10), transparent 34%),
    linear-gradient(135deg, #24221e, #1c1a17);
  color: #f4efe4;
  border-radius: 12px;
  border: 1px solid #171512;
  padding: 30px 32px;
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 28px;
  box-shadow: 0 16px 40px rgba(24, 22, 19, .14);
}
.hero::after {
  content: "观";
  position: absolute;
  right: 24px;
  bottom: -46px;
  font-family: var(--title-font);
  font-size: 190px;
  line-height: 1;
  color: rgba(244, 239, 228, .045);
  pointer-events: none;
}
.hero .eyebrow { color: #d88972; }
.hero h2 {
  margin: 0 0 10px;
  font-family: var(--title-font);
  font-size: 29px;
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: .04em;
  max-width: 680px;
}
.hero p { margin: 0; color: rgba(244, 239, 228, .62); font-size: 13px; max-width: 620px; }
.hero-quote {
  margin-top: 18px;
  padding-left: 13px;
  border-left: 2px solid var(--red);
  font-family: var(--title-font);
  font-size: 15px;
  color: rgba(244, 239, 228, .82);
  letter-spacing: .06em;
}
.hero-side {
  border-left: 1px solid rgba(244, 239, 228, .14);
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}
.hero-side .label { color: rgba(244, 239, 228, .48); }
.hero-progress { height: 5px; background: rgba(244, 239, 228, .14); border-radius: 99px; overflow: hidden; }
.hero-progress > i { display: block; height: 100%; background: #d88972; border-radius: inherit; }
.hero-side .big { font-family: var(--title-font); font-size: 34px; line-height: 1; letter-spacing: .02em; }
.hero-side .small { color: rgba(244, 239, 228, .55); font-size: 11px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.stat-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -18px;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(168, 58, 44, .10);
  border-radius: 50%;
}
.stat-card .label { font-size: 10px; letter-spacing: .12em; }
.stat-card .num {
  font-family: var(--title-font);
  font-size: 30px;
  line-height: 1.2;
  margin-top: 4px;
}
.stat-card .num small { font-family: var(--body-font); font-size: 12px; color: var(--muted); font-weight: 400; }
.stat-card .hint { font-size: 11px; color: var(--muted); margin-top: 2px; }

.dash-grid { display: grid; grid-template-columns: 1.45fr .85fr; gap: 16px; margin-top: 16px; }
.queue-list { display: flex; flex-direction: column; }
.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.queue-item:last-child { border-bottom: 0; }
.queue-platform {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #fff8ee;
  font-size: 12px;
  flex: 0 0 30px;
}
.queue-main { flex: 1; min-width: 0; }
.queue-title { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }

.pillar-bars { display: flex; flex-direction: column; gap: 13px; }
.pillar-row { display: grid; grid-template-columns: 92px 1fr 38px; align-items: center; gap: 10px; }
.pillar-row .name { font-size: 12px; color: var(--ink-2); }
.pillar-row .bar { height: 7px; background: #e8dfd0; border-radius: 99px; overflow: hidden; }
.pillar-row .bar > i { display: block; height: 100%; border-radius: inherit; }
.pillar-row .pct { font-size: 11px; color: var(--muted); text-align: right; }

.alert-list { display: flex; flex-direction: column; gap: 9px; }
.alert-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--ink-2);
  padding: 9px 11px;
  background: rgba(255, 255, 255, .35);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.alert-item .dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 7px; flex: 0 0 6px; }
.alert-item .dot.red { background: var(--red); }
.alert-item .dot.amber { background: var(--amber); }
.alert-item .dot.green { background: var(--green); }

.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.quick-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .35);
  border-radius: 9px;
  padding: 16px;
  text-align: left;
  transition: .16s ease;
}
.quick-card:hover { background: var(--paper-2); border-color: var(--line-strong); transform: translateY(-1px); }
.quick-card .q-icon { width: 28px; height: 28px; color: var(--red); margin-bottom: 8px; }
.quick-card .q-title { font-size: 13px; color: var(--ink); }
.quick-card .q-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- positioning ---------- */
.position-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; }
.position-main { padding: 24px 26px; }
.position-one-liner {
  font-family: var(--title-font);
  font-size: 25px;
  line-height: 1.55;
  letter-spacing: .04em;
  margin: 8px 0 14px;
  padding-left: 14px;
  border-left: 3px solid var(--red);
}
.position-persona { color: var(--muted); font-size: 13px; }
.position-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.platform-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.35); }
.platform-card + .platform-card { margin-top: 10px; }
.platform-card .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.platform-card .pname { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.platform-dot { width: 22px; height: 22px; border-radius: 5px; display: grid; place-items: center; color: #fff8ee; font-size: 10px; }
.platform-card .note { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.65; }

.redline-box { background: var(--red-soft); border: 1px solid #e7c4ba; border-radius: 9px; padding: 14px 16px; }
.redline-box .label { color: var(--danger); }
.redline-words { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.redline-words span { background: rgba(255,255,255,.55); border: 1px solid #e7c4ba; color: var(--danger); border-radius: 5px; padding: 1px 6px; font-size: 11px; }

/* ---------- topics ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.topic-card {
  border: 1px solid var(--line);
  background: var(--paper-2);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: .16s ease;
}
.topic-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.topic-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.topic-title { font-family: var(--title-font); font-size: 17px; line-height: 1.45; letter-spacing: .02em; margin: 0; }
.topic-excerpt { font-size: 12px; color: var(--muted); line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.topic-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.topic-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--line); }
.topic-actions { display: flex; gap: 5px; }

.score-ring {
  --p: 70;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: conic-gradient(var(--red) calc(var(--p) * 1%), #e6ddcd 0);
  display: grid;
  place-items: center;
  flex: 0 0 52px;
  position: relative;
}
.score-ring::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--paper-2);
}
.score-ring b { position: relative; z-index: 1; font-family: var(--title-font); font-size: 17px; font-weight: 600; }
.score-ring.green { background: conic-gradient(var(--green) calc(var(--p) * 1%), #e6ddcd 0); }
.score-ring.amber { background: conic-gradient(var(--amber) calc(var(--p) * 1%), #e6ddcd 0); }
.score-ring.gray { background: conic-gradient(var(--muted-2) calc(var(--p) * 1%), #e6ddcd 0); }

/* ---------- compliance ---------- */
.compliance-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.scan-panel { padding: 20px 22px; }
.scan-result { min-height: 220px; }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.result-level { font-family: var(--title-font); font-size: 22px; letter-spacing: .03em; }
.result-level.red { color: var(--danger); }
.result-level.high { color: var(--amber); }
.result-level.warn { color: var(--blue); }
.result-level.safe { color: var(--green); }
.result-score { font-family: var(--title-font); font-size: 34px; line-height: 1; }
.finding-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; max-height: 420px; overflow-y: auto; }
.finding {
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: 6px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, .35);
  font-size: 12px;
}
.finding.red { border-left-color: var(--danger); }
.finding.high { border-left-color: var(--amber); }
.finding.warn { border-left-color: var(--blue); }
.finding.info { border-left-color: var(--green); }
.finding .f-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.finding .f-term { font-weight: 600; }
.finding .f-sug { color: var(--muted); margin-top: 3px; line-height: 1.6; }

.highlight-box {
  white-space: pre-wrap;
  line-height: 2;
  font-size: 13px;
  background: rgba(255, 255, 255, .4);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 14px 16px;
  max-height: 360px;
  overflow-y: auto;
}
.mark-red { background: rgba(157, 47, 34, .16); border-bottom: 1px solid var(--danger); padding: 0 1px; }
.mark-high { background: rgba(168, 117, 43, .16); border-bottom: 1px solid var(--amber); padding: 0 1px; }
.mark-warn { background: rgba(63, 95, 120, .12); border-bottom: 1px solid var(--blue); padding: 0 1px; }
.mark-info { background: rgba(63, 107, 82, .10); border-bottom: 1px dashed var(--green); padding: 0 1px; }

.rule-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rule-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: rgba(255,255,255,.32); }
.rule-card .rc-title { font-size: 12px; font-weight: 600; }
.rule-card .rc-count { font-family: var(--title-font); font-size: 22px; margin-top: 2px; }
.rule-card .rc-desc { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- covers ---------- */
.cover-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.cover-controls { padding: 18px 18px 20px; }
.cover-preview-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(45deg, #e9e2d5 25%, transparent 25%),
    linear-gradient(-45deg, #e9e2d5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e9e2d5 75%),
    linear-gradient(-45deg, transparent 75%, #e9e2d5 75%),
    #f6f1e7;
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  padding: 24px;
  display: flex;
  justify-content: center;
}
.cover-preview-wrap canvas {
  width: auto;
  max-width: 100%;
  max-height: 640px;
  border-radius: 4px;
  box-shadow: 0 18px 50px rgba(24, 22, 19, .18);
  background: #fff;
}
.template-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.template-chip {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 6px;
  background: rgba(255,255,255,.4);
  text-align: center;
  font-size: 10px;
  color: var(--muted);
}
.template-chip.active { border-color: var(--ink); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.template-chip .swatch { height: 18px; border-radius: 3px; margin-bottom: 5px; }
.size-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.size-tabs .chip { justify-content: center; }

/* ---------- calendar ---------- */
.calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--line); gap: 1px; }
.calendar-dow { background: var(--paper-3); padding: 8px; font-size: 10px; color: var(--muted); text-align: center; letter-spacing: .12em; }
.day-cell { background: var(--paper-2); min-height: 116px; padding: 8px; position: relative; }
.day-cell.other { background: #f1ebdf; color: var(--muted-2); }
.day-cell.today { box-shadow: inset 0 0 0 2px var(--red); }
.day-num { font-family: var(--title-font); font-size: 15px; margin-bottom: 4px; }
.draft-pill {
  display: block;
  width: 100%;
  border: 0;
  text-align: left;
  font-size: 10px;
  line-height: 1.5;
  padding: 3px 5px;
  margin-bottom: 3px;
  border-radius: 4px;
  background: var(--paper-3);
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.draft-pill:hover { background: #e4dac9; }
.draft-pill.red { background: var(--red-soft); color: var(--danger); }
.draft-pill.green { background: var(--green-soft); color: var(--green); }
.draft-pill.blue { background: var(--blue-soft); color: var(--blue); }

/* ---------- data ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; background: var(--paper-2); }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 820px; }
.data-table th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .1em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-3);
  white-space: nowrap;
}
.data-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: rgba(255, 255, 255, .35); }
.data-table .num { font-family: var(--title-font); font-size: 14px; }

.data-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mini-stat { border: 1px solid var(--line); border-radius: 8px; padding: 13px 15px; background: rgba(255,255,255,.35); }
.mini-stat .label { font-size: 10px; }
.mini-stat .v { font-family: var(--title-font); font-size: 24px; margin-top: 2px; }

/* ---------- knowledge ---------- */
.knowledge-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px; align-items: start; }
.k-tabs { display: flex; flex-direction: column; gap: 3px; }
.k-tab {
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
}
.k-tab:hover { background: rgba(255,255,255,.4); color: var(--ink); }
.k-tab.active { background: var(--ink); color: #fff8ee; }
.k-item { border: 1px solid var(--line); border-radius: 8px; padding: 13px 15px; background: rgba(255,255,255,.32); }
.k-item + .k-item { margin-top: 9px; }
.k-item .k-title { font-size: 13px; font-weight: 600; }
.k-item .k-body { font-size: 12px; color: var(--muted); white-space: pre-wrap; margin-top: 5px; line-height: 1.75; }

/* ---------- funnel ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px; background: var(--line-strong); }
.timeline-item { position: relative; padding: 0 0 18px 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -19px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper-2);
  border: 2px solid var(--red);
}
.day-badge { display: inline-block; font-family: var(--title-font); color: var(--red); font-size: 15px; margin-right: 8px; }
.timeline-item h3 { display: inline; font-size: 14px; font-weight: 600; margin: 0; }
.timeline-item p { margin: 4px 0 0; font-size: 12px; color: var(--muted); line-height: 1.7; }

.calc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.calc-result { background: var(--ink); color: #fff8ee; border-radius: 9px; padding: 18px 20px; }
.calc-result .label { color: rgba(244,239,228,.5); }
.calc-result .v { font-family: var(--title-font); font-size: 34px; line-height: 1.2; }
.calc-result .hint { font-size: 11px; color: rgba(244,239,228,.55); margin-top: 4px; }

/* ---------- settings ---------- */
.settings-section { padding: 20px 22px; }
.settings-section + .settings-section { margin-top: 12px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.settings-row:last-child { border-bottom: 0; }
.settings-row .sr-main { flex: 1; }
.settings-row .sr-title { font-size: 13px; }
.settings-row .sr-desc { font-size: 11px; color: var(--muted); margin-top: 2px; }
.warn-box { background: var(--amber-soft); border: 1px solid #e4d2b3; border-radius: 8px; padding: 11px 14px; font-size: 12px; color: #7a571f; line-height: 1.7; }
.info-box { background: var(--blue-soft); border: 1px solid #c9dbe4; border-radius: 8px; padding: 11px 14px; font-size: 12px; color: #2f4c60; line-height: 1.7; }
.danger-box { background: var(--red-soft); border: 1px solid #e7c4ba; border-radius: 8px; padding: 11px 14px; font-size: 12px; color: var(--danger); line-height: 1.7; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .main { padding: 0 24px 60px; }
  .hero { grid-template-columns: 1fr; }
  .hero-side { border-left: 0; border-top: 1px solid rgba(244,239,228,.14); padding-left: 0; padding-top: 16px; }
  .dash-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .position-grid { grid-template-columns: 1fr; }
  .compliance-layout { grid-template-columns: 1fr; }
  .cover-layout { grid-template-columns: 280px minmax(0, 1fr); }
  .knowledge-layout { grid-template-columns: 160px minmax(0, 1fr); }
  .rule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .sidebar { width: 72px; flex-basis: 72px; padding: 14px 8px; }
  .brand { padding: 4px 4px 16px; justify-content: center; }
  .brand-name, .brand-sub, .nav-label, .sidebar-footer .mini-note, .sidebar-footer .link-btn { display: none; }
  .brand-seal { width: 40px; height: 40px; flex-basis: 40px; }
  .nav-item { justify-content: center; padding: 10px 6px; }
  .nav-item span { display: none; }
  .nav-item svg { width: 19px; height: 19px; flex-basis: 19px; }
  .main { padding: 0 16px 50px; }
  .topbar { padding-top: 20px; }
  .topbar h1 { font-size: 24px; }
  .topic-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .cover-layout { grid-template-columns: 1fr; }
  .knowledge-layout { grid-template-columns: 1fr; }
  .k-tabs { flex-direction: row; overflow-x: auto; }
  .data-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-grid { grid-template-columns: 1fr; }
  .calendar-grid { min-width: 760px; }
  .calendar-wrap { overflow-x: auto; }
  .hero h2 { font-size: 23px; }
  .hero { padding: 22px; }
  .modal-backdrop { padding: 3vh 10px 20px; }
  .quick-grid { grid-template-columns: 1fr; }
}

/* ---------- 账号工作流 ---------- */
.workflow-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}
.workflow-banner > div { flex: 1; min-width: 0; }
.workflow-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 9px;
  display: inline-block;
}
.workflow-list { display: flex; flex-direction: column; gap: 8px; }
.workflow-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
}
.workflow-item.active { border-color: var(--red); background: rgba(168, 58, 44, .04); }
.workflow-main { flex: 1; min-width: 0; }
.workflow-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 600;
}
.workflow-sub { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.workflow-btns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.workflow-facts .label { font-size: 11px; }

/* ---------- 爆款拆解台 ---------- */
.bd-hero {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 26px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    radial-gradient(circle at 88% 0%, rgba(168, 58, 44, .07), transparent 38%),
    linear-gradient(135deg, #fbf8f1, #f0e8d8);
  margin-bottom: 18px;
}
.bd-hero h2 {
  margin: 0 0 8px;
  font-family: var(--title-font);
  font-size: 25px;
  line-height: 1.35;
  font-weight: 550;
  letter-spacing: .04em;
}
.bd-hero p { margin: 0; color: var(--muted); font-size: 13px; max-width: 720px; }
.bd-hero-side {
  border-left: 1px solid var(--line);
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  justify-content: center;
}
.bd-mode { font-family: var(--title-font); font-size: 22px; color: var(--red); letter-spacing: .05em; }
.bd-link-state {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--line);
}
.bd-link-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); }
.bd-link-state.on { color: var(--green); background: var(--green-soft); border-color: #c8dbce; }
.bd-link-state.on::before { background: var(--green); }
.bd-link-state.off { color: var(--amber); background: var(--amber-soft); border-color: #e4d2b3; }
.bd-link-state.off::before { background: var(--amber); }

.bd-layout {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  gap: 16px;
  align-items: start;
}
.bd-input { position: sticky; top: 18px; }
.bd-url-row { align-items: stretch; }
.bd-url-row .input { flex: 1 1 auto; min-width: 0; }
.bd-url-row .btn { flex: 0 0 auto; }
.bd-note {
  margin-top: 10px;
  padding: 8px 10px;
  border-left: 2px solid var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  line-height: 1.6;
}
.bd-error {
  margin-top: 10px;
  padding: 8px 10px;
  border-left: 2px solid var(--danger);
  background: var(--red-soft);
  color: var(--danger);
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  line-height: 1.6;
}
.bd-hint { margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.7; }

.bd-empty { padding: 26px 22px; }
.bd-empty-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.bd-empty-steps div { font-size: 12px; color: var(--muted); }
.bd-empty-steps b {
  display: block;
  font-family: var(--title-font);
  color: var(--red);
  font-size: 18px;
  margin-bottom: 2px;
}

.bd-result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 4px 2px 14px;
}
.bd-result-head h3 {
  margin: 0 0 4px;
  font-family: var(--title-font);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: .03em;
}
.bd-result-head p { margin: 0; max-width: 680px; }
.bd-warning {
  padding: 9px 11px;
  border: 1px solid #e4d2b3;
  background: var(--amber-soft);
  color: var(--amber);
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.65;
  margin-bottom: 12px;
}
.bd-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bd-block { min-width: 0; }
.bd-block-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--title-font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
}
.bd-block-title .small { font-family: var(--body-font); font-weight: 400; }
.bd-hook {
  font-family: var(--title-font);
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink);
  padding-left: 12px;
  border-left: 2px solid var(--red);
}
.bd-scene { margin: 0; display: flex; flex-direction: column; gap: 7px; }
.bd-scene > div { display: grid; grid-template-columns: 38px 1fr; gap: 8px; }
.bd-scene dt { color: var(--muted-2); font-size: 11px; padding-top: 1px; }
.bd-scene dd { margin: 0; font-size: 12px; line-height: 1.65; }

.bd-structure { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.bd-structure-row {
  display: grid;
  grid-template-columns: 58px 88px 1fr;
  gap: 10px;
  padding: 9px 11px;
  background: var(--paper-2);
  font-size: 12px;
  line-height: 1.65;
}
.bd-structure-row:nth-child(even) { background: #f8f4ea; }
.bd-time { color: var(--red); font-family: ui-monospace, Consolas, monospace; font-size: 11px; white-space: nowrap; }
.bd-structure-row b { font-weight: 600; color: var(--ink-2); }
.bd-structure-row > span:last-child { color: var(--muted); }

.bd-list { margin: 0; padding-left: 17px; font-size: 12px; line-height: 1.75; color: var(--ink-2); }
.bd-list-warn { color: var(--danger); }
.bd-list li + li { margin-top: 4px; }

.bd-topics { margin-top: 24px; }
.bd-topics .section-head { margin-top: 0; }
.bd-topic {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper-2);
  padding: 15px 17px;
  margin-bottom: 10px;
}
.bd-topic-top { display: flex; gap: 10px; align-items: flex-start; }
.bd-topic-index {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff8ee;
  font-family: var(--title-font);
  font-size: 13px;
  letter-spacing: .02em;
}
.bd-topic h4 {
  margin: 0 0 5px;
  font-family: var(--title-font);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}
.bd-topic-body { margin-top: 10px; padding-left: 44px; }
.bd-topic-body p { margin: 0 0 5px; font-size: 12px; line-height: 1.7; color: var(--muted); }
.bd-topic-body p b { color: var(--ink-2); font-weight: 600; }
.bd-outline {
  margin-top: 10px;
  padding: 10px 12px;
  background: #f7f2e7;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
}
.bd-outline ol { margin: 6px 0 0; padding-left: 18px; font-size: 12px; line-height: 1.75; color: var(--ink-2); }
.bd-outline li + li { margin-top: 2px; }
.bd-topic-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-left: 44px;
}

@media (max-width: 1180px) {
  .bd-layout { grid-template-columns: 1fr; }
  .bd-input { position: static; }
}
@media (max-width: 860px) {
  .bd-hero { grid-template-columns: 1fr; gap: 16px; }
  .bd-hero-side { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 14px; }
  .bd-grid-2 { grid-template-columns: 1fr; }
  .bd-structure-row { grid-template-columns: 52px 1fr; }
  .bd-structure-row > span:last-child { grid-column: 1 / -1; }
  .bd-topic-body, .bd-topic-foot { padding-left: 0; }
  .bd-topic-foot { align-items: flex-start; flex-direction: column; }
  .bd-empty-steps { grid-template-columns: 1fr; }
}


/* ---------- compliance rule library ---------- */
.lib-panel { padding: 16px 18px; }
.lib-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lib-stats { font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.lib-stats b { color: var(--ink); font-weight: 600; }
.lib-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(120px, .6fr));
  gap: 8px;
  margin-top: 12px;
}
.lib-toolbar .input, .lib-toolbar .select { height: 34px; font-size: 12px; }
.lib-hint { font-size: 11px; color: var(--muted); margin: 8px 0 4px; line-height: 1.6; }
.lib-list { display: flex; flex-direction: column; margin-top: 6px; }
.lib-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.lib-row:last-child { border-bottom: 0; }
.lib-row.off { opacity: .55; }
.lib-row-main { flex: 1; min-width: 0; }
.lib-row-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lib-term { font-size: 13px; color: var(--ink); font-weight: 600; letter-spacing: .02em; }
.lib-scope {
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 1px 7px;
}
.lib-replace { font-size: 11px; color: var(--green); }
.lib-sug { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.lib-row-actions { display: flex; gap: 6px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.lib-row-actions .btn.small { padding: 4px 9px; font-size: 11px; }
.lib-code {
  display: inline-block;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  color: var(--ink-2);
  background: rgba(0, 0, 0, .04);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.lib-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
@media (max-width: 1180px) {
  .lib-toolbar { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .lib-toolbar { grid-template-columns: 1fr; }
  .lib-row { flex-direction: column; }
  .lib-row-actions { justify-content: flex-start; }
}