/* ============================================================
   AmberVouch 设计令牌（三色体系 · 定稿 2026-09-19）
   与门户首页 home.html 一致：暖米白底 + 墨 + 琥珀（朱红仅用于印章/警示）
   全站唯一色值目标 ≤ 24；工具页一律引用这里的变量，不要再写死十六进制。
   ============================================================ */
:root{
  --ink:#101826;        /* 墨：工具页 banner 底 / 正文标题 */
  --amber:#f5b942;      /* 琥珀：强调色（按钮/高亮），不做大面积底色 */
  --amber-deep:#b45309; /* 琥珀深：链接 / 次级强调 */
  --bg:#faf7f0;         /* 暖米白：页面底色（与首页一致） */
  --surface:#fffdf8;    /* 卡片面 */
  --border:#e8e0d0;     /* 暖色描边 */
  --txt:#1e293b;
  --txt-2:#64748b;
  --seal-red:#c0392b;   /* 仅印章 / 警示 */
  --ok:#1c7c4a; --warn:#b45309; --err:#b91c1c;
  --nav-h:60px;         /* 顶栏统一高度（全站一致，见导航统一） */
}

:root {
    --brand: #101826;
    --brand-2: #b45309;
    --brand-light: #f7f2e7;
    --border: #e8e0d0;
    --ok: #1c7c4a;
    --warn: #b45309;
    --err: #b91c1c;
    --muted: #64748b;
  }
  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    background: #faf7f0;
    color: #1e293b;
    line-height: 1.6;
  }
  .mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; }

  /* ---------- 头部 ---------- */
  header { background: var(--brand); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
  .wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
  .hd { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
        padding: 0; height: var(--nav-h, 60px); box-sizing: border-box; }
  /* 【2026-09-19】顶栏高度统一：这一版原先实测 74px（首页 62 / 门户系 58 / 版权指南 79），
     四个值在讲同一件事。现在一律 --nav-h（60px），窄屏放行由内容撑高。 */
  @media (max-width: 640px) { .hd { height: auto; min-height: var(--nav-h, 60px); padding: 10px 0; } }
  .hd-l { display: flex; align-items: center; gap: 12px; }
  .logo { width: 38px; height: 38px; border-radius: 8px; background: rgba(255,255,255,.16);
          display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; }
  .hd h1 { margin: 0; font-size: 17px; font-weight: 600; }
  .hd .sub { font-size: 12px; color: #e8e0d0; }
  .hd-r { font-size: 12px; color: #e8e0d0; text-align: right; }
  .pill { display: inline-block; background: rgba(255,255,255,.16); border-radius: 999px;
          padding: 2px 10px; font-size: 11px; }

  /* ---------- 工具导航 ---------- */
  nav { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
  .tabs { display: flex; gap: 4px; overflow-x: auto; padding: 8px 0; }
  .tab { flex: 0 0 auto; padding: 7px 14px; border-radius: 6px; border: 1px solid transparent;
         background: transparent; color: #1e293b; font-size: 13px; cursor: pointer; white-space: nowrap; }
  .tab:hover { background: #faf7f0; }
  .tab.on { background: var(--brand); color: #fff; border-color: var(--brand); }
  /* 分类页顶部补全的「同类工具」外链：不在本页有面板，点了会跳到独立工具页。
     用虚线边框 + ↗ 与真 tab 区分，避免用户误以为点了会就地切换。 */
  .tabout { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px;
    border-radius: 6px; border: 1px dashed var(--border); background: transparent; color: var(--muted);
    font-size: 13px; white-space: nowrap; text-decoration: none; transition: .14s; }
  .tabout:hover { background: #faf7f0; color: var(--txt); border-style: solid; border-color: var(--brand); }
  .tabout::after { content: '↗'; font-size: 11px; opacity: .6; }

  /* 分类下拉导航：顶部只显示六大类名称，悬停/点击展开该类的工具
     注意 overflow 必须放行，否则下拉会被 .tabs 原有的 overflow-x:auto 裁掉 */
  .tabs.catnav { overflow: visible; flex-wrap: wrap; gap: 2px; }
  .cn-item { position: relative; }
  .cn-top { display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; border-radius: 8px;
    border: 1px solid transparent; background: transparent; font-size: 13px; font-weight: 600;
    color: var(--txt); cursor: pointer; font-family: inherit; white-space: nowrap; transition: .15s; }
  .cn-item:hover .cn-top, .cn-item.open .cn-top {
    background: var(--brand-light); border-color: var(--border); }
  .cn-ic { font-size: 15px; line-height: 1; }
  .cn-caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 5px solid currentColor; opacity: .45; }
  .cn-menu { position: absolute; top: calc(100% + 4px); left: 0; min-width: 216px; background: #fff;
    border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(16,24,38,.10);
    padding: 6px; display: none; z-index: 60; }
  .cn-item:hover .cn-menu, .cn-item.open .cn-menu { display: block; }
  /* 热区桥接：菜单在按钮下方留了 4px 缝，鼠标从按钮移向菜单时会穿过这条缝，
     :hover 中断导致菜单闪退。这里铺一层不可见热区把缝补上（与首页导航同款做法）。 */
  .cn-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
  .cn-menu .tab, .cn-menu a { display: block; width: 100%; text-align: left; padding: 7px 10px;
    border-radius: 6px; border: 0; background: transparent; font-size: 13px; font-weight: 400;
    color: var(--txt); text-decoration: none; cursor: pointer; font-family: inherit; transition: .12s; }
  .cn-menu .tab:hover, .cn-menu a:hover, .cn-menu .tab:focus-visible, .cn-menu a:focus-visible {
    background: var(--amber); color: var(--ink); }
  .cn-menu .tab.on { background: var(--brand); color: #fff; }

  /* 分类分组标签：把 tab 条按六大分类切开（.tcat 不是 .tab，initTabs 不受影响） */
  .tabs .tcat { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600;
    color: var(--muted); white-space: nowrap; padding: 0 2px 0 12px; user-select: none; }
  .tabs .tcat:first-child { padding-left: 2px; }
  .tabs .tcat::after { content: ''; width: 1px; height: 13px; background: var(--border); margin-left: 10px; }

  /* ---------- 面板 ---------- */
  main { padding: 20px 0 60px; }
  .panel { display: none; }
  .panel.on { display: block; }
  .card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 16px; }
  .card h2 { margin: 0 0 4px; font-size: 16px; color: var(--brand); }
  .card .desc { margin: 0 0 16px; font-size: 13px; color: var(--muted); }

  /* ---------- 拖拽区 ---------- */
  .drop { border: 2px dashed #94a3b8; border-radius: 10px; background: #fffdf8;
          padding: 28px 16px; text-align: center; cursor: pointer; transition: .15s; }
  .drop:hover, .drop.active { border-color: var(--brand); background: var(--brand-light); }
  .drop .big { font-size: 14px; color: #1e293b; }
  .drop .small { font-size: 12px; color: var(--muted); margin-top: 4px; }

  /* ---------- 表单 ---------- */
  .row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 14px; }
  .fld { display: flex; flex-direction: column; gap: 4px; }
  .fld label { font-size: 12px; color: var(--muted); }
  select, input[type=text], input[type=number] {
    border: 1px solid var(--border); border-radius: 6px; padding: 7px 9px; font-size: 13px;
    background: #fff; color: #1e293b; min-width: 100px;
  }
  input[type=range] { width: 160px; }
  .btn {
    border: 1px solid var(--border); background: #fff; color: #1e293b;
    border-radius: 6px; padding: 8px 16px; font-size: 13px; cursor: pointer; transition: .15s;
  }
  .btn:hover { background: #faf7f0; }
  .btn-p { background: var(--brand); border-color: var(--brand); color: #fff; }
  .btn-p:hover { background: var(--brand-2); }
  .btn:disabled { opacity: .5; cursor: not-allowed; }
  .btn-sm { padding: 5px 11px; font-size: 12px; }

  /* ---------- 文件列表 ---------- */
  .files { margin-top: 14px; }
  .fitem { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border);
           border-radius: 6px; margin-bottom: 6px; font-size: 13px; background: #fff; }
  .fitem .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fitem .sz { color: var(--muted); font-size: 12px; }

  /* ---------- 状态 ---------- */
  .status { margin-top: 14px; font-size: 13px; display: none; }
  .status.on { display: block; }
  .status.ok { color: var(--ok); }
  .status.err { color: var(--err); }
  .status.info { color: var(--brand); }
  .bar { height: 5px; background: #e2e8f0; border-radius: 3px; overflow: hidden; margin-top: 8px; display: none; }
  .bar.on { display: block; }
  .bar > i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }

  /* ---------- 结果 ---------- */
  .results { margin-top: 16px; }
  .results table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 12.5px; }
  .results th, .results td { border: 1px solid var(--border); padding: 6px 10px; text-align: right; }
  .results th { background: var(--brand-light); color: var(--brand); }
  .results td:first-child, .results th:first-child { text-align: left; }
  .lsum { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 2px; }
  .lsum > div { background: #fffdf8; border: 1px solid var(--border); border-radius: 8px; padding: 9px 14px; font-size: 12.5px; color: #1e293b; }
  .lsum b { display: block; font-size: 17px; color: var(--brand); font-variant-numeric: tabular-nums; }
  .ltitle { font-weight: 600; color: var(--brand); margin: 14px 0 2px; }
  .ritem { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--border);
           border-radius: 8px; margin-bottom: 8px; background: #fff; flex-wrap: wrap; }
  .ritem .nm { flex: 1; min-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .save { font-size: 12px; color: var(--ok); font-weight: 600; }
  .bigger { font-size: 12px; color: var(--warn); font-weight: 600; }

  /* 固化引流按钮 */
  .fix { background: #f7f2e7; border: 1px solid #f7f2e7; color: #b45309; }
  .fix:hover { background: #f7f2e7; }

  /* ---------- 预览 ---------- */
  .preview { border: 1px solid var(--border); border-radius: 8px; background: #fff;
             margin-top: 14px; padding: 16px; max-height: 460px; overflow: auto; }
  .preview img { max-width: 100%; height: auto; display: block; margin: 0 auto 10px;
                 box-shadow: 0 1px 4px rgba(0,0,0,.12); }
  #qrOut { text-align: center; }
  #qrOut img { max-width: 260px; }

  /* 提示 */
  .note { background: #fffdf8; border-left: 3px solid var(--brand-2); padding: 10px 12px;
          font-size: 12px; color: #1e293b; margin-top: 14px; border-radius: 0 6px 6px 0; }
  .note b { color: var(--brand); }

  /* 页脚 */
  footer { background: #101826; color: #94a3b8; font-size: 12px; padding: 18px 0; text-align: center; }
  footer a { color: #e2e8f0; text-decoration: none; }
  footer a:hover { color: #fff; text-decoration: underline; }

  /* 页脚工具互链：让 7 个落地页彼此连通，也把首页权重传下去 */
  .tool-links { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center;
                margin-bottom: 12px; font-size: 12.5px; }
  .tool-links .tl-title { color: #64748b; }
  .tool-links a { padding: 2px 8px; border-radius: 5px; background: rgba(255,255,255,.06); }
  .tool-links a:hover { background: rgba(255,255,255,.14); text-decoration: none; }
  .tool-links a.cur { background: rgba(255,255,255,.22); color: #fff; font-weight: 600; }
  .ft-note { color: #64748b; }
  @media print {
    body > * { display: none !important; }
    #printArea, #printArea * { display: block !important; visibility: visible !important; }
    #printArea { position: absolute; left: 0; top: 0; width: 100%; background: #fff; }
    #printArea .docx { box-shadow: none !important; margin: 0 !important; }
    @page { margin: 14mm; }
  }
  /* ---------- 主站门户条（回到首页 / 存证 / 后台）---------- */
  .portal-bar { background: #101826; border-bottom: 1px solid #1e293b; font-size: 12.5px; }
  .portal-bar .pb-in { display: flex; align-items: center; gap: 10px; min-height: 38px; flex-wrap: wrap; }
  .portal-bar .pb-brand { display: inline-flex; align-items: center; gap: 7px;
                          color: #fff; text-decoration: none; font-weight: 600; }
  .portal-bar .pb-brand:hover { text-decoration: none; }
  .portal-bar .pb-mark { width: 20px; height: 20px; flex: 0 0 20px; }
  .portal-bar .pb-mark svg { display: block; width: 100%; height: 100%; }
  .portal-bar .pb-nm i { color: #f5b942; font-style: normal; }
  .portal-bar .pb-sep { color: #1e293b; }
  .portal-bar .pb-cur { color: #94a3b8; }
  .portal-bar .pb-links { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
  .portal-bar .pb-links a { color: #cbd5e1; text-decoration: none; padding: 4px 10px;
                            border-radius: 6px; transition: .15s; white-space: nowrap; }
  .portal-bar .pb-links a:hover { background: rgba(148,163,184,.16); color: #fff;
                                  text-decoration: none; }
  .portal-bar .pb-links a.pb-cta { background: linear-gradient(135deg,#f5b942,#f5b942);
                                   color: #4a3520; font-weight: 700; }
  .portal-bar .pb-links a.pb-cta:hover { filter: brightness(1.08); }
  @media (max-width: 720px) {
    .portal-bar .pb-cur { display: none; }
    .portal-bar .pb-links a { padding: 4px 7px; font-size: 12px; }
    /* 窄屏：门户条允许换行，避免整体宽度被撑破（实测 390px 下会溢出到 425px） */
    .portal-bar .pb-in { height: auto; min-height: 38px; flex-wrap: wrap; padding: 4px 0; }
    .portal-bar .pb-links { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
  }
  @media (max-width: 420px) {
    /* 更窄屏幕：品牌只留标记字，链接缩小，避免横向滚动 */
    .portal-bar { font-size: 11.5px; }
    .portal-bar .pb-nm { display: none; }
    .portal-bar .pb-sep { display: none; }
    .portal-bar .pb-links a { padding: 3px 6px; font-size: 11.5px; }
    .ad-slot { padding: 12px 13px; }
  }
  /* ---------- 主站门户条（回到首页 / 存证 / 后台）---------- */
  .portal-bar { background: #101826; border-bottom: 1px solid #1e293b; font-size: 12.5px; }
  .portal-bar .pb-in { display: flex; align-items: center; gap: 10px; min-height: 38px; flex-wrap: wrap; }
  .portal-bar .pb-brand { display: inline-flex; align-items: center; gap: 7px;
                          color: #fff; text-decoration: none; font-weight: 600; }
  .portal-bar .pb-brand:hover { text-decoration: none; }
  .portal-bar .pb-mark { width: 20px; height: 20px; flex: 0 0 20px; }
  .portal-bar .pb-mark svg { display: block; width: 100%; height: 100%; }
  .portal-bar .pb-nm i { color: #f5b942; font-style: normal; }
  .portal-bar .pb-sep { color: #1e293b; }
  .portal-bar .pb-cur { color: #94a3b8; }
  .portal-bar .pb-links { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
  .portal-bar .pb-links a { color: #cbd5e1; text-decoration: none; padding: 4px 10px;
                            border-radius: 6px; transition: .15s; white-space: nowrap; }
  .portal-bar .pb-links a:hover { background: rgba(148,163,184,.16); color: #fff;
                                  text-decoration: none; }
  .portal-bar .pb-links a.pb-cta { background: linear-gradient(135deg,#f5b942,#f5b942);
                                   color: #4a3520; font-weight: 700; }
  .portal-bar .pb-links a.pb-cta:hover { filter: brightness(1.08); }
  @media (max-width: 720px) {
    .portal-bar .pb-cur { display: none; }
    .portal-bar .pb-links a { padding: 4px 7px; font-size: 12px; }
    /* 窄屏：门户条允许换行，避免整体宽度被撑破（实测 390px 下会溢出到 425px） */
    .portal-bar .pb-in { height: auto; min-height: 38px; flex-wrap: wrap; padding: 4px 0; }
    .portal-bar .pb-links { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
  }
  @media (max-width: 420px) {
    /* 更窄屏幕：品牌只留标记字，链接缩小，避免横向滚动 */
    .portal-bar { font-size: 11.5px; }
    .portal-bar .pb-nm { display: none; }
    .portal-bar .pb-sep { display: none; }
    .portal-bar .pb-links a { padding: 3px 6px; font-size: 11.5px; }
    .ad-slot { padding: 12px 13px; }
  }

  /* ---------- 广告位（承接办公软件商单 / 自营导流） ---------- */
  .ad-slot {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 6px;
    padding: 14px 16px; margin: 14px 0; position: relative;
  }
  .ad-slot::before {
    content: '广告'; position: absolute; top: 8px; right: 10px;
    font-size: 10px; color: #94a3b8; border: 1px solid #cbd5e1;
    border-radius: 3px; padding: 0 4px; line-height: 14px;
  }
  .ad-slot .ad-title { font-size: 13px; font-weight: 600; color: #101826; margin: 0 0 5px; }
  .ad-slot .ad-desc { font-size: 12px; color: #64748b; line-height: 1.65; margin: 0 0 9px; }
  .ad-slot .ad-cta {
    display: inline-block; background: #101826; color: #fff; font-size: 12px;
    padding: 6px 14px; border-radius: 4px; text-decoration: none;
  }
  .ad-slot .ad-cta:hover { background: #163a5c; }
  .ad-slot.ad-foot { background: #fffdf8; }
