/* ============================================================
   轻链 · LinkDock — 液态玻璃（Liquid Glass）视觉系统
   纯 CSS，无构建，无外部字体/图片依赖
   ============================================================ */

/* ---------- 1. 设计令牌 ---------- */
:root {
  color-scheme: dark;

  /* 玻璃层 */
  --glass-bg: rgba(255, 255, 255, 0.055);
  --glass-bg-strong: rgba(255, 255, 255, 0.085);
  --glass-bg-hover: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-border-strong: rgba(255, 255, 255, 0.22);
  --glass-blur: blur(26px) saturate(180%);
  --glass-blur-strong: blur(40px) saturate(200%);

  /* 高光/内阴影：制造"液体厚度" */
  --inner-top: inset 0 1px 0 0 rgba(255, 255, 255, 0.24);
  --inner-bottom: inset 0 -1px 0 0 rgba(255, 255, 255, 0.06);
  --drop-shadow: 0 18px 44px -18px rgba(0, 0, 0, 0.62);
  --refract: inset 0 1px 1px rgba(255, 255, 255, 0.14),
             inset 0 -12px 26px -18px rgba(255, 255, 255, 0.14);

  /* 文字 */
  --text: #f2f5fb;
  --text-soft: rgba(242, 245, 251, 0.68);
  --text-dim: rgba(242, 245, 251, 0.42);
  --text-faint: rgba(242, 245, 251, 0.24);

  /* 强调色（每个入口一套） */
  --tone-0: #5b8cff;
  --tone-1: #ff8a5c;
  --tone-2: #3ad9a0;
  --tone-3: #a67cff;
  --tone-4: #ffc44d;
  --tone-5: #4fd6e8;

  /* 尺寸 */
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --gap: 16px;
  --pad-page: 20px;
  --maxw: 1180px;

  /* 动效 */
  --ease-out: cubic-bezier(0.22, 0.8, 0.28, 1);
  --ease-spring: cubic-bezier(0.34, 1.42, 0.64, 1);
}

/* 亮色主题 */
:root[data-theme="light"] {
  color-scheme: light;

  --glass-bg: rgba(255, 255, 255, 0.5);
  --glass-bg-strong: rgba(255, 255, 255, 0.66);
  --glass-bg-hover: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-border-strong: #ffffff;

  --inner-top: inset 0 1px 0 0 rgba(255, 255, 255, 0.95);
  --inner-bottom: inset 0 -1px 0 0 rgba(120, 140, 180, 0.1);
  --drop-shadow: 0 18px 44px -20px rgba(48, 68, 112, 0.32);
  --refract: inset 0 1px 1px rgba(255, 255, 255, 0.9),
             inset 0 -12px 26px -18px rgba(120, 145, 195, 0.18);

  --text: #101728;
  --text-soft: rgba(16, 23, 40, 0.66);
  --text-dim: rgba(16, 23, 40, 0.44);
  --text-faint: rgba(16, 23, 40, 0.26);

  --tone-0: #2b62e8;
  --tone-1: #e2673a;
  --tone-2: #12946a;
  --tone-3: #7b4fe8;
  --tone-4: #c48a10;
  --tone-5: #0c8fa4;
}

/* ---------- 2. 基础重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

/* hidden 属性必须压过 .sheet-mask/.empty 等自带的 display 值 */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-base, #06070d);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 0.5s var(--ease-out), color 0.35s var(--ease-out);
}

