/* ============================================================
   高级税务师报告样式  advisor-report.css  20260929a
   ============================================================ */

/* ---------- 加载 ---------- */
.ar-loading { padding: 28px; text-align: center; color: var(--navy-3); }

/* ---------- 报告容器 ---------- */
.ar-report {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(14, 42, 71, 0.06);
}

/* ---------- 报告头 ---------- */
.ar-head { position: relative; padding: 30px 34px 24px; }
.ar-head-band {
  position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy-3) 55%, var(--gold) 100%);
}
.ar-title {
  font-size: 25px; color: var(--navy); letter-spacing: 1px;
  padding-bottom: 12px; border-bottom: 2px solid var(--gold-light);
  margin-bottom: 14px;
}
.ar-head-meta {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  font-size: 12.5px; color: var(--muted); margin-bottom: 16px;
}

/* ---------- 风险徽标 ---------- */
.ar-risk-badge, .ar-risk-line {
  display: flex; align-items: center; gap: 10px;
  border-radius: 8px; padding: 11px 15px; font-size: 13.5px; line-height: 1.55;
}
.ar-risk-line { margin-bottom: 14px; }
.ar-badge-icon { font-size: 19px; line-height: 1; }
.ar-badge-danger { background: var(--danger-bg); color: #9c2b1f; border: 1px solid #f3c2bb; }
.ar-badge-warn   { background: var(--warn-bg); color: #8a5a08; border: 1px solid #ecd9a0; }
.ar-badge-ok     { background: var(--ok-bg); color: var(--ok); border: 1px solid #bfe3cd; }
.ar-badge-info   { background: #eef3f9; color: #1c4a7a; border: 1px solid #c5d6ea; }

.ar-degraded {
  background: var(--warn-bg); color: #8a5a08; font-size: 13px;
  padding: 9px 34px; border-bottom: 1px solid #ecd9a0;
}

/* ---------- 布局：目录 + 正文 ---------- */
.ar-layout { display: flex; align-items: flex-start; }
.ar-toc {
  width: 210px; flex: 0 0 210px; position: sticky; top: 12px;
  padding: 22px 16px; border-right: 1px solid var(--border);
  max-height: calc(100vh - 24px); overflow-y: auto;
}
.ar-toc-title {
  font-size: 13px; font-weight: 700; color: var(--navy);
  letter-spacing: 2px; margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.ar-toc a {
  display: block; padding: 7px 10px; border-radius: 6px;
  font-size: 13px; color: var(--muted); text-decoration: none;
  border-left: 3px solid transparent; margin-bottom: 2px;
  transition: all .15s;
}
.ar-toc a:hover { background: #f1f5fa; color: var(--navy-3); }
.ar-toc a.active {
  background: #eef3f9; color: var(--navy); font-weight: 600;
  border-left-color: var(--gold);
}

.ar-body { flex: 1; min-width: 0; padding: 8px 34px 30px; }

/* ---------- 章节 ---------- */
.ar-sec { padding: 22px 0; border-bottom: 1px dashed var(--border); }
.ar-sec:last-child { border-bottom: none; }
.ar-h2 {
  display: flex; align-items: center; gap: 11px;
  font-size: 17px; color: var(--navy); margin-bottom: 14px;
}
.ar-h2-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 27px; height: 27px; border-radius: 6px;
  background: var(--navy); color: #fff; font-size: 14px; font-weight: 600;
}
.ar-p { font-size: 14px; line-height: 1.9; color: var(--text); margin: 0; }
.ar-analysis { white-space: normal; }
.ar-md-h3 {
  font-size: 15px; font-weight: 700; color: var(--navy);
  margin: 16px 0 8px; padding-left: 10px;
  border-left: 3px solid var(--brand, #2563eb);
}
.ar-md-h3:first-child { margin-top: 4px; }
.ar-md-h4 { font-size: 14px; font-weight: 600; color: var(--navy-3, #334155); margin: 12px 0 6px; }
.ar-md-p { margin: 0 0 8px; }
.ar-md-ul, .ar-md-ol { margin: 4px 0 10px; padding-left: 22px; }
.ar-md-ul li, .ar-md-ol li { margin: 3px 0; line-height: 1.85; }
.ar-analysis strong, .ar-liability strong { font-weight: 700; color: var(--navy); }
.ar-muted { color: var(--muted); font-size: 13.5px; padding: 6px 0; }
.ar-muted-sm { color: var(--muted); font-size: 12.5px; }

/* ---------- 要素 ---------- */
.ar-facts-details { margin-top: 12px; }
.ar-facts-details summary {
  cursor: pointer; font-size: 13px; color: var(--navy-3);
  padding: 6px 0; user-select: none;
}
.ar-facts {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px 18px; margin-top: 8px;
}
.ar-fact {
  display: flex; gap: 8px; font-size: 13px;
  background: #f7f9fc; border-radius: 6px; padding: 7px 11px;
}
.ar-fact-k { color: var(--muted); flex: 0 0 auto; }
.ar-fact-v { color: var(--text); word-break: break-word; }

/* ---------- 法规 ---------- */
.ar-basis {
  border: 1px solid var(--border); border-left: 3px solid var(--gold);
  border-radius: 6px; padding: 11px 14px; margin-bottom: 10px; background: #fdfcf8;
}
.ar-basis-name { font-size: 14px; font-weight: 600; color: var(--navy); }
.ar-docnum {
  font-size: 12px; font-weight: 500; color: #8a5a08;
  background: var(--warn-bg); border-radius: 4px; padding: 2px 7px; margin-left: 8px;
}
.ar-article {
  font-size: 12px; color: var(--navy-3); margin-left: 8px;
}
.ar-basis-rel { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.7; }

/* ---------- 测算表 ---------- */
.ar-calc-note {
  font-size: 12.5px; color: var(--ok); background: var(--ok-bg);
  border-radius: 6px; padding: 8px 12px; margin-bottom: 14px;
}
.ar-table-wrap { margin-bottom: 16px; }
.ar-table-title {
  font-size: 13.5px; font-weight: 600; color: var(--navy-2); margin-bottom: 7px;
}
.ar-table .ar-num { font-weight: 600; color: var(--navy); white-space: nowrap; }

/* ---------- 风险 ---------- */
.ar-risk-list { margin: 12px 0; }
.ar-risk-item {
  border: 1px solid var(--border); border-radius: 7px;
  padding: 10px 14px; margin-bottom: 8px;
}
.ar-risk-point { font-size: 13.5px; font-weight: 600; color: #9c2b1f; }
.ar-risk-detail { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.7; }
.ar-liability {
  margin-top: 14px; background: #f7f9fc; border-radius: 8px; padding: 14px 16px;
}
.ar-liability-k {
  font-size: 13.5px; font-weight: 700; color: var(--navy); margin-bottom: 7px;
}

/* ---------- 行动方案 ---------- */
.ar-actions { display: flex; flex-direction: column; gap: 10px; }
.ar-action { display: flex; gap: 13px; }
.ar-action-no {
  flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--navy-3); color: #fff; font-size: 13.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.ar-action-main { flex: 1; }
.ar-action-step { font-size: 13.5px; line-height: 1.7; color: var(--text); }
.ar-action-meta {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  font-size: 12.5px; color: var(--muted); margin-top: 3px;
}
.ar-prio {
  display: inline-block; font-size: 11px; border-radius: 4px;
  padding: 1px 6px; margin-right: 7px; vertical-align: 1px;
}
.ar-prio-high { background: var(--danger-bg); color: #9c2b1f; }
.ar-prio-mid { background: var(--warn-bg); color: #8a5a08; }
.ar-prio-low { background: var(--ok-bg); color: var(--ok); }

/* ---------- 列表 ---------- */
.ar-bullets { margin: 4px 0 4px 4px; list-style: none; }
.ar-bullets li {
  position: relative; padding: 4px 0 4px 18px; font-size: 13.5px; line-height: 1.7;
}
.ar-bullets li::before {
  content: ''; position: absolute; left: 3px; top: 13px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--gold);
}
.ar-docs-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 2px 20px; }

/* ---------- 案例 ---------- */
.ar-case {
  border: 1px solid var(--border); border-radius: 7px;
  margin-bottom: 8px; background: #fff;
}
.ar-case summary {
  cursor: pointer; padding: 10px 14px; display: flex; align-items: center; gap: 11px;
  list-style: none; user-select: none;
}
.ar-case summary::-webkit-details-marker { display: none; }
.ar-case-score {
  flex: 0 0 auto; min-width: 34px; text-align: center;
  background: var(--navy); color: #fff; font-size: 12.5px; font-weight: 600;
  border-radius: 5px; padding: 3px 0;
}
.ar-case-title { font-size: 13.5px; color: var(--navy-2); font-weight: 500; }
.ar-case[open] .ar-case-title { color: var(--navy); font-weight: 600; }
.ar-case-body { padding: 4px 14px 12px 59px; }
.ar-line { font-size: 13px; line-height: 1.8; color: var(--text); }
.ar-line-k { color: var(--muted); }

/* ---------- 免责 ---------- */
.ar-gaps-k { font-size: 13.5px; font-weight: 600; color: var(--warn); margin-bottom: 4px; }
.ar-disclaimer {
  margin-top: 12px; font-size: 12.5px; color: var(--muted);
  background: #f7f9fc; border-radius: 7px; padding: 12px 15px; line-height: 1.8;
}

/* ---------- 打印 ---------- */
.ar-toolbar { margin-bottom: 12px; text-align: right; }
@media print {
  body { background: #fff; }
  .app-header, .tabs, .ask-card, .ar-toc, .ar-toolbar, .ar-degraded { display: none !important; }
  .ar-report { border: none; box-shadow: none; }
  .ar-layout { display: block; }
  .ar-body { padding: 0; }
  .ar-sec { break-inside: avoid; page-break-inside: avoid; }
  .ar-case-body { padding-left: 14px; }
  details.ar-case:not([open]) .ar-case-body { display: block; }
  details.ar-case > summary ~ * { display: block !important; }
  details > summary::after { content: ''; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .ar-layout { flex-direction: column; }
  .ar-toc {
    position: static; width: 100%; flex: none; max-height: none;
    border-right: none; border-bottom: 1px solid var(--border);
    display: flex; flex-wrap: wrap; gap: 4px;
  }
  .ar-toc-title { width: 100%; border-bottom: none; }
  .ar-toc a { border-left: none; background: #f4f6fa; margin: 0; }
  .ar-facts, .ar-docs-list { grid-template-columns: 1fr; }
  .ar-head, .ar-body { padding-left: 18px; padding-right: 18px; }
}
