/* ============================================================
   鱼鱼词元所 · 全站主题
   暖白纸感 / 墨色 / 青绿点缀，覆盖 new-api 默认蓝白皮肤
   ============================================================ */

:root,
.light {
  --font-ui-sans: "Public Sans Variable", "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif !important;
  --font-body: var(--font-ui-sans) !important;
  --font-serif: "Lora Variable", "Songti SC", "SimSun", serif;

  --radius: 0.9rem !important;

  --paper: #F6F3ED;
  --ink: #171410;
  --cream: #FCFAF6;
  --teal: #0E7A6B;

  --background: #F6F3ED !important;
  --foreground: #171410 !important;
  --card: #FCFAF6 !important;
  --card-foreground: #171410 !important;
  --popover: #FCFAF6 !important;
  --popover-foreground: #171410 !important;
  --primary: #171410 !important;
  --primary-foreground: #FCFAF6 !important;
  --secondary: #EDE8DF !important;
  --secondary-foreground: #171410 !important;
  --muted: #EFEAE1 !important;
  --muted-foreground: #6F685E !important;
  --accent: #E4EFEA !important;
  --accent-foreground: #0E3B33 !important;
  --destructive: #B42318 !important;
  --destructive-foreground: #FFF8F6 !important;
  --success: #0E7A6B !important;
  --success-foreground: #F5FFFC !important;
  --warning: #A96500 !important;
  --warning-foreground: #FFF9EF !important;
  --info: #2B5DA8 !important;
  --info-foreground: #F7FAFF !important;
  --neutral: #9A9388 !important;
  --neutral-foreground: #171410 !important;
  --border: rgba(23, 20, 16, 0.10) !important;
  --input: rgba(23, 20, 16, 0.13) !important;
  --ring: #0E7A6B !important;

  --sidebar: #F1EDE5 !important;
  --sidebar-foreground: #171410 !important;
  --sidebar-primary: #171410 !important;
  --sidebar-primary-foreground: #FCFAF6 !important;
  --sidebar-accent: #E4EFEA !important;
  --sidebar-accent-foreground: #0E3B33 !important;
  --sidebar-border: rgba(23, 20, 16, 0.10) !important;
  --sidebar-ring: #0E7A6B !important;

  --chart-1: #0E7A6B !important;
  --chart-2: #7C6BA8 !important;
  --chart-3: #C08A5A !important;
  --chart-4: #4E7AA8 !important;
  --chart-5: #B4695B !important;
  --overview-accent-1: #0E7A6B !important;
  --overview-accent-2: #7C6BA8 !important;
  --overview-accent-3: #C08A5A !important;

  --table-row: var(--background) !important;
  --table-header: rgba(23, 20, 16, 0.035) !important;
  --table-header-hover: rgba(23, 20, 16, 0.06) !important;
  --skeleton-base: #EDE8DF !important;
  --skeleton-highlight: #F6F3ED !important;
}

.dark {
  --background: #141210 !important;
  --foreground: #F5F1E9 !important;
  --card: #1C1916 !important;
  --card-foreground: #F5F1E9 !important;
  --popover: #1C1916 !important;
  --popover-foreground: #F5F1E9 !important;
  --primary: #F5F1E9 !important;
  --primary-foreground: #141210 !important;
  --secondary: #26221D !important;
  --secondary-foreground: #F5F1E9 !important;
  --muted: #221E1A !important;
  --muted-foreground: #A9A196 !important;
  --accent: #22322E !important;
  --accent-foreground: #BFE3D9 !important;
  --border: rgba(245, 241, 233, 0.10) !important;
  --input: rgba(245, 241, 233, 0.14) !important;
  --ring: #3FBFA8 !important;
  --sidebar: #181512 !important;
  --sidebar-foreground: #F5F1E9 !important;
  --sidebar-primary: #F5F1E9 !important;
  --sidebar-primary-foreground: #141210 !important;
  --sidebar-accent: #22322E !important;
  --sidebar-accent-foreground: #BFE3D9 !important;
  --sidebar-border: rgba(245, 241, 233, 0.10) !important;
  --sidebar-ring: #3FBFA8 !important;
  --table-header: rgba(245, 241, 233, 0.04) !important;
  --table-header-hover: rgba(245, 241, 233, 0.07) !important;
  --skeleton-base: #221E1A !important;
  --skeleton-highlight: #2A251F !important;
}