:root[data-theme="light"] body {
  --bg-base: #eef2fa;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--tone-0);
  outline-offset: 3px;
  border-radius: 6px;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.noscript {
  margin: 40px 20px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  text-align: center;
  color: var(--text-soft);
}

/* ---------- 3. 背景层：流动光斑 + 噪点 ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 12% 8%, #16224a 0%, transparent 58%),
    radial-gradient(110% 80% at 88% 16%, #2a1440 0%, transparent 55%),
    radial-gradient(120% 100% at 50% 108%, #07202e 0%, transparent 60%),
    #06070d;
}

:root[data-theme="light"] .backdrop {
  background:
    radial-gradient(120% 90% at 12% 8%, #cfdcff 0%, transparent 58%),
    radial-gradient(110% 80% at 88% 16%, #ffd9ec 0%, transparent 55%),
    radial-gradient(120% 100% at 50% 108%, #cdf3ff 0%, transparent 60%),
    #eef2fa;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.5;
  will-change: transform;
}

:root[data-theme="light"] .blob {
  opacity: 0.62;
  filter: blur(64px);
}

.blob-a {
  width: 46vmax;
  height: 46vmax;
  top: -16vmax;
  left: -12vmax;
  background: radial-gradient(circle, #3f6bff 0%, transparent 68%);
  animation: drift-a 26s var(--ease-out) infinite alternate;
}

.blob-b {
  width: 40vmax;
  height: 40vmax;
  top: -8vmax;
  right: -14vmax;
  background: radial-gradient(circle, #b44dff 0%, transparent 68%);
  animation: drift-b 32s var(--ease-out) infinite alternate;
}

.blob-c {
  width: 42vmax;
  height: 42vmax;
  bottom: -18vmax;
  left: 22%;
  background: radial-gradient(circle, #00d4b8 0%, transparent 68%);
  animation: drift-c 29s var(--ease-out) infinite alternate;
}

.blob-d {
  width: 30vmax;
  height: 30vmax;
  bottom: -10vmax;
  right: 6%;
  background: radial-gradient(circle, #ff5f8f 0%, transparent 70%);
  animation: drift-d 35s var(--ease-out) infinite alternate;
}

/* 细噪点，压掉渐变的塑料感 */
.grain {
  position: absolute;
  inset: -50%;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

:root[data-theme="light"] .grain {
  opacity: 0.14;
  mix-blend-mode: multiply;
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(6vmax, 4vmax, 0) scale(1.12); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.06); }
  to   { transform: translate3d(-7vmax, 5vmax, 0) scale(0.94); }
}
@keyframes drift-c {
  from { transform: translate3d(0, 0, 0) scale(0.96); }
  to   { transform: translate3d(-5vmax, -6vmax, 0) scale(1.14); }
}
@keyframes drift-d {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4vmax, -4vmax, 0) scale(1.1); }
}

/* ---------- 4. 玻璃基类 ---------- */
.glass {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--drop-shadow), var(--inner-top), var(--inner-bottom), var(--refract);
  border-radius: var(--radius-lg);
}

/* 顶部一道弧形高光，模拟液面反光 */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    170deg,
    rgba(255, 255, 255, 0.16) 0%,
    rgba(255, 255, 255, 0.04) 18%,
    transparent 42%,
    transparent 78%,
    rgba(255, 255, 255, 0.05) 100%
  );
  opacity: 0.9;
}

:root[data-theme="light"] .glass::before {
  background: linear-gradient(
    170deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 0.4) 20%,
    transparent 46%,
    transparent 76%,
    rgba(255, 255, 255, 0.5) 100%
  );
}

/* ---------- 5. 布局 ---------- */
.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) var(--pad-page)
           calc(40px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- 6. 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  animation: rise-in 0.6s var(--ease-out) both;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 7px 16px 7px 8px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--inner-top), var(--drop-shadow);
  transition: background 0.25s var(--ease-out), transform 0.25s var(--ease-spring);
}

