/**
 * 快企务主题 · 国家公司注册页（single-kqw_country.php）与全球目录（template-parts/country-directory.php）。
 * 依赖 tokens.css 的设计变量；通用章节、标题区、FAQ 样式来自 inner.css。
 */

/* ---------- 首屏侧栏：注册机构卡 ---------- */
.p2-cty-card { position: relative; padding: clamp(22px, 2.2vw, 30px); background: rgba(255, 255, 255, .04); border: 1px solid var(--line-dark); backdrop-filter: blur(6px); }
.p2-cty-card::before { content: ""; position: absolute; left: -1px; top: -1px; width: 64px; height: 3px; background: var(--accent); }
.p2-cty-card-label { margin: 0 0 8px; font-size: 13px; color: var(--mist); letter-spacing: .06em; }
.p2-cty-card-title { margin: 0; font-size: clamp(18px, 1.6vw, 22px); font-weight: 700; line-height: 1.45; color: var(--white); }
.p2-cty-card-local { margin: 6px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--mist); overflow-wrap: anywhere; }
.p2-cty-card-link { display: inline-block; margin-top: 12px; font-size: 14px; color: var(--white); border-bottom: 1px solid var(--accent); padding-bottom: 2px; }
.p2-cty-card-link:hover { color: var(--accent); }
.p2-cty-card-facts { margin: 20px 0 0; }
.p2-cty-card-facts div { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-dark); font-size: 14px; }
.p2-cty-card-facts dt { color: var(--mist); }
.p2-cty-card-facts dd { margin: 0; color: var(--white); }
.p2-cty-card-facts dd.is-ok::before, .p2-cty-card-facts dd.is-warn::before, .p2-cty-card-facts dd.is-cond::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; vertical-align: .08em; transform: skewX(calc(var(--slant) * -1)); }
/* 状态圆点只用品牌蓝系，靠形状区分：可办理 = 实心，有条件 = 空心，需评估 = 白色空心（文字标签同时说明） */
.p2-cty-card-facts dd.is-ok::before { background: var(--accent); }
.p2-cty-card-facts dd.is-cond::before { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
.p2-cty-card-facts dd.is-warn::before { background: transparent; box-shadow: inset 0 0 0 2px var(--white); }
.p2-cty-card-facts dd.is-ok::before, .p2-cty-card-facts dd.is-warn::before, .p2-cty-card-facts dd.is-cond::before { flex: none; }
.p2-cty-card-date { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line-dark); font: 500 12.5px/1.5 var(--numeric); color: var(--mist); letter-spacing: .02em; }

/* ---------- 限制提示 ---------- */
.p2-cty-alert { position: relative; margin: 0 0 clamp(40px, 5vw, 64px); padding: 20px 24px 20px 28px; background: #FFF4EC; border-left: 3px solid var(--accent); color: var(--ink); }
.p2-cty-alert strong { display: block; margin-bottom: 6px; font-size: 16px; }
.p2-cty-alert p { margin: 0; line-height: 1.75; color: var(--text); }
.p2-cty-alert.is-cond { background: #FFF9EC; border-left-color: #E9A23B; }

/* ---------- 公司类型 ---------- */
.p2-cty-entities { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.p2-cty-entity { display: flex; flex-direction: column; padding: clamp(22px, 2.2vw, 30px); background: var(--white); border: 1px solid var(--line); transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease); }
.p2-section.is-light .p2-cty-entity { background: var(--white); }
.p2-cty-entity:hover { border-color: rgba(9, 46, 184, .35); }
.p2-cty-entity header { display: flex; align-items: flex-start; gap: 16px; }
.p2-cty-abbr { flex: none; min-width: 64px; padding: 6px 10px 8px; background: var(--ink-deep); color: var(--white); font: 700 20px/1.1 var(--numeric); letter-spacing: .01em; text-align: center; position: relative; }
.p2-cty-abbr::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 3px; height: 2px; background: var(--accent); transform: skewX(calc(var(--slant) * -1)); }
.p2-cty-abbr.is-long { max-width: 46%; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.p2-cty-entity h3 { margin: 0; font-size: 18px; line-height: 1.45; color: var(--ink); }
.p2-cty-local { margin: 4px 0 0; font-size: 13px; line-height: 1.55; color: var(--muted); overflow-wrap: anywhere; }
.p2-cty-use { margin: 16px 0 0; font-size: 15px; line-height: 1.75; color: var(--text); }
.p2-cty-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; margin: auto 0 0; padding-top: 18px; }
.p2-cty-specs div { padding: 10px 0; border-top: 1px solid var(--line); }
.p2-cty-specs dt { font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }
.p2-cty-specs dd { margin: 4px 0 0; font-size: 14px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.p2-cty-specs dd.is-tbd { color: var(--muted); font-style: normal; }

/* ---------- 设立要求 ---------- */
.p2-cty-reqs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(32px, 4vw, 64px); }
.p2-cty-reqs li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 4px 12px; padding: 22px 0; border-top: 1px solid var(--line); }
.p2-cty-reqs b { font: 700 22px/1.2 var(--numeric); color: var(--accent); letter-spacing: -.01em; }
.p2-cty-reqs h3 { margin: 0; font-size: 17px; line-height: 1.5; color: var(--ink); }
.p2-cty-reqs p { margin: 6px 0 0; font-size: 15px; line-height: 1.75; color: var(--text); }

