/* ============================================================
   OneTHU 站点样式 —— 几何方块 + 线条风格，全部取值来自 assets/tokens.css
   （--bg/--surface/--text-*/--primary/--accent/--gap-*/--r-*/--text-*）
   ============================================================ */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, kbd, .mono { font-family: var(--font-mono); font-size: .92em; }

.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
@media (max-width: 640px) { .wrap { width: calc(100% - 32px); } }

/* ── 网格底纹：细线 + 稀疏方块（几何语言的底） ── */
.grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--border-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-soft) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 100%);
}

/* ── 顶栏 ── */
header.top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.top-in { display: flex; align-items: center; gap: var(--gap-4); height: 62px; }
.top nav { display: flex; gap: var(--gap-4); margin-left: auto; align-items: center; }
.top nav a { color: var(--text-2); font-size: var(--text-sm); }
.top nav a:hover { color: var(--text-1); text-decoration: none; }
/* 导航里的按钮必须保持按钮自身配色（否则被上面的 a{color} 压成灰字） */
.top nav a.btn { font-size: var(--text-sm); }
.top nav a.btn-primary { color: var(--on-primary); }
.top nav a.btn-primary:hover { color: var(--on-primary); }
.top nav a.btn:not(.btn-primary) { color: var(--text-1); }
@media (max-width: 860px) { .top nav .hide-sm { display: none; } }

/* ── 导航下拉（交流与反馈：交流群 / Issues 直达） ── */
.top nav .nav-item { position: relative; display: flex; align-items: center; }
.top nav .nav-item > a { display: block; }
.top nav .nav-menu {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  min-width: 172px; padding: 6px; margin-top: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-3); display: none; z-index: 60;
}
.top nav .nav-item:hover .nav-menu,
.top nav .nav-item:focus-within .nav-menu { display: block; }
.top nav .nav-menu a { display: block; padding: 8px 10px; border-radius: var(--r-sm); font-size: var(--text-sm); color: var(--text-2); white-space: nowrap; }
.top nav .nav-menu a:hover { background: var(--hover); color: var(--text-1); text-decoration: none; }