html,
body {
  background-color: var(--background) !important;
  color: var(--foreground) !important;
}

body {
  background-image:
    radial-gradient(1100px 620px at 88% -12%, rgba(14, 122, 107, 0.06), transparent 62%),
    radial-gradient(820px 520px at -8% 18%, rgba(176, 146, 112, 0.09), transparent 60%) !important;
  background-attachment: fixed !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.03;
  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='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

#root,
.notranslate {
  position: relative;
  z-index: 1;
}

::selection {
  background: #CFE5DE;
  color: #0E3B33;
}

h1, h2, h3, h4 {
  letter-spacing: -0.022em;
}

/* ---------- 通用控件 ---------- */
[data-slot="form-control"] {
  height: 2.65rem !important;
  border-radius: 12px !important;
  background: rgba(255, 253, 249, 0.9) !important;
  border-color: var(--border) !important;
  padding-inline: 0.85rem !important;
  font-size: 0.875rem !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}

.dark [data-slot="form-control"] {
  background: rgba(28, 25, 22, 0.9) !important;
}

[data-slot="form-control"]:focus-visible {
  border-color: var(--teal) !important;
  box-shadow: 0 0 0 3px rgba(14, 122, 107, 0.13) !important;
  outline: none !important;
}

button[type="submit"] {
  border-radius: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
}

[data-slot="button"] {
  border-radius: 10px;
}

[data-slot="card"] {
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  box-shadow: 0 1px 2px rgba(23, 20, 16, 0.03);
}

[data-slot="dialog-content"],
[data-slot="sheet-content"],
[data-slot="popover-content"] {
  border: 1px solid var(--border) !important;
  border-radius: 20px !important;
  box-shadow: 0 40px 90px -50px rgba(23, 20, 16, 0.5) !important;
}

thead {
  background: var(--table-header) !important;
}

tbody tr:hover {
  background: rgba(23, 20, 16, 0.025) !important;
}

.dark tbody tr:hover {
  background: rgba(245, 241, 233, 0.035) !important;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: rgba(23, 20, 16, 0.18);
  border-radius: 99px;
  border: 3px solid var(--background);
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- 登录 / 注册 ---------- */
div.relative.grid.h-svh {
  background: transparent !important;
}

@media (min-width: 1024px) {
  div.relative.grid.h-svh::before {
    content: "";
    position: fixed;
    left: 5vw;
    bottom: 4vh;
    width: 320px;
    height: 320px;
    background: url("/brand/logo.png") center / contain no-repeat;
    opacity: 0.055;
    pointer-events: none;
  }
  div.relative.grid.h-svh::after {
    content: "";
    position: fixed;
    right: -8vw;
    top: -18vh;
    width: 52vw;
    height: 52vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 122, 107, 0.07), transparent 65%);
    pointer-events: none;
  }
}

div.relative.grid.h-svh .container > div.mx-auto {
  background: rgba(252, 250, 246, 0.9) !important;
  border: 1px solid var(--border) !important;
  border-radius: 28px !important;
  box-shadow: 0 34px 90px -50px rgba(23, 20, 16, 0.45), 0 1px 0 rgba(255, 255, 255, 0.85) inset !important;
  backdrop-filter: blur(12px);
  padding: 2.6rem !important;
}

.dark div.relative.grid.h-svh .container > div.mx-auto {
  background: rgba(28, 25, 22, 0.88) !important;
  box-shadow: 0 34px 90px -50px rgba(0, 0, 0, 0.7) !important;
}

@media (max-width: 640px) {
  div.relative.grid.h-svh .container > div.mx-auto {
    padding: 1.9rem 1.4rem !important;
    width: calc(100% - 32px) !important;
  }
}

