/* ============================================================
 *  QuiID · 样式
 *  暗色优先 / 毛玻璃 / 移动端优先；深浅色用 [data-theme] 切换
 * ============================================================ */

:root,
[data-theme="dark"] {
  --bg: #12141c;
  --bg-soft: #171a24;
  --panel: rgba(255, 255, 255, 0.055);
  --panel-solid: #1b1e29;
  --panel-hover: rgba(255, 255, 255, 0.09);
  --text: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.68);
  --text-dim: rgba(255, 255, 255, 0.42);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --accent: #6c8cff;
  --accent-soft: rgba(108, 140, 255, 0.16);
  --accent-text: #a8bcff;
  --danger: #ff6b6b;
  --success: #4ade80;
  --warn: #fbbf24;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.44);
  --blur: blur(22px) saturate(180%);
  --radius: 18px;
  --radius-sm: 11px;
}

[data-theme="light"] {
  --bg: #eef1f7;
  --bg-soft: #f6f8fc;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;
  --panel-hover: rgba(255, 255, 255, 0.95);
  --text: #171a21;
  --text-soft: rgba(23, 26, 33, 0.66);
  --text-dim: rgba(23, 26, 33, 0.4);
  --border: rgba(150, 165, 195, 0.4);
  --border-strong: rgba(130, 148, 185, 0.6);
  --accent: #3d64f4;
  --accent-soft: rgba(61, 100, 244, 0.1);
  --accent-text: #2f52d6;
  --danger: #dc3d3d;
  --success: #15803d;
  --warn: #b45309;
  --shadow: 0 12px 40px rgba(40, 55, 90, 0.14);
  --blur: blur(22px) saturate(180%);
  --radius: 18px;
  --radius-sm: 11px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* 内嵌 SVG 图标：跟随父级字号与文字颜色，避免 iconify CDN 不可用时图标空白 */
.quiid-icon { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.quiid-icon > svg { width: 1em; height: 1em; display: block; }
/* 实心图标（默认）：用当前文字色填充 */
.quiid-icon > svg:not([fill="none"]) { fill: currentColor; }
/* 描边图标：显式标了 fill="none" 的，不强制填充，交给它自己的 stroke 属性 */
.quiid-icon > svg[fill="none"] { fill: none; }
/* 方形图标容器内的内嵌图标：撑满容器而不是跟随字号 */
.item-icon > .quiid-icon, .app-icon > .quiid-icon { width: 100%; height: 100%; border-radius: inherit; overflow: hidden; font-size: 25px; }
.item-icon > .quiid-icon > svg, .app-icon > .quiid-icon > svg { width: 100%; height: 100%; }
.app-icon > .quiid-icon { font-size: 22px; }
.nav-icon { font-size: 17px; }
.hero-icon-link .quiid-icon { font-size: 20px; }
.social-link .quiid-icon { font-size: 19px; }

body {
  font-family: "HarmonyOS Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s, color 0.35s;
  overflow-x: hidden;
}

/* ---------- 背景 ---------- */
/* 底色渐变兜底：背景图加载失败（网络/缓存）时也不会是一片死黑 */
.bg-layer { position: fixed; inset: 0; z-index: -3; background: var(--bg-soft); }
.bg-img {
  width: 100%; height: 100%; object-fit: cover;
  filter: blur(26px) brightness(0.34) saturate(1.2);
  transform: scale(1.16);
  transition: filter 0.4s, opacity 0.4s;
}
[data-theme="light"] .bg-img { filter: blur(26px) brightness(1.06) saturate(1.15); opacity: 0.7; }
.bg-mask {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(circle at 50% 0%, transparent 0%, var(--bg) 78%);
}
.bg-canvas { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.5; }

/* ---------- 加载动画 ---------- */
.loader {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); transition: opacity 0.4s;
}
.loader.hide { opacity: 0; pointer-events: none; }
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 顶部导航 ---------- */
.topnav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px max(20px, calc((100vw - 1120px) / 2));
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; letter-spacing: -0.01em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), #9d7bff);
  color: #fff; font-size: 16px; font-weight: 800;
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px; border-radius: 9px;
  font-size: 14px; color: var(--text-soft); text-decoration: none;
  transition: 0.2s; white-space: nowrap;
}
.nav-link:hover { background: var(--panel); color: var(--text); }
.nav-link.active { color: var(--text); background: var(--panel); }
.nav-user { display: flex; align-items: center; gap: 8px; }
.nav-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--border-strong); }
.nav-user-name { font-size: 14px; font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 主题切换 ---------- */
.theme-toggle {
  position: fixed; top: 12px; right: 16px; z-index: 45;
  width: 36px; height: 36px; border-radius: 11px;
  background: var(--panel); border: 1px solid var(--border);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  color: var(--text); font-size: 15px; cursor: pointer;
  display: grid; place-items: center; transition: 0.25s;
}
.theme-toggle:hover { background: var(--panel-hover); transform: translateY(-1px); }
.topnav { padding-right: 68px; }

#scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent), #9d7bff);
  z-index: 50; transition: width 0.1s linear;
}