/* ── 交流与反馈：二维码 + 说明两栏 ── */
.community { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: var(--gap-5); align-items: start; }
@media (max-width: 760px) { .community { grid-template-columns: 1fr; } }
.community .qr { margin: 0; padding: 10px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.community .qr img { display: block; width: 100%; height: auto; border-radius: var(--r-md); }
.community .qr figcaption { margin-top: 8px; text-align: center; color: var(--text-3); font-size: var(--text-xs); }

/* ── 品牌标识（与应用 brand-logo 同构：竖排两行、括号等宽 / One 衬线 / THU 重黑） ── */
.brand { display: inline-flex; flex-direction: column; line-height: .92; font-size: 15px; }
.brand .b-r { display: flex; align-items: baseline; gap: 2px; }
.brand .b-r2 { margin-left: .5em; }
.brand .p { font-family: "SF Mono", Menlo, Consolas, monospace; color: var(--text-3); transform: scaleY(1.05); }
.brand .b-one { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.035em; }
.brand .b-thu { font-family: Inter, "SF Pro Display", "Helvetica Neue", system-ui, sans-serif; font-weight: 800; letter-spacing: -.02em; }

/* ── 按钮 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-1);
  font: inherit; font-size: var(--text-base); cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, background .12s ease, border-color .12s ease, color .12s ease;
}
.btn:hover { border-color: var(--border-strong); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-ghost { background: transparent; }
.btn-sm { height: 34px; padding: 0 14px; font-size: var(--text-sm); }

/* ── 首屏 ── */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border-soft); }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-in { position: relative; padding: 96px 0 84px; }
.hero .logo { color: var(--text-1); }
/* 两行锁排：(One 在上、THU) 在下并右移一格，括号纵向把两行夹住 */
.lockup { display: grid; grid-template-columns: max-content; gap: 0; align-items: baseline; line-height: .92; }
/* 两行错落：第二行整体右移，形成上下行 lockup（(One / THU)） */
.lockup .row { display: flex; align-items: baseline; gap: 2px; }
.lockup .p { font-family: var(--font-mono); font-weight: 400; color: var(--text-3); }
.lockup .one {
  font-family: Georgia, "Playfair Display", "Times New Roman", serif; font-weight: 500;
  letter-spacing: -.035em; font-size: clamp(56px, 9vw, 108px);
}
.lockup .thu {
  font-family: Inter, "SF Pro Display", "Helvetica Neue", system-ui, sans-serif; font-weight: 800;
  letter-spacing: -.02em; font-size: clamp(52px, 8.4vw, 100px);
}
.lockup .p-lg { font-size: clamp(56px, 9vw, 108px); }
.lockup .r2 { margin-left: clamp(28px, 6vw, 84px); }
@media (max-width: 520px) { .lockup .r2 { margin-left: 18px; } }
.hero h1 {
  margin: 28px 0 0; font-size: clamp(30px, 5vw, 52px); line-height: 1.15;
  letter-spacing: -.02em; font-weight: 700;
}
/* 首屏主张：One 衬线 · THUer 黑体 · should have 等宽 · 结句 (One/THU) 带括号上下两行 */
.claim .one { font-family: Georgia, "Playfair Display", "Times New Roman", serif; font-weight: 500; letter-spacing: -.03em; }
.claim .thuer { font-family: Inter, "SF Pro Display", "Helvetica Neue", system-ui, sans-serif; font-weight: 800; letter-spacing: -.02em; }
.claim .code { font-family: var(--font-mono); font-weight: 400; font-size: .78em; letter-spacing: -.02em; color: var(--text-2); }
.claim .mark { display: inline-block; vertical-align: baseline; letter-spacing: -.02em; text-align: left; }
.claim .mark .m-r { display: flex; align-items: baseline; gap: .03em; }
.claim .mark .m-r2 { margin-left: .42em; }
.claim .mark .mp { font-family: var(--font-mono); font-weight: 400; font-size: .8em; color: var(--text-3); }
.claim .mark .one, .claim .mark .thu { display: block; line-height: .9; }
.claim .mark .thu { font-family: Inter, "SF Pro Display", "Helvetica Neue", system-ui, sans-serif; font-weight: 800; }
.hero .slogan { margin-top: 14px; font-size: clamp(15px, 2vw, 18px); color: var(--text-2); }
.hero .slogan b { color: var(--text-1); }
.hero .cta { display: flex; flex-wrap: wrap; gap: var(--gap-3); margin-top: 30px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px;
  border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font-size: var(--text-xs);
}
.chip-accent { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.chip-mono { font-family: var(--font-mono); }

/* ── 区块骨架：编号方块 + 发丝分隔 ── */
section.block { position: relative; padding: 76px 0; border-bottom: 1px solid var(--border-soft); }
.sec-head { display: flex; align-items: baseline; gap: var(--gap-3); margin-bottom: 8px; }
.sec-num {
  flex: none; width: 26px; height: 26px; display: grid; place-items: center;
  background: var(--primary); color: var(--on-primary);
  border-radius: var(--r-sm); font-family: var(--font-mono); font-size: 12px;
}
.sec-title { font-size: clamp(20px, 2.6vw, 28px); font-weight: 700; letter-spacing: -.01em; margin: 0; }
.sec-sub { color: var(--text-2); margin: 6px 0 34px; max-width: 74ch; }

/* ── 功能卡：线性图标 + 线条 ── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap-4); }
.card {
  position: relative; padding: 20px 20px 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.card:hover { border-color: var(--accent-border); box-shadow: var(--shadow-2); transform: translateY(-2px); }
/* 图标瓦片：淡色底 + 单色线性 icon（替代旧配色块） */
.ic {
  flex: none; width: 38px; height: 38px; border-radius: 10px; margin-bottom: 14px;
  display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-1);
}
.ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic.tint-blue { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.ic.tint-green { background: var(--green-soft); border-color: rgba(34, 197, 94, .3); color: #16a34a; }
.ic.tint-amber { background: var(--amber-soft); border-color: rgba(217, 115, 13, .3); color: var(--amber); }
.ic.tint-red { background: var(--red-soft); border-color: rgba(229, 72, 77, .3); color: var(--red); }
.card h3 { margin: 0 0 6px; font-size: var(--text-md); font-weight: 650; }
.card p { margin: 0; color: var(--text-2); font-size: var(--text-sm); }
.card ul { margin: 10px 0 0; padding-left: 18px; color: var(--text-2); font-size: var(--text-sm); }
.card li { margin: 3px 0; }
.card .tag-row { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  height: 22px; display: inline-flex; align-items: center; padding: 0 9px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--text-3); font-size: var(--text-xxs);
}

/* 大片功能：左侧方块编号 + 右侧线条列表（几何语言的“块—线”构图） */
.feature-row { display: grid; grid-template-columns: 64px 1fr; gap: var(--gap-4); padding: 22px 0; border-top: 1px solid var(--border-soft); }
.feature-row:first-of-type { border-top: 0; }
.feature-row .idx { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--text-3); }
.feature-row h4 { margin: 0 0 6px; font-size: var(--text-md); }
.feature-row p { margin: 0; color: var(--text-2); font-size: var(--text-sm); max-width: 82ch; }
.feature-row .k { color: var(--text-1); font-weight: 600; }

/* ── 界面：完整截图一排横滑 ── */
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 252px; gap: var(--gap-4);
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
  padding: 4px 4px 18px; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail { cursor: grab; }
