/* IP 档案模块（archive）页面样式。类名统一 ar- 前缀；颜色、圆角沿用 app.css 的变量。 */

.ar-page { max-width: 1320px; }
.ar-back { display: inline-block; font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.ar-back:hover { color: var(--brand-ink); text-decoration: none; }
.ar-empty-lg { padding: 44px 20px; font-size: 14.5px; }
.ar-empty-lg b { font-size: 17px; margin-bottom: 6px; }

/* ---------- 列表页：IP 卡片 ---------- */
.ar-ipgrid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.ar-ipcard { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px 16px; }
.ar-ipcard-top { display: flex; align-items: flex-start; gap: 14px; }
.ar-ipcard-top h3 { font-size: 19px; line-height: 1.3; color: #264763; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ar-ipcard-top h3 a { color: inherit; }
.ar-ipcard-top p { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.ar-ipcard-kv { grid-template-columns: 84px minmax(0, 1fr); font-size: 14px; padding: 12px 14px; background: var(--soft); border-radius: 12px; }
.ar-ipcard-actions { display: flex; gap: 8px; align-items: center; margin-top: auto; padding-top: 2px; }

.ar-progress-text { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.ar-progress-text b { color: var(--brand-ink); font-size: 14px; }
.ar-bar { position: relative; height: 8px; border-radius: 4px; background: #e6eef6; overflow: hidden; }
.ar-bar i, .ar-bar b { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; min-width: 0; }
.ar-bar i { background: #a9cdec; }            /* 已填写 */
.ar-bar b { background: #58b894; }            /* 其中已确认 */

/* ---------- 档案页头 ---------- */
.ar-head { padding: 22px 24px 18px; margin-bottom: 18px; }
.ar-head-main { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ar-head-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ar-head-title h1 { font-size: 26px; line-height: 1.25; color: #264763; }
.ar-head-sub { font-size: 14.5px; color: var(--ink-2); margin-top: 2px; }
.ar-head-meta { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px 20px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.ar-head-meta span { display: block; font-size: 12.5px; color: var(--muted); }
.ar-head-meta b { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); word-break: break-word; }
.ar-head-meta b .pending { font-weight: 400; }

/* ---------- 基础档案 ---------- */
.ar-stats { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding: 16px 20px; margin-bottom: 16px; }
.ar-stats-nums { display: flex; gap: 10px; flex-wrap: wrap; }
.ar-stats .stat { min-width: 112px; padding: 9px 14px; }
.ar-stats .stat b { font-size: 22px; }
.ar-stats .stat b small { font-size: 14px; font-weight: 400; color: var(--muted); }
.ar-stats .stat.ok { background: var(--ok-bg); border-color: #cfeadd; } .ar-stats .stat.ok b { color: var(--ok); }
.ar-stats .stat.warn { background: var(--warn-bg); border-color: #f3e2c2; } .ar-stats .stat.warn b { color: var(--warn); }
.ar-stats .stat.gray { background: var(--gray-bg); border-color: #e2e8ee; } .ar-stats .stat.gray b { color: var(--gray); }
.ar-stats-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ar-sug-notice { margin-bottom: 16px; background: var(--purple-bg); border-color: #dcd7f5; color: #4f4599; }

.ar-sec { padding: 0; margin-bottom: 16px; overflow: hidden; overflow: clip; scroll-margin-top: 70px; }
.ar-sec-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: #fbfdff; flex-wrap: wrap; }
.ar-sec-head h3 { font-size: 17px; color: #2c4d6a; }
.ar-sec-code { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--soft-2); color: var(--brand-ink); font-weight: 700; font-size: 14px; flex: none; }
.ar-sec-count { font-size: 13px; color: var(--muted); }
.ar-sec.is-editing { border-color: #a9cdec; box-shadow: 0 0 0 3px rgba(111, 170, 222, .16), var(--shadow); }
.ar-sec-none { padding: 18px 20px; color: var(--muted); font-size: 13.5px; }

.ar-field { display: grid; grid-template-columns: 200px minmax(0, 1fr) 190px; gap: 6px 20px; padding: 14px 20px; border-bottom: 1px solid #eef4fa; align-items: start; }
.ar-field:last-child { border-bottom: 0; }
.ar-field-label { font-size: 14px; font-weight: 600; color: var(--ink-2); line-height: 1.55; }
.ar-field-value { font-size: 14.5px; color: var(--ink); line-height: 1.7; }
.ar-field.is-empty .ar-field-label { color: var(--muted); font-weight: 500; }
.ar-field-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.ar-field-by { font-size: 12.5px; color: var(--muted); }
.ar-custom-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; font-size: 11.5px; font-weight: 400; background: var(--soft-2); color: #5b85aa; vertical-align: 1px; }
.ar-foot-note { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.8; }
.ar-foot-note b { color: var(--ink-2); font-weight: 600; }

/* AI 建议：与正式档案内容明显区分（紫色虚线框 + “AI 建议”标签） */
.ar-sug { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: #f6f4fd; border: 1px dashed #c3bbee; font-size: 14px; }
.ar-field-value + .ar-sug { margin-top: 10px; }
.ar-sug-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: #6a60b0; margin-bottom: 6px; }
.ar-sug-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px; background: var(--purple); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .3px; }
.ar-sug-value { color: #3b3470; line-height: 1.7; }
.ar-sug-quote, .ar-sug-reason { margin-top: 6px; font-size: 13px; color: #6f6a94; line-height: 1.65; }
.ar-sug-quote span, .ar-sug-reason span { display: inline-block; margin-right: 8px; padding: 0 6px; border-radius: 5px; background: #e7e3f8; color: #5d53a8; font-size: 12px; }
.ar-sug-quote em { display: block; font-style: normal; color: var(--warn); margin-top: 2px; }
.ar-sug-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.ar-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ar-compare-col { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fbfdff; font-size: 14px; line-height: 1.7; }
.ar-compare-col.is-sug { background: #f6f4fd; border: 1px dashed #c3bbee; }
.ar-compare-title { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

/* 分区编辑模式 */
.ar-edit-hint { padding: 10px 20px; font-size: 13.5px; color: #3b6c9b; background: var(--info-bg); border-bottom: 1px solid #d9e9f8; }
.ar-edit-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) 132px; gap: 8px 16px; padding: 12px 20px; border-bottom: 1px solid #eef4fa; align-items: start; }
.ar-edit-label { padding-top: 8px; }
.ar-edit-label label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.ar-edit-row .textarea { min-height: 60px; }
.ar-edit-side { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.ar-edit-side .select:disabled { color: var(--faint); background-color: #f4f7fa; }
.ar-edit-foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px; background: #fbfdff; flex-wrap: wrap; position: sticky; bottom: 0; border-top: 1px solid var(--line); }

/* ---------- 阶段与方向 ---------- */
.ar-stage { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.ar-stage-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.ar-stage-side { background: #fbfdff; }
.ar-preview-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 16px 18px; box-shadow: var(--shadow); }
.ar-preview-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ar-preview-top b { font-size: 17px; color: #264763; }

/* ---------- 资料文件 ---------- */
.ar-files-top { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 18px; align-items: stretch; }
.ar-upload { display: flex; gap: 16px; align-items: flex-start; border-style: dashed; border-color: var(--line-2); transition: border-color .12s, background .12s; }
.ar-upload.is-over { border-color: var(--brand-2); background: var(--soft); }
.ar-upload.is-off { opacity: .75; }
.ar-upload h3, .ar-aicard h3 { font-size: 16.5px; color: #2c4d6a; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.ar-upload-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--soft-2); color: var(--brand); display: grid; place-items: center; font-size: 22px; font-weight: 700; flex: none; }
.ar-upload-ctrl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 8px; }
.ar-upload-ctrl .select { width: auto; min-width: 120px; }
.ar-upload-progress { color: var(--brand-ink); min-height: 4px; }
.ar-upload-note { font-size: 13px; color: var(--muted); line-height: 1.75; }
.ar-aicard { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.ar-ai-off { color: var(--warn); }
.ar-ai-files { display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdff; }
.ar-ai-files .check { align-items: center; }
.ar-ai-files .check.is-off { color: var(--faint); cursor: not-allowed; }
.ar-ai-files .check .tiny { margin-left: 4px; }

.ar-filetable td { vertical-align: middle; }
.ar-filename { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.ar-filename b { font-weight: 600; color: var(--ink); word-break: break-all; }
.ar-fileicon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; flex: none; background: var(--gray-bg); color: var(--gray); }
.ar-fileicon.red { background: var(--danger-bg); color: var(--danger); }
.ar-fileicon.blue { background: var(--info-bg); color: var(--info); }
.ar-fileicon.green { background: var(--ok-bg); color: var(--ok); }
.ar-fileicon.orange { background: var(--warn-bg); color: var(--warn); }
.ar-fileicon.purple { background: var(--purple-bg); color: var(--purple); }
.ar-fileops { display: flex; gap: 6px; flex-wrap: wrap; }
.ar-problems { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 14px; line-height: 1.9; }
.ar-imgpreview { text-align: center; background: #f4f7fa; border-radius: 12px; padding: 12px; }
.ar-imgpreview img { max-width: 100%; max-height: 72vh; border-radius: 8px; }

/* ---------- 观察 / 灵感 / 复盘资料包 ---------- */
.ar-rec-head { margin-top: 4px; align-items: flex-start; }
.ar-rec-head p { margin-top: 2px; max-width: 760px; }
.ar-rec-list { display: flex; flex-direction: column; gap: 14px; }
.ar-rec { padding: 18px 20px 14px; }
.ar-rec-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ar-rec-top h4 { font-size: 16.5px; color: #2c4d6a; margin-right: 4px; }
.ar-rec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ar-block { background: var(--soft); border: 1px solid var(--soft-2); border-radius: 12px; padding: 10px 14px; font-size: 14.5px; line-height: 1.7; color: var(--ink); min-width: 0; }
.ar-block > span { display: block; font-size: 12.5px; font-weight: 600; color: #6c8fb0; margin-bottom: 2px; }
.ar-rec-foot { display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--muted); }
.ar-quick { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.ar-quick .select { width: auto; min-width: 150px; }
.ar-seg-wrap { flex-wrap: wrap; }

.ar-quote { position: relative; margin: 0 0 12px; padding: 14px 16px 12px 18px; border-left: 4px solid #9cc5e8; background: #f7fbff; border-radius: 0 12px 12px 0; font-size: 15.5px; line-height: 1.75; color: #2b4a66; }
.ar-quote-tag { display: inline-block; margin-bottom: 4px; padding: 0 8px; height: 20px; line-height: 20px; border-radius: 6px; background: #dcebf8; color: #4a7aa6; font-size: 12px; font-weight: 600; }
.ar-need { color: var(--warn); font-weight: 600; }
.ar-idea-note { margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }
.ar-idea-note span { display: inline-block; margin-right: 8px; color: var(--muted); }

.ar-pack { display: flex; flex-direction: column; gap: 12px; }
.ar-pack-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ar-pack-top h4 { font-size: 17px; }
.ar-pack-top h4 .linkbtn { color: #2c4d6a; font-weight: 600; text-align: left; }
.ar-pack .kv { grid-template-columns: 104px minmax(0, 1fr); }
.ar-pack .ar-rec-foot { margin-top: 0; }
.ar-pack-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.ar-packsec { margin-bottom: 12px; padding: 14px 18px; background: #fff; }
.ar-packsec h4 { font-size: 15px; color: #2c4d6a; margin-bottom: 6px; }
.ar-packsec h4 small { font-size: 12.5px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.ar-packsec .pre { font-size: 14.5px; line-height: 1.75; color: var(--ink); }
.ar-packcontents { margin-bottom: 6px; }
.ar-packfile { align-items: center; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .ar-head-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ar-field { grid-template-columns: 170px minmax(0, 1fr) 170px; }
  .ar-edit-row { grid-template-columns: 170px minmax(0, 1fr) 124px; }
}
@media (max-width: 820px) {
  .ar-ipgrid { grid-template-columns: minmax(0, 1fr); }
  .ar-head { padding: 16px; }
  .ar-head-title h1 { font-size: 22px; }
  .ar-head-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ar-field, .ar-edit-row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px 16px; }
  .ar-field-meta { flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; gap: 8px; }
  .ar-edit-label { padding-top: 0; }
  .ar-edit-side { flex-direction: row; }
  .ar-stage, .ar-files-top, .ar-rec-grid, .ar-compare { grid-template-columns: minmax(0, 1fr); }
  .ar-upload { flex-direction: column; }
  .ar-quick { margin-left: 0; }
  .ar-sec-head { padding: 12px 16px; }
}
