:root {
  --ink: #101c33;
  --ink-2: #2b3b57;
  --muted: #6b7a92;
  --line: #e2e8f2;
  --bg: #f4f7fc;
  --card: #ffffff;
  --accent: #ff6a2b;
  --accent-soft: #fff1e9;
  --navy: #12325a;
  --teal: #0f8f8f;
  --danger: #d64545;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(16, 28, 51, 0.07);
  --shadow-lg: 0 22px 50px rgba(16, 28, 51, 0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
p { margin: 0; }
img { max-width: 100%; }
button { font-family: inherit; }

/* ------------------------------ header ------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--navy), #1d4f86);
  color: #fff; font-size: 18px;
}

.brand-text {
  font-size: 18px; font-weight: 700;
  display: flex; flex-direction: column; line-height: 1.1;
}

.brand-text em {
  font-style: normal; font-size: 11px; letter-spacing: 0.16em;
  color: var(--muted); font-weight: 500; text-transform: uppercase;
}

.main-nav { display: flex; gap: 4px; }

.main-nav a {
  padding: 8px 14px; border-radius: 999px;
  font-size: 14px; color: var(--ink-2); font-weight: 500;
  transition: background 0.18s, color 0.18s;
  white-space: nowrap;
}

.main-nav a:hover { background: #f0f4fa; }
.main-nav a.active { background: var(--accent-soft); color: var(--accent); }

.search {
  margin-left: auto;
  display: flex; align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 4px 4px 16px;
  min-width: 250px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 106, 43, 0.12); }

.search input {
  flex: 1; border: 0; background: transparent; outline: none;
  font-size: 14px; color: var(--ink); min-width: 0;
}

.search button {
  border: 0; background: var(--navy); color: #fff;
  font-size: 13px; padding: 7px 16px; border-radius: 999px;
  cursor: pointer; transition: background 0.2s;
}

.search button:hover { background: var(--accent); }

/* rate strip */
.rate-strip {
  max-width: 1240px; margin: 0 auto;
  padding: 0 24px 10px;
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; overflow: hidden;
}

.rate-label {
  flex-shrink: 0; background: var(--navy); color: #fff;
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
}

.rate-track {
  display: flex; gap: 22px; overflow-x: auto;
  scrollbar-width: none; white-space: nowrap; color: var(--muted);
  padding-bottom: 2px;
}

.rate-track::-webkit-scrollbar { display: none; }

.rate-item { display: inline-flex; align-items: baseline; gap: 6px; }
.rate-item b { color: var(--ink); font-weight: 600; }
.rate-item .up { color: var(--danger); font-size: 12px; }
.rate-item .down { color: #178f6b; font-size: 12px; }
.rate-item .stale { color: var(--muted); font-size: 11px; }

/* ------------------------------ layout ------------------------------ */
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

.page { padding: 34px 0 60px; }

.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 20px; flex-wrap: wrap; margin-bottom: 24px;
}

.page-head h1 { font-size: 28px; letter-spacing: -0.01em; }

.page-head p { color: var(--muted); font-size: 14px; margin-top: 6px; }

.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a:hover { color: var(--accent); }

/* ------------------------------ buttons ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px;
  font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid transparent;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}

.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 22px rgba(255, 106, 43, 0.26); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-small { padding: 7px 14px; font-size: 13px; }

/* ------------------------------ chips / tabs ------------------------------ */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }

.tab {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  font-size: 13px; padding: 7px 15px; border-radius: 999px; cursor: pointer;
  transition: all 0.16s;
}

.tab:hover { border-color: var(--navy); }
.tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.chip {
  display: inline-block; background: var(--accent-soft); color: var(--accent);
  padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
}

.chip.hot { background: #ffeaea; color: var(--danger); }
.chip.live { background: #e8f7f1; color: #178f6b; }
.chip.demo { background: #fff6e5; color: #b27a12; }

/* ------------------------------ home hero ------------------------------ */
.hero {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 36px;
  align-items: start; padding: 46px 0 10px;
}

.eyebrow {
  display: inline-block; font-size: 12px; letter-spacing: 0.16em;
  color: var(--accent); background: var(--accent-soft);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 16px; font-weight: 600;
}

.hero h1 { font-size: clamp(28px, 3.1vw, 40px); letter-spacing: -0.015em; }
.hero-sub { color: var(--muted); font-size: 15.5px; margin: 16px 0 24px; max-width: 580px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.stat-strip {
  margin-top: 30px; display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 2px;
}

.stat-card strong { font-size: 22px; letter-spacing: -0.02em; }
.stat-card span { font-size: 12px; color: var(--muted); }

.fx-card {
  background: linear-gradient(160deg, #ffffff, #f7faff);
  border: 1px solid var(--line); border-radius: 20px;
  padding: 22px; box-shadow: var(--shadow);
}

.fx-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.fx-head h2 { font-size: 15px; color: var(--muted); font-weight: 600; letter-spacing: 0.04em; }
.fx-head a { font-size: 12px; color: var(--accent); font-weight: 600; }

.fx-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.fx-item {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; display: flex; justify-content: space-between; align-items: baseline;
}

.fx-item span { font-size: 12px; color: var(--muted); }
.fx-item b { font-size: 16px; }
.fx-note { font-size: 12px; color: var(--muted); margin-top: 12px; }

/* ------------------------------ sections ------------------------------ */
.section { padding: 44px 0 8px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head h2 { font-size: 24px; }
.section-head p { color: var(--muted); font-size: 13.5px; margin-top: 5px; }
.section-more { font-size: 13px; color: var(--accent); font-weight: 600; }

/* ------------------------------ news ------------------------------ */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.news-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.news-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.news-card.featured { grid-column: span 2; flex-direction: row; }
.news-card.featured .news-cover { width: 45%; flex-shrink: 0; }

.news-cover { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #dbe5f4, #eef4fd); overflow: hidden; }
.news-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s; }
.news-card:hover .news-cover img { transform: scale(1.04); }

.news-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.news-meta { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.news-title { font-size: 16.5px; font-weight: 700; line-height: 1.45; }
.news-card.featured .news-title { font-size: 20px; }
.news-summary {
  font-size: 13.5px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.news-foot {
  margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--muted); display: flex; justify-content: space-between;
}

/* list page filter bar */
.filter-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  flex-wrap: wrap; margin-bottom: 20px;
}

.filter-bar .search-inline {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 6px 6px 14px; min-width: 240px;
}

.filter-bar .search-inline input { border: 0; outline: none; background: transparent; font-size: 13px; flex: 1; min-width: 0; }
.filter-bar .search-inline button {
  border: 0; background: var(--navy); color: #fff; font-size: 12px;
  padding: 6px 13px; border-radius: 999px; cursor: pointer;
}

/* ------------------------------ articles ------------------------------ */
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.article-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.article-cover { aspect-ratio: 16 / 9; overflow: hidden; background: #e8eef8; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.article-title { font-size: 17px; font-weight: 700; }
.article-summary { font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-foot { margin-top: auto; display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); padding-top: 8px; border-top: 1px dashed var(--line); }

/* ------------------------------ prose / detail ------------------------------ */
.prose-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.prose-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 30px 34px; }
.prose-card h1 { font-size: 28px; letter-spacing: -0.01em; margin-bottom: 12px; }
.prose-meta { display: flex; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; margin-bottom: 20px; }
.prose-lead { font-size: 16px; color: var(--ink-2); background: #f7faff; border-left: 3px solid var(--accent); padding: 14px 18px; border-radius: 0 10px 10px 0; margin-bottom: 22px; }
.prose-card p.body { font-size: 15.5px; color: var(--ink-2); margin-bottom: 16px; }
.prose-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.prose-tags span { font-size: 12px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; }
.prose-cover { border-radius: 14px; overflow: hidden; margin-bottom: 22px; aspect-ratio: 16 / 8; }
.prose-cover img { width: 100%; height: 100%; object-fit: cover; }
.side-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.side-card h3 { font-size: 14px; margin-bottom: 12px; color: var(--muted); letter-spacing: 0.05em; }
.side-link { display: block; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.side-link:last-child { border-bottom: 0; }
.side-link small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.impact-box { background: var(--accent-soft); border-radius: 12px; padding: 16px 18px; margin: 20px 0; }
.impact-box h4 { color: var(--accent); font-size: 13px; margin-bottom: 6px; }
.impact-box p { font-size: 14.5px; color: var(--ink-2); }

/* ------------------------------ directory ------------------------------ */
.dir-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 26px; align-items: start; }
.dir-side { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; position: sticky; top: 130px; }
.dir-side h3 { font-size: 12px; color: var(--muted); letter-spacing: 0.08em; margin: 6px 8px 10px; }
.dir-side a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 10px; border-radius: 10px; font-size: 13.5px; color: var(--ink-2);
}
.dir-side a:hover { background: var(--bg); }
.dir-side a.active { background: var(--navy); color: #fff; }
.dir-side a small { opacity: 0.7; font-size: 11px; }

.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.tool-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.tool-card:hover { transform: translateY(-3px); border-color: #c9d8ee; box-shadow: var(--shadow); }
.tool-top { display: flex; align-items: center; justify-content: space-between; }
.tool-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; background: #eef3fb; }
.tool-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eaf7f2; color: var(--teal); }
.tool-name { font-size: 15px; font-weight: 700; }
.tool-desc { font-size: 13px; color: var(--muted); flex: 1; }
.tool-plats { display: flex; gap: 6px; flex-wrap: wrap; }
.tool-plats span { font-size: 11px; color: var(--ink-2); background: var(--bg); padding: 2px 8px; border-radius: 999px; }
.tool-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); padding-top: 8px; border-top: 1px dashed var(--line); }
.tool-foot .cat { color: var(--navy); font-weight: 600; }
.tool-link { color: var(--accent); font-weight: 600; }

/* ------------------------------ market ------------------------------ */
.market-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.rate-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.rate-card .pair { font-size: 12px; color: var(--muted); }
.rate-card .value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0; }
.rate-card .sub { font-size: 12px; color: var(--muted); }
.rate-card .up { color: var(--danger); font-weight: 600; }
.rate-card .down { color: #178f6b; font-weight: 600; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2 { font-size: 17px; }
.panel-head small { color: var(--muted); font-size: 12px; }

.chart-wrap { width: 100%; overflow: hidden; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 8px; }

.market-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.market-table th {
  text-align: left; font-size: 12px; color: var(--muted); font-weight: 600;
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.market-table td { padding: 11px 12px; border-bottom: 1px dashed var(--line); }
.market-table tr:last-child td { border-bottom: 0; }
.market-table .country { font-weight: 600; }
.flag { margin-right: 6px; }

.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12.5px; color: var(--muted); }
.field input {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
  font-size: 14px; outline: none; font-family: inherit; color: var(--ink);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 106, 43, 0.12); }
.calc-result { background: #f7faff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.calc-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 13.5px; border-bottom: 1px dashed var(--line); }
.calc-row:last-child { border-bottom: 0; }
.calc-row strong { font-size: 15px; }
.calc-row.total strong { font-size: 20px; color: var(--accent); }
.calc-note { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ------------------------------ academy ------------------------------ */
.academy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.course-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.course-cover { aspect-ratio: 16 / 8; overflow: hidden; background: #e8eef8; }
.course-cover img { width: 100%; height: 100%; object-fit: cover; }
.course-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-meta { display: flex; gap: 8px; font-size: 12px; color: var(--muted); }
.course-title { font-size: 16px; font-weight: 700; }
.course-summary { font-size: 13px; color: var(--muted); flex: 1; }
.course-modules { display: none; margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); }
.course-modules.open { display: block; }
.course-modules li { margin-bottom: 4px; }
.course-actions { display: flex; gap: 8px; }
.course-actions button {
  flex: 1; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 7px 12px; font-size: 12.5px; cursor: pointer;
}
.course-actions button.primary { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ------------------------------ timeline ------------------------------ */
.timeline { position: relative; margin-left: 10px; padding-left: 26px; border-left: 2px solid var(--line); }
.timeline-item { position: relative; padding: 0 0 26px 4px; }
.timeline-item::before {
  content: ""; position: absolute; left: -34px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent);
}
.timeline-date { font-size: 12.5px; color: var(--accent); font-weight: 700; letter-spacing: 0.04em; }
.timeline-item h3 { font-size: 16.5px; margin: 4px 0 4px; }
.timeline-item p { font-size: 13.5px; color: var(--muted); }

/* ------------------------------ pagination ------------------------------ */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 28px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  font-size: 13px; color: var(--ink-2); padding: 0 10px;
}
.pagination a:hover { border-color: var(--navy); }
.pagination .current { background: var(--navy); border-color: var(--navy); color: #fff; }
.pagination .disabled { color: #c3ccda; }

/* ------------------------------ state ------------------------------ */
.loading { color: var(--muted); font-size: 14px; padding: 20px 0; }
.empty { color: var(--muted); font-size: 14px; padding: 36px 0; text-align: center; }
.page-loading { color: var(--muted); font-size: 14px; padding: 60px 24px; text-align: center; }
.skeleton { background: linear-gradient(90deg, #eef2f9 25%, #f7f9fc 37%, #eef2f9 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 10px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ------------------------------ footer ------------------------------ */
.site-footer { background: #0d1729; color: #cdd8ea; margin-top: 50px; }
.footer-inner {
  max-width: 1240px; margin: 0 auto; padding: 34px 24px;
  display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap;
}
.footer-brand { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.footer-desc { font-size: 12.5px; color: #8e9db6; max-width: 620px; }
.footer-meta { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: #8e9db6; text-align: right; }

/* ------------------------------ responsive ------------------------------ */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; gap: 26px; }
  .news-grid, .article-grid, .academy-grid { grid-template-columns: repeat(2, 1fr); }
  .news-card.featured { grid-column: span 2; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .market-grid { grid-template-columns: repeat(2, 1fr); }
  .prose-wrap { grid-template-columns: 1fr; }
  .dir-layout { grid-template-columns: 1fr; }
  .dir-side { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .dir-side h3 { width: 100%; }
  .dir-side a { padding: 7px 12px; }
  .main-nav { display: none; }
}

@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; gap: 12px; }
  .search { min-width: 0; width: 100%; margin-left: 0; }
  .news-grid, .article-grid, .academy-grid, .tool-grid { grid-template-columns: 1fr; }
  .news-card.featured { grid-column: span 1; flex-direction: column; }
  .news-card.featured .news-cover { width: 100%; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .calc-grid { grid-template-columns: 1fr; }
  .prose-card { padding: 22px 20px; }
  .footer-meta { text-align: left; }
}
