/* ============================================================
   银行联行号查询网 - 全局样式（PC / 移动端自适应）
   ============================================================ */
* { margin: 0; padding: 0; -webkit-box-sizing: border-box; box-sizing: border-box; }

:root {
  --primary: #1a66d6;
  --primary-dark: #0f4c9e;
  --primary-light: #e8f1fd;
  --accent: #e8890c;
  --text: #1f2937;
  --text-2: #5b6b82;
  --line: #e5eaf2;
  --bg: #f4f7fc;
  --white: #fff;
  --radius: 12px;
  --shadow: 0 4px 18px rgba(23, 62, 124, .08);
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; border: 0; }
button, input, select { font-family: inherit; font-size: inherit; outline: none; }
table { border-collapse: collapse; width: 100%; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------------- 顶部区域 ---------------- */
.site-header {
  background: linear-gradient(135deg, #1a66d6 0%, #0f4c9e 100%);
  color: #fff;
  box-shadow: 0 2px 12px rgba(15, 76, 158, .22);
}

.header-top { display: flex; align-items: center; justify-content: space-between; height: 62px; }

.logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; }
.logo:hover { color: #fff; text-decoration: none; }
.logo-mark {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px;
  background: rgba(255, 255, 255, .18);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.25; }
.logo-text b { font-size: 18px; letter-spacing: .5px; }
.logo-text span { font-size: 11px; font-weight: 400; opacity: .82; letter-spacing: 1px; }
.header-tel { font-size: 13px; opacity: .92; white-space: nowrap; }

.main-nav { border-top: 1px solid rgba(255, 255, 255, .15); }
.main-nav ul { display: flex; gap: 26px; height: 46px; align-items: center; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.main-nav ul::-webkit-scrollbar { display: none; }
.main-nav li { flex: 0 0 auto; }
.main-nav a {
  display: inline-block; color: rgba(255, 255, 255, .9); font-size: 15px;
  padding: 4px 0; border-bottom: 2px solid transparent; white-space: nowrap;
}
.main-nav a:hover, .main-nav a.active { color: #fff; border-bottom-color: #ffd76a; text-decoration: none; }

/* ---------------- 面包屑 ---------------- */
.crumb { font-size: 13px; color: var(--text-2); padding: 14px 0 0; }
.crumb a { color: var(--text-2); }
.crumb a:hover { color: var(--primary); }

/* ---------------- 首屏标题 ---------------- */
.hero { padding: 20px 0 4px; }
.hero h1 { font-size: 24px; line-height: 1.5; font-weight: 700; margin-bottom: 8px; }
.hero .lead { color: var(--text-2); font-size: 14px; }

/* ---------------- 卡片与表单 ---------------- */
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-top: 16px;
}
.card + .card { margin-top: 16px; }

.form-grid { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { flex: 1 1 190px; min-width: 0; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field select, .field input {
  width: 100%; height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fbfcfe; color: var(--text);
  -webkit-appearance: none; appearance: none;
}
.field select { background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%235b6b82' d='M6 8 0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; }
.field select:focus, .field input:focus { border-color: var(--primary); background-color: #fff; }
.field-btn { flex: 0 0 auto; }

.btn {
  height: 44px; padding: 0 30px; border: 0; border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 16px; cursor: pointer;
  transition: background .2s, transform .1s; white-space: nowrap;
}
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }
.btn-block { display: block; width: 100%; }
.btn-ghost { background: #eef3fb; color: var(--primary); }
.btn-ghost:hover { background: #e2ebfa; color: var(--primary-dark); }

/* ---------------- 长尾需求快捷入口 ---------------- */
.quick-nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line);
  font-size: 13px;
}
.quick-nav .quick-title { color: var(--text-2); }
.quick-nav a { display: inline-block; padding: 3px 10px; border-radius: 20px; background: var(--primary-light); color: var(--primary-dark); }
.quick-nav a:hover { background: var(--primary); color: #fff; text-decoration: none; }

/* ---------------- 工具入口 ---------------- */
.tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.tool-item {
  display: block; background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; color: var(--text);
  transition: transform .18s, box-shadow .18s;
}
.tool-item:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(23, 62, 124, .14); text-decoration: none; }
.tool-item h3 { font-size: 16px; margin-bottom: 4px; color: var(--primary-dark); }
.tool-item p { font-size: 13px; color: var(--text-2); }

/* ---------------- 结果区 ---------------- */
.result-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.result-head h2 { font-size: 17px; }
.result-count { font-size: 13px; color: var(--text-2); }
.result-count b { color: var(--accent); }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; border: 1px solid var(--line); }
.data-table { min-width: 620px; font-size: 14px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.data-table thead th { background: #f1f6fd; color: var(--primary-dark); font-weight: 600; white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f8fbff; }
.data-table .col-code { font-family: Consolas, Monaco, "Courier New", monospace; font-weight: 600; color: var(--primary); white-space: nowrap; }
.data-table .col-idx { width: 56px; color: var(--text-2); }
.data-table.two-col { min-width: 460px; }

.empty, .loading { text-align: center; padding: 38px 10px; color: var(--text-2); font-size: 14px; }
.empty .ico { font-size: 30px; display: block; margin-bottom: 8px; opacity: .5; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; }
.pager a, .pager span {
  min-width: 36px; height: 36px; padding: 0 10px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: #fff; color: var(--text); font-size: 14px;
}
.pager a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.pager .current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager .disabled { color: #c3ccda; }

/* ---------------- 知识/文章区 ---------------- */
.section { margin-top: 26px; }
.section-title { font-size: 20px; font-weight: 700; padding-left: 12px; border-left: 4px solid var(--primary); line-height: 1.3; margin-bottom: 14px; }
.article-box { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.article-box h3 { font-size: 16px; margin: 18px 0 8px; color: var(--primary-dark); }
.article-box h3:first-child { margin-top: 0; }
.article-box p { margin-bottom: 10px; color: #37485f; }
.article-box ul { margin: 0 0 12px 4px; }
.article-box ul li { position: relative; padding-left: 16px; margin-bottom: 6px; color: #37485f; }
.article-box ul li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }
.article-box strong { color: var(--primary-dark); }

.tip-box { background: #fff8ec; border: 1px solid #ffe3b8; border-radius: 10px; padding: 12px 14px; font-size: 14px; color: #8a5a11; margin: 12px 0; }

/* ---------------- FAQ ---------------- */
.faq-list { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 0; }
.faq-q {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 15px 18px; cursor: pointer; font-size: 16px; font-weight: 600; color: var(--text);
}
.faq-q:hover { background: #f8fbff; }
.faq-q .sign { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: var(--primary-light); color: var(--primary); font-size: 15px; line-height: 22px; text-align: center; transition: transform .2s; }
.faq-item.open .faq-q .sign { transform: rotate(45deg); }
.faq-a { display: none; padding: 0 18px 16px; color: #37485f; font-size: 14.5px; }
.faq-item.open .faq-a { display: block; }
.faq-a p { margin-bottom: 8px; }
.faq-a ol { counter-reset: step; margin: 8px 0; }
.faq-a ol li { position: relative; padding-left: 26px; margin-bottom: 6px; }
.faq-a ol li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 1px; width: 18px; height: 18px; border-radius: 50%; background: var(--primary-light); color: var(--primary); font-size: 12px; line-height: 18px; text-align: center; }
.faq-cta { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13.5px; color: var(--text-2); }

/* ---------------- 银行机构导航 / 银行网址大全 ---------------- */
.bank-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.bank-cell {
  display: block; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
a.bank-cell:hover { border-color: var(--primary); box-shadow: 0 6px 16px rgba(26, 102, 214, .12); text-decoration: none; }
.bank-cell b { display: block; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bank-cell span {
  display: block; font-size: 13px; color: var(--primary);
  font-family: Consolas, Monaco, monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bank-cell em { display: block; font-style: normal; font-size: 12px; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bank-grid .loading, .bank-grid .empty { grid-column: 1 / -1; }

/* ---------------- 页脚 ---------------- */
.site-footer { margin-top: 32px; background: #16233a; color: #9fb0c8; font-size: 13px; }
.site-footer .wrap { padding-top: 26px; padding-bottom: 20px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 14px; }
.footer-links a { color: #cdd9ea; }
.footer-links a:hover { color: #fff; }
.site-footer p { line-height: 1.9; }
.site-footer .copyright { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .1); color: #7d8ea6; }

/* ---------------- 返回顶部 ---------------- */
.to-top {
  position: fixed; right: 18px; bottom: 22px; width: 42px; height: 42px;
  border-radius: 50%; background: var(--primary); color: #fff; border: 0;
  font-size: 18px; cursor: pointer; box-shadow: 0 6px 16px rgba(26, 102, 214, .35);
  display: none; z-index: 99;
}
.to-top.show { display: block; }

/* ---------------- 全国地区代码网格（每行 3 个） ---------------- */
.region-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.region-cell {
  background: #fbfcfe; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; min-width: 0; line-height: 1.4;
  transition: border-color .15s, background .15s;
}
.region-cell:hover { border-color: var(--primary); background: var(--primary-light); }
.region-cell .rc-line { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.region-cell .rc-code {
  flex: 0 0 auto; font-family: Consolas, Monaco, "Courier New", monospace;
  font-weight: 700; font-size: 14px; color: var(--primary);
}
.region-cell .rc-name {
  flex: 1 1 auto; font-size: 14px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.region-cell .rc-prov {
  display: block; font-size: 12px; color: var(--text-2); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.region-grid .loading, .region-grid .empty { grid-column: 1 / -1; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 992px) {
  .bank-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  body { font-size: 14.5px; }
  .header-top { height: 56px; }
  .logo-text b { font-size: 16px; }
  .logo-text span { display: none; }
  .header-tel { display: none; }
  .main-nav ul { gap: 20px; height: 44px; }
  .hero h1 { font-size: 19px; }
  .hero .lead { font-size: 13px; }
  .card { padding: 16px; border-radius: 10px; }
  .form-grid { gap: 10px; }
  .field { flex: 1 1 100%; }
  .field-btn { flex: 1 1 100%; }
  .btn { width: 100%; }
  .tool-grid { grid-template-columns: 1fr; gap: 10px; }
  .bank-grid { grid-template-columns: repeat(2, 1fr); }
  .section-title { font-size: 17px; }
  .article-box { padding: 16px; }
  .faq-q { font-size: 15px; padding: 14px 14px; }
  .faq-a { padding: 0 14px 14px; }
  .to-top { right: 12px; bottom: 16px; width: 38px; height: 38px; }

  /* 地区代码网格：窄屏下 5 列改为竖排，保证 4 位代码与地名都能看清 */
  .region-grid { gap: 5px; }
  .region-cell { padding: 6px 4px; }
  .region-cell .rc-line { flex-direction: column; align-items: center; gap: 2px; }
  .region-cell .rc-code { font-size: 13px; }
  .region-cell .rc-name { font-size: 13px; }
  .region-cell .rc-prov { font-size: 11px; text-align: center; margin-top: 1px; }
}

@media (max-width: 420px) {
  .bank-grid { grid-template-columns: 1fr; }
}
