/* ============================================================
   VulpeCat 灵猫司海 —— 设计系统
   与 jianjianmao.top 门户同源：深色玻璃卡 + 珊瑚粉强调 + 4 套主题
   主题：html[data-theme] = dusk | sakura | ink | ocean
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  /* 默认主题：落樱 */
  --bg-d: url("../assets/bg-dusk.webp");
  --bg-m: url("../assets/bg-dusk-m.webp");
  --sun:   #ffb0c4;
  --coral: #e8748f;
  --glow:  rgba(232, 116, 143, .85);

  --ink:       #f5f0ec;
  --ink-dim:   #d3cac6;
  --ink-mute:  rgba(245, 240, 236, .56);
  --line:      rgba(255, 255, 255, .17);
  --line-soft: rgba(255, 255, 255, .1);
  --glass:     rgba(16, 17, 24, .67);
  --glass-2:   rgba(255, 255, 255, .055);
  --ok:        #86e0a8;
  --warn:      #ffd166;
  --bad:       #ff9b9b;

  --r:    20px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Consolas, monospace;
}

html[data-theme="sakura"] {
  --bg-d: url("../assets/bg-sakura.webp");
  --bg-m: url("../assets/bg-sakura-m.webp");
  --sun:   #f7b9d6;
  --coral: #c274a8;
  --glow:  rgba(194, 116, 168, .85);
}

html[data-theme="ink"] {
  --bg-d: url("../assets/bg-ink.webp");
  --bg-m: url("../assets/bg-ink-m.webp");
  --sun:   #a3b4ff;
  --coral: #5d6be0;
  --glow:  rgba(93, 107, 224, .85);
}

html[data-theme="ocean"] {
  --bg-d: url("../assets/bg-ocean.webp");
  --bg-m: url("../assets/bg-ocean-m.webp");
  --sun:   #ffc48c;
  --coral: #e8745f;
  --glow:  rgba(232, 116, 95, .85);
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: #0d1017;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 背景 ---------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: var(--bg-d);
  background-size: cover;
  background-position: 58% center;
  background-repeat: no-repeat;
  animation: pan 60s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes pan {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-1.5%, 0, 0); }
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(104deg,
      rgba(10, 10, 16, .9) 0%,
      rgba(10, 10, 16, .74) 24%,
      rgba(10, 10, 16, .4) 46%,
      rgba(10, 10, 16, .08) 62%),
    radial-gradient(130% 95% at 50% 118%, rgba(10, 10, 16, .62), transparent 62%);
  /* 底图偏亮时压一层底，保证白字始终读得清 */
  background-color: rgba(9, 10, 15, .46);
  pointer-events: none;
}

/* ---------- 布局骨架 ---------- */

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
}

.pane {
  position: absolute;
  inset: 0;
  display: flex;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: clamp(20px, 6vw, 96px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s var(--ease), visibility .3s;
}
.pane.on { opacity: 1; visibility: visible; }
.pane::-webkit-scrollbar { width: 0; height: 0; }

/* ---------- 玻璃卡 ---------- */

.card {
  width: min(400px, 100%);
  min-width: 0;
  margin: auto auto auto clamp(0px, 4vw, 88px);
  padding: clamp(26px, 3.4vw, 38px) clamp(24px, 3.2vw, 36px) 22px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(135%);
  -webkit-backdrop-filter: blur(24px) saturate(135%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .1) inset,
    0 30px 74px -26px rgba(0, 0, 0, .8),
    0 2px 10px rgba(0, 0, 0, .3);
}

.card.in  { animation: cardIn .52s var(--ease); }
.card.out { animation: cardOut .26s cubic-bezier(.4, 0, 1, 1) both; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(26px) scale(.982); filter: blur(7px); }
  to   { opacity: 1; transform: none;                       filter: blur(0); }
}
@keyframes cardOut {
  from { opacity: 1; transform: none;                        filter: blur(0); }
  to   { opacity: 0; transform: translateY(-18px) scale(.972); filter: blur(9px); }
}

.card.dash {
  width: min(880px, 100%);
  margin: auto;
  padding: clamp(26px, 2.4vw, 40px) clamp(24px, 2.4vw, 40px) 22px;
}

/* ---------- 顶部账号行 ---------- */

.hello {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 22px;
}

.avatar {
  width: 46px; height: 46px;
  flex: 0 0 46px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 19px; font-weight: 600;
  color: #2a1016;
  background: linear-gradient(155deg, var(--sun), var(--coral));
  box-shadow: 0 8px 22px -10px var(--glow);
}

