/* 盛世财务 · 文书生成系统 —— 样式（零依赖，深蓝 #0A1F3D + 金 #C9A54A） */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font: 14px/1.65 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; color: #222; background: #f5f4f0; }
.hidden { display: none !important; }

/* ---------- 顶栏 ---------- */
.topbar { background: #0A1F3D; color: #fff; }
.topbar-inner { max-width: 960px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.brand { font-weight: 500; letter-spacing: 1px; }
.brand-mark { display: inline-block; width: 26px; height: 26px; line-height: 26px; text-align: center; background: #C9A54A; color: #0A1F3D; border-radius: 4px; margin-right: 8px; font-weight: 500; }
.topnav { display: flex; align-items: center; gap: 16px; }
.nav-link { color: #C9A54A; text-decoration: none; }
.nav-user { color: #b9c3d4; font-size: 13px; }

/* ---------- 主体 ---------- */
.wrap { max-width: 960px; margin: 20px auto 60px; padding: 0 16px; }
.doc-head h1 { font-size: 22px; color: #0A1F3D; margin-bottom: 6px; }
.doc-head > p { color: #555; margin-bottom: 12px; }
.limit-hint { font-size: 13px; color: #8a6d1a; background: #faf3e0; border: 1px solid #e8d9a8; border-radius: 6px; padding: 8px 12px; }
.notice { background: #fff; border-left: 4px solid #C9A54A; border-radius: 6px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; }
.notice ul { padding-left: 18px; }

/* ---------- 卡片表单 ---------- */
.card { background: #fff; border: 1px solid #e3e0d8; border-radius: 10px; padding: 18px 20px; margin-bottom: 16px; }
.card legend, .card .legend { font-size: 15px; font-weight: 500; color: #0A1F3D; padding: 0 6px; }
fieldset.card { border: 1px solid #e3e0d8; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin-top: 10px; }
.field label { display: block; font-size: 13px; color: #333; margin-bottom: 4px; }
.req { color: #c0392b; margin-left: 2px; }
.field input, .field select { width: 100%; padding: 8px 10px; border: 1px solid #cfcabd; border-radius: 6px; font: inherit; background: #fff; }
.field input:focus, .field select:focus { outline: none; border-color: #C9A54A; box-shadow: 0 0 0 2px rgba(201,165,74,.18); }
.field .hint { font-size: 12px; color: #999; margin-top: 3px; }
.field.bad input, .field.bad select { border-color: #c0392b; background: #fdf3f2; }
.span2 { grid-column: 1 / -1; }

/* ---------- v1.14「更多选项」折叠区 ----------
   把选填项与「已有常规默认值」的项收进来，首屏只留常用必填项。
   折叠 ≠ 不必填：若折叠区里还有未填的必填项，JS 会给它加 .need 并自动展开。 */
.adv-box { margin-top: 12px; border-top: 1px dashed #e8e4da; padding-top: 6px; }
.adv-box > summary {
  cursor: pointer; list-style: none; font-size: 13px; color: #7a8494;
  padding: 6px 2px; display: flex; align-items: center; gap: 6px;
  user-select: none; border-radius: 6px;
}
.adv-box > summary::-webkit-details-marker { display: none; }
.adv-box > summary::before {
  content: '＋'; display: inline-block; width: 16px; text-align: center;
  color: #C9A54A; font-weight: 700;
}
.adv-box[open] > summary::before { content: '－'; }
.adv-box > summary:hover { color: #0A1F3D; }
.adv-box[open] > summary { color: #0A1F3D; }
.adv-tip { color: #a8b0bb; font-weight: 400; }
.adv-box .grid { margin-top: 6px; }
.adv-box.need > summary,
.adv-box.need > summary .adv-tip { color: #b07b1e; }
.adv-box.need > summary::before { content: '!'; color: #c0392b; }

/* ---------- 预览与提交 ---------- */
.preview { background: #f8f6ef; border: 1px dashed #d8c98f; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.preview b { color: #0A1F3D; }
.actions { display: flex; align-items: center; gap: 14px; }
.btn { display: inline-block; border: none; border-radius: 8px; padding: 10px 22px; font: inherit; cursor: pointer; text-decoration: none; text-align: center; }
.btn-primary { background: #0A1F3D; color: #fff; }
.btn-primary:hover { background: #12305c; }
.btn-primary[disabled] { opacity: .55; cursor: not-allowed; }
.btn-block { display: block; width: 100%; }
.status { color: #666; font-size: 13px; }
.errors { border-left: 4px solid #c0392b; }
.errors li { margin-left: 18px; color: #a03026; margin-bottom: 4px; line-height: 1.75; overflow-wrap: anywhere; }

/* ---------- 历史记忆关联提示条（输入公司/股东等信息后自动出现） ---------- */
.recall-bar { background: #f2f7ee; border: 1px solid #9dc08b; border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }
.recall-bar[hidden] { display: none; }
.recall-bar .recall-head { color: #2f5d2a; font-weight: bold; margin-bottom: 6px; }
.recall-bar .recall-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; border-top: 1px dashed #cfe3c4; }
.recall-bar .recall-row:first-of-type { border-top: none; }

/* ---------- 登录页 ---------- */
.login-body { background: #0A1F3D; display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: #fff; border-radius: 14px; padding: 34px 36px 26px; width: 380px; max-width: 92vw; }
.login-brand { color: #C9A54A; letter-spacing: 6px; font-size: 15px; margin-bottom: 4px; }
.login-card h1 { font-size: 19px; color: #0A1F3D; margin-bottom: 4px; }
.login-sub { color: #999; font-size: 13px; margin-bottom: 18px; }
.login-card label { display: block; font-size: 13px; color: #333; margin-bottom: 12px; }
.login-card input { width: 100%; margin-top: 4px; padding: 9px 10px; border: 1px solid #cfcabd; border-radius: 6px; font: inherit; }
.login-divider { text-align: center; color: #bbb; margin: 14px 0; position: relative; }
.login-divider::before, .login-divider::after { content: ""; position: absolute; top: 50%; width: 40%; border-top: 1px solid #e5e2d8; }
.login-divider::before { left: 0; }
.login-divider::after { right: 0; }
.login-foot { font-size: 12px; color: #aaa; margin-top: 16px; text-align: center; }
.btn-wecom { background: #1aad19; color: #fff; }
.wecom-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #fff; margin-right: 6px; }
.alert { border-radius: 6px; padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }
.alert-error { background: #fdf3f2; color: #a03026; border: 1px solid #f0c4c0; }

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
}

/* ---------- 历史记录页 ---------- */
.rec-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rec-table th, .rec-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #eee7d8; vertical-align: middle; }
.rec-table th { color: #0A1F3D; font-weight: 500; background: #faf8f2; }
.rec-table tr:hover td { background: #fcfbf6; }
.rec-ops { display: flex; gap: 6px; flex-wrap: wrap; }
.btn:hover { border-color: #C9A54A; color: #8a6d1a; }
.btn-primary:hover { color: #C9A54A; }
.btn-small { padding: 4px 10px; font-size: 12px; }
.btn-danger { color: #a03026; border-color: #d9b1ab; }
.btn-danger:hover { background: #fdf3f1; border-color: #a03026; color: #a03026; }
.rec-empty { padding: 16px; color: #777; }

/* ---------- 公司信息自动填卡 ---------- */
.autofill-card { padding: 14px 20px; }
.autofill-row { display: flex; gap: 10px; }
.autofill-row input { flex: 1; padding: 9px 12px; border: 1px solid #cfcabd; border-radius: 6px; font: inherit; }
.autofill-card .hint { margin-top: 8px; font-size: 12px; color: #8a6d1a; }
/* ---------- 主体区块工具栏（OCR / 企业查询） ---------- */
.party-tools { display: flex; align-items: center; gap: 12px; margin: 2px 0 12px; padding: 10px 14px; background: #faf8f2; border: 1px dashed #d8cfae; border-radius: 8px; flex-wrap: wrap; }
.ocr-btn { display: inline-block; background: #fff; border: 1px solid #cfcabd; border-radius: 6px; padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer; color: #333; }
.ocr-btn:hover { border-color: #C9A54A; color: #8a6d1a; }
/* 文件控件视觉隐藏（不用 hidden 属性：部分 WebView 里 hidden 控件无法唤起选图） */
.ocr-input { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
/* 扫码上传按钮 + 弹层（电脑出码 → 手机拍照 → 照片回流识别） */
.qr-link { display: inline-block; background: #fff; border: 1px solid #cfcabd; border-radius: 6px;
           padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer; color: #333; }
.qr-link:hover { border-color: #C9A54A; color: #8a6d1a; }
.qr-overlay { position: fixed; inset: 0; background: rgba(10, 31, 61, .55); z-index: 60;
              display: flex; align-items: center; justify-content: center; }
.qr-overlay[hidden] { display: none; }
.qr-box { background: #fff; border-radius: 12px; padding: 26px 30px 22px; max-width: 320px; text-align: center;
          box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.qr-box h3 { margin: 0 0 14px; color: #0A1F3D; font-size: 17px; }
.qr-canvas { display: flex; justify-content: center; margin-bottom: 10px; }
.qr-canvas img, .qr-canvas canvas, .qr-canvas table { border: 6px solid #fff; box-shadow: 0 0 0 1px #e5ddc5; }
.qr-box .hint { font-size: 12px; color: #8a6d1a; line-height: 1.7; margin: 0 0 6px; }
.qr-status { font-size: 13px; color: #0A1F3D; font-weight: bold; margin: 6px 0 12px; }
.ocr-status { font-size: 12px; color: #8a6d1a; }
.autofill-row select { padding: 9px 10px; border: 1px solid #cfcabd; border-radius: 6px; font: inherit; background: #fff; max-width: 220px; }
/* ---------- 锁定字段（第一期100%时后续各期自动填0） ---------- */
.field.locked input, .field.locked select { background: #f3f1ea; color: #888; }
/* ---------- 股东名单结果表 ---------- */
.sh-results { margin-top: 10px; }
.sh-results select { padding: 4px 8px; border: 1px solid #cfcabd; border-radius: 6px; font: inherit; font-size: 12px; background: #fff; }