.rail.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.rail .shot { scroll-snap-align: start; }
.shot {
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow-1);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.shot:hover { border-color: var(--accent-border); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.shot img { width: 100%; height: auto; display: block; background: var(--bg); }
.shot .cap { display: flex; flex-direction: column; gap: 1px; padding: 9px 12px 10px; border-top: 1px solid var(--border-soft); }
.shot .cap b { font-size: var(--text-sm); font-weight: 650; }
.shot .cap span { color: var(--text-3); font-size: var(--text-xxs); }
@media (max-width: 640px) { .rail { grid-auto-columns: min(252px, 72vw); } }

/* ── 插件市场（与应用内市场同款卡片观感） ── */
.market-bar { display: flex; align-items: center; gap: var(--gap-3); flex-wrap: wrap; margin-bottom: var(--gap-4); }
.market-search {
  display: flex; align-items: center; gap: 8px; height: 38px; min-width: 240px; flex: 1 1 260px;
  padding: 0 14px; border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text-3);
}
.market-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; color: var(--text-1); }
.tabs { display: inline-flex; gap: 2px; padding: 2px; background: var(--surface-3); border-radius: var(--r-md); flex-wrap: wrap; }
.tab {
  border: 0; background: transparent; padding: 0 14px; height: 30px; border-radius: var(--r-sm);
  font: inherit; font-size: var(--text-sm); color: var(--text-2); cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--surface); color: var(--text-1); font-weight: 600; box-shadow: var(--shadow-1); }
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap-4); }
.market-card {
  display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 14px;
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  box-shadow: var(--shadow-1); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.market-card:hover { border-color: var(--accent-border); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.market-card .head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.market-card .name { font-size: var(--text-base); font-weight: 700; }
.market-card .stars {
  flex: none; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--amber);
  background: var(--amber-soft); border-radius: var(--r-pill); padding: 1px 8px;
}
.market-card .meta { color: var(--text-3); font-size: var(--text-xs); font-family: var(--font-mono); }
.market-card .desc { color: var(--text-2); font-size: var(--text-sm); min-height: 40px; }
.market-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--border-soft); }
.market-card .repo { font-family: var(--font-mono); font-size: var(--text-xxs); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62%; }
.market-empty { padding: 36px 0; text-align: center; color: var(--text-3); font-size: var(--text-sm); }
.skeleton-card { height: 148px; border-radius: var(--r-lg); border: 1px solid var(--border-soft); background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: sk 1.1s ease infinite; }
@keyframes sk { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }

/* ── 下载区 ── */
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--gap-3); margin-top: 22px; }
.dl a {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border);
  border-radius: var(--r-lg); background: var(--surface); color: var(--text-1);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.dl a:hover { border-color: var(--accent); text-decoration: none; box-shadow: var(--shadow-2); }
.dl a.is-current { border-color: var(--accent); background: var(--accent-soft); }
.dl .ic { width: 30px; height: 30px; border-radius: 8px; margin-bottom: 0; }
.dl .ic svg { width: 16px; height: 16px; }
.dl .t { font-weight: 600; font-size: var(--text-sm); }
.dl .s { color: var(--text-3); font-size: var(--text-xs); font-family: var(--font-mono); }

/* ── 下载渠道：GitHub Releases 与清华云盘并排、等权重 ── */
.channels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-3); margin-top: 18px; }
@media (max-width: 640px) { .channels { grid-template-columns: 1fr; } }
.channels .ch {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px; border: 1px solid var(--border);
  border-radius: var(--r-lg); background: var(--surface); color: var(--text-1);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.channels .ch:hover { border-color: var(--accent); text-decoration: none; box-shadow: var(--shadow-2); }
.channels .ch .ic { width: 34px; height: 34px; border-radius: 9px; margin-bottom: 0; }
.channels .ch .ic svg { width: 18px; height: 18px; }
.channels .ch .t { font-weight: 600; font-size: var(--text-base); }
.channels .ch .s { color: var(--text-3); font-size: var(--text-xs); font-family: var(--font-mono); }
.dl-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.dl-item.is-current { border-color: var(--accent); background: var(--accent-soft); }

/* ── 仓库 / 链接行 ── */
.repos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap-3); }
.repo-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border-soft); border-radius: var(--r-md); background: var(--surface); }
.repo-row .dot { width: 8px; height: 8px; background: var(--accent); border-radius: 2px; flex: none; }
.repo-row .n { font-family: var(--font-mono); font-size: var(--text-sm); }
.repo-row .d { color: var(--text-3); font-size: var(--text-xs); }

/* ── 页脚 ── */
footer.bot { padding: 46px 0 60px; color: var(--text-3); font-size: var(--text-sm); }
footer.bot .cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--gap-4); margin-bottom: 26px; }
footer.bot h5 { margin: 0 0 8px; font-size: var(--text-xs); color: var(--text-2); letter-spacing: .04em; }
footer.bot a { color: var(--text-2); display: block; padding: 2px 0; }
footer.bot .fine { border-top: 1px solid var(--border-soft); padding-top: 18px; line-height: 1.8; }

/* ── 滚动显现 ── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s cubic-bezier(.2,.7,.3,1), transform .5s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ── 子页页头 ── */
.page-head { position: relative; overflow: hidden; border-bottom: 1px solid var(--border-soft); }
.page-head canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.page-head-in { position: relative; padding: 64px 0 52px; }
.page-head h1 { margin: 10px 0 8px; font-size: clamp(26px, 4vw, 40px); letter-spacing: -.02em; }
.page-head p { margin: 0; color: var(--text-2); max-width: 70ch; }
.crumb { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-3); }
.section-link { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); }