/* ---------- 布局 ---------- */
main { width: min(100% - 40px, 1120px); margin: 0 auto; padding: 0 0 70px; }
.section { margin-top: 54px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-title { font-size: clamp(20px, 3.4vw, 27px); font-weight: 700; letter-spacing: -0.02em; }
.section-sub { display: block; margin-top: 5px; font-size: 13.5px; color: var(--accent-text); font-weight: 600; }
.section-more {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 14px; color: var(--accent-text); text-decoration: none; font-weight: 600;
}
.section-more:hover { gap: 6px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  margin: 42px 0 34px;
  padding: clamp(34px, 7vw, 76px) clamp(24px, 5vw, 56px);
  border-radius: 26px;
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.hero-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(circle at 30% 20%, #000 0%, transparent 62%);
  -webkit-mask-image: radial-gradient(circle at 30% 20%, #000 0%, transparent 62%);
}
.hero-orbit {
  position: absolute; border: 1px solid var(--border); border-radius: 50%;
  pointer-events: none;
}
.hero-orbit-a { width: 420px; height: 420px; top: -180px; right: -120px; }
.hero-orbit-b { width: 620px; height: 620px; top: -280px; right: -200px; opacity: 0.5; }
.hero-content { position: relative; z-index: 1; max-width: 760px; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.16em;
  color: var(--text-dim); text-transform: uppercase; margin-bottom: 20px;
  flex-wrap: wrap;
}
.hero-kicker i { width: 22px; height: 1px; background: var(--border-strong); display: inline-block; }
.hero-title {
  font-size: clamp(38px, 9vw, 80px);
  line-height: 0.98; font-weight: 800; letter-spacing: -0.035em;
  margin-bottom: 20px;
}
.hero-title span { display: block; }
.hero-title em { font-style: italic; font-weight: 400; color: var(--accent-text); }
.hero-desc {
  font-size: clamp(14.5px, 2vw, 17px);
  color: var(--text-soft); max-width: 620px; line-height: 1.75;
}
.hero-actions { display: flex; align-items: center; gap: 11px; margin-top: 28px; flex-wrap: wrap; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 12px 22px; border-radius: 12px;
  background: linear-gradient(140deg, var(--accent), #9d7bff);
  color: #fff; text-decoration: none; font-size: 14.5px; font-weight: 650;
  border: none; cursor: pointer; transition: 0.25s;
  box-shadow: 0 6px 22px rgba(108, 140, 255, 0.32);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(108, 140, 255, 0.42); }
.hero-icon-link {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--text); font-size: 20px; text-decoration: none; transition: 0.25s;
}
.hero-icon-link:hover { background: var(--panel-hover); transform: translateY(-2px); border-color: var(--border-strong); }

/* ---------- 自述卡 ---------- */
.about-card-wrap { margin-bottom: 8px; }
.about-card {
  padding: clamp(24px, 4vw, 34px);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-solid) 88%, transparent);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}
.about-text { font-size: clamp(14.5px, 2vw, 16.5px); color: var(--text-soft); line-height: 1.85; }
.about-text b { color: var(--text); font-weight: 700; }
.about-foot {
  display: flex; align-items: center; gap: 15px;
  margin-top: 26px; padding-top: 24px;
  border-top: 1px solid var(--border);
}
.about-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2.5px solid var(--panel-solid); }
.about-name { font-size: 18px; font-weight: 700; }
.about-title { font-size: 13.5px; color: var(--text-dim); }

