:root {
	--navy: #0f172a;
	--navy-2: #1e293b;
	--amber: #f59e0b;
	--amber-2: #d97706;
	--up: #dc2626;
	--down: #16a34a;
	--bg: #f8fafc;
	--card: #ffffff;
	--text: #0f172a;
	--muted: #64748b;
	--line: #e2e8f0;
	--shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
	--radius: 12px;
	--header: 72px;
	--font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
	--num: "SF Mono", "Roboto Mono", "Source Code Pro", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.6;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select { font: inherit; }
h1, h2, h3, p { margin-top: 0; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}
.skip-link {
	position: absolute;
	left: 12px;
	top: -40px;
	background: var(--amber);
	color: var(--navy);
	padding: 8px 12px;
	z-index: 100;
}
.skip-link:focus { top: 12px; }
.wrap { width: min(1200px, calc(100% - 32px)); margin: 0 auto; }
.muted { color: var(--muted); }
.card {
	background: var(--card);
	border: 1px solid rgba(226, 232, 240, 0.9);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--amber);
	color: var(--navy);
	font-weight: 700;
	text-decoration: none;
	border: 0;
	border-radius: 999px;
	padding: 10px 18px;
	cursor: pointer;
}
.btn:hover { background: var(--amber-2); }
.is-up { color: var(--up); }
.is-down { color: var(--down); }
.is-flat { color: var(--muted); }
.chg { font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.chg--lg { font-size: 20px; }

.site-header {
	position: sticky;
	top: 0;
	z-index: 40;
	height: var(--header);
	background: var(--navy);
	color: #e2e8f0;
	border-bottom: 1px solid rgba(245, 158, 11, 0.35);
}
.header-inner {
	height: 100%;
	width: min(1200px, calc(100% - 32px));
	margin: 0 auto;
	display: grid;
	grid-template-columns: 1fr minmax(260px, 460px) 1fr;
	align-items: center;
	gap: 20px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; justify-self: start; }
.logo__mark {
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: var(--amber);
	color: var(--navy);
	display: grid;
	place-items: center;
}
.logo__mark svg { width: 22px; height: 22px; fill: currentColor; }
.logo__text { font-weight: 750; letter-spacing: 0.04em; }
.primary-nav { justify-self: end; }
.primary-nav .menu, .footer-menu { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; }
.primary-nav a { color: #cbd5e1; text-decoration: none; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { color: #fff; }

.global-search { position: relative; }
.global-search input[type="search"] {
	width: 100%;
	height: 42px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	padding: 0 16px;
}
.global-search input::placeholder { color: #94a3b8; }
.global-search input:focus { outline: none; border-color: var(--amber); }
.search-close { display: none; }
.search-panel {
	display: none;
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 8px);
	background: #fff;
	color: var(--text);
	border-radius: var(--radius);
	box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
	padding: 12px;
	z-index: 50;
}
.global-search:focus-within .search-panel,
.global-search.is-open .search-panel { display: block; }
.search-hot p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.hot-tags, .search-results { display: flex; flex-wrap: wrap; gap: 8px; }
.hot-tags a, .search-item {
	display: flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	background: var(--bg);
	border-radius: 999px;
	padding: 6px 10px;
}
.search-results { flex-direction: column; }
.search-item { border-radius: 10px; width: 100%; }
.search-item.is-active, .search-item:hover { background: #fff7ed; }
.coin-logo {
	width: var(--logo, 28px);
	height: var(--logo, 28px);
	flex: 0 0 auto;
	display: inline-grid;
}
.coin-logo img,
.coin-logo .avatar {
	width: 100%;
	height: 100%;
	max-width: none;
	border-radius: 50%;
	object-fit: cover;
}
.coin-logo [hidden] { display: none !important; }
.search-item img, .avatar {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	object-fit: cover;
}
.avatar {
	display: inline-grid;
	place-items: center;
	background: var(--navy);
	color: var(--amber);
	font-size: 12px;
	font-weight: 700;
}
.search-item strong { margin-right: 6px; }
.search-item em, .coin-id em, .hot-card em, .board-list em { font-style: normal; color: var(--muted); margin-left: 6px; }
.search-empty { margin: 8px 0 0; color: var(--muted); }

.stale-banner {
	display: none;
	background: #fff7ed;
	color: #9a3412;
	text-align: center;
	padding: 8px 16px;
	font-size: 14px;
}
body.has-stale .stale-banner, .stale-banner.is-on { display: block; }

.breadcrumbs { padding: 14px 0 0; color: var(--muted); font-size: 14px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li:not(:last-child)::after { content: ">"; margin-left: 6px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }

.hero {
	background:
		radial-gradient(circle at 90% 0%, rgba(245, 158, 11, 0.18), transparent 36%),
		linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
	color: #e2e8f0;
	padding: 48px 0 40px;
}
.eyebrow { color: var(--amber); letter-spacing: 0.08em; font-size: 13px; margin-bottom: 8px; }
.hero h1 { font-size: 40px; margin-bottom: 8px; color: #fff; }
.hero__lead { max-width: 640px; color: #cbd5e1; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 28px 0 12px; }
.hero-stats div { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: var(--radius); padding: 16px; }
.hero-stats dt { color: #94a3b8; font-size: 13px; }
.hero-stats dd { margin: 6px 0 0; font-size: 24px; color: #fff; }
.source-line { color: #94a3b8; font-size: 13px; }

.site-content { flex: 1 0 auto; }
.home-main, .list-page, .coin-page, .prose-page { padding: 28px 0 72px; }
.section { margin-top: 28px; }
.section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section__head h2 { margin: 0; }
.page-head { margin-bottom: 18px; }
.page-head h1 { margin: 0 0 8px; }
.page-head p { margin: 0; color: var(--muted); max-width: 42em; }
.section__head a { color: var(--amber-2); text-decoration: none; font-weight: 650; }
.sector-row { display: flex; flex-wrap: wrap; gap: 8px; }
.sector-row a, .rank-tabs a {
	text-decoration: none;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 999px;
	padding: 6px 12px;
}
.rank-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.rank-tabs a.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }

.hot-grid, .news-grid, .related-grid { display: grid; gap: 16px; }
.hot-grid { grid-template-columns: repeat(4, 1fr); }
.news-grid, .related-grid { grid-template-columns: repeat(3, 1fr); }
.hot-card, .related-card, .news-card { padding: 16px; text-decoration: none; display: flex; flex-direction: column; gap: 8px; transition: transform 180ms ease; }
.hot-card:hover, .related-card:hover, .news-card:hover { transform: translateY(-3px); }
.hot-card__id, .related-card, .coin-id { display: flex; align-items: center; gap: 10px; }
.hot-card__id { display: flex; }
.hot-card .price { font-size: 22px; }
.spark { width: 100px; height: 36px; }
.spark-svg { display: block; }

.board { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.board .card { padding: 8px 16px 16px; }
.board-list { list-style: none; margin: 0; padding: 0; }
.board-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.board-list a { display: flex; align-items: center; gap: 8px; min-width: 0; text-decoration: none; }
.board-list__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-card time { color: var(--muted); font-size: 13px; }
.empty-state { padding: 28px; }

.site-footer { background: var(--navy); color: #cbd5e1; padding: 36px 0 28px; }
.footer-grid { display: grid; gap: 16px; }
.footer-menu { flex-wrap: wrap; }
.footer-brand { color: #fff; font-weight: 700; font-size: 18px; }
.footer-menu a { color: #cbd5e1; text-decoration: none; }
.risk { color: #fbbf24; }
.risk--block { background: #fff7ed; color: #9a3412; padding: 12px 14px; border-radius: var(--radius); }

.tabbar {
	display: none;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 45;
	background: #fff;
	border-top: 1px solid var(--line);
	padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
	grid-template-columns: repeat(4, 1fr);
}
.tabbar__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	background: none;
	border: 0;
	color: var(--muted);
	text-decoration: none;
	font-size: 12px;
	padding: 4px;
}
.tabbar__item svg { width: 22px; height: 22px; }
.tabbar__item.is-current { color: var(--navy); font-weight: 700; }

.flash-up { animation: flashUp 300ms ease; }
.flash-down { animation: flashDown 300ms ease; }
@keyframes flashUp { from { background: rgba(220, 38, 38, 0.18); } to { background: transparent; } }
@keyframes flashDown { from { background: rgba(22, 163, 74, 0.18); } to { background: transparent; } }
.skeleton {
	background: linear-gradient(90deg, #e2e8f0 25%, #f8fafc 37%, #e2e8f0 63%);
	background-size: 400% 100%;
	animation: shimmer 1.4s ease infinite;
	border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.news-source { margin: 0 0 16px; padding: 10px 12px; background: var(--bg); border-left: 3px solid var(--amber); color: var(--muted); font-size: 14px; }
.entry-content { line-height: 1.85; }
.entry-content h2 { margin-top: 1.6em; font-size: 1.35rem; }
.entry-content h3 { margin-top: 1.3em; }
.entry-content a { color: #b45309; }
.toc {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 14px 16px;
	margin: 0 0 24px;
}
.toc__title { font-weight: 700; margin-bottom: 8px; }
.toc ul { margin: 0; padding-left: 18px; }
.toc a { text-decoration: none; }
.converter { padding: 20px; display: grid; gap: 16px; }
.converter__fields { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(160px, 0.7fr); gap: 12px; align-items: end; }
.converter label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.converter input, .converter select {
	width: 100%;
	height: 44px;
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 0 12px;
	background: #fff;
	color: var(--text);
}
.convert-out { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0; }
.convert-out div { background: var(--bg); border-radius: 10px; padding: 14px 16px; }
.convert-out dt { color: var(--muted); font-size: 13px; }
.convert-out dd { margin: 6px 0 0; font-family: var(--num); font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 650; }
.converter__note { margin: 0; color: var(--muted); font-size: 13px; }
.prose-page h1 { margin-bottom: 8px; }
.post-meta { color: var(--muted); }
.plain-list { padding-left: 18px; }
.inline-search { display: flex; gap: 8px; margin-top: 16px; }
.inline-search input { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