div.relative.grid.h-svh h1,
div.relative.grid.h-svh .text-2xl.font-semibold {
  font-size: 1.9rem !important;
  letter-spacing: -0.035em !important;
  font-weight: 600 !important;
}

@media (min-width: 640px) {
  div.relative.grid.h-svh h1,
  div.relative.grid.h-svh .text-2xl.font-semibold {
    font-size: 2.1rem !important;
  }
}

div.relative.grid.h-svh .text-muted-foreground {
  font-size: 0.875rem !important;
  line-height: 1.7 !important;
}

div.relative.grid.h-svh a.underline,
div.relative.grid.h-svh .underline {
  color: var(--teal) !important;
  text-decoration-color: rgba(14, 122, 107, 0.35) !important;
  text-underline-offset: 4px !important;
}

div.relative.grid.h-svh button[type="submit"] {
  height: 2.8rem !important;
  margin-top: 0.6rem !important;
  background: var(--ink) !important;
  color: var(--cream) !important;
  box-shadow: 0 12px 26px -16px rgba(23, 20, 16, 0.7) !important;
}

div.relative.grid.h-svh button[type="submit"]:hover {
  background: #2A261F !important;
}

div.relative.grid.h-svh img.h-8.w-8 {
  width: 38px !important;
  height: 38px !important;
}

div.relative.grid.h-svh .container > div.mx-auto h1::before,
div.relative.grid.h-svh .container > div.mx-auto .text-2xl.font-semibold::before {
  content: "鱼鱼词元所 · TOKEN RELAY";
  display: block;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--muted-foreground);
  margin-bottom: 12px;
  text-transform: uppercase;
}

div.relative.grid.h-svh .text-xl.font-medium {
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.015em !important;
}

/* ---------- 控制台 ---------- */
body:has([data-slot="sidebar-wrapper"]) header {
  background: rgba(246, 243, 237, 0.78) !important;
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border) !important;
}

.dark header {
  background: rgba(20, 18, 16, 0.78) !important;
}

/* 表格更轻 */
table {
  border-color: var(--border) !important;
}

table th {
  font-weight: 600 !important;
  letter-spacing: 0.01em;
}

/* 代码/日志区域延续纸感 */
pre,
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* ============================================================
   v2 · 控制台结构重排（不是换色，是换骨架）
   ============================================================ */

:root {
  --app-header-height: 4rem !important;
}