.brand:hover {
  background: var(--glass-bg-hover);
  transform: translateY(-1px);
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(145deg, #6d92ff 0%, #9b5cff 55%, #ff5f8f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45),
              0 6px 16px -6px rgba(120, 90, 255, 0.75);
}

.brand-name {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.topbar-actions {
  display: flex;
  gap: 9px;
}

.pill-btn {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--inner-top), var(--drop-shadow);
  transition: background 0.22s var(--ease-out), transform 0.22s var(--ease-spring);
}

.pill-btn:hover {
  background: var(--glass-bg-hover);
  transform: translateY(-1px);
}

.pill-btn:active {
  transform: scale(0.94);
}

.ico {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  color: var(--text-soft);
  transition: color 0.22s, transform 0.45s var(--ease-spring);
}

.pill-btn:hover .ico {
  color: var(--text);
}

.ico svg {
  width: 100%;
  height: 100%;
}

/* 明暗图标叠在一起，按主题显示一个 */
#btn-theme .ico {
  position: absolute;
}
.ico-sun  { opacity: 0; transform: rotate(-70deg) scale(0.6); }
.ico-moon { opacity: 1; transform: rotate(0deg) scale(1); }
:root[data-theme="light"] .ico-sun  { opacity: 1; transform: rotate(0deg) scale(1); }
:root[data-theme="light"] .ico-moon { opacity: 0; transform: rotate(70deg) scale(0.6); }

/* ---------- 7. Hero 卡片 ---------- */
.hero {
  overflow: hidden;
  padding: 26px 28px;
  border-radius: var(--radius-xl);
  animation: rise-in 0.65s 0.05s var(--ease-out) both;
}

.hero-main {
  position: relative;
  z-index: 2;
}

.hero-time {
  font-size: clamp(44px, 11vw, 68px);
  font-weight: 250;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(175deg, var(--text) 12%, var(--text-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-meta {
  margin-top: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  font-size: 13px;
  color: var(--text-dim);
}

.hero-meta b {
  color: var(--text-soft);
  font-weight: 620;
}

.dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}

/* 卡片内一颗游动的高光球 */
.hero-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  right: -50px;
  top: -70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120, 150, 255, 0.5) 0%, transparent 66%);
  filter: blur(26px);
  animation: hero-float 14s var(--ease-out) infinite alternate;
  pointer-events: none;
}

:root[data-theme="light"] .hero-glow {
  background: radial-gradient(circle, rgba(90, 125, 255, 0.34) 0%, transparent 66%);
}

@keyframes hero-float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-40px, 24px, 0) scale(1.18); }
}

/* ---------- 8. 区块标题 ---------- */
.grid-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
  animation: rise-in 0.6s 0.1s var(--ease-out) both;
}

.section-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 620;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.hint {
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ---------- 9. 入口网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--gap);
  align-content: start;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  min-height: 148px;
  padding: 18px 18px 16px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: left;
  isolation: isolate;

  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--drop-shadow), var(--inner-top), var(--inner-bottom), var(--refract);

  animation: tile-in 0.55s var(--ease-out) both;
  animation-delay: var(--d, 0ms);
  transition: background 0.28s var(--ease-out),
              border-color 0.28s var(--ease-out),
              transform 0.32s var(--ease-spring),
              box-shadow 0.32s var(--ease-out);
}

/* 玻璃顶面高光 */
.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    168deg,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(255, 255, 255, 0.05) 20%,
    transparent 44%,
    transparent 80%,
    rgba(255, 255, 255, 0.06) 100%
  );
  z-index: 1;
}

:root[data-theme="light"] .tile::before {
  background: linear-gradient(
    168deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.42) 22%,
    transparent 48%,
    transparent 78%,
    rgba(255, 255, 255, 0.55) 100%
  );
}

/* 每个入口一坨专属色彩雾，落在右下角 */
.tile::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -54px;
  bottom: -60px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--tone) 0%, transparent 70%);
  opacity: 0.42;
  filter: blur(20px);
  z-index: 0;
  transition: opacity 0.35s var(--ease-out), transform 0.45s var(--ease-out);
}

:root[data-theme="light"] .tile::after {
  opacity: 0.28;
}

.tile:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-strong);
  transform: translateY(-4px);
  box-shadow: 0 28px 60px -22px rgba(0, 0, 0, 0.7),
              var(--inner-top), var(--inner-bottom), var(--refract);
}

.tile:hover::after {
  opacity: 0.62;
  transform: scale(1.15) translate3d(-6px, -6px, 0);
}

.tile:active {
  transform: translateY(-1px) scale(0.985);
  transition-duration: 0.1s;
}

