/* ============================================================
 * ai-finance.css — 账税卫士 AI 财税体检 P0（20261021）
 * 外链样式，CSP 合规（无内联 style 块）
 * ============================================================ */
:root { --af-accent: #0e7490; --af-accent-soft: #e0f2f7; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f7fa; color: #0f172a; line-height: 1.6;
}

/* 顶栏 */
.af-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; background: #fff;
  border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; z-index: 20;
}
.af-logo {
  width: 40px; height: 40px; border-radius: 10px; background: var(--af-accent-soft);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.af-tt-wrap { flex: 1; min-width: 0; }
.af-tt { font-weight: 700; font-size: 16px; }
.af-ss { font-size: 12px; color: #64748b; }
.af-back { color: var(--af-accent); text-decoration: none; font-size: 14px; white-space: nowrap; }

/* 主体 */
.af-wrap { max-width: 860px; margin: 0 auto; padding: 20px 16px 48px; }
.af-hero { padding: 24px 4px 8px; }
.af-hero h1 { font-size: 26px; margin: 0 0 8px; }
.af-hero h1 em { color: var(--af-accent); font-style: normal; }
.af-hero p { margin: 0 0 12px; color: #475569; font-size: 14px; }
.af-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.af-chip {
  font-size: 12px; padding: 4px 12px; border-radius: 999px;
  background: #fff; border: 1px solid #e2e8f0; color: #334155;
}

/* 卡片 */
.af-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
  padding: 18px; margin-top: 16px;
}
.af-card h2 { font-size: 16px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.af-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--af-accent); display: inline-block; }
.af-desc { font-size: 13px; color: #64748b; margin: 0 0 14px; }

/* 数据快照 */
.af-data-meta { font-weight: 400; font-size: 12px; color: #94a3b8; margin-left: 8px; }
.af-data-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.af-kv { background: #f8fafc; border: 1px solid #eef2f6; border-radius: 10px; padding: 8px 10px; }
.af-k { font-size: 12px; color: #64748b; }
.af-v { font-size: 15px; font-weight: 650; color: #0f172a; word-break: break-all; }
.af-data-hint { font-size: 12px; color: #94a3b8; margin: 10px 0 0; }

/* Tabs */
.af-tabs { display: flex; gap: 8px; margin-top: 20px; }
.af-tab {
  flex: 1; padding: 12px 10px; border-radius: 12px; border: 1px solid #e2e8f0;
  background: #fff; font-size: 14px; font-weight: 600; color: #475569; cursor: pointer;
}
.af-tab.is-active { background: var(--af-accent); border-color: var(--af-accent); color: #fff; }

/* 按钮 */
.af-btn {
  display: inline-block; padding: 11px 22px; border-radius: 10px; border: none;
  background: var(--af-accent); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
  text-decoration: none; text-align: center;
}
.af-btn:disabled { opacity: .55; cursor: not-allowed; }
.af-mini-btn {
  padding: 6px 14px; border-radius: 8px; border: 1px solid #cbd5e1;
  background: #fff; font-size: 13px; color: #334155; cursor: pointer;
}
.af-mini-btn:hover { border-color: var(--af-accent); color: var(--af-accent); }

/* 结果区 */
.af-result-wrap { margin-top: 16px; }
.af-result-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.af-badge {
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: #f1f5f9; color: #475569;
}
.af-badge.is-running { background: var(--af-accent-soft); color: var(--af-accent); }
.af-badge.is-done { background: #dcfce7; color: #15803d; }
.af-badge.is-err { background: #fee2e2; color: #b91c1c; }
.af-actions { display: flex; gap: 8px; }
.af-result {
  border: 1px solid #eef2f6; background: #fcfdfe; border-radius: 12px;
  padding: 16px; font-size: 14px; min-height: 60px; overflow-x: auto;
}
.af-result.is-busy { border-style: dashed; }
.af-result h1, .af-result h2, .af-result h3 { font-size: 15px; margin: 14px 0 6px; color: #0f172a; }
.af-result h2:first-child, .af-result h3:first-child { margin-top: 0; }
.af-result p { margin: 6px 0; }
.af-result ul { margin: 6px 0; padding-left: 20px; }
.af-result table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 13px; }
.af-result th, .af-result td { border: 1px solid #e2e8f0; padding: 6px 8px; text-align: left; }
.af-result th { background: #f8fafc; }
.af-caret {
  display: inline-block; width: 2px; height: 1em; background: var(--af-accent);
  vertical-align: -0.15em; animation: afBlink 0.9s steps(1) infinite;
}
@keyframes afBlink { 50% { opacity: 0; } }
.af-disclaimer {
  margin-top: 10px; font-size: 12px; color: #94a3b8;
  border-top: 1px dashed #e2e8f0; padding-top: 8px;
}

/* 底部 */
.af-foot { margin-top: 28px; text-align: center; font-size: 12px; color: #94a3b8; }

/* 登录门禁 */
.af-gate[hidden] { display: none; }
.af-gate {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.af-gate-card {
  background: #fff; border-radius: 16px; padding: 24px; max-width: 360px; width: 100%;
  text-align: center;
}
.af-gate-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.af-gate-card p { font-size: 13px; color: #64748b; margin: 0 0 16px; }
.af-gate-btn { width: 100%; margin-bottom: 10px; }
.af-gate-close { width: 100%; }

@media (max-width: 560px) {
  .af-hero h1 { font-size: 21px; }
  .af-wrap { padding: 14px 12px 40px; }
}
