/* ============================================================
   Trade Claw — shared design system for SSR pages
   ============================================================ */
:root {
  --bg:           #171313;
  --bg-deep:      #0F0C0C;
  --surface-1:    #201A1A;
  --surface-2:    #292222;
  --surface-3:    #322626;
  --border:       #3A2F2F;
  --border-soft:  #2A2222;
  --text:         #FFFFFF;
  --muted:        #BFBFBF;
  --muted-2:      #7A6E6E;
  --primary:      #F93728;
  --primary-soft: rgba(249, 55, 40, 0.5);
  --link:         #FF6B5C;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-sans:    "Manrope", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  --font-cn:      "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Manrope", sans-serif;

  --container: 1080px;
  --container-wide: 1320px;
  --gutter: 24px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}
:lang(zh-CN), :lang(zh), .cn { font-family: var(--font-cn); }

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

.container       { max-width: var(--container);       margin: 0 auto; padding: 0 var(--gutter); }
.container-wide  { max-width: var(--container-wide);  margin: 0 auto; padding: 0 var(--gutter); }

/* ============================================================
   Top nav (shared with SSR pages)
   ============================================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(23,19,19,0.92), rgba(23,19,19,0.7));
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border-soft);
}
.site-nav-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 68px;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.site-brand img {
  height: 38px;
  width: auto;
  filter: drop-shadow(0 0 12px rgba(249, 55, 40, 0.3));
  transition: filter 0.2s;
}
.site-brand:hover img {
  filter: drop-shadow(0 0 20px rgba(249, 55, 40, 0.5));
}
.site-nav-links {
  display: flex;
  gap: 24px;
  margin-left: 16px;
}
.site-nav-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.site-nav-links a:hover { color: var(--text); border-bottom-color: rgba(249,55,40,0.4); }
.site-nav-links a.active { color: var(--primary); border-bottom-color: var(--primary); }
.site-nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.lang-switch {
  display: flex;
  gap: 2px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  margin-right: 6px;
}
.lang-switch .lang-link {
  color: var(--muted-2);
  padding: 5px 7px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.lang-switch .lang-link:hover {
  color: var(--text);
  border-color: var(--border);
}
.lang-switch .lang-link.active {
  color: var(--primary);
  border-color: rgba(249, 55, 40, 0.4);
  background: rgba(249, 55, 40, 0.06);
}
@media (max-width: 640px) {
  .lang-switch { display: none; }   /* Saved for mobile real-estate; can re-enable with collapsed UI later */
}
.btn-cta {
  height: 34px;
  padding: 0 16px;
  background: var(--primary);
  color: white;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s;
}
.btn-cta:hover {
  background: #ff4538;
  color: white;
  box-shadow: 0 0 24px -4px rgba(249,55,40,0.45);
}

/* ============================================================
   Page heads, sections
   ============================================================ */
.page-head {
  padding: 80px 0 56px;
  border-bottom: 1px solid var(--border-soft);
}
.kicker-line {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--primary);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.kicker-line::before {
  content: "";
  width: 20px;
  height: 1px;
  background: var(--primary);
}
.page-h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 5vw, 60px);
  letter-spacing: -0.02em;
  line-height: 1.08;
}
.page-meta {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.page-meta .v { color: var(--text); }
.crumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 28px;
}
.crumb a    { color: var(--muted-2); }
.crumb a:hover { color: var(--primary); }
.crumb .now { color: var(--text); }
.crumb .sep { color: var(--muted-2); }

/* ============================================================
   Article body typography (markdown-rendered HTML)
   ============================================================ */
.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 0;
  font-size: 17px;
  line-height: 1.78;
  color: var(--text);
  font-family: var(--font-cn);
}
.prose > * + * { margin-top: 1.1em; }
.prose h1, .prose h2, .prose h3, .prose h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-top: 2em;
  color: var(--text);
}
.prose h2 { font-size: 28px; }
.prose h3 { font-size: 22px; }
.prose h4 { font-size: 18px; }
.prose p  { color: var(--text); }
.prose a  { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,107,92,0.4); }
.prose a:hover { color: var(--primary); text-decoration-color: var(--primary); }
.prose strong { color: var(--text); font-weight: 600; }
.prose em     { color: var(--text); font-style: italic; }
.prose ul, .prose ol { padding-left: 1.6em; }
.prose li { margin-top: 0.3em; }
.prose blockquote {
  border-left: 3px solid var(--primary);
  padding: 4px 0 4px 18px;
  margin-left: 0;
  color: var(--muted);
  font-style: normal;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  padding: 1px 6px;
}
.prose pre {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  padding: 18px 22px;
  overflow-x: auto;
  line-height: 1.55;
}
.prose pre code { background: transparent; border: 0; padding: 0; }
.prose img {
  max-width: 100%;
  height: auto;
  margin: 1.6em 0;
  display: block;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 14px;
}
.prose th, .prose td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}
.prose th { background: var(--bg-deep); }