/* ---------- 项目分组 ---------- */
.group { margin-top: 46px; }
.group-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.group-title { font-size: 19px; font-weight: 700; }
.group-desc { font-size: 13.5px; color: var(--text-dim); }
.group-items { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .group-items { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (min-width: 1024px) { .group-items { grid-template-columns: repeat(3, 1fr); } }

.item {
  display: flex; align-items: center; gap: 15px;
  padding: 17px 18px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--border);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  transition: 0.26s; text-decoration: none; color: inherit;
}
/* 卡片本体 hover：只做轻微的底色/描边反馈，不上浮、不投影（避免整块卡片跳起来） */
.item:hover { background: var(--panel-hover); border-color: var(--border-strong); }
.item-icon {
  position: relative; flex-shrink: 0;
  width: 50px; height: 50px; border-radius: 14px; overflow: hidden;
  display: grid; place-items: center;
  background: var(--accent-soft); font-size: 25px; color: var(--accent-text);
}
.item-icon img, .item-icon svg { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.item-tag {
  position: absolute; top: -5px; right: -5px;
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px;
  background: linear-gradient(140deg, var(--accent), #9d7bff); color: #fff;
  white-space: nowrap;
}
.item-body { flex: 1; min-width: 0; }
.item-name { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.item-desc { font-size: 13px; color: var(--text-soft); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { font-size: 11.5px; color: var(--text-dim); margin-top: 5px; }
.item-go {
  flex-shrink: 0; padding: 7px 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text);
  font-size: 13px; font-weight: 650; transition: 0.24s; white-space: nowrap;
}
/* 「开始」按钮：变色只由按钮自身 hover 触发，卡片 hover 不再带它变色。
   ⚠️ 这里两条规则特异性都是 0-3-0（.item + :hover + .item-go），必须靠源序决定胜负，
   所以「按钮自身 hover」那条一定写在后面；也不要删掉父级那条，否则会回落到 .item-go 的基础色。 */
.item:hover .item-go { background: var(--accent-soft); color: var(--accent-text); }
.item:hover .item-go:hover { background: var(--accent); color: #fff; }

/* ---------- 最新动态 ---------- */
.feed-rail {
  display: flex; gap: 18px; overflow-x: auto; padding-bottom: 12px;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.feed-rail::-webkit-scrollbar { display: none; }
.feed-card {
  flex-shrink: 0; width: 300px; scroll-snap-align: start;
  padding: 22px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--border);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  display: flex; flex-direction: column; transition: 0.26s;
  text-decoration: none; color: inherit; min-height: 178px;
}
.feed-card:hover { background: var(--panel-hover); transform: translateY(-3px); border-color: var(--border-strong); }
.feed-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.feed-badge {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text);
}
.feed-date { font-size: 11.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.feed-title { font-size: 15.5px; font-weight: 700; line-height: 1.45; margin-bottom: 9px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.feed-notes { margin-top: auto; display: flex; flex-direction: column; gap: 5px; }
.feed-note { font-size: 12.5px; color: var(--text-soft); padding-left: 13px; position: relative;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-note::before { content: ""; position: absolute; left: 3px; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: var(--text-dim); }
.feed-skel { flex-shrink: 0; width: 300px; height: 178px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ---------- 页脚 ---------- */
.footer { margin-top: 64px; padding-top: 34px; border-top: 1px solid var(--border); text-align: center; }
.social { display: flex; justify-content: center; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.social-link {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--text-soft); font-size: 19px; text-decoration: none; transition: 0.24s;
}
.social-link:hover { background: var(--panel-hover); color: var(--text); transform: translateY(-2px); }
.hitokoto { font-size: 13.5px; color: var(--text-soft); margin-bottom: 12px; }
.copyright { font-size: 12.5px; color: var(--text-dim); }
.beian { margin-top: 9px; font-size: 12.5px; }
.beian a { color: var(--text-dim); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.beian img { width: 15px; height: 15px; }
.beian a:hover { color: var(--text-soft); }

/* ---------- 浮动工具栏 ---------- */
.float-bar { position: fixed; right: 16px; bottom: 22px; z-index: 40; display: flex; flex-direction: column; gap: 9px; }
.float-btn {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--border);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  color: var(--text); font-size: 15px; cursor: pointer;
  display: grid; place-items: center; transition: 0.24s;
}
.float-btn:hover { background: var(--panel-hover); transform: translateY(-2px); }

/* ---------- 模态 ---------- */
/* 注意：.modal 用了 display:grid，会覆盖 hidden 属性的默认 display:none，
   必须显式声明 [hidden]，否则弹窗一进页面就显示出来。 */
.modal[hidden] { display: none !important; }
.modal { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); padding: 20px; }
.modal-box {
  position: relative; width: min(100%, 340px); padding: 28px;
  border-radius: var(--radius); background: var(--panel-solid);
  border: 1px solid var(--border); box-shadow: var(--shadow); text-align: center;
}
.modal-box h3 { font-size: 16px; margin-bottom: 16px; }
.modal-close { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: 8px; border: none; background: var(--panel); color: var(--text); cursor: pointer; }
/* 二维码：本地 Canvas 生成（白底黑码，扫码识别率最高） */
.qr-canvas {
  display: block; width: 100%; max-width: 260px; height: auto;
  margin: 0 auto; border-radius: 12px; padding: 8px; background: #fff;
}
.modal-tip { margin-top: 13px; font-size: 12.5px; color: var(--text-dim); }

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 22px);
  padding: 11px 22px; border-radius: 12px;
  background: var(--panel-solid); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow); font-size: 14px;
  opacity: 0; pointer-events: none; transition: 0.3s; z-index: 70; max-width: 84vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 表单 / 卡片（登录注册与控制台共用） ---------- */
.narrow { width: min(100%, 440px); margin: 0 auto; }
.panel {
  padding: clamp(26px, 5vw, 40px); border-radius: 22px;
  background: color-mix(in srgb, var(--panel-solid) 92%, transparent);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.panel-title { font-size: 25px; font-weight: 750; letter-spacing: -0.025em; margin-bottom: 7px; }
.panel-sub { font-size: 14px; color: var(--text-soft); margin-bottom: 28px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-soft); margin-bottom: 7px; }
.input {
  width: 100%; padding: 13px 15px; border-radius: var(--radius-sm);
  background: var(--panel); border: 1px solid var(--border);
  color: var(--text); font-size: 15px; font-family: inherit;
  transition: 0.22s; outline: none;
}
.input::placeholder { color: var(--text-dim); }
.input:focus { border-color: var(--accent); background: var(--panel-hover); box-shadow: 0 0 0 3.5px var(--accent-soft); }
.input-row { display: flex; gap: 10px; }
.input-row .input { flex: 1; }
.btn {
  width: 100%; padding: 14px; border-radius: var(--radius-sm);
  background: linear-gradient(140deg, var(--accent), #9d7bff);
  color: #fff; font-size: 15px; font-weight: 650; font-family: inherit;
  border: none; cursor: pointer; transition: 0.24s; margin-top: 6px;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(108, 140, 255, 0.34); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-ghost {
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  box-shadow: none; width: auto; padding: 10px 18px; font-size: 14px;
}
.btn-ghost:hover:not(:disabled) { background: var(--panel-hover); box-shadow: none; }
.btn-danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: rgba(255, 107, 107, 0.1); box-shadow: none; }
.form-note { margin-top: 20px; font-size: 13px; color: var(--text-dim); text-align: center; }
.form-note a { color: var(--accent-text); text-decoration: none; font-weight: 600; }
.form-note a:hover { text-decoration: underline; }
.alert { padding: 11px 15px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 16px; display: none; }
.alert.show { display: block; }
.alert-error { background: rgba(255, 107, 107, 0.12); color: var(--danger); border: 1px solid rgba(255, 107, 107, 0.28); }
.alert-success { background: rgba(74, 222, 128, 0.12); color: var(--success); border: 1px solid rgba(74, 222, 128, 0.28); }
.hint { font-size: 12.5px; color: var(--text-dim); margin-top: 6px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--text-dim); font-size: 12.5px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- 控制台 ---------- */
.console-grid { display: grid; gap: 20px; grid-template-columns: 1fr; margin-top: 34px; }
@media (min-width: 900px) { .console-grid { grid-template-columns: 340px 1fr; align-items: start; } }
.profile-card { text-align: center; }
.profile-avatar {
  width: 92px; height: 92px; border-radius: 50%; object-fit: cover;
  margin: 0 auto 16px; border: 3px solid var(--panel-solid); display: block;
  background: var(--accent-soft);
}
.profile-name { font-size: 21px; font-weight: 750; }
.profile-email { font-size: 13.5px; color: var(--text-dim); margin-top: 3px; }
.profile-uid {
  display: inline-block; margin-top: 12px; padding: 4px 11px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; color: var(--text-soft);
}
.tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  padding: 11px 16px; border: none; background: none; color: var(--text-dim);
  font-size: 14.5px; font-weight: 600; font-family: inherit; cursor: pointer;
  border-bottom: 2px solid transparent; transition: 0.22s; white-space: nowrap;
}
.tab:hover { color: var(--text-soft); }
.tab.active { color: var(--accent-text); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.app-row {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 0; border-bottom: 1px solid var(--border);
}
.app-row:last-child { border-bottom: none; }
.app-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--accent-soft);
  color: var(--accent-text); font-size: 22px; overflow: hidden;
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-info { flex: 1; min-width: 0; }
.app-name { font-size: 15px; font-weight: 650; }
.app-meta { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-actions { flex-shrink: 0; }
.empty { padding: 44px 20px; text-align: center; color: var(--text-dim); font-size: 14px; }
.empty-icon { font-size: 38px; margin-bottom: 12px; opacity: 0.5; }

/* ---------- 文档页 ---------- */
.doc { max-width: 800px; }
.doc h2 { font-size: 24px; font-weight: 750; margin: 40px 0 14px; letter-spacing: -0.02em; }
.doc h2:first-of-type { margin-top: 0; }
.doc h3 { font-size: 17.5px; font-weight: 700; margin: 28px 0 10px; }
.doc p { font-size: 14.5px; color: var(--text-soft); margin-bottom: 14px; line-height: 1.85; }
.doc ul, .doc ol { margin: 0 0 16px 22px; font-size: 14.5px; color: var(--text-soft); line-height: 1.9; }
.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
  padding: 2px 7px; border-radius: 6px; background: var(--panel); border: 1px solid var(--border);
  color: var(--accent-text);
}
.code-block {
  position: relative; margin: 16px 0 22px; padding: 20px;
  border-radius: var(--radius-sm); background: var(--panel-solid);
  border: 1px solid var(--border); overflow-x: auto;
}
.code-block pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.8px; line-height: 1.72; color: var(--text); white-space: pre; }
.code-block .copy-btn {
  position: absolute; top: 11px; right: 11px; padding: 5px 11px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--border); color: var(--text-soft);
  font-size: 12px; font-family: inherit; cursor: pointer; transition: 0.2s;
}
.code-block .copy-btn:hover { background: var(--panel-hover); color: var(--text); }

/* ---------- 令牌区（默认遮罩，点击才展示，10 秒自动隐藏） ---------- */
.token-block { padding: 0; overflow: hidden; }
/* ★ 兜底：任何带 display 的元素都会覆盖 hidden 属性的默认 display:none，
   .token-mask 是 flex、.token-body 是 block，所以必须显式声明一遍。 */
.token-mask[hidden], .token-body[hidden] { display: none !important; }
.token-mask {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; padding: 18px 20px;
}
.token-mask-text { font-size: 13px; color: var(--text-dim); }
/* 遮罩态下的「显示令牌」按钮：走普通文档流，不用 copy-btn 的绝对定位 */
.token-mask .btn { width: auto; margin: 0; padding: 8px 16px; font-size: 13px; }

.token-body { padding: 18px 20px; }
.token-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.token-countdown { font-size: 12.5px; font-weight: 650; color: var(--accent-text); }
.token-actions { display: flex; gap: 8px; }
/* 令牌区内的按钮跟随文档流，整齐排在标题行右侧 */
.token-actions .copy-btn {
  position: static; top: auto; right: auto;
}
.token-body pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.8px; line-height: 1.72; color: var(--text);
  word-break: break-all; white-space: pre-wrap; margin: 0;
}
.endpoint {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 13px 16px; border-radius: var(--radius-sm);
  background: var(--panel); border: 1px solid var(--border); margin-bottom: 12px;
}
.method {
  font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 6px;
  letter-spacing: 0.04em;
}
.method-get { background: rgba(74, 222, 128, 0.16); color: var(--success); }
.method-post { background: var(--accent-soft); color: var(--accent-text); }
.endpoint-path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; font-weight: 600; }
.endpoint-desc { font-size: 13px; color: var(--text-dim); }
table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: 13.5px; }
th, td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--border); }
th { color: var(--text-soft); font-weight: 650; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.05em; }
td { color: var(--text-soft); }
td code { font-size: 12.5px; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 700;
}
.badge-required { background: rgba(255, 107, 107, 0.14); color: var(--danger); }
.badge-optional { background: var(--panel); color: var(--text-dim); border: 1px solid var(--border); }
.callout {
  padding: 15px 18px; border-radius: var(--radius-sm); margin: 18px 0;
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  font-size: 13.8px; color: var(--text-soft); line-height: 1.8;
}
.callout b { color: var(--text); }
.step-num {
  display: inline-grid; place-items: center; width: 24px; height: 24px;
  border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 700; margin-right: 8px; vertical-align: middle;
}

@media (max-width: 640px) {
  .nav-user-name { display: none; }
  main { width: calc(100% - 32px); }
  .feed-card, .feed-skel { width: 268px; }
  .float-bar { bottom: 16px; right: 12px; }
  .item { padding: 15px; gap: 13px; }
  .item-icon { width: 44px; height: 44px; font-size: 22px; }
}
