/* ============================================================
   Plobi.top — 团队介绍 + 产品陈列
   单页静态样式：中性色板 / 真实字体排印 / 无装饰性效果
   零外部依赖：只用系统字体，不请求任何 CDN
   ============================================================ */

/* ─── 字体栈（全部系统内置，零网络请求）──────────────────── */
:root {
  --font-display: Georgia, 'Times New Roman', 'Songti SC', 'Noto Serif CJK SC', 'Noto Serif SC', 'Source Han Serif SC', serif;
  --font-ui: system-ui, -apple-system, 'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  --r-sm: 6px;
  --r-md: 8px;
  --trans: .18s cubic-bezier(.4, 0, .2, 1);
  --maxw: 1100px;
  --nav-h: 60px;
}

/* ─── 浅色：纸 ────────────────────────────────────────────── */
:root {
  color-scheme: light;
  --bg:    #fbfaf8;
  --bg2:   #f4f2ee;
  --bg3:   #eae7e1;
  --border:      rgba(26, 26, 25, .12);
  --border-h:    rgba(26, 26, 25, .32);
  --text:  #1a1a19;
  --text2: #4f4d49;
  --text3: #6e6b66;
  --card:         #ffffff;
  --card-border:  rgba(26, 26, 25, .10);
  --accent:    #2f6d4f;
  --accent-b:  #1f5138;
  --accent-soft: rgba(47, 109, 79, .07);
  --nav-bg: rgba(251, 250, 248, .9);
}

/* ─── 深色：墨（跟随系统 / 手动指定，两处同值）──────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:    #101110;
    --bg2:   #171817;
    --bg3:   #1e1f1e;
    --border:      rgba(255, 255, 255, .10);
    --border-h:    rgba(255, 255, 255, .28);
    --text:  #eceae6;
    --text2: #a9a5a0;
    --text3: #8a8782;
    --card:         #171817;
    --card-border:  rgba(255, 255, 255, .09);
    --accent:    #6fc99a;
    --accent-b:  #4fa877;
    --accent-soft: rgba(111, 201, 154, .10);
    --nav-bg: rgba(16, 17, 16, .9);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:    #101110;
  --bg2:   #171817;
  --bg3:   #1e1f1e;
  --border:      rgba(255, 255, 255, .10);
  --border-h:    rgba(255, 255, 255, .28);
  --text:  #eceae6;
  --text2: #a9a5a0;
  --text3: #8a8782;
  --card:         #171817;
  --card-border:  rgba(255, 255, 255, .09);
  --accent:    #6fc99a;
  --accent-b:  #4fa877;
  --accent-soft: rgba(111, 201, 154, .10);
  --nav-bg: rgba(16, 17, 16, .9);
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%;
  /* 窄屏防横向溢出：
     clip 不创建滚动容器（不会破坏 position:sticky），也不像 hidden 那样掩盖真实溢出 */
  overflow-x: clip;
  /* 长英文词 / URL / 备案号在窄屏允许断行，避免撑破容器 */
  overflow-wrap: break-word;
}
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  /* 原 body{overflow-x:hidden} 已移除：它会建立滚动容器并掩盖真实溢出，
     防溢出统一交给 html{overflow-x:clip} */
  transition: background var(--trans), color var(--trans);
}
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; color: inherit; }
ul, ol { list-style: none; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.015em; }
::selection { background: var(--accent); color: var(--bg); }

/* 焦点可见：键盘操作时必须看得见 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ─── 跳转到主内容 ───────────────────────────────────────── */
/* 原实现 left:-9999px 会让元素盒子真实越界到视口左侧之外，
   在窄屏检测里被计为"溢出元素"，且可能被某些裁剪策略真的切掉。
   改用 clip-path 的视觉隐藏：盒子始终停留在视口内的 1px 位置。 */
.skip {
  position: absolute; left: 0; top: 0; z-index: 200;
  transform: translateY(-120%);
  background: var(--accent); color: #fff;
  padding: .6rem 1rem; border-radius: 0 0 var(--r-sm) 0; font-size: .85rem; font-weight: 700;
}
.skip:focus { transform: translateY(0); }