/* 色彩映射 */
.tone-0 { --tone: var(--tone-0); }
.tone-1 { --tone: var(--tone-1); }
.tone-2 { --tone: var(--tone-2); }
.tone-3 { --tone: var(--tone-3); }
.tone-4 { --tone: var(--tone-4); }
.tone-5 { --tone: var(--tone-5); }

.tile-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.tile-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
  background: linear-gradient(150deg,
    color-mix(in oklab, var(--tone) 92%, #ffffff) 0%,
    color-mix(in oklab, var(--tone) 68%, #0a0e18) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5),
              0 8px 20px -8px color-mix(in oklab, var(--tone) 70%, transparent);
  flex: none;
}

.tile-arrow {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  flex: none;
  transition: transform 0.3s var(--ease-spring),
              color 0.25s, background 0.25s;
}

.tile:hover .tile-arrow {
  transform: translate3d(2px, -2px, 0);
  color: var(--text);
  background: rgba(255, 255, 255, 0.14);
}

:root[data-theme="light"] .tile-arrow {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.9);
}

:root[data-theme="light"] .tile:hover .tile-arrow {
  background: rgba(255, 255, 255, 0.95);
}

.tile-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.tile-name {
  font-size: 16px;
  font-weight: 640;
  letter-spacing: 0.005em;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-domain {
  font-size: 12px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 单列时不至于拉太宽 */
@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  }
}

/* ---------- 10. 空态 ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 54px 28px;
  text-align: center;
  border-radius: var(--radius-lg);
  animation: rise-in 0.55s var(--ease-out) both;
}

.empty-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 15px;
  color: var(--text-soft);
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
}

.empty-mark svg {
  width: 22px;
  height: 22px;
}

.empty-title {
  font-size: 16px;
  font-weight: 640;
}

.empty-desc {
  font-size: 13.5px;
  color: var(--text-dim);
  max-width: 30ch;
}

.empty .btn {
  margin-top: 10px;
}

/* ---------- 11. 页脚 ---------- */
.foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-top: 8px;
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.03em;
}

.foot-line {
  height: 1px;
  width: 46px;
  background: linear-gradient(90deg, transparent, var(--text-faint), transparent);
}

/* ---------- 12. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform 0.22s var(--ease-spring),
              background 0.22s var(--ease-out),
              box-shadow 0.22s var(--ease-out),
              border-color 0.22s;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(145deg, #6a8dff 0%, #8b5cf6 52%, #d954a8 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42),
              0 12px 26px -12px rgba(120, 90, 255, 0.9);
}

.btn-primary:hover {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5),
              0 16px 34px -12px rgba(120, 90, 255, 1);
}

.btn-ghost {
  color: var(--text-soft);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--inner-top);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-strong);
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  color: var(--text-dim);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  transition: color 0.2s, background 0.2s, transform 0.2s;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--glass-bg-hover);
  transform: rotate(90deg);
}

/* ---------- 13. 管理面板 ---------- */
.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 6, 14, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: fade-in 0.24s var(--ease-out) both;
}

:root[data-theme="light"] .sheet-mask {
  background: rgba(120, 140, 175, 0.28);
}

.sheet {
  width: min(560px, 100%);
  max-height: min(84vh, 780px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: var(--glass-blur-strong);
  backdrop-filter: var(--glass-blur-strong);
  animation: sheet-in 0.34s var(--ease-spring) both;
  overflow: hidden;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 14px;
  flex: none;
}

.sheet-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 660;
  letter-spacing: 0.01em;
}

.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 22px 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border-strong) transparent;
}

.sheet-body::-webkit-scrollbar {
  width: 6px;
}

.sheet-body::-webkit-scrollbar-thumb {
  background: var(--glass-border-strong);
  border-radius: 99px;
}

.sheet-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 22px 20px;
  border-top: 1px solid var(--glass-border);
  flex-wrap: wrap;
}

.sheet-foot-right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 单条编辑器 */
.editor {
  position: relative;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--inner-top);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: rise-in 0.3s var(--ease-out) both;
}

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.editor-index {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.editor-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tone);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--tone) 22%, transparent);
}

