:root {
  --bg: #0b1016;
  --panel: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --link: #60a5fa;
  --accent: #34d399;
  --danger: #f87171;
  --border: #1f2937;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC", Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.6;
}

.container {
  max-width: 980px;
  padding: 0 16px;
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(17,24,39,0.9), rgba(11,16,22,0.9));
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(6px);
}

.site-header h1 {
  margin: 16px 0 4px;
  font-size: 24px;
}

.subtitle {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.nav {
  display: flex;
  gap: 12px;
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--link);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.nav a:hover {
  background: #0f172a;
  border-color: var(--border);
}

.nav a.active {
  background: #0f172a;
  border-color: var(--border);
  color: #bfdbfe;
}

/* Pin Investor Warning (EN) link to the right across pages */
.nav a[href$="investor-warning-en.html"] {
  margin-left: auto;
  order: 999;
}

/* Top-right Investor link for Chinese pages */
.site-header .container {
  position: relative;
}

.investor-link {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 20;
  white-space: nowrap;
}

.hero {
  padding: 32px 0 8px;
}

.cta-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  background: #0f172a;
}

.button.primary {
  background: #065f46;
  border-color: #064e3b;
}

.button.ghost {
  background: transparent;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 24px 0;
}

@media (max-width: 720px) {
  .cards { grid-template-columns: 1fr; }
}

.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: var(--panel);
}

.disclaimer ul {
  margin: 0;
  padding-left: 20px;
}

.article-wrap {
  padding: 24px 0;
}

.article {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 12px;
  padding: 18px;
  overflow-x: auto;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.article h1, .article h2, .article h3, .article h4 {
  margin-top: 1.2em;
}

.article a {
  color: var(--link);
}

.article blockquote {
  margin: 0.8em 0;
  padding-left: 12px;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

.article table {
  border-collapse: collapse;
  width: 100%;
}

.article table th, .article table td {
  border: 1px solid var(--border);
  padding: 8px;
}

.article code, .article pre {
  background: #0f172a;
  border-radius: 8px;
  padding: 2px 6px;
}

.article pre {
  padding: 10px;
  overflow-x: auto;
}

.error {
  margin-top: 12px;
  color: var(--danger);
}

.site-footer {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding: 16px 0 24px;
  color: var(--muted);
}

/* search UI */
.search-bar {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.search-bar input[type="search"] {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f172a;
  color: var(--text);
}

.search-bar button {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f172a;
  color: var(--text);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.tag-list .tag {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #0f172a;
  color: var(--text);
  cursor: pointer;
}

.tag-list .tag[aria-pressed="true"] {
  background: #064e3b;
  border-color: #065f46;
}

.result-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 720px) {
  .result-list { grid-template-columns: 1fr; }
}

/* Chinese typography refinements */
.article p {
  text-align: justify;
  text-justify: inter-ideograph;
}

.article h1, .article h2, .article h3, .article h4 {
  line-height: 1.4;
}

.article sup, .article sub {
  line-height: 0;
}

:where(a, button, .button):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

/* highlight utilities */
.hl {
  background: rgba(234, 179, 8, 0.18);
  color: inherit;
  padding: 0 2px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(234, 179, 8, 0.25);
}

.hl-block {
  display: block;
  margin: 8px 0;
  padding: 8px 10px;
  border-left: 3px solid #f59e0b;
  border-radius: 8px;
  background: rgba(234, 179, 8, 0.08);
}