.who { min-width: 0; }
.who b { display: block; font-size: 16px; font-weight: 620; letter-spacing: .01em; }
.who span { display: block; margin-top: 3px; font-size: 11.5px; color: var(--ink-mute); }

.tools { display: flex; gap: 6px; margin-left: auto; flex: 0 0 auto; }

.iconbtn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(255, 255, 255, .05);
  color: var(--ink-dim);
  cursor: pointer;
  transition: all .16s var(--ease);
  text-decoration: none;
}
.iconbtn:hover { background: rgba(255, 255, 255, .12); color: var(--ink); }
.iconbtn svg { width: 17px; height: 17px; }

/* ---------- 小节标题 ---------- */

.sec-title {
  margin: 4px 2px 10px;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(245, 240, 236, .42);
}

/* ---------- 概览条 ---------- */

.usage {
  margin: 0 0 18px;
  padding: 14px 16px 13px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .045);
}

.usage-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.usage-label { font-size: 11px; letter-spacing: .1em; color: var(--ink-mute); }
.usage-num { font-size: 12px; color: var(--ink-mute); }
.usage-num b { font-size: 17px; font-weight: 600; color: var(--ink); margin-right: 3px; font-variant-numeric: tabular-nums; }
.usage-num em { font-style: normal; }

.usage-bar {
  height: 5px;
  margin: 10px 0 9px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}
.usage-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--sun), var(--coral));
  transition: width .5s var(--ease);
}

.usage-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--ink-mute);
}

/* ---------- 功能入口 ---------- */

.feat-hero {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 17px 18px;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .06);
  text-decoration: none;
  color: inherit;
  transition: all .18s var(--ease);
  position: relative;
  overflow: hidden;
}
.feat-hero::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(120% 140% at 12% 0%, color-mix(in srgb, var(--sun) 16%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity .25s var(--ease);
  pointer-events: none;
}
.feat-hero:hover {
  background: rgba(255, 255, 255, .09);
  border-color: color-mix(in srgb, var(--sun) 42%, transparent);
  transform: translateY(-1px);
  box-shadow: 0 18px 40px -24px var(--glow);
}
.feat-hero:hover::after { opacity: 1; }
.feat-hero:active { transform: none; }

.feat-hero .glyph {
  width: 50px; height: 50px;
  flex: 0 0 50px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(155deg,
              color-mix(in srgb, var(--sun) 28%, transparent),
              color-mix(in srgb, var(--coral) 28%, transparent));
  color: var(--sun);
}
.feat-hero .glyph svg { width: 23px; height: 23px; }

/* 灵猫线稿 logo：用 mask 上色，线条自动跟随主题（currentColor） */
.usv-logo {
  display: block;
  width: 26px;
  height: 26px;
  background-color: currentColor;
  -webkit-mask: url("../assets/logo-usv.png") center / contain no-repeat;
          mask: url("../assets/logo-usv.png") center / contain no-repeat;
}
.feat-hero .txt { flex: 1; min-width: 0; position: relative; z-index: 1; }
.feat-hero .txt b { display: block; font-size: 16.5px; font-weight: 650; margin-bottom: 3px; }
.feat-hero .txt span { display: block; font-size: 12px; line-height: 1.5; color: var(--ink-mute); }
.feat-hero .arrow { color: var(--ink-mute); flex: 0 0 auto; }
.feat-hero .arrow svg { width: 17px; height: 17px; display: block; }

.feat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.feat {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 16px;
  min-height: 112px;
  border-radius: 15px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .045);
  text-decoration: none;
  color: inherit;
  transition: all .18s var(--ease);
  position: relative;
  text-align: left;
  font: inherit;
}
button.feat { cursor: pointer; }
.feat:hover {
  background: rgba(255, 255, 255, .1);
  border-color: color-mix(in srgb, var(--sun) 38%, transparent);
  transform: translateY(-1px);
}
.feat .glyph {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--sun) 16%, transparent);
  color: var(--sun);
}
.feat .glyph svg { width: 17px; height: 17px; }
.feat b { font-size: 14px; font-weight: 600; }
.feat span { font-size: 11.5px; line-height: 1.55; color: var(--ink-mute); }
.feat.soon { opacity: .56; pointer-events: none; }
.feat.soon .soon-tag {
  position: absolute;
  top: 12px; right: 12px;
  font-size: 10px;
  letter-spacing: .08em;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
  color: var(--ink-mute);
  background: rgba(255, 255, 255, .04);
}