/* ---------- 周期与税务（暗场） ---------- */
.p2-cty-tax { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px; }
.p2-cty-tax-card { position: relative; padding: clamp(24px, 2.4vw, 34px); border: 1px solid var(--line-dark); background: rgba(255, 255, 255, .03); }
.p2-cty-tax-card.is-time::before { content: ""; position: absolute; left: -1px; top: -1px; width: 64px; height: 3px; background: var(--accent); }
.p2-cty-tax-label { margin: 0 0 12px; font-size: 13px; color: var(--mist); letter-spacing: .06em; }
.p2-cty-tax-card .p2-cty-rate { margin: 0 0 14px; font: 700 clamp(44px, 4.6vw, 68px)/1 var(--numeric); color: var(--white); letter-spacing: -.02em; }
.p2-cty-tax-card p { margin: 0; font-size: 15px; line-height: 1.8; color: rgba(209, 219, 255, .86); }
.p2-cty-tax-note { max-width: 62em; margin: 22px 0 0; font-size: 14px; line-height: 1.8; color: var(--mist); }

/* ---------- 年度合规 ---------- */
.p2-cty-annual { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 32px clamp(40px, 6vw, 96px); align-items: start; }
.p2-cty-annual .p2-head { margin-bottom: 0; }

/* ---------- 资料来源与核验 ---------- */
.p2-cty-sources-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 32px clamp(40px, 5vw, 80px); align-items: start; }
.p2-cty-sources { list-style: none; margin: 0; padding: 0; counter-reset: src; }
.p2-cty-sources li { position: relative; padding: 16px 0 16px 44px; border-top: 1px solid var(--line); counter-increment: src; }
.p2-cty-sources li::before { content: counter(src, decimal-leading-zero); position: absolute; left: 0; top: 17px; font: 700 14px/1.4 var(--numeric); color: var(--accent); }
.p2-cty-sources a, .p2-cty-sources span { font-size: 15.5px; font-weight: 600; line-height: 1.55; color: var(--ink); overflow-wrap: anywhere; }
.p2-cty-sources a { background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1px no-repeat; transition: background-size var(--fast) var(--ease), color var(--fast) var(--ease); }
.p2-cty-sources a:hover { color: var(--blue); background-size: 100% 1px; }
.p2-cty-sources a::after { content: " ↗"; font-weight: 400; color: var(--muted); }
.p2-cty-source-meta { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.p2-cty-source-use { margin: 4px 0 0; font-size: 13.5px; line-height: 1.65; color: var(--text); }
.p2-cty-verify { position: sticky; top: 96px; padding: 24px; background: var(--pale); border-top: 3px solid var(--ink); }
.p2-section.is-pale .p2-cty-verify { background: var(--white); }
.p2-cty-verify h3 { margin: 0 0 10px; font-size: 17px; color: var(--ink); }
.p2-cty-verify h4 { margin: 18px 0 8px; font-size: 14.5px; color: var(--ink); }
.p2-cty-verify p { margin: 0; font-size: 14px; line-height: 1.8; color: var(--text); }
.p2-cty-verify .p2-dotlist li { font-size: 14px; color: var(--text); }
.p2-cty-verify .p2-note { margin-top: 16px; font-size: 13px; color: var(--muted); }
.p2-cty-verify .p2-note a { color: var(--blue); }

/* ---------- 配套服务与同区域 ---------- */
.p2-cty-related { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px clamp(40px, 5vw, 80px); align-items: start; }
.p2-cty-related h3 { margin: 0 0 16px; font-size: 17px; color: var(--ink); }
.p2-cty-links { list-style: none; margin: 0; padding: 0; }
.p2-cty-links a { display: grid; grid-template-columns: 8em minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 15px 0; border-top: 1px solid var(--line); color: var(--ink); transition: color var(--fast) var(--ease), padding var(--fast) var(--ease); }
.p2-cty-links a::after { content: "→"; color: var(--accent); }
.p2-cty-links a:hover { color: var(--blue); padding-left: 6px; }
.p2-cty-links b { font-size: 15.5px; }
.p2-cty-links span { font-size: 14px; color: var(--muted); }
.p2-cty-neighbors { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.p2-cty-neighbors a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border: 1px solid var(--line); background: var(--white); font-size: 14px; color: var(--ink); transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease); }
.p2-cty-neighbors a:hover { color: var(--accent); border-color: var(--accent); }
.p2-cty-neighbors em, .p2-cty-dir em { font-style: normal; font-size: 11px; line-height: 1; padding: 3px 5px; border: 1px solid currentColor; color: var(--accent); }
.p2-cty-more { display: inline-block; margin-top: 18px; font-size: 14.5px; color: var(--blue); }
.p2-cty-more:hover { color: var(--accent); }

