:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --brand: #0f766e;
  --line: #e5e7eb;
  --danger: #b91c1c;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "PingFang SC", "Microsoft YaHei", sans-serif; }
#htmx-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: #0ea5e9; z-index: 30; opacity: 0; transition: width .2s ease, opacity .2s ease; }
#htmx-progress.active { width: 60%; opacity: 1; }
#htmx-progress.done { width: 100%; opacity: 0; }
.topbar { display:flex; align-items:center; justify-content:space-between; padding: 10px 16px; background:#fff; border-bottom:1px solid var(--line); position: sticky; top:0; z-index:9; }
.brand { font-weight:700; color: var(--brand); }
.nav { display:flex; gap:10px; }
.nav-item { position: relative; }
.nav-link { display:inline-block; text-decoration:none; color:#334155; padding:6px 10px; border-radius:8px; }
.nav-link.active, .nav-link:hover { background:#e6fffa; color:#0f766e; }
.nav-dropdown {
  display:none;
  position:absolute;
  left:0;
  top:100%;
  min-width:168px;
  padding:6px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:10px;
  box-shadow:0 10px 24px rgba(15, 23, 42, 0.14);
  z-index:20;
}
.nav-dropdown a {
  display:block;
  text-decoration:none;
  color:#334155;
  padding:6px 10px;
  border-radius:8px;
  white-space:nowrap;
}
.nav-dropdown a:hover, .nav-dropdown a.active { background:#e6fffa; color:#0f766e; }
.nav-item:hover .nav-dropdown, .nav-item:focus-within .nav-dropdown { display:block; }
.userbox { display:flex; gap:12px; align-items:center; }
.userbox a { text-decoration:none; color:#334155; padding:4px 8px; border-radius:8px; }
.userbox a:hover { background:#e6fffa; color:#0f766e; }
.mail-link { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 34px; font-size: 16px; line-height: 1; }
.mail-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  font-weight: 700;
}
.container { max-width: 1400px; margin: 16px auto; padding: 0 16px; }
.narrow { max-width: 520px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:14px; margin-bottom:14px; }
.breadcrumb { margin: 0 0 10px; font-size: 13px; line-height: 1.4; font-weight: 500; color: #64748b; }
.toolbar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:10px; }
.muted { color: var(--muted); }
.form-grid { display:flex; flex-wrap:wrap; gap:8px 12px; align-items:center; }
.form-grid > * { flex: 1 1 calc(50% - 12px); min-width: 220px; }
.form-grid.cols-4 > * { flex: 1 1 calc(25% - 12px); min-width: 180px; }
.form-grid .full-row { flex: 1 1 100%; min-width: 0; }
.param-grid { display:flex; flex-wrap:wrap; gap:8px 12px; }
.param-grid > .form-item { flex: 1 1 calc(25% - 12px); min-width: 0; }
.form-item { display:flex; flex-direction:column; gap:4px; }
label { font-size: 12px; color:#475569; }
input, select, button, textarea { width:100%; padding:8px 10px; border:1px solid #cbd5e1; border-radius:8px; background:#fff; font-size: 14px; }
button { cursor:pointer; }
.btn { display:inline-block; width:auto; padding:8px 14px; background:#fff; border:1px solid #cbd5e1; }
.btn.primary { background: var(--brand); color:#fff; border-color: var(--brand); }
.btn.danger { background:#fee2e2; color:var(--danger); border-color:#fecaca; }
.btn.tiny { padding:4px 8px; font-size:12px; }
.actions { display:flex; gap:8px; flex-wrap:wrap; flex: 1 1 100%; min-width: 0; }
.inline-form { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:8px; }
.msg { padding:8px 10px; border-radius:8px; margin-bottom:8px; }
.msg.error { background:#fee2e2; color:#991b1b; }
.msg.success { background:#dcfce7; color:#166534; }
.msg.warning { background:#fef3c7; color:#92400e; }
.msg.info { background:#dbeafe; color:#1e3a8a; }
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  max-width: min(440px, calc(100vw - 24px));
  pointer-events: none;
}
.toast-item {
  position: relative;
  width: min(380px, calc(100vw - 24px));
  min-height: 56px;
  margin: 0;
  padding: 14px 16px 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-left-width: 5px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
  pointer-events: auto;
  opacity: 1;
  transform: translateX(0);
  transition: opacity .22s ease, transform .22s ease;
}
.toast-item.is-hiding {
  opacity: 0;
  transform: translateX(28px);
}
.toast-item.msg.success {
  background: linear-gradient(135deg, #ecfdf3 0%, #dcfce7 100%);
  border-color: rgba(22, 163, 74, 0.18);
  border-left-color: #16a34a;
  color: #14532d;
}
.toast-item.msg.error {
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  border-color: rgba(225, 29, 72, 0.18);
  border-left-color: #e11d48;
  color: #881337;
}
.toast-item.msg.warning {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-color: rgba(234, 88, 12, 0.18);
  border-left-color: #ea580c;
  color: #9a3412;
}
.toast-item.msg.info {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: rgba(37, 99, 235, 0.18);
  border-left-color: #2563eb;
  color: #1e3a8a;
}
.toast-item-body {
  padding-right: 22px;
  word-break: break-word;
}
.toast-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,0.45);
  color: inherit;
  font-size: 18px;
  line-height: 24px;
  text-align: center;
  cursor: pointer;
}
.toast-close:hover {
  background: rgba(255,255,255,0.78);
}
.progress { width:100%; height:10px; background:#e5e7eb; border-radius:999px; overflow:hidden; }
.progress .bar { height:100%; background:#0ea5e9; }
.status-inline { display:flex; align-items:center; gap:12px; flex-wrap:nowrap; }
.status-title { margin:0; font-size:15px; white-space:nowrap; flex:0 0 auto; }
.status-progress-inline { display:flex; align-items:center; gap:8px; flex:1 1 auto; min-width:0; }
.status-progress-inline .progress { flex:1 1 auto; width:auto; max-width:none; margin:0; }
.status-percent { color:#475569; font-size:13px; min-width:48px; text-align:right; flex:0 0 auto; }
.tabs-nav { display:flex; align-items:center; gap:8px; margin-bottom:10px; flex-wrap:wrap; }
.tab-btn { width:auto; border:1px solid #cbd5e1; background:#fff; color:#334155; border-radius:8px; padding:6px 12px; font-size:13px; }
.tab-btn.active { background:#e6fffa; border-color:#99f6e4; color:#0f766e; }
.tab-panel { display:none; }
.tab-panel.active { display:block; }
.stack-col { display:flex; flex-direction:column; gap:12px; }
.kv-compact { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:8px 12px; }
.kv-item { display:flex; align-items:center; justify-content:space-between; gap:8px; border:1px solid var(--line); border-radius:8px; padding:6px 8px; background:#fafafa; }
.kv-key { color:#64748b; font-size:12px; }
.kv-value { color:#0f172a; font-size:13px; font-weight:600; text-align:right; }
.meta-value { color:#0f172a; font-size:13px; font-weight:600; min-height:22px; display:flex; align-items:center; }
.text-danger { color: var(--danger); font-weight: 600; }
.user-action-row { display:flex; align-items:center; gap:12px; margin-top:10px; }
.user-action-row > * { flex: 1 1 50%; min-width: 0; }
.user-pass-row { flex-wrap: nowrap; }
.user-pass-row input[type="password"] { flex: 1 1 auto; width: auto; min-width: 240px; }
.user-pass-row .btn { flex: 0 0 auto; }
.user-bottom-actions { justify-content: flex-end; gap: 10px; }
.user-bottom-actions form { margin-top: 0; }
.table-wrap { width:100%; overflow:auto; -webkit-overflow-scrolling: touch; }
table { width:100%; border-collapse:collapse; }
th, td { border-bottom:1px solid #e5e7eb; padding:6px 8px; text-align:left; white-space:nowrap; font-size:13px; }
.audit-page .card { padding: 10px; margin-bottom: 10px; border-radius: 8px; }
.audit-page h3 { margin: 0 0 8px; font-size: 15px; }
.audit-page .form-grid { gap: 6px 8px; }
.audit-page .form-grid.cols-4 > * { flex: 1 1 calc(25% - 8px); min-width: 170px; }
.audit-page label { font-size: 11px; color: #475569; }
.audit-page input,
.audit-page select,
.audit-page textarea { padding: 6px 8px; font-size: 12px; border-radius: 6px; }
.audit-page .actions { gap: 6px; margin-top: 2px; }
.audit-page .btn { padding: 6px 10px; font-size: 12px; border-radius: 6px; }
.audit-page .btn.tiny { padding: 4px 8px; font-size: 12px; }
.audit-page .toolbar { margin-top: 8px; margin-bottom: 0; gap: 6px; }
.audit-page th,
.audit-page td { padding: 4px 6px; font-size: 12px; }
.chart { height:360px; width:100%; }
.return-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.return-picker-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.return-picker-btn {
  width: auto;
  padding: 4px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 500;
}
.return-picker-btn.is-active {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}
.return-picker-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
.return-calendar-panel {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 7px;
}
.return-calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.return-calendar-nav {
  display: inline-flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.return-calendar-nav-btn {
  width: auto;
  min-width: 28px;
  padding: 4px 7px;
  border: 0;
  border-right: 1px solid #e5e7eb;
  border-radius: 0;
  background: #fff;
  color: #334155;
  line-height: 1;
}
.return-calendar-nav-btn:last-child {
  border-right: 0;
  border-left: 1px solid #e5e7eb;
}
.return-calendar-label {
  min-width: 50px;
  padding: 4px 7px;
  text-align: center;
  color: #0f172a;
  font-weight: 500;
  font-size: 13px;
}
.return-calendar-today {
  width: auto;
  min-width: 60px;
  padding: 4px 9px;
  border: 1px solid #84cc16;
  border-radius: 8px;
  background: #84cc16;
  color: #fff;
  font-weight: 500;
  font-size: 12px;
}
.return-calendar-weekhead {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 4px;
}
.return-calendar-weekhead > span {
  text-align: center;
  padding: 3px 0;
  border-radius: 6px;
  background: #e5e7eb;
  color: #334155;
  font-size: 10px;
  font-weight: 500;
}
.return-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.return-calendar-cell {
  width: 100%;
  min-height: 38px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  padding: 4px 3px;
  gap: 1px;
}
.return-calendar-date {
  font-size: 12px;
  line-height: 1;
  font-weight: 500;
  width: 100%;
  text-align: center;
}
.return-calendar-ret {
  font-size: 9px;
  line-height: 1;
  width: 100%;
  text-align: center;
  color: #64748b;
}
.return-calendar-ret.is-empty {
  color: #cbd5e1;
}
.return-calendar-cell.is-outside {
  color: #cbd5e1;
  background: #f8fafc;
}
.return-calendar-cell.is-has-data {
  color: #1e293b;
}
.return-calendar-cell.is-pos .return-calendar-ret {
  color: #dc2626;
}
.return-calendar-cell.is-neg .return-calendar-ret {
  color: #16a34a;
}
.return-calendar-cell.is-flat .return-calendar-ret {
  color: #dc2626;
}
.return-calendar-cell.is-selected {
  border-color: #60a5fa;
  background: #3b82f6;
  color: #fff;
}
.return-calendar-cell.is-selected .return-calendar-ret {
  color: #e2e8f0;
}
.return-period-panel {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 7px;
}
.return-echart {
  width: 100%;
}
.return-echart-day {
  height: 280px;
}
.return-echart-month {
  height: 210px;
}
.return-echart-year {
  min-height: 120px;
  height: 180px;
}
.return-period-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.return-period-label {
  min-width: 64px;
  text-align: center;
  color: #0f172a;
  font-weight: 500;
  font-size: 13px;
}
.return-period-grid {
  display: grid !important;
  width: 100%;
  gap: 5px;
}
.return-month-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}
.return-year-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}
.return-period-cell {
  width: auto;
  min-height: 44px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  justify-content: center;
}
.return-period-cell.is-selected {
  border-color: #60a5fa;
  background: #eff6ff;
}
.return-period-title {
  font-size: 12px;
  color: #334155;
  font-weight: 500;
  line-height: 1.1;
}
.return-period-value {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.1;
}
.return-period-cell.is-pos .return-period-value {
  color: #dc2626;
}
.return-period-cell.is-neg .return-period-value {
  color: #16a34a;
}
.return-period-cell.is-flat .return-period-value {
  color: #dc2626;
}
.return-period-cell.is-empty .return-period-value {
  color: #cbd5e1;
}
.return-picker-result {
  margin-top: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px;
}
.return-picker-result-label {
  font-size: 12px;
  color: #64748b;
}
.return-picker-result-value {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}
.return-picker-result-value.is-pos {
  color: #166534;
}
.return-picker-result-value.is-neg {
  color: #b91c1c;
}
.return-picker-result-value.is-flat {
  color: #475569;
}
.return-picker-result-value.is-empty {
  color: #94a3b8;
  font-weight: 500;
}
.grid-2 { display:flex; flex-wrap:wrap; gap:12px; }
.grid-2 > * { flex: 1 1 calc(50% - 12px); min-width: 320px; }
.mobile-only { display:none; }
.mobile-card-list { display:flex; flex-direction:column; gap:10px; }
.mobile-card { border:1px solid var(--line); border-radius:10px; padding:10px; background:#fff; }
.mobile-card h4 { margin:0 0 8px; font-size:14px; }
.mobile-card p { margin:4px 0; font-size:13px; color:#334155; }
.mobile-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.mobile-actions form { width:100%; }
.error-box { background:#111827; color:#f3f4f6; padding:8px; border-radius:8px; overflow:auto; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 10px 0 8px; }
.markdown-body p { margin: 8px 0; line-height: 1.65; }
.markdown-body ul, .markdown-body ol { margin: 8px 0; padding-left: 22px; }
.markdown-body code { background:#f3f4f6; color:#111827; border-radius:4px; padding:1px 4px; }
.markdown-body pre { background:#f5f5f5; color:#111827; border:1px solid #e5e7eb; border-radius:8px; padding:10px; overflow:auto; }
.markdown-body pre code { background:transparent; color:#111827; padding:0; border-radius:0; }
.markdown-body img { max-width: 100%; height: auto; }
.tag-input-wrap { position: relative; width: 100%; min-height: 38px; border:1px solid #cbd5e1; border-radius:8px; padding:4px; background:#fff; }
.tag-chips { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.tag-search { border:0; outline:none; min-width:120px; flex:1; padding:6px 8px; }
.tag-chip { display:inline-flex; align-items:center; gap:6px; background:#ecfeff; border:1px solid #99f6e4; color:#0f766e; border-radius:999px; padding:3px 8px; font-size:12px; }
.tag-chip-remove { width:auto; border:0; padding:0; background:transparent; color:#0f766e; font-size:14px; line-height:1; cursor:pointer; }
.tag-suggestions { display:none; position:absolute; left:0; right:0; top:100%; margin-top:4px; border:1px solid #cbd5e1; background:#fff; border-radius:8px; box-shadow:0 8px 24px rgba(15,23,42,0.12); max-height:260px; overflow:auto; z-index: 20; }
.tag-suggestion { padding:8px 10px; font-size:13px; cursor:pointer; }
.tag-suggestion:hover { background:#f0fdfa; }
.query-checkbox-inline { display:inline-flex; align-items:center; gap:8px; color:#334155; font-size:14px; }
.query-checkbox-inline input[type="checkbox"] { width:auto; margin:0; }
.query-submit-item .btn { margin-top:auto; }
.risk-group { border:1px solid var(--line); border-radius:10px; padding:10px; background:#fcfdff; }
.risk-section-head { margin: 4px 0 6px; }
.risk-section-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  border: 0;
  background: transparent;
  padding: 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.risk-section-caret {
  display: inline-block;
  width: 12px;
  text-align: center;
  color: #475569;
  font-size: 12px;
  line-height: 1;
}
.risk-panel-body {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
}
.risk-panel-body.is-hidden { display: none; }
.risk-group-head { display:flex; align-items:center; justify-content:flex-start; gap:8px; margin-bottom:8px; }
.risk-group-title { display:inline-flex; align-items:center; gap:6px; flex-wrap:wrap; font-size:11px; color:#334155; font-weight:600; }
.risk-group-body.is-hidden { display:none; }
.risk-tip { position:relative; display:inline-flex; align-items:center; }
.risk-tip-icon {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:24px;
  height:16px;
  padding:0 4px;
  border:1px solid #93c5fd;
  border-radius:999px;
  background:#eff6ff;
  color:#1d4ed8;
  font-size:9px;
  line-height:1;
  cursor:help;
  user-select:none;
}
.risk-tip-pop {
  position:absolute;
  left:0;
  top:calc(100% + 6px);
  z-index:30;
  width:min(420px, 88vw);
  padding:8px 10px;
  border:1px solid #cbd5e1;
  border-radius:8px;
  background:#ffffff;
  color:#334155;
  font-size:12px;
  font-weight:500;
  line-height:1.55;
  white-space:pre-line;
  box-shadow:0 10px 24px rgba(15, 23, 42, 0.14);
  opacity:0;
  pointer-events:none;
  transform:translateY(4px);
  transition:opacity .15s ease, transform .15s ease;
}
.risk-tip:hover .risk-tip-pop,
.risk-tip:focus-within .risk-tip-pop {
  opacity:1;
  pointer-events:auto;
  transform:translateY(0);
}
.switch-toggle { position:relative; display:inline-block; width:30px; height:16px; flex:0 0 auto; }
.switch-toggle input[type="hidden"] { display:none; }
.switch-input { opacity:0; width:0; height:0; position:absolute; }
.switch-slider { position:absolute; inset:0; border-radius:999px; background:#cbd5e1; cursor:pointer; transition:all .2s ease; }
.switch-slider:before {
  content:"";
  position:absolute;
  left:2px;
  top:2px;
  width:12px;
  height:12px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 1px 2px rgba(0, 0, 0, 0.18);
  transition:transform .2s ease;
}
.switch-input:checked + .switch-slider { background:#0f766e; }
.switch-input:checked + .switch-slider:before { transform:translateX(14px); }
.risk-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 12px;
}
.risk-modal-backdrop.is-hidden { display: none; }
.risk-modal-card {
  width: min(520px, 96vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.2);
}
.risk-modal-title { font-size: 16px; font-weight: 600; color:#0f172a; margin-bottom: 10px; }
.tutorial-layout { display:flex; align-items:flex-start; gap:12px; }
.tutorial-tree { flex:0 0 280px; position: sticky; top: 64px; }
.tutorial-tree-title { font-size:14px; font-weight:600; color:#0f172a; margin-bottom:8px; }
.tutorial-tree-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; }
.tutorial-tree-node { margin:0; padding:0; }
.tutorial-tree-link { display:flex; align-items:flex-start; gap:8px; text-decoration:none; color:#334155; border:1px solid transparent; border-radius:8px; padding:8px; }
.tutorial-tree-link:hover, .tutorial-tree-link.active { background:#ecfeff; border-color:#99f6e4; color:#0f766e; }
.tutorial-tree-index { flex:0 0 18px; font-size:12px; color:#64748b; line-height:1.6; }
.tutorial-tree-text { flex:1 1 auto; font-size:13px; line-height:1.5; }
.tutorial-content { flex:1 1 auto; min-width:0; }
.doc-toc .doc-toc-body .toc { margin: 0; }
.doc-toc .doc-toc-body .toc ul { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; }
.doc-toc .doc-toc-body .toc li { margin:0; padding:0; }
.doc-toc .doc-toc-body .toc a {
  display:flex;
  align-items:flex-start;
  gap:8px;
  text-decoration:none;
  color:#334155;
  border:1px solid transparent;
  border-radius:8px;
  padding:8px;
  font-size:13px;
  line-height:1.5;
}
.doc-toc .doc-toc-body .toc a:hover { background:#ecfeff; border-color:#99f6e4; color:#0f766e; }
.doc-toc .doc-toc-body .toc > ul { counter-reset: doc-toc-index; }
.doc-toc .doc-toc-body .toc > ul > li > a::before {
  counter-increment: doc-toc-index;
  content: counter(doc-toc-index);
  flex:0 0 18px;
  color:#64748b;
  font-size:12px;
  line-height:1.6;
}
.doc-toc .doc-toc-body .toc ul ul {
  margin-left: 26px;
  padding-left: 10px;
  border-left: 1px solid #e2e8f0;
  gap:4px;
}
.doc-toc .doc-toc-body .toc ul ul a {
  font-size:12px;
  padding:6px 8px;
}
.doc-toc .doc-toc-body .toc ul ul a::before {
  content: "•";
  flex:0 0 10px;
  color:#94a3b8;
  font-size:12px;
  line-height:1.4;
}
.markdown-body h1, .markdown-body h2, .markdown-body h3 { scroll-margin-top: 74px; }
.site-footer-notice {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(980px, calc(100vw - 24px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #fbbf24;
  background: linear-gradient(90deg, rgba(255, 247, 237, 0.96) 0%, rgba(254, 243, 199, 0.96) 100%);
  box-shadow: 0 10px 28px rgba(161, 98, 7, 0.24);
  backdrop-filter: blur(3px);
  z-index: 60;
  animation: site-notice-pulse 2.4s ease-in-out infinite;
}
.site-footer-notice.is-hidden { display: none; }
.site-footer-notice__body { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.site-footer-notice__title { color: #9a3412; font-size: 14px; white-space: nowrap; }
.site-footer-notice__text { color: #7c2d12; font-size: 14px; line-height: 1.5; word-break: break-word; }
.site-footer-notice__text p { margin: 0; }
.site-footer-notice__close {
  width: auto;
  flex: 0 0 auto;
  border: 1px solid #f59e0b;
  background: #b45309;
  color: #fff;
  font-size: 13px;
  padding: 6px 10px;
}
@keyframes site-notice-pulse {
  0% { box-shadow: 0 10px 28px rgba(161, 98, 7, 0.16); }
  50% { box-shadow: 0 10px 30px rgba(161, 98, 7, 0.32); }
  100% { box-shadow: 0 10px 28px rgba(161, 98, 7, 0.16); }
}
@media (max-width: 960px){
  .toast-stack {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }
  .toast-item {
    width: 100%;
    max-width: none;
  }
  .form-grid > *, .form-grid.cols-4 > * { flex: 1 1 100%; min-width: 0; }
  .grid-2 > * { flex: 1 1 100%; min-width: 0; }
  .param-grid > .form-item { flex: 1 1 100%; min-width: 0; }
  .desktop-only { display:none !important; }
  .mobile-only { display:block; }
  .topbar { flex-direction: column; align-items:flex-start; gap:8px; }
  .nav { width: 100%; overflow-x: auto; white-space: nowrap; }
  .nav-item { position: static; }
  .nav-dropdown {
    position: static;
    min-width: 0;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    padding: 0 0 0 8px;
    margin-top: 4px;
    background: transparent;
  }
  .userbox { width: 100%; justify-content: space-between; }
  .actions .btn { flex: 1 1 100%; }
  .btn.tiny { padding: 6px 10px; }
  .chart { height: 260px; }
  .return-calendar-toolbar { gap: 4px; }
  .return-calendar-nav { flex: 1 1 auto; }
  .return-calendar-label { min-width: 0; flex: 1 1 auto; }
  .return-calendar-today { flex: 1 1 auto; text-align: center; }
  .return-calendar-cell { min-height: 34px; }
  .return-calendar-date { font-size: 11px; }
  .return-calendar-ret { font-size: 8px; }
  .return-period-toolbar { width: 100%; justify-content: center; }
  .return-echart-day { height: 240px; }
  .return-echart-month { height: 180px; }
  .return-echart-year { height: 150px; min-height: 120px; }
  .return-month-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .return-year-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .return-period-cell { min-height: 40px; padding: 5px 3px; }
  .return-period-title { font-size: 11px; }
  .return-period-value { font-size: 9px; }
  .return-picker-switch { width: 100%; }
  .return-picker-btn { flex: 1 1 auto; text-align: center; }
  .return-picker-result-value { font-size: 14px; }
  .card { padding: 10px; }
  th, td { font-size: 12px; }
  .msg { font-size: 13px; }
  .container { padding: 0 10px; }
  .status-inline { gap:8px; }
  .status-title { font-size:14px; }
  .status-progress-inline { min-width: 0; width:100%; }
  .status-progress-inline .progress { max-width: none; width:100%; }
  .status-percent { min-width: 40px; }
  .kv-compact { grid-template-columns: 1fr; }
  .user-action-row { flex-wrap: wrap; }
  .user-action-row > * { flex: 1 1 100%; }
  .user-pass-row { flex-wrap: wrap; }
  .user-pass-row input[type="password"] { min-width: 0; width: 100%; }
  .user-bottom-actions { justify-content: flex-start; }
  .tutorial-layout { flex-direction:column; }
  .tutorial-tree { position: static; width:100%; flex: 1 1 auto; }
.site-footer-notice { align-items: flex-start; gap: 10px; }
.site-footer-notice__body { flex-direction: column; align-items: flex-start; gap: 4px; }
}

@keyframes riskTitleBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.25; }
}

.risk-blink-title {
  animation: riskTitleBlink 1s steps(1, end) infinite;
}
