@charset "utf-8";

/* ============================================================
   汇率吧 · 清爽金融数据风
   ============================================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary: #3b82f6;
  --accent: #f97316;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-header: #1e293b;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --up: #dc2626;      /* 涨（红） */
  --down: #16a34a;    /* 跌（绿） */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .08), 0 2px 4px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 24px rgba(15, 23, 42, .10);
  --transition: .18s ease;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0;
  font-size: 15px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p, ul, li, dl, dt, dd { margin: 0; padding: 0; }
ul, li, dl, dt, dd { list-style: none; }

a { text-decoration: none; color: var(--primary); transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.num, td, .price { font-variant-numeric: tabular-nums; }

/* ============================================================
   Header 顶部导航
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: .5px;
  white-space: nowrap;
}
.brand:hover { color: var(--text); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.site-nav a {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition);
}
.site-nav a:hover { background: var(--primary-light); color: var(--primary); }
.site-nav a.active { background: var(--primary); color: #fff; }

/* 面包屑 */
.crumbs {
  padding: 14px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
.crumbs a { color: var(--text-secondary); }
.crumbs a:hover { color: var(--primary); }
.crumbs .sep { margin: 0 6px; color: #cbd5e1; }

/* ============================================================
   Hero（首页）
   ============================================================ */
.hero {
  margin: 20px 0;
  padding: 40px 24px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 45%, #3b82f6 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}
.hero h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.hero p {
  font-size: 14px;
  color: rgba(255, 255, 255, .85);
  max-width: 640px;
  line-height: 1.8;
  text-wrap: balance;
}
.hero .hero-tags {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hero .hero-tags a {
  padding: 5px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .25);
  color: #fff;
  font-size: 13px;
  transition: all var(--transition);
}
.hero .hero-tags a:hover { background: rgba(255, 255, 255, .25); color: #fff; }

/* ============================================================
   Section 区块
   ============================================================ */
.section { margin-bottom: 28px; }
.section-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 14px;
}
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  padding-left: 12px;
  border-left: 4px solid var(--primary);
  line-height: 1.4;
}
.section-note {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================================
   中间价卡片（首页）
   ============================================================ */
.rate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.rate-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition);
  min-width: 0;
}
.rate-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}
.rate-card .rc-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.rate-card .rc-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rate-card .rc-code {
  font-size: 12px;
  color: var(--text-muted);
}
.rate-card .rc-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
}

/* ============================================================
   货币列表（首页）
   ============================================================ */
.currency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.currency-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.currency-item:hover {
  border-color: var(--primary-light);
  background: var(--primary-light);
  transform: translateY(-1px);
}
.currency-item .name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.currency-item .code {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}
.currency-item:hover .name { color: var(--primary-dark); }

/* ============================================================
   银行卡片（首页）
   ============================================================ */
.bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.bank-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.bank-card:hover {
  border-color: var(--primary-light);
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.bank-card .name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}
.bank-card:hover .name { color: var(--primary-dark); }

/* 银行 logo */
.bank-logo {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bank-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
}
.bank-logo.sm { width: 36px; height: 36px; border-radius: 8px; }
.bank-logo.lg { width: 150px; height: 44px; border-radius: 10px; }

/* 国旗 */
.flag {
  flex-shrink: 0;
  width: 26px;
  height: 19px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .06);
  background: #eef2f7;
}
.flag.sm { width: 22px; height: 16px; }
.flag.lg { width: 40px; height: 30px; border-radius: 6px; }

/* ============================================================
   页面头部卡片（银行页 / 币种页）
   ============================================================ */
.page-head {
  margin: 20px 0;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.page-head .ph-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}
.page-head .ph-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}
.page-head .ph-meta {
  margin-left: auto;
  text-align: right;
}
.page-head .ph-time {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  background: #fef2f2;
  color: var(--up);
  font-size: 13px;
  font-weight: 600;
}

/* ============================================================
   数据表格（银行牌价 / 币种对比）
   ============================================================ */
.data-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table thead th {
  padding: 13px 14px;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  letter-spacing: .3px;
}
.data-table thead th:first-child { text-align: left; }
.data-table tbody td {
  padding: 12px 14px;
  text-align: center;
  font-size: 14px;
  color: var(--text);
  border-top: 1px solid var(--border-light);
  white-space: nowrap;
}
.data-table tbody td:first-child { text-align: left; }
.data-table tbody tr:nth-child(even) { background: #f8fafc; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: #eff6ff; }
.data-table tbody td a { font-weight: 500; }
.data-table tbody td a:hover { text-decoration: underline; }
.data-table td .num-up { color: var(--up); font-weight: 600; }
.data-table td .num-down { color: var(--down); font-weight: 600; }
.data-table tfoot td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  background: #f8fafc;
  border-top: 1px solid var(--border);
}
.data-table .td-flex {
  display: flex;
  align-items: center;
  gap: 8px;
}
.data-table .td-flex .cc {
  font-size: 12px;
  color: var(--text-muted);
}

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ============================================================
   简介（货币 / 银行）
   ============================================================ */
.intro {
  margin: 20px 0;
  padding: 22px 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f0f6ff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
}
.intro::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
}
.intro-icon {
  flex-shrink: 0;
}
.intro-body {
  flex: 1;
  min-width: 0;
}
.intro-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.intro-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.9;
}
.bank-logo.mid { width: 110px; height: 32px; border-radius: 8px; }

@media screen and (max-width: 767px) {
  .intro { flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  margin-top: 40px;
  background: var(--bg-header);
  color: var(--text-muted);
}
.footer-inner {
  padding: 28px 20px 24px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  justify-content: center;
  margin-bottom: 14px;
}
.footer-links a {
  padding: 2px 12px;
  border-radius: 14px;
  color: #cbd5e1;
  font-size: 13px;
  transition: all var(--transition);
}
.footer-links a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.footer-copy {
  text-align: center;
  font-size: 12px;
  line-height: 1.8;
  color: #64748b;
}
.footer-copy a { color: #94a3b8; }
.footer-copy a:hover { color: #fff; }

/* ============================================================
   响应式
   ============================================================ */
@media screen and (max-width: 767px) {
  .container { padding: 0 12px; }
  .header-inner { height: 52px; gap: 10px; }
  .brand { font-size: 17px; }
  .site-nav { gap: 2px; }
  .site-nav a { padding: 5px 9px; font-size: 13px; }

  .hero { padding: 28px 18px; margin: 12px 0; }
  .hero h1 { font-size: 22px; }
  .hero p { font-size: 13px; }

  .section-title { font-size: 16px; }
  .section-note { flex-basis: 100%; padding-left: 16px; }

  .rate-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
  .rate-card { padding: 12px; }
  .rate-card .rc-price { font-size: 17px; }

  .currency-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .bank-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }

  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; }
  .page-head .ph-meta { margin-left: 0; text-align: left; }
  .page-head .ph-title { font-size: 19px; }

  .data-table thead th, .data-table tbody td { padding: 10px 10px; font-size: 13px; }

  /* 移动端表格：横向滚动时冻结第一列（银行名/货币名始终可见） */
  .data-table thead th:first-child,
  .data-table tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
  }
  .data-table thead th:first-child { z-index: 2; }
  .data-table tbody td:first-child { background: #fff; }
  .data-table tbody tr:nth-child(even) td:first-child { background: #f8fafc; }
  .data-table tbody tr:hover td:first-child { background: #eff6ff; }
}

@media screen and (max-width: 479px) {
  .rate-grid { grid-template-columns: repeat(3, 1fr); }
  .currency-grid { grid-template-columns: 1fr 1fr; }
  .bank-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