/* ─── 顶栏 ───────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: var(--maxw); height: 100%; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.02rem; min-width: 0; }
.brand-mark { color: var(--accent); }
.brand-sub { font-family: var(--font-mono); font-size: .64rem; color: var(--text3); letter-spacing: .08em; }
.topnav { display: flex; align-items: center; gap: .3rem; min-width: 0; flex-wrap: wrap; }
.topnav a {
  padding: .34rem .7rem; border-radius: var(--r-sm);
  font-size: .8rem; font-weight: 700; color: var(--text2);
  transition: color var(--trans), background var(--trans);
}
.topnav a:hover { color: var(--accent); background: var(--accent-soft); }

.theme-btn {
  display: inline-flex; align-items: center; gap: .34rem;
  height: 30px; padding: 0 .6rem;
  background: transparent; border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text2); font-size: .72rem; font-weight: 700;
  transition: color var(--trans), border-color var(--trans), background var(--trans);
}
.theme-btn:hover { color: var(--accent); border-color: var(--border-h); background: var(--accent-soft); }
.theme-btn svg { width: 14px; height: 14px; }
.ico { display: none; }
:root:not([data-theme]) .ico-sys  { display: block; }
:root[data-theme="light"] .ico-light { display: block; }
:root[data-theme="dark"]  .ico-dark  { display: block; }

/* ─── 布局 ───────────────────────────────────────────────── */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; min-width: 0; }
.section { padding: 4.5rem 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-label {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font-mono); font-size: .72rem; font-weight: 700;
  color: var(--accent); letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: .55rem; max-width: 100%; overflow-wrap: break-word;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.2vw, 2.35rem);
  line-height: 1.12;
}
.section-sub { margin-top: .6rem; color: var(--text2); font-size: .93rem; max-width: 46rem; min-width: 0; overflow-wrap: break-word; }
.prose { min-width: 0; overflow-wrap: break-word; }
.prose p { font-size: .97rem; color: var(--text2); line-height: 1.85; margin-bottom: 1rem; overflow-wrap: break-word; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--text); font-weight: 700; }

/* ─── Hero ───────────────────────────────────────────────── */
.hero { padding: 5.5rem 0 4.5rem; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: .3rem .9rem; font-family: var(--font-mono); font-size: .7rem;
  color: var(--accent); letter-spacing: .06em;
}
.hero-badge .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 5.6rem);
  line-height: 1; letter-spacing: -.03em;
  margin: 1.6rem 0 0;
}
.hero h1 .en { color: var(--accent); }
.hero-tagline {
  margin-top: 1.6rem; max-width: 40rem;
  font-size: clamp(1rem, 1.9vw, 1.15rem); color: var(--text); line-height: 1.75;
  min-width: 0; overflow-wrap: break-word;
}
.hero-note {
  margin-top: .9rem; max-width: 40rem; color: var(--text2); font-size: .93rem; line-height: 1.8;
  min-width: 0; overflow-wrap: break-word;
}
.hero-cta { margin-top: 2.2rem; display: flex; gap: .7rem; flex-wrap: wrap; min-width: 0; }
.hero-tags {
  margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: .45rem;
  /* 每个标签独立成行约束：标签本体过长时在窄屏内部断行，不撑破行容器 */
  min-width: 0; max-width: 100%;
}
.hero-tags span {
  font-family: var(--font-mono); font-size: .7rem; color: var(--text3);
  border: 1px solid var(--border); border-radius: var(--r-sm); padding: .22rem .6rem;
  /* 不使用 white-space:nowrap —— 窄屏允许标签内部换行 */
  white-space: normal; overflow-wrap: break-word; max-width: 100%;
}

/* ─── 按钮 ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .58rem 1.25rem; border-radius: var(--r-md);
  font-size: .85rem; font-weight: 700; border: 1px solid transparent;
  transition: filter var(--trans), color var(--trans), border-color var(--trans), background var(--trans);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text2); border-color: var(--border); }
.btn-ghost:hover { color: var(--accent); border-color: var(--border-h); background: var(--accent-soft); }
.btn-sm { padding: .38rem .82rem; font-size: .78rem; }

/* ─── 卡片 ───────────────────────────────────────────────── */
.grid {
  display: grid;
  /* minmax(0,1fr) 而非 minmax(300px,1fr)：
       300px 的下限在 <300px 视口 + padding 下会撑破容器造成横向溢出 */
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 1.1rem;
  margin-top: 2.2rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  padding: 1.35rem;
  display: flex; flex-direction: column; gap: .7rem;
  /* flex/grid 子项默认 min-width:auto，长内容会顶破卡片 */
  min-width: 0; overflow-wrap: break-word;
  transition: border-color var(--trans);
}
.card:hover { border-color: var(--border-h); }
.card-head { display: flex; align-items: baseline; gap: .55rem; flex-wrap: wrap; min-width: 0; }
.card-name { font-weight: 700; font-size: 1rem; min-width: 0; }
.card-en { font-family: var(--font-mono); font-size: .7rem; color: var(--text3); overflow-wrap: break-word; min-width: 0; }
.card-desc { font-size: .85rem; color: var(--text2); line-height: 1.7; min-width: 0; overflow-wrap: break-word; }
.card-meta { display: flex; gap: .4rem; flex-wrap: wrap; min-width: 0; }
.tag {
  font-size: .68rem; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--border);
  border-radius: 20px; padding: .16rem .58rem;
  white-space: normal; overflow-wrap: break-word; max-width: 100%;
}
.tag-plain { color: var(--text3); background: var(--bg3); border-color: transparent; }
.badge-comp {
  font-size: .68rem; font-weight: 700; color: var(--accent-b);
  background: var(--accent-soft); border: 1px solid var(--border-h);
  border-radius: var(--r-sm); padding: .16rem .58rem;
}
.card-note { font-size: .72rem; color: var(--text3); font-family: var(--font-mono); overflow-wrap: break-word; min-width: 0; }
.card-links { margin-top: auto; padding-top: .5rem; display: flex; gap: .4rem; flex-wrap: wrap; min-width: 0; }
.card-links a {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .78rem; font-weight: 700; color: var(--text2);
  border: 1px solid var(--border); border-radius: var(--r-sm); padding: .32rem .7rem;
  max-width: 100%; overflow-wrap: break-word; min-width: 0;
  transition: color var(--trans), border-color var(--trans), background var(--trans);
}
.card-links a:hover { color: var(--accent); border-color: var(--border-h); background: var(--accent-soft); }
.card-links a svg { width: 11px; height: 11px; }
.card-links .ext { color: var(--text3); font-family: var(--font-mono); font-size: .62rem; }