.editor-actions {
  display: flex;
  gap: 4px;
}

.mini-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-dim);
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  transition: color 0.18s, background 0.18s, transform 0.18s;
}

.mini-btn:hover:not(:disabled) {
  color: var(--text);
  background: var(--glass-bg-hover);
}

.mini-btn:active:not(:disabled) {
  transform: scale(0.92);
}

.mini-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.mini-btn.danger:hover:not(:disabled) {
  color: #ff7a90;
  background: rgba(255, 80, 110, 0.16);
  border-color: rgba(255, 90, 120, 0.3);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.input {
  width: 100%;
  height: 40px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

:root[data-theme="light"] .input {
  background: rgba(255, 255, 255, 0.72);
}

.input::placeholder {
  color: var(--text-faint);
}

.input:focus {
  border-color: color-mix(in oklab, var(--tone-0) 70%, transparent);
  background: rgba(0, 0, 0, 0.28);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--tone-0) 20%, transparent);
}

:root[data-theme="light"] .input:focus {
  background: #fff;
}

.input.invalid {
  border-color: #ff6b85;
  box-shadow: 0 0 0 3px rgba(255, 107, 133, 0.18);
}

.editor-error {
  font-size: 12px;
  color: #ff8098;
  line-height: 1.4;
}

/* ---------- 14. Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  z-index: 90;
  transform: translateX(-50%);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--text);
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border-strong);
  -webkit-backdrop-filter: var(--glass-blur-strong);
  backdrop-filter: var(--glass-blur-strong);
  box-shadow: var(--drop-shadow), var(--inner-top);
  animation: toast-in 0.3s var(--ease-spring) both;
  pointer-events: none;
  max-width: calc(100vw - 40px);
  text-align: center;
}

/* ---------- 15. 动效关键帧 ---------- */
@keyframes rise-in {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes tile-in {
  from { opacity: 0; transform: translate3d(0, 18px, 0) scale(0.97); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes sheet-in {
  from { opacity: 0; transform: translate3d(0, 22px, 0) scale(0.965); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(0.94); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ---------- 16. 移动端 ---------- */
@media (max-width: 640px) {
  :root {
    --pad-page: 16px;
    --gap: 13px;
    --radius-xl: 28px;
    --radius-lg: 22px;
  }

  body {
    font-size: 14.5px;
  }

  .app {
    gap: 18px;
  }

  .hero {
    padding: 22px 22px;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tile {
    min-height: 132px;
    padding: 15px 15px 14px;
    gap: 14px;
  }

  .tile-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 16px;
  }

  .tile-arrow {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .tile-name {
    font-size: 14.5px;
  }

  .tile-domain {
    font-size: 11px;
  }

  .sheet-mask {
    padding: 0;
    align-items: flex-end;
  }

  .sheet {
    width: 100%;
    max-height: 88dvh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    animation: sheet-up 0.36s var(--ease-spring) both;
  }

  .sheet-foot {
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }

  .sheet-foot-right {
    margin-left: auto;
  }
}

@keyframes sheet-up {
  from { opacity: 0; transform: translate3d(0, 100%, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* 超窄屏：单列 */
@media (max-width: 340px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- 17. 无障碍 & 降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .blob,
  .hero-glow {
    animation: none !important;
  }
}

/* 不支持 backdrop-filter 时用实底，别让文字糊在背景上 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass,
  .tile,
  .brand,
  .pill-btn,
  .btn-ghost,
  .input,
  .toast,
  .sheet {
    background: rgba(18, 24, 40, 0.9);
  }

  :root[data-theme="light"] .glass,
  :root[data-theme="light"] .tile,
  :root[data-theme="light"] .brand,
  :root[data-theme="light"] .pill-btn,
  :root[data-theme="light"] .btn-ghost,
  :root[data-theme="light"] .input,
  :root[data-theme="light"] .toast,
  :root[data-theme="light"] .sheet {
    background: rgba(255, 255, 255, 0.96);
  }
}
