/* ============================================================
   P20 · OCR 识别 + 实名核验 · 样式
   ------------------------------------------------------------
   shell.php 会自动发现 /static/css/p<数字>.css 并注入(p20 命中该规则),
   所以本文件不需要在页面里手动引 <link>。
   只补充 app.css 里没有的布局件,颜色一律用 app.css 的 CSS 变量,不引外部 CDN。
   ============================================================ */

/* ---------------- 顶栏 / 标题 ---------------- */
.p20-topbar { align-items: flex-start; }
.p20-title { font-size: 18px; font-weight: 600; color: var(--text-1, #1f2329); }
.p20-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- 两栏栅格 ---------------- */
.p20-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
    align-items: start;
}
@media (max-width: 1100px) {
    .p20-grid { grid-template-columns: minmax(0, 1fr); }
}
.p20-col-main, .p20-col-side { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* ---------------- 状态横幅 ---------------- */
.p20-banner {
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.7;
    border: 1px solid transparent;
}
.p20-banner-ok   { background: #f0f9f2; border-color: #cfe9d6; color: #1f6b34; }
.p20-banner-warn { background: #fff8ed; border-color: #f5dfbd; color: #8a5a12; }
.p20-banner-note { margin-top: 6px; opacity: .85; }
.p20-banner-facts { margin-top: 8px; display: flex; gap: 16px; flex-wrap: wrap; opacity: .9; }
.p20-banner-facts b { font-weight: 600; }

/* ---------------- 标签页 / 类型选择 ---------------- */
.p20-tabs { display: flex; gap: 6px; margin-bottom: 12px; border-bottom: 1px solid var(--border, #e5e6eb); }
.p20-tab {
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text-2, #4e5969);
    border-bottom: 2px solid transparent;
    text-decoration: none;
}
.p20-tab.on { color: var(--primary, #165dff); border-bottom-color: var(--primary, #165dff); font-weight: 600; }

.p20-srcbox { padding: 4px 0 8px; }

.p20-typelist { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.p20-type {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--border, #e5e6eb);
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s;
}
.p20-type:hover { border-color: var(--primary, #165dff); }
.p20-type.on { border-color: var(--primary, #165dff); background: #f2f6ff; }
.p20-type input { display: none; }
.p20-type-name { font-size: 14px; font-weight: 600; color: var(--text-1, #1f2329); }
.p20-type-meta { font-size: 12px; color: var(--text-3, #86909c); }

/* ---------------- 表单 ---------------- */
.p20-formgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 18px; }
.p20-row { margin-top: 12px; }
.p20-gh {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2, #4e5969);
    margin: 18px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--border, #e5e6eb);
}
.p20-gh:first-child { margin-top: 0; }
.p20-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2, #4e5969); cursor: pointer; }
.p20-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.p20-file { font-size: 13px; }
.p20-secretrow { display: flex; align-items: center; gap: 10px; }
.p20-secretrow input { flex: 1; min-width: 0; }
.p20-secretrow a { font-size: 12px; white-space: nowrap; }

/* ---------------- 图片预览 ---------------- */
.p20-preview { margin-top: 14px; border: 1px dashed var(--border, #e5e6eb); border-radius: 8px; padding: 12px; text-align: center; }
.p20-preview img { max-width: 100%; max-height: 260px; border-radius: 6px; display: block; margin: 0 auto; }
.p20-preview-meta { margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.p20-preview-meta .hint { word-break: break-all; font-size: 12px; }
.p20-preview-empty { color: var(--text-3, #86909c); font-size: 13px; }

/* ---------------- 结果面板 ---------------- */
.p20-resultmeta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--text-2, #4e5969); margin-bottom: 10px; }
.p20-resultmeta b { color: var(--text-1, #1f2329); font-weight: 600; }
.p20-msg { padding: 9px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 12px; word-break: break-all; }
.p20-msg.ok   { background: #f0f9f2; color: #1f6b34; }
.p20-msg.warn { background: #fff8ed; color: #8a5a12; }
.p20-msg.err  { background: #fef1f1; color: #a8261f; }
.p20-err { color: #a8261f; }
.p20-warn { color: #8a5a12; }

/* ---------------- 表格 ---------------- */
.p20-tablewrap { overflow-x: auto; }
.p20-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.p20-table th, .p20-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border, #e5e6eb);
    text-align: left;
    vertical-align: top;
}
.p20-table thead th { background: #fafbfc; color: var(--text-2, #4e5969); font-weight: 600; white-space: nowrap; }
.p20-table tbody tr:hover { background: #fafbfc; }
.p20-table-sm th, .p20-table-sm td { padding: 6px 8px; font-size: 12px; }
.p20-table th[scope], .p20-table tbody th { width: 110px; color: var(--text-2, #4e5969); font-weight: 500; white-space: nowrap; }
.p20-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
.p20-nowrap { white-space: nowrap; }
.p20-unit { font-size: 13px; color: var(--text-2, #4e5969); font-weight: 400; margin-left: 2px; }

/* ---------------- 筛选条 ---------------- */
.p20-filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.p20-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2, #4e5969); }
.p20-filters input, .p20-filters select { min-width: 130px; }
.p20-filters input[type="date"] { min-width: 140px; }

/* ---------------- 原始响应 ---------------- */
.p20-raw { margin-top: 12px; }
.p20-raw summary { cursor: pointer; font-size: 13px; color: var(--primary, #165dff); }
.p20-raw pre {
    margin-top: 8px;
    max-height: 320px;
    overflow: auto;
    background: #f7f8fa;
    border: 1px solid var(--border, #e5e6eb);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.6;
    word-break: break-all;
    white-space: pre-wrap;
}

/* ---------------- 弹窗内容 ---------------- */
.p20-modal { max-height: 62vh; overflow-y: auto; font-size: 13px; }
.p20-modal h4 { margin: 14px 0 8px; font-size: 13px; color: var(--text-1, #1f2329); }
.p20-modal ul { margin: 6px 0 6px 18px; padding: 0; }
.p20-modal li { margin: 4px 0; line-height: 1.7; }
.p20-modal code { background: #f2f3f5; padding: 1px 5px; border-radius: 3px; font-size: 12px; }

/* ---------------- #/setting/ocr 的 P20 扩展面板 ---------------- */
.p20-extend { border: 1px solid #cfe9d6; }
.p20-extend .card-head { background: #f0f9f2; }
.p20-extend .card-head h3 { margin: 0; }