/* 深墨色浮动侧栏 */
[data-slot="sidebar-wrapper"] {
  --sidebar-width: 15.5rem !important;
}
[data-slot="sidebar"] {
  width: var(--sidebar-width) !important;
}
[data-slot="sidebar-container"] {
  top: calc(var(--app-header-height) + 10px) !important;
  bottom: 10px !important;
  height: auto !important;
  padding-left: 10px;
}
[data-slot="sidebar-inner"] {
  background: #171410 !important;
  color: #F5F1E9 !important;
  border: 1px solid rgba(245, 241, 233, 0.08) !important;
  border-radius: 24px !important;
  box-shadow: 0 34px 80px -55px rgba(23, 20, 16, 0.9), 0 1px 0 rgba(255, 255, 255, 0.06) inset !important;
  position: relative;
  overflow: hidden;
}
[data-slot="sidebar-content"] {
  padding-bottom: 54px !important;
}
[data-slot="sidebar-inner"]::after {
  content: "INVITE-ONLY BETA · 服务正常";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(245, 241, 233, 0.10);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: rgba(245, 241, 233, 0.42);
  pointer-events: none;
}
[data-slot="sidebar-menu-button"] {
  border-radius: 10px !important;
  color: rgba(245, 241, 233, 0.74) !important;
  position: relative;
}
[data-slot="sidebar-menu-button"]:hover {
  background: rgba(245, 241, 233, 0.06) !important;
  color: #F5F1E9 !important;
}
[data-slot="sidebar-menu-button"][data-active="true"],
[data-slot="sidebar-menu-button"][aria-current="page"] {
  background: rgba(245, 241, 233, 0.09) !important;
  color: #F5F1E9 !important;
}
[data-slot="sidebar-menu-button"][data-active="true"]::before,
[data-slot="sidebar-menu-button"][aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: #3FBFA8;
}
[data-slot="sidebar"] svg {
  color: rgba(245, 241, 233, 0.72);
}
[data-slot="sidebar-group-label"] {
  color: rgba(245, 241, 233, 0.38) !important;
  font-size: 10px !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

[data-slot="sidebar-wrapper"] {
  --sidebar: #171410 !important;
  --sidebar-foreground: #F5F1E9 !important;
  --sidebar-primary: #F5F1E9 !important;
  --sidebar-primary-foreground: #171410 !important;
  --sidebar-accent: rgba(245, 241, 233, 0.09) !important;
  --sidebar-accent-foreground: #F5F1E9 !important;
  --sidebar-border: rgba(245, 241, 233, 0.10) !important;
  --sidebar-ring: #3FBFA8 !important;
}

/* 顶栏：更高、更轻、无重边框 */
body:has([data-slot="sidebar-wrapper"]) header {
  height: var(--app-header-height) !important;
  background: rgba(246, 243, 237, 0.82) !important;
  border-bottom: 1px solid var(--border) !important;
  backdrop-filter: blur(18px);
}
body:has([data-slot="sidebar-wrapper"]) header nav a {
  font-size: 13px !important;
  color: var(--muted-foreground) !important;
}
body:has([data-slot="sidebar-wrapper"]) header nav a:hover {
  color: var(--ink) !important;
}
body:has([data-slot="sidebar-wrapper"]) header a[href="/"] {
  font-weight: 600 !important;
  letter-spacing: -0.01em;
}
body:has([data-slot="sidebar-wrapper"]) header a[href="/"] img {
  width: 26px !important;
  height: 26px !important;
}

/* 页头：编辑式眉题 + 大标题 */
body:has([data-slot="sidebar-wrapper"]) main .shrink-0[class*="px-3"][class*="pt-3"] {
  padding: 22px 28px 14px !important;
  border-bottom: 1px solid var(--border);
  background: transparent;
}
body:has([data-slot="sidebar-wrapper"]) main .shrink-0[class*="px-3"][class*="pt-3"]::before {
  content: "YUYU TOKEN RELAY / WORKSPACE";
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--muted-foreground);
  margin-bottom: 7px;
}
body:has([data-slot="sidebar-wrapper"]) main .shrink-0[class*="px-3"][class*="pt-3"] h2 {
  font-size: 27px !important;
  font-weight: 600 !important;
  letter-spacing: -0.035em !important;
}

/* 顶层卡片：更圆、更轻、悬浮感 */
main .flex.flex-col.gap-4 > [class*="bg-card"] {
  border-radius: 22px !important;
  border-color: var(--border) !important;
  background: rgba(252, 250, 246, 0.76) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset,
              0 30px 60px -55px rgba(23, 20, 16, 0.5) !important;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
main .flex.flex-col.gap-4 > [class*="bg-card"]:hover {
  transform: translateY(-2px);
  border-color: rgba(23, 20, 16, 0.16) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset,
              0 36px 72px -52px rgba(23, 20, 16, 0.58) !important;
}

/* 表格：把每一行做成独立卡片 */
main table {
  border-collapse: separate !important;
  border-spacing: 0 6px !important;
}
main table thead tr {
  background: transparent !important;
}
main table thead th {
  border: 0 !important;
  padding: 9px 14px !important;
  font-size: 10.5px !important;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted-foreground) !important;
}
main table tbody tr {
  background: rgba(252, 250, 246, 0.72) !important;
}
main table tbody td {
  border-top: 1px solid var(--border) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 12px 14px !important;
}
main table tbody td:first-child {
  border-left: 1px solid var(--border) !important;
  border-radius: 12px 0 0 12px !important;
}
main table tbody td:last-child {
  border-right: 1px solid var(--border) !important;
  border-radius: 0 12px 12px 0 !important;
}
main table tbody tr:hover {
  background: rgba(255, 253, 249, 0.95) !important;
}

