/* =====================================================================
   人保小工具 · 站点外壳样式 v2.0 高端视觉升级版
   设计原则：极简高级 + 精致细节 + 流畅动效
   小工具页面本身不受影响：它们各自在自己的 <iframe> 里，用自己的 CSS。
   ===================================================================== */

:root {
  /* 颜色系统 */
  --bg: #f8f9fc;
  --bg-top: #fafbfe;
  --bg-alt: #f2f4f9;
  --panel: #ffffff;
  --panel-2: #fcfdfe;
  --ink: #0f1419;
  --ink2: #4a5568;
  --ink3: #8b93a1;
  --line: #e5e8f0;
  --line2: #d8dce8;
  --line3: #f0f2f8;
  
  /* 品牌色系 */
  --brand: #c8102e;
  --brand-2: #9b0b23;
  --brand-3: #e4142f;
  --brand-4: #ff4d5a;
  --brand-soft: #fdf2f4;
  --brand-light: #fff5f7;
  --brand-line: #f6d5dc;
  
  /* 辅助色 */
  --ok: #127a52;
  --ok-soft: #eaf7f0;
  --warn: #d97706;
  --error: #dc2626;
  
  /* 形状 / 阴影 */
  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;
  
  /* 高级阴影系统 */
  --shadow-xs: 0 1px 2px rgba(15, 20, 25, .03);
  --shadow-1: 0 2px 4px rgba(15, 20, 25, .05), 0 1px 2px rgba(15, 20, 25, .03);
  --shadow-2: 0 10px 24px -8px rgba(15, 20, 25, .12), 0 4px 10px -6px rgba(15, 20, 25, .06);
  --shadow-3: 0 20px 48px -12px rgba(15, 20, 25, .18), 0 8px 16px -8px rgba(200, 16, 46, .15);
  --shadow-4: 0 30px 64px -16px rgba(15, 20, 25, .25), 0 12px 24px -12px rgba(200, 16, 46, .2);
  --ring: 0 0 0 5px rgba(200, 16, 46, .12);

  /* 其它 */
  --sidebar-w: 272px;
  --ease: cubic-bezier(.22, .68, .3, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, .2, 1);
  --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font: 14px/1.6 var(--font);
  background:
    radial-gradient(900px 480px at 12% -8%, #ffffff 0%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(760px 420px at 100% 0%, #fff0f3 0%, rgba(255, 240, 243, 0) 58%),
    linear-gradient(180deg, var(--bg-top), var(--bg) 42%, #f6f7fc);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; }
svg { display: block; }
::selection { background: rgba(200, 16, 46, .18); color: var(--ink); }

:focus-visible { outline: 2px solid rgba(200, 16, 46, .65); outline-offset: 2px; }
input:focus-visible { outline: none; }

/* ============ 布局骨架 ============ */
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

/* ============ 侧栏 ============ */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 14px 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 50%, #fafbfe 100%);
  border-right: 1px solid var(--line);
  box-shadow: 
    inset 1px 0 0 rgba(255, 255, 255, .9),
    inset -1px 0 0 rgba(15, 20, 25, .02),
    20px 0 48px -32px rgba(15, 20, 25, .15);
  overflow: hidden;
  z-index: 60;
}

.brand { 
  display: flex; align-items: center; gap: 14px; 
  padding: 8px 8px 24px; 
  position: relative;
  cursor: pointer;
  transition: transform .24s var(--ease);
}
.brand:hover { transform: translateX(2px); }
.brand::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 6px; height: 1px;
  background: linear-gradient(90deg, var(--line), rgba(229, 232, 240, .3));
}
.brand-mark {
  width: 72px; height: 72px; flex: 0 0 72px;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: transform .24s var(--ease);
}
.brand:hover .brand-mark { 
  transform: translateY(-2px) scale(1.05);
}
.brand-mark svg { width: 44px; height: 44px; }
.brand-mark img { width: 64px; height: 64px; }
.brand-text { 
  display: flex; flex-direction: column; 
  line-height: 1.28; min-width: 0;
}
.brand-text strong { 
  font-size: 18px; font-weight: 700; 
  letter-spacing: -.3px; 
  color: var(--ink);
  background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-text small { 
  font-size: 13px; color: var(--ink3); 
  letter-spacing: .3px;
  font-weight: 500;
}

/* 搜索框 */
.side-search {
  position: relative;
  display: flex; align-items: center;
  height: 40px;
  padding: 0 10px 0 36px;
  background: linear-gradient(180deg, #f5f7fb, #f0f2f8);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: all .2s var(--ease);
}
.side-search:hover { 
  background: linear-gradient(180deg, #f7f9fc, #f3f5fa);
  border-color: var(--line2);
  box-shadow: var(--shadow-xs);
}
.side-search:focus-within {
  background: #fff;
  border-color: var(--brand-line);
  box-shadow: var(--ring), var(--shadow-1);
  transform: translateY(-1px);
}
.side-search > svg { 
  position: absolute; left: 12px; 
  width: 16px; height: 16px; 
  color: var(--ink3);
  transition: color .2s var(--ease);
}
.side-search:focus-within > svg { color: var(--brand); }
.side-search input {
  border: 0; background: transparent; outline: 0;
  width: 100%; height: 100%;
  font: inherit; font-size: 13.5px; color: var(--ink); 
  letter-spacing: .05px;
}
.side-search input::placeholder { color: var(--ink3); }
.side-search input::-webkit-search-cancel-button { display: none; }
.side-search kbd {
  font: 10.5px/1 var(--mono);
  color: var(--ink3);
  border: 1px solid var(--line2);
  border-radius: 6px;
  padding: 4px 6px;
  background: #fbfcfd;
  box-shadow: 0 1px 2px rgba(15, 20, 25, .03);
  white-space: nowrap;
  letter-spacing: .06em;
}

/* 导航 */
.nav-sort-hint { margin: -3px 10px -8px; color: var(--ink3); font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.side-nav { 
  flex: 1; 
  overflow-y: auto; overflow-x: hidden; 
  padding: 4px 0 12px; 
  scrollbar-width: thin;
}
.side-nav::-webkit-scrollbar { width: 7px; }
.side-nav::-webkit-scrollbar-thumb { 
  background: #e1e5f0;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.side-nav::-webkit-scrollbar-thumb:hover { 
  background: #d0d5e5;
  background-clip: content-box;
}

.nav-group { margin-top: 16px; }
.nav-group:first-child { margin-top: 4px; }
.nav-group > h4 {
  margin: 0 0 8px; padding: 0 12px;
  font-size: 11.5px; font-weight: 700;
  color: var(--ink3);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.side-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 12px; margin-bottom: 5px;
  border-radius: 11px;
  color: var(--ink2);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  transition: all .18s var(--ease);
}
.side-item::before {
  content: ""; position: absolute; left: 0; top: 50%; 
  transform: translateY(-50%) scaleY(.15);
  width: 4px; height: 18px; 
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--brand-4), var(--brand-3), var(--brand-2));
  opacity: 0; 
  transition: all .2s var(--ease);
}
.side-item:hover { 
  background: #f3f5fa;
  color: var(--ink);
  transform: translateX(3px);
}
.side-item.on {
  background: linear-gradient(90deg, rgba(200, 16, 46, .12), rgba(200, 16, 46, .04));
  color: var(--brand);
  font-weight: 700;
}
.side-item.on::before { 
  opacity: 1; 
  transform: translateY(-50%) scaleY(1);
}
.side-item.sort-holding { background-color: var(--brand-soft); }
.side-nav.sorting .side-item { transform: none; transition: none; }
.side-item.sort-picked { background: var(--brand-soft); outline: 1px dashed var(--brand); outline-offset: -1px; }
.side-nav.sorting .side-item.sort-picked > * { opacity: .3; }
.side-item.sort-ghost {
  position: fixed; z-index: 220; margin: 0; pointer-events: none;
  background: #fff; color: var(--brand); outline: 1px solid var(--brand-line);
  box-shadow: var(--shadow-3); transform: scale(1.02); transition: none;
}
body.nav-sorting, body.nav-sorting .side-item { cursor: grabbing; user-select: none; }
body.nav-sorting .frame { pointer-events: none; }
.si-ico { 
  width: 24px; height: 24px; 
  flex: 0 0 24px; 
  color: var(--ink2); 
  transition: all .18s var(--ease);
}
.si-ico-doc { color: #58739a; }
.si-ico-presentation { color: #b45a50; }
.si-ico-image { color: #4c8a79; }
.si-ico-table { color: #b27a37; }
.si-ico-checklist { color: #7560a6; }
.si-ico-calc { color: #4e8e9c; }
.si-ico-text { color: #8a6a54; }
.si-ico-wrench { color: #8a6e6e; }
.si-ico svg { width: 100%; height: 100%; stroke-width: 2.2; }
.side-item:hover .si-ico { filter: saturate(1.2) brightness(.96); }
.side-item.on .si-ico { color: var(--brand); }
.si-txt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.si-badge {
  font-size: 10px; font-weight: 700; line-height: 1;
  padding: 4px 8px; border-radius: 22px;
  background: linear-gradient(135deg, var(--brand-4), var(--brand-3));
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(200, 16, 46, .75);
  letter-spacing: .05em;
  animation: badge-pulse 2s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 6px 16px -6px rgba(200, 16, 46, .75); }
  50% { box-shadow: 0 8px 20px -4px rgba(200, 16, 46, .85); }
}
.nav-empty { padding: 14px 12px; font-size: 12.5px; color: var(--ink3); }

.side-foot {
  margin-top: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #fbfcfe, #f6f8fc);
  font-size: 11.5px; line-height: 1.8; 
  color: var(--ink3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}
.side-foot b { color: var(--ink); font-weight: 700; font-size: 12.5px; }
.side-foot a { 
  color: var(--ink2); 
  border-bottom: 1px dashed rgba(200, 16, 46, .2);
  transition: all .2s var(--ease);
}
.side-foot a:hover { 
  color: var(--brand);
  border-bottom-color: var(--brand-line);
}

/* ============ 主区 ============ */
.main { 
  flex: 1; min-width: 0; 
  display: flex; flex-direction: column; 
  overflow: hidden;
}

.topbar {
  flex: 0 0 60px; height: 60px;
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  background: rgba(255, 255, 255, .75);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid var(--line);
  z-index: 40;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .01);
}

.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent; 
  border-radius: 10px;
  background: transparent; 
  color: var(--ink2); 
  cursor: pointer;
  transition: all .16s var(--ease);
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { 
  background: var(--bg-alt);
  border-color: var(--line2);
  color: var(--ink);
}
.icon-btn:active { transform: scale(.95); }

.crumb { 
  flex: 1; min-width: 0; 
  display: flex; align-items: center; gap: 8px; 
  font-size: 13.5px; 
  color: var(--ink3);
}
.crumb .c-home { 
  color: var(--ink2); 
  transition: all .2s var(--ease);
}
.crumb a.c-home:hover { color: var(--brand); }
.crumb .sep { color: #d5dae8; font-size: 11px; }
.crumb .c-now {
  color: var(--ink); font-weight: 600;
  padding: 4px 11px; border-radius: 8px;
  background: var(--bg-alt);
  box-shadow: 
    0 1px 0 rgba(255, 255, 255, .9) inset,
    0 0 0 1px rgba(229, 232, 240, 1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crumb .c-desc {
  color: var(--ink3); font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.top-actions { display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line2); 
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #fcfdff);
  color: var(--ink2);
  font-size: 13px; font-weight: 600; 
  cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-1);
  transition: all .18s var(--ease);
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { 
  border-color: var(--line);
  color: var(--ink); 
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0px); box-shadow: var(--shadow-xs); }
.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand-3) 0%, var(--brand-2) 100%);
  color: #fff;
  box-shadow: 0 12px 28px -10px rgba(200, 16, 46, .75);
}
.btn.primary:hover { 
  color: #fff; 
  filter: brightness(1.06);
  box-shadow: 0 16px 36px -12px rgba(200, 16, 46, .85);
  transform: translateY(-2px);
}
.btn.primary:active { transform: translateY(-1px); }

[hidden] { display: none !important; }

.stage { 
  flex: 1; min-height: 0; 
  overflow: auto; 
  scroll-behavior: smooth;
  scroll-padding: 20px;
}
.stage::-webkit-scrollbar { width: 10px; }
.stage::-webkit-scrollbar-track { background: transparent; }
.stage::-webkit-scrollbar-thumb { 
  background: #e5e8f0;
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.stage::-webkit-scrollbar-thumb:hover { 
  background: #d5dae8;
  background-clip: content-box;
}
.stage.tool-mode { overflow: hidden; scroll-behavior: auto; }

.view.home { 
  max-width: 1240px; margin: 0 auto; 
  padding: 42px 36px 80px;
}
.view.tool { 
  height: 100%; 
  padding: 20px 24px 24px;
}

/* ============ 首页 ============ */
.hero { padding: 0 0 6px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
  font-size: 12px; font-weight: 700; 
  letter-spacing: .15em;
  color: var(--brand);
  text-transform: uppercase;
}
.hero-eyebrow i {
  width: 7px; height: 7px; 
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-4), var(--brand-2));
  box-shadow: 0 0 0 4px rgba(200, 16, 46, .12);
  animation: dot-pulse 2s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(200, 16, 46, .12); }
  50% { box-shadow: 0 0 0 8px rgba(200, 16, 46, .06); }
}
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 800;
  letter-spacing: -.8px;
  line-height: 1.2;
  color: var(--ink);
}
.hero p { 
  margin: 0; 
  color: var(--ink2); 
  font-size: 15px; 
  max-width: 65ch; 
  line-height: 1.7;
  font-weight: 500;
}

.hero-search {
  position: relative;
  display: flex; align-items: center;
  margin: 28px 0 8px;
  height: 56px;
  max-width: 640px;
  padding: 0 16px 0 50px;
  background: linear-gradient(180deg, #fff, #fcfdfe);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-2);
  transition: all .2s var(--ease);
}
.hero-search:hover { 
  border-color: var(--line2);
  box-shadow: var(--shadow-3);
}
.hero-search:focus-within {
  border-color: var(--brand-line);
  box-shadow: var(--ring), var(--shadow-3);
  transform: translateY(-2px);
}
.hero-search > svg { 
  position: absolute; left: 18px; 
  width: 19px; height: 19px; 
  color: var(--ink3); 
  transition: all .2s var(--ease);
}
.hero-search:focus-within > svg { color: var(--brand); }
.hero-search input {
  border: 0; outline: 0; background: transparent;
  width: 100%; height: 100%;
  font: inherit; font-size: 15px; 
  color: var(--ink);
  font-weight: 500;
}
.hero-search input::placeholder { color: var(--ink3); }
.hero-search input::-webkit-search-cancel-button { display: none; }
.hero-hint {
  display: inline-flex; align-items: center; gap: 7px;
  margin-left: 12px; padding-left: 14px;
  border-left: 1.5px solid var(--line);
  font-size: 12px; color: var(--ink3); white-space: nowrap;
}
.hero-hint kbd {
  font: 10px/1 var(--mono); color: var(--ink3);
  border: 1px solid var(--line2); border-radius: 6px;
  padding: 4px 6px; background: #fbfcfd;
  box-shadow: 0 1px 2px rgba(15, 20, 25, .03);
}

.sec { margin-top: 48px; }
.sec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.sec-head h2 { 
  margin: 0; 
  font-size: 16px; font-weight: 750; 
  letter-spacing: -.3px; 
  color: var(--ink);
}
.sec-head span, .sec-count {
  font-size: 11.5px; font-weight: 700; 
  color: var(--ink2);
  background: linear-gradient(135deg, #f3f5fa, #f0f2f8);
  border: 1px solid var(--line3);
  border-radius: 22px;
  padding: 3px 11px;
  letter-spacing: .05em;
  box-shadow: var(--shadow-xs);
}
.sec-head::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line), rgba(229, 232, 240, .2));
}

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  height: 34px; padding: 0 15px;
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #fcfdfe);
  color: var(--ink2);
  font-size: 13px; font-weight: 600; 
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all .18s var(--ease);
}
.chip:hover { 
  border-color: var(--line2);
  color: var(--ink);
  box-shadow: var(--shadow-1);
  transform: translateY(-2px);
}
.chip.on {
  background: linear-gradient(135deg, #1a1f27, #0f1419);
  border-color: #14181d;
  color: #fff;
  box-shadow: 0 12px 28px -10px rgba(15, 20, 25, .85);
}
.chip.on:hover { transform: none; }
.chip em { 
  font-style: normal; 
  font-size: 11px; 
  opacity: .5; 
  font-weight: 500;
}
.chip.on em { opacity: .6; }
.chip .chip-ico { width: 15px; height: 15px; flex: 0 0 15px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #fcfdff 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  cursor: pointer;
  transition: all .24s var(--ease);
  animation: card-in .56s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 48ms);
}
.card::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, 
    rgba(200, 16, 46, 0), 
    rgba(200, 16, 46, .05) 25%, 
    rgba(200, 16, 46, 0) 50%);
  opacity: 0; 
  transition: opacity .28s var(--ease);
  pointer-events: none;
}
.card::after {
  content: ""; position: absolute; 
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    400px 300px at 110% -10%, 
    rgba(200, 16, 46, .12), 
    rgba(200, 16, 46, 0) 70%);
  opacity: 0; 
  transition: opacity .28s var(--ease);
  pointer-events: none;
}
.card:hover {
  transform: translateY(-6px);
  border-color: var(--brand-line);
  box-shadow: var(--shadow-4);
}
.card:hover::before { opacity: 1; }
.card:hover::after { opacity: 1; }

.card-top { 
  display: flex; align-items: flex-start; 
  justify-content: space-between; 
  margin-bottom: 16px;
}
.card-ico {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #fff5f7, #fde8ec);
  color: var(--brand);
  box-shadow: 
    0 2px 0 rgba(255, 255, 255, .9) inset,
    0 0 0 1px rgba(246, 213, 220, 1),
    0 8px 20px -8px rgba(200, 16, 46, .2);
  transition: all .24s var(--ease);
}
.card:hover .card-ico { 
  transform: scale(1.08) rotate(-3deg);
  box-shadow: 
    0 2px 0 rgba(255, 255, 255, .9) inset,
    0 0 0 1px rgba(246, 213, 220, 1),
    0 12px 28px -6px rgba(200, 16, 46, .3);
}
.card-ico svg { width: 24px; height: 24px; }
.card-badge {
  font-size: 10px; font-weight: 800; 
  letter-spacing: .12em;
  line-height: 1;
  padding: 6px 10px; 
  border-radius: 22px;
  border: none;
  background: linear-gradient(135deg, var(--brand-4), var(--brand-3));
  color: #fff;
  text-transform: uppercase;
  box-shadow: 0 8px 16px -6px rgba(200, 16, 46, .6);
  animation: badge-pop .6s var(--ease);
}
@keyframes badge-pop {
  0% { transform: scale(.8) rotate(-8deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.card h3 {
  margin: 0 0 8px;
  font-size: 16px; font-weight: 750; 
  letter-spacing: -.25px;
  color: var(--ink);
  display: flex; align-items: center; gap: 7px;
  line-height: 1.3;
}
.card p { 
  margin: 0; 
  font-size: 13px; 
  color: var(--ink2); 
  line-height: 1.75;
}
.card-tags { 
  display: flex; flex-wrap: wrap; 
  gap: 8px; margin-top: 16px;
}
.card-tags span {
  font-size: 11px; 
  color: var(--ink2);
  background: linear-gradient(135deg, #f5f7fb, #f0f2f8);
  border: 1px solid var(--line3);
  border-radius: 8px;
  padding: 3px 9px;
  letter-spacing: .03em;
  box-shadow: var(--shadow-xs);
}
.card-go {
  margin-top: 18px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; 
  color: var(--brand);
  opacity: 0; 
  transform: translateX(-8px);
  transition: all .24s var(--ease);
}
.card-go svg { width: 16px; height: 16px; }
.card:hover .card-go, .card:focus-visible .card-go { 
  opacity: 1; 
  transform: translateX(0);
}

.empty {
  padding: 64px 28px; 
  text-align: center;
  border: 2px dashed var(--line2); 
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #fafcfe, #f5f7fc);
  color: var(--ink3); 
  font-size: 13.5px;
}
.empty b { 
  display: block; 
  color: var(--ink); 
  font-size: 15px; 
  margin-bottom: 10px; 
  font-weight: 750;
}

/* ============ 工具内嵌区 ============ */
.frame-box {
  position: relative;
  height: 100%;
  background: linear-gradient(135deg, #ffffff, #fcfdff);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  animation: frame-in .36s var(--ease) backwards;
}
@keyframes frame-in {
  from { opacity: 0; transform: scale(.98); }
  to { opacity: 1; transform: scale(1); }
}
.frame-box .frame { 
  width: 100%; 
  height: 100%; 
  border: 0; 
  display: block; 
  background: #fff;
}

.frame-loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; 
  align-items: center; justify-content: center; 
  gap: 18px;
  background: linear-gradient(135deg, #ffffff, #fcfdff);
  color: var(--ink3); 
  font-size: 14px; 
  letter-spacing: .03em;
  font-weight: 500;
  z-index: 2;
  transition: all .28s var(--ease);
}
.frame-loading.gone { opacity: 0; pointer-events: none; }
.frame-loading::after {
  content: ""; 
  position: absolute; left: 20%; right: 20%; top: 0; 
  height: 3px;
  background: linear-gradient(90deg, 
    rgba(200, 16, 46, 0) 0%, 
    var(--brand) 50%, 
    rgba(200, 16, 46, 0) 100%);
  background-size: 50% 100%;
  background-repeat: no-repeat;
  animation: load-bar 1.4s cubic-bezier(.4, 0, .6, 1) infinite;
}
@keyframes load-bar {
  0% { background-position: -100% 0; }
  100% { background-position: 200% 0; }
}
.spin {
  width: 28px; height: 28px; 
  border-radius: 50%;
  border: 3px solid rgba(229, 232, 240, .9);
  border-top-color: var(--brand);
  border-right-color: rgba(200, 16, 46, .6);
  animation: spin .8s cubic-bezier(.4, 0, .6, 1) infinite;
}
@keyframes spin { 
  to { transform: rotate(360deg); }
}

/* ============ 提示 ============ */
.toasts {
  position: fixed; left: 50%; bottom: 32px; 
  transform: translateX(-50%);
  display: flex; flex-direction: column; 
  gap: 10px; align-items: center;
  z-index: 200; pointer-events: none;
}
.toast {
  max-width: min(82vw, 540px);
  padding: 12px 18px;
  font-size: 13px; font-weight: 600; 
  letter-spacing: .03em;
  color: #fff;
  background: linear-gradient(135deg, 
    rgba(15, 20, 25, .92),
    rgba(15, 20, 25, .88));
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 13px;
  box-shadow: 
    0 26px 48px -24px rgba(0, 0, 0, .7),
    0 2px 0 rgba(255, 255, 255, .08) inset;
  animation: toast-in .32s var(--ease);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============ 小屏 ============ */
.scrim {
  position: fixed; inset: 0;
  background: rgba(15, 20, 25, .48);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 55;
  animation: fade-in .2s var(--ease);
}
@keyframes fade-in { from { opacity: 0; } }
.only-mobile { display: none; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .only-mobile { display: flex; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0;
    width: 280px;
    transform: translateX(-101%);
    transition: transform .32s var(--ease);
    box-shadow: 
      40px 0 80px -40px rgba(15, 20, 25, .3),
      inset 1px 0 0 rgba(255, 255, 255, .9);
  }
  .sidebar.open { transform: none; }
  .topbar { padding: 0 16px; height: 56px; }
  .view.home { padding: 30px 20px 70px; }
  .view.tool { padding: 12px 12px 14px; }
  .frame-box { border-radius: 14px; }
  .hero h1 { font-size: 26px; }
  .hero-search { 
    height: 50px; 
    padding-left: 44px; 
    max-width: 100%;
  }
  .hero-search > svg { left: 16px; }
  .hero-hint { display: none; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .crumb .c-desc { display: none; }
  .btn .btn-label { display: none; }
  .btn { padding: 0 11px; height: 34px; }
  .view.home { max-width: 100%; }
}

@media (max-width: 640px) {
  .sidebar { width: 260px; }
  .hero h1 { font-size: 22px; }
  .view.home { padding: 24px 16px 60px; }
  .hero-search { margin: 20px 0 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { 
    animation-duration: .001ms !important; 
    animation-iteration-count: 1 !important; 
    transition-duration: .001ms !important;
  }
}