/* ---------- 双列小按钮 ---------- */

.pair { display: flex; gap: 10px; }
.pair > * { flex: 1; min-width: 0; }

.mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .045);
  color: var(--ink-dim);
  font-size: 12.5px;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: all .16s var(--ease);
}
.mini:hover { background: rgba(255, 255, 255, .1); color: var(--ink); border-color: color-mix(in srgb, var(--sun) 30%, transparent); }
.mini svg { width: 15px; height: 15px; }

/* ---------- 页脚 ---------- */

.foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
  color: rgba(245, 240, 236, .38);
}
.foot .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }

/* ---------- 主题面板 ---------- */

.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(6, 7, 11, .6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .24s var(--ease), visibility .24s;
}
.sheet-mask.on { opacity: 1; visibility: visible; }

.sheet {
  position: fixed;
  z-index: 61;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -46%) scale(.97);
  width: min(360px, calc(100vw - 32px));
  padding: 20px 20px 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(20, 21, 29, .92);
  backdrop-filter: blur(24px) saturate(135%);
  -webkit-backdrop-filter: blur(24px) saturate(135%);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .9);
  opacity: 0;
  visibility: hidden;
  transition: opacity .24s var(--ease), transform .24s var(--ease), visibility .24s;
}
.sheet.on { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.sheet-head b { font-size: 13px; letter-spacing: .1em; color: var(--ink-dim); font-weight: 550; }

.themes { display: grid; gap: 8px; }

.theme-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 13px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .04);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: all .16s var(--ease);
}
.theme-opt:hover { background: rgba(255, 255, 255, .09); }
.theme-opt[aria-checked="true"] {
  border-color: color-mix(in srgb, var(--sun) 50%, transparent);
  background: color-mix(in srgb, var(--sun) 10%, rgba(255, 255, 255, .04));
}
.theme-opt .sw { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; }
.theme-opt .nm { display: block; font-size: 13px; font-weight: 550; }
.theme-opt .sb { display: block; font-size: 11px; color: var(--ink-mute); margin-top: 2px; }

/* ---------- 提示条 ---------- */

.toasts {
  position: fixed;
  z-index: 70;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  min-width: 220px;
  max-width: 340px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(20, 21, 29, .92);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 44px -22px rgba(0, 0, 0, .9);
  font-size: 12.5px;
  line-height: 1.5;
  animation: toastIn .3s var(--ease);
}
.toast b { display: block; font-size: 11px; letter-spacing: .08em; color: var(--ink-mute); margin-bottom: 3px; }
.toast.warn { border-color: rgba(255, 209, 102, .45); }
.toast.crit { border-color: rgba(255, 107, 107, .55); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 无障碍 ---------- */

@media (prefers-reduced-motion: reduce) {
  .bg { animation: none; }
  .card { animation: none; }
  * { transition-duration: .01ms !important; }
}

:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--sun) 60%, transparent);
  outline-offset: 2px;
}

.noscroll { overflow: hidden; }

/* ============================================================
   手机
   ============================================================ */

@media (max-width: 760px) {
  .bg {
    background-image: var(--bg-m);
    background-position: center 18%;
    animation: none;
    transform: none;
  }
  .scrim {
    background:
      linear-gradient(180deg,
        rgba(10, 10, 16, .62) 0%,
        rgba(10, 10, 16, .2) 22%,
        rgba(10, 10, 16, .58) 58%,
        rgba(10, 10, 16, .9) 100%);
  }
  .pane { padding: 16px 16px calc(22px + env(safe-area-inset-bottom)); }
  .card {
    width: 100%;
    margin: auto 0 0 0;
    border-radius: 22px;
    padding: 24px 20px 18px;
    background: rgba(16, 17, 24, .70);
  }
  .card.dash { width: 100%; margin: auto 0 0 0; padding: 22px 18px 16px; }
  .feat-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .feat { min-height: 104px; padding: 14px; }
  .feat-hero { padding: 15px; gap: 13px; }
  .feat-hero .glyph { width: 44px; height: 44px; flex-basis: 44px; border-radius: 12px; }
  .feat-hero .txt b { font-size: 15.5px; }
  .sheet {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    transform: translateY(8px);
    border-radius: 22px 22px 0 0;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
  .sheet.on { transform: none; }
  .toasts { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
}

@media (max-height: 560px) and (min-width: 761px) {
  .card { padding: 20px 26px 14px; }
}