[data-slot="badge"] {
  border-radius: 999px !important;
  font-weight: 500;
}

/* 控制台右下角淡鱼水印 */
@media (min-width: 1280px) {
  body:has([data-slot="sidebar-wrapper"])::before {
    content: "";
    position: fixed;
    right: -70px;
    bottom: -90px;
    width: 380px;
    height: 380px;
    background: url("/brand/logo.png") center / contain no-repeat;
    opacity: 0.035;
    pointer-events: none;
    z-index: 0;
  }
}

/* 侧栏品牌行：把主品牌收进深色侧栏 */
@media (min-width: 768px) {
  body:has([data-slot="sidebar-wrapper"]) header a[href="/"]:has(img) {
    display: none !important;
  }
  [data-slot="sidebar-inner"]::before {
    content: "鱼鱼词元所";
    display: block;
    height: 58px;
    margin: 8px 12px 2px;
    padding-left: 38px;
    background: url("/brand/logo-light.png") left center / 26px 26px no-repeat;
    color: #F5F1E9;
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 58px;
  }
}

/* ============================================================
   v3 · 登录/注册：左右分屏 + 鱼群元素
   ============================================================ */
@media (min-width: 1024px) {
  div.relative.grid.h-svh {
    display: block !important;
    background: #F6F3ED !important;
  }
  div.relative.grid.h-svh > a {
    display: none !important;
  }
  div.relative.grid.h-svh::before {
    content: "";
    position: fixed;
    left: 0;
    top: 0;
    width: 52vw;
    height: 100svh;
    background-color: #171410;
    background-image:
      radial-gradient(circle at 26% 18%, rgba(63, 191, 168, 0.18), transparent 44%),
      linear-gradient(rgba(245, 241, 233, 0.045) 1px, transparent 1px),
      linear-gradient(90deg, rgba(245, 241, 233, 0.045) 1px, transparent 1px);
    background-repeat: no-repeat, repeat, repeat;
    background-position: 0 0, 0 0, 0 0;
    background-size: auto, 42px 42px, 42px 42px;
    border-right: 1px solid rgba(245, 241, 233, 0.06);
    bottom: auto !important;
    right: auto !important;
    opacity: 1 !important;
    pointer-events: none;
    z-index: 0;
  }
  div.relative.grid.h-svh::after {
    content: "一个入口，\A连接所有模型。";
    position: fixed;
    left: 5.5vw;
    bottom: 9vh;
    white-space: pre;
    color: #F5F1E9;
    font-size: clamp(34px, 3.1vw, 48px);
    line-height: 1.12;
    letter-spacing: -0.045em;
    font-weight: 600;
    z-index: 2;
    top: auto !important;
    right: auto !important;
    width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
    background: none !important;
    pointer-events: none;
  }
  div.relative.grid.h-svh > .container {
    margin-left: 52vw !important;
    width: 48vw !important;
    height: 100svh !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative;
    z-index: 1;
  }
  div.relative.grid.h-svh .container > div.mx-auto {
    width: 420px !important;
    padding: 2.6rem !important;
    background: rgba(252, 250, 246, 0.94) !important;
    border: 1px solid var(--border) !important;
    border-radius: 28px !important;
    box-shadow: 0 34px 90px -55px rgba(23, 20, 16, 0.45),
                0 1px 0 rgba(255, 255, 255, 0.85) inset !important;
    max-height: calc(100svh - 32px);
    overflow-y: auto;
  }
}


/* 鱼群绕球场景 */
.cys-scene { display: none; }
@media (min-width: 1024px) {
  .cys-scene {
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    width: 52vw;
    height: 100svh;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
  }
  .cys-scene svg {
    position: absolute;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: auto;
    overflow: visible;
  }
}