/* ---------- 全球目录（总览页，暗场） ---------- */
.p2-cty-dir-tools { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 16px 24px; align-items: center; margin-bottom: clamp(28px, 3.5vw, 44px); }
.p2-cty-dir-search { width: 100%; min-height: 50px; padding: 0 16px; border: 1px solid var(--line-dark); border-radius: 0; background: rgba(255, 255, 255, .05); color: var(--white); font: 15px var(--sans); }
.p2-cty-dir-search::placeholder { color: rgba(209, 219, 255, .55); }
.p2-cty-dir-search:focus { outline: none; border-color: var(--accent); background: rgba(255, 255, 255, .08); }
.p2-cty-dir-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.p2-cty-dir-tabs button { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border: 1px solid var(--line-dark); background: transparent; color: var(--mist); font: 14px var(--sans); cursor: pointer; transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease), background var(--fast) var(--ease); }
.p2-cty-dir-tabs button span { font: 600 12px var(--numeric); opacity: .7; }
.p2-cty-dir-tabs button:hover { color: var(--white); border-color: rgba(209, 219, 255, .45); }
.p2-cty-dir-tabs button[aria-pressed="true"] { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--white); }
.p2-cty-dir-tabs button[aria-pressed="true"] span { opacity: 1; }
.p2-cty-dir-tools:not(:has(.p2-cty-dir-tabs)) { grid-template-columns: 1fr; }
.p2-cty-dir-count { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--mist); }
.p2-cty-dir:not(.is-enhanced) .p2-cty-dir-search, .p2-cty-dir:not(.is-enhanced) .p2-cty-dir-tabs, .p2-cty-dir:not(.is-enhanced) .p2-cty-dir-count { display: none; }
.p2-cty-dir-groups { display: grid; gap: clamp(32px, 4vw, 48px); }
.p2-cty-dir-group h3 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 6px; font-size: 17px; color: var(--white); }
.p2-cty-dir-group h3 span { font: 600 13px var(--numeric); color: var(--mist); }
.p2-cty-dir-group ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 0 20px; }
.p2-cty-dir-group li a { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "zh badge" "en badge"; gap: 2px 8px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-dark); transition: color var(--fast) var(--ease), padding var(--fast) var(--ease); }
.p2-cty-dir-zh { grid-area: zh; font-size: 15px; color: var(--white); }
.p2-cty-dir-en { grid-area: en; font: 12px/1.4 var(--numeric); color: rgba(209, 219, 255, .62); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p2-cty-dir-group li a em { grid-area: badge; }
/* 状态标签不再用橙/黄色：靠文字（需评估 / 有条件）区分，颜色只做轻重层次 */
.p2-cty-dir-group li a em.is-warn { color: var(--white); font-weight: 700; }
.p2-cty-dir-group li a em.is-cond { color: var(--mist); }
.p2-cty-dir-group li a:hover { padding-left: 6px; }
.p2-cty-dir-group li a:hover .p2-cty-dir-zh { color: var(--accent); }
.p2-cty-dir-empty { margin: 8px 0 0; padding: 20px 24px; border: 1px dashed var(--line-dark); color: var(--mist); line-height: 1.8; }
.p2-cty-dir-empty a { color: var(--white); border-bottom: 1px solid var(--accent); }

/* ---------- 响应式 ---------- */
@media (max-width: 1023px) {
  .p2-cty-reqs, .p2-cty-annual, .p2-cty-sources-grid, .p2-cty-related { grid-template-columns: minmax(0, 1fr); }
  .p2-cty-verify { position: static; }
  .p2-cty-dir-tools { grid-template-columns: minmax(0, 1fr); }
  .p2-cty-dir-tabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) 4px; scrollbar-width: none; }
  .p2-cty-dir-tabs::-webkit-scrollbar { display: none; }
  .p2-cty-dir-tabs button { flex: none; }
}
@media (max-width: 640px) {
  .p2-cty-specs { grid-template-columns: minmax(0, 1fr); }
  .p2-cty-reqs li { grid-template-columns: 40px minmax(0, 1fr); padding: 18px 0; }
  .p2-cty-reqs b { font-size: 18px; }
  .p2-cty-links a { grid-template-columns: minmax(0, 1fr) auto; }
  .p2-cty-links span { grid-column: 1; grid-row: 2; }
  .p2-cty-links a::after { grid-row: 1 / 3; grid-column: 2; align-self: center; }
  .p2-cty-dir-group ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
  .p2-cty-card-facts div { grid-template-columns: 6em minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .p2-cty-entity, .p2-cty-links a, .p2-cty-dir-group li a, .p2-cty-sources a { transition: none; }
}

/* ---------- 全球公司注册总览：已有海外公司（转代理 / 历史问题处理）入口 ----------
   组件语言沿用“同板块的其他业务”：白卡 + 1px 分隔线，悬停/聚焦转深底。
   深底 #212773 上：正文 rgba(255,255,255,.8)，小标题与按钮 #809BFF（5.0:1）。行动橙只留给表单提交，这里不用。 */
/* 标题按语义分两段，每段整体换行（窄屏放不下时段内仍可折行） */
.p2-tentry-h { display: inline-block; }
.p2-tentry-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; padding: 0; list-style: none; background: var(--line); border: 1px solid var(--line); }
.p2-tentry-list > li { display: flex; }
.p2-tentry { position: relative; display: flex; flex-direction: column; gap: 12px; width: 100%; padding: 30px 32px 28px; background: var(--white); color: var(--ink); box-sizing: border-box; transition: background var(--fast) var(--ease), color var(--fast) var(--ease); }
.p2-tentry::before { content: ""; position: absolute; top: 0; left: 0; width: 56px; height: 2px; background: var(--accent); transition: width var(--fast) var(--ease), background var(--fast) var(--ease); }
.p2-tentry-kicker { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--accent); }
/* 需高于 .p2-inner h3（0,1,1），否则深底悬停时标题仍为深蓝 */
.p2-tentry .p2-tentry-title { margin: 0; font-size: clamp(20px, 1.7vw, 24px); line-height: 1.35; color: inherit; }
.p2-tentry p { margin: 0; font-size: 15px; line-height: 1.75; color: var(--muted); }
.p2-tentry-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; padding: 0; list-style: none; }
.p2-tentry-tags li { padding: 3px 9px; font-size: 12px; line-height: 1.5; color: var(--ink); background: var(--pale); border: 1px solid var(--line); }
.p2-tentry-cta { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; font-weight: 700; color: var(--accent); }
.p2-tentry-cta i { font-style: normal; transition: transform var(--fast) var(--ease); }
.p2-tentry:hover, .p2-tentry:focus-visible { background: var(--ink); color: var(--white); }
.p2-tentry:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.p2-tentry:hover::before, .p2-tentry:focus-visible::before { width: 100%; background: #809BFF; }
.p2-tentry:hover p, .p2-tentry:focus-visible p { color: rgba(255, 255, 255, .8); }
.p2-tentry:hover .p2-tentry-kicker, .p2-tentry:focus-visible .p2-tentry-kicker,
.p2-tentry:hover .p2-tentry-cta, .p2-tentry:focus-visible .p2-tentry-cta { color: #809BFF; }
.p2-tentry:hover .p2-tentry-tags li, .p2-tentry:focus-visible .p2-tentry-tags li { color: var(--white); background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .24); }
.p2-tentry:hover .p2-tentry-cta i, .p2-tentry:focus-visible .p2-tentry-cta i { transform: translateX(4px); }
@media (max-width: 760px) {
  .p2-tentry-list { grid-template-columns: minmax(0, 1fr); }
  .p2-tentry { padding: 24px 20px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .p2-tentry, .p2-tentry::before, .p2-tentry-cta i { transition: none; }
}