/* ─── 个人网站入口 ───────────────────────────────────────── */
.more-card {
  margin-top: 2.2rem;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--r-md); padding: 1.8rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.2rem; flex-wrap: wrap;
  min-width: 0; overflow-wrap: break-word;
  transition: border-color var(--trans);
}
.more-card:hover { border-color: var(--border-h); }
.more-card > div { min-width: 0; flex: 1 1 16rem; }
.more-card h3 { font-family: var(--font-display); font-size: 1.25rem; margin-bottom: .3rem; }
.more-card p { font-size: .88rem; color: var(--text2); }

/* ─── 页脚 ───────────────────────────────────────────────── */
footer { border-top: 1px solid var(--border); padding: 2.2rem 0 2.6rem; }
.foot-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: .8rem; flex-wrap: wrap; min-width: 0;
}
.foot-brand { font-weight: 800; color: var(--accent); font-size: .92rem; }
.foot-copy { font-size: .78rem; color: var(--text3); font-family: var(--font-mono); overflow-wrap: break-word; min-width: 0; }
/* 工信部令 33 号第十三条：备案号置于页面底部中央 */
.foot-filings {
  margin-top: 1.1rem; text-align: center;
  display: flex; gap: .5rem 1.1rem; justify-content: center; flex-wrap: wrap;
  min-width: 0;
}
.foot-filings a {
  font-size: .76rem; color: var(--text2); font-family: var(--font-mono);
  border-bottom: 1px solid transparent;
  max-width: 100%; overflow-wrap: break-word; min-width: 0;
  transition: color var(--trans), border-color var(--trans);
}
.foot-filings a:hover { color: var(--accent); border-bottom-color: var(--border-h); }

/* ─── 响应式 ─────────────────────────────────────────────── */
@media (max-width: 760px) {
  .wrap { padding: 0 1.15rem; }
  .section { padding: 3.2rem 0; }
  .hero { padding: 3.6rem 0 3rem; }
  .grid { grid-template-columns: 1fr; margin-top: 1.6rem; }
  .topnav { display: none; }
  .more-card { padding: 1.35rem; }
  .brand-sub { display: none; }
}

/* 窄屏（<= 480px）：容器内边距与字号再收紧，保证中文/英文长词都能在
   375px 视口内自然换行，任何一行都不越出右边界 */
@media (max-width: 480px) {
  .wrap { padding: 0 1rem; }
  .card { padding: 1.1rem; }
  .more-card { padding: 1.15rem; }
  .hero h1 { font-size: clamp(2.5rem, 14vw, 3.2rem); }
  .hero-tags { gap: .4rem; }
  .hero-tags span { font-size: .66rem; padding: .2rem .5rem; }
  .card-links a { font-size: .74rem; padding: .3rem .55rem; }
  .foot-filings { gap: .4rem .8rem; }
  .foot-filings a { font-size: .7rem; }
  /* 主题按钮在窄屏只留图标，避免挤压品牌区 */
  .theme-btn { padding: 0 .5rem; }
  #themeLabel { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ─── 打印 ───────────────────────────────────────────────── */
@media print {
  .topbar, .theme-btn { display: none; }
  body { background: #fff; color: #000; }
}