.prose-cover {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  margin: 32px 0 0;
}

/* ============================================================
   Article list / resource list grids
   ============================================================ */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin: 48px 0;
}
.article-card {
  background: var(--surface-1);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  transition: background 0.25s;
  position: relative;
  overflow: hidden;
}
.article-card:hover { background: var(--surface-2); }
.article-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  height: 2px; width: 0;
  background: var(--primary);
  transition: width 0.4s;
}
.article-card:hover::after { width: 100%; }
.article-card-cover {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--surface-3), var(--bg-deep));
  position: relative;
  overflow: hidden;
}
.article-card-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.article-card-cover .placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.article-card-body {
  padding: 22px 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.article-card .eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--primary);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.article-card .eyebrow .lang {
  color: var(--muted-2);
  font-weight: 400;
}
.article-card h3 {
  margin: 0;
  font-family: var(--font-cn);
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
}
.article-card p {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card .foot {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.06em;
}
.article-card .foot .arrow {
  color: var(--primary);
  transition: transform 0.2s;
}
.article-card:hover .foot .arrow { transform: translateX(3px); }

/* ============================================================
   Footer
   ============================================================ */
.site-foot {
  margin-top: 80px;
  padding: 56px 0 28px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-deep);
}
.site-foot .inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border-soft);
}
.site-foot .brand-line { margin-bottom: 18px; }
.site-foot .brand-line img { height: 48px; filter: drop-shadow(0 0 12px rgba(249, 55, 40, 0.3)); }
.site-foot p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.7;
}
.site-foot .slogan {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--primary);
  letter-spacing: 0.30em;
  text-transform: uppercase;
}
.site-foot h4 {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted-2);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.site-foot ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.site-foot ul a {
  color: var(--muted);
  font-size: 13.5px;
}
.site-foot ul a:hover { color: var(--text); }
.site-foot .bottom {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 22px var(--gutter) 0;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.site-foot .bottom .right { display: flex; gap: 22px; }
.site-foot .bottom a { color: var(--muted-2); }
.site-foot .bottom a:hover { color: var(--primary); }

/* ============================================================
   Misc
   ============================================================ */
.empty-state {
  padding: 80px 32px;
  text-align: center;
  border: 1px dashed var(--border);
  background: rgba(255,255,255,0.01);
  margin: 40px 0;
}
.empty-state .eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--primary);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.empty-state .msg {
  font-size: 16px;
  color: var(--muted);
}

.pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin: 32px 0 16px;
}
.pagination a, .pagination .page-cur {
  min-width: 32px;
  height: 32px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.pagination a:hover { color: var(--text); border-color: var(--muted-2); }
.pagination .page-cur {
  background: var(--primary); border-color: var(--primary); color: white; font-weight: 600;
}
.pagination .disabled { opacity: 0.4; pointer-events: none; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .site-foot .inner { grid-template-columns: 1fr 1fr; gap: 32px; }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  :root { --gutter: 18px; }
  .site-nav-inner { height: 60px; gap: 14px; }
  .site-nav-links { display: none; }
  .site-brand img { height: 30px; }
  .page-head { padding: 56px 0 36px; }
  .page-h1 { font-size: clamp(28px, 8vw, 38px); }
  .prose { padding: 36px 0; font-size: 16px; line-height: 1.7; }
  .prose-cover { max-height: 240px; margin-top: 20px; }
  .article-grid { grid-template-columns: 1fr; }
  .site-foot .inner { grid-template-columns: 1fr; gap: 28px; }
  .site-foot .bottom { flex-direction: column; gap: 12px; }
}
