/* 当前项目的全站样式文件，负责首页布局、主题切换、卡片、搜索面板和后台入口等视觉表现。 */
/* 深色主题与全站通用颜色变量。 */
:root {
    --bg: linear-gradient(rgba(15, 23, 42, 0.48), rgba(15, 23, 42, 0.48)), url("../img/平静-水纹-治愈.png") center center / cover fixed no-repeat;
    --bg-night: linear-gradient(rgba(15, 23, 42, 0.48), rgba(15, 23, 42, 0.48)), url("../img/平静-水纹-治愈.png") center center / cover fixed no-repeat;
    --bg-day: linear-gradient(rgba(248, 250, 252, 0.4), rgba(248, 250, 252, 0.4)), url("../img/平静-水纹-治愈.png") center center / cover fixed no-repeat;
    --text: #e5e7eb;
    --muted: #cbd5e1;
    --soft: #a8b4c8;
    --hero-bg: rgba(30, 41, 59, 0.72);
    --card-bg: rgba(255, 255, 255, 0.07);
    --border: rgba(148, 163, 184, 0.2);
    --tag-bg: rgba(59, 130, 246, 0.2);
    --tag-text: #bfdbfe;
    --get-bg: rgba(34, 197, 94, 0.2);
    --get-text: #bbf7d0;
    --post-bg: rgba(59, 130, 246, 0.2);
    --post-text: #bfdbfe;
    --path-text: #f8fafc;
    --shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
    --ease: cubic-bezier(.4, -.3, .6, 1.3);
    --theme-ease: cubic-bezier(.22, 1, .36, 1);
    --switch-ease: cubic-bezier(.34, 1.56, .64, 1);
    --clr-background-day: #1b7fcc;
    --clr-background-night: #223a5e;
    --clr-sun: #fce570;
    --clr-sun-lgt: #ffffe3;
    --clr-moon: hsl(212, 13%, 75%);
    --sidebar-bg: rgba(30, 41, 59, 0.95);
    --sidebar-item-bg: rgba(255, 255, 255, 0.05);
    --sidebar-item-hover-bg: rgba(255, 255, 255, 0.1);
    --sidebar-mask-bg: rgba(15, 23, 42, 0.35);
}

/* 浅色主题下覆盖默认变量。 */
body.light {
    --bg: linear-gradient(rgba(248, 250, 252, 0.4), rgba(248, 250, 252, 0.4)), url("../img/平静-水纹-治愈.png") center center / cover fixed no-repeat;
    --text: #0f172a;
    --muted: #334155;
    --soft: #64748b;
    --hero-bg: rgba(255, 255, 255, 0.78);
    --card-bg: rgba(255, 255, 255, 0.72);
    --border: rgba(148, 163, 184, 0.28);
    --tag-bg: rgba(37, 99, 235, 0.12);
    --tag-text: #1d4ed8;
    --get-bg: rgba(34, 197, 94, 0.12);
    --get-text: #15803d;
    --post-bg: rgba(59, 130, 246, 0.12);
    --post-text: #1d4ed8;
    --path-text: #0f172a;
    --sidebar-bg: rgba(241, 245, 249, 0.88);
    --sidebar-item-bg: rgba(15, 23, 42, 0.06);
    --sidebar-item-hover-bg: rgba(15, 23, 42, 0.12);
    --sidebar-mask-bg: rgba(15, 23, 42, 0.14);
}

body.light .sidebar-nav-icon {
    filter: none;
}

body.light .api-status.normal {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
}

body.light .api-status.maintain {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

body.light .api-view {
    background: rgba(59, 130, 246, 0.14);
    color: #1d4ed8;
}

/* 统一盒模型，避免尺寸计算偏差。 */
* { box-sizing: border-box; }

html {
    min-height: 100%;
    background: #020617;
}

/* 页面整体背景、字体与主题过渡。 */
body {
    margin: 0;
    min-height: 100vh;
    position: relative;
    isolation: isolate;
    font-family: "Microsoft YaHei", Arial, sans-serif;
    background: transparent;
    color: var(--text);
    transition: none;
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: var(--bg-night);
    pointer-events: none;
    z-index: -1;
}

body::after {
    background: var(--bg-day);
    opacity: 0;
}

body.light::before {
    opacity: 0;
}

body.light::after {
    opacity: 1;
}

body.theme-ready {
    transition: color .35s var(--theme-ease);
}

body.theme-ready::before,
body.theme-ready::after {
    transition: opacity .9s var(--theme-ease);
}

body.theme-ready .page-header-shell,
body.theme-ready .menu-toggle,
body.theme-ready .welcome-toast,
body.theme-ready .api-popup,
body.theme-ready .api-popup-content,
body.theme-ready .sidebar,
body.theme-ready .sidebar-mask,
body.theme-ready .api-card,
body.theme-ready .api-status,
body.theme-ready .api-card-name,
body.theme-ready .api-card-path,
body.theme-ready .api-card-desc,
body.theme-ready .api-feedback,
body.theme-ready .api-view,
body.theme-ready .floating-backtop,
body.theme-ready .floating-search,
body.theme-ready .search-panel,
body.theme-ready .search-panel-input,
body.theme-ready .search-panel-results,
body.theme-ready .search-result-item,
body.theme-ready .doc-container,
body.theme-ready .doc-hero,
body.theme-ready .doc-badge,
body.theme-ready .doc-title,
body.theme-ready .doc-desc,
body.theme-ready .doc-meta-item,
body.theme-ready .doc-tab,
body.theme-ready .doc-subtab,
body.theme-ready .doc-table th,
body.theme-ready .doc-table td {
    transition:
        background-color .45s var(--theme-ease),
        background .45s var(--theme-ease),
        color .35s var(--theme-ease),
        border-color .45s var(--theme-ease),
        box-shadow .45s var(--theme-ease),
        filter .35s var(--theme-ease);
}

body.theme-ready .api-popup-backdrop {
    transition:
        opacity .35s ease,
        background .45s var(--theme-ease);
}

body.theme-ready .api-popup {
    transition:
        transform .35s ease,
        background .45s var(--theme-ease),
        color .35s var(--theme-ease),
        border-color .45s var(--theme-ease),
        box-shadow .45s var(--theme-ease);
}

body.theme-ready .sidebar {
    transition:
        transform .28s ease,
        background .45s var(--theme-ease),
        border-color .45s var(--theme-ease),
        box-shadow .45s var(--theme-ease);
}

body.theme-ready .sidebar-mask {
    transition:
        opacity .25s ease,
        background .45s var(--theme-ease);
}

body.theme-ready .search-panel {
    transition:
        opacity .25s ease,
        transform .25s ease,
        background .45s var(--theme-ease),
        border-color .45s var(--theme-ease),
        box-shadow .45s var(--theme-ease);
}

body.theme-ready .floating-backtop {
    transition:
        opacity .25s ease,
        transform .25s ease,
        background .45s var(--theme-ease),
        border-color .45s var(--theme-ease),
        box-shadow .45s var(--theme-ease);
}

html.is-scroll-locked,
body.is-scroll-locked {
    overflow: hidden;
}

body.is-scroll-locked {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
}

/* 隐藏的渐变定义 SVG，不参与页面排版。 */
.defs-svg {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

/* 顶部外层盒子，负责承载分隔线并让内部内容垂直居中。 */
.page-header-shell {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 72px;
    margin: 0;
    padding-top: 0;
    display: flex;
    align-items: center;
    background: var(--hero-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 30;
    overflow: visible;
}

/* 页面顶部行，左侧菜单和 logo，右侧主题按钮。 */
.page-header {
    width: 100%;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* 左侧品牌区。 */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

/* 菜单按钮基础样式。 */
.menu-toggle {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    border-radius: 8px;
    transition: background .2s ease, border-color .2s ease, transform .15s ease, box-shadow .2s ease;
}

/* 菜单按钮悬停时的视觉反馈。 */
.menu-toggle:hover {
    background: var(--sidebar-item-hover-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* 菜单按钮按下时的轻微缩放。 */
.menu-toggle:active {
    transform: scale(0.92);
}

/* 菜单按钮中的图标大小。 */
.menu-toggle img {
    display: block;
    width: 18px;
    height: 18px;
}

/* logo 尺寸控制。 */
.brand-logo {
    display: block;
    height: 42px;
    width: auto;
    max-width: min(220px, 48vw);
}

/* logo 图展示盒子，放在顶部栏下方。 */
.logo-box {
    margin-top: 72px;
    padding: 24px;
    display: flex;
    justify-content: center;
}

/* 两张图片的并排容器。 */
.logo-box-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 8px;
    padding: 24px 32px;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
}

/* 展示盒子中的图片尺寸控制。 */
.logo-box-image {
    display: block;
    max-width: min(54vw, 560px);
    max-height: 220px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* 页面进入时显示的欢迎提示框。 */
.welcome-toast {
    position: fixed;
    top: 92px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    padding: 10px 18px;
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #f1f5f9;
    font-size: .95rem;
    white-space: nowrap;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    opacity: 0;
    pointer-events: none;
    transition: opacity .4s ease, transform .4s ease;
    z-index: 60;
}

.welcome-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

body.light .welcome-toast {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(148, 163, 184, 0.25);
    color: #0f172a;
}

.api-popup-backdrop {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s ease;
    z-index: 70;
    overscroll-behavior: contain;
}

.api-popup-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.api-popup {
    width: min(92vw, 420px);
    padding: 24px 22px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.82);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    color: #f8fafc;
    transform: translateY(24px) scale(0.96);
    transition: transform .35s ease;
    text-align: center;
}

.api-popup-backdrop.is-visible .api-popup {
    transform: translateY(0) scale(1);
}

.api-popup-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(94, 174, 253, 0.16);
    color: #bfdbfe;
    font-size: .82rem;
    letter-spacing: 1px;
}

.api-popup-status {
    margin-top: 16px;
    color: #93c5fd;
    font-size: .92rem;
}

.api-popup-title {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.3;
}

.api-popup-count {
    margin-top: 8px;
    color: rgba(226, 232, 240, 0.78);
    font-size: .95rem;
}

.api-popup-desc {
    margin-top: 14px;
    color: rgba(241, 245, 249, 0.86);
    font-size: .96rem;
    line-height: 1.8;
}

.api-popup-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.api-popup-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 142px;
    min-height: 46px;
    margin-top: 0;
    padding: 0 22px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #00bc9b, #5eaefd);
    color: #ffffff;
    font-weight: 600;
    font-size: .98rem;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(94, 174, 253, 0.24);
    cursor: pointer;
}

.api-popup-link:disabled {
    opacity: .72;
    cursor: wait;
}

.api-popup-link-secondary {
    background: rgba(148, 163, 184, 0.18);
    color: #e2e8f0;
    box-shadow: none;
}

body.light .api-popup-backdrop {
    background: rgba(226, 232, 240, 0.34);
}

body.light .api-popup {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(148, 163, 184, 0.24);
    box-shadow: 0 24px 60px rgba(148, 163, 184, 0.22);
    color: #0f172a;
}

body.light .api-popup-link-secondary {
    background: rgba(148, 163, 184, 0.14);
    color: #334155;
}

body.light .api-popup-label {
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
}

body.light .api-popup-status {
    color: #0284c7;
}

body.light .api-popup-count {
    color: rgba(15, 23, 42, 0.68);
}

body.light .api-popup-desc {
    color: rgba(15, 23, 42, 0.82);
}

/* 弹窗中的接口实际返回内容。 */
.api-popup-content {
    width: 100%;
    margin: 16px 0 0;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(2, 6, 23, 0.34);
    color: #e2e8f0;
    font-size: .92rem;
    line-height: 1.75;
    white-space: normal;
    word-break: break-word;
    text-align: left;
    max-height: min(42vh, 320px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.api-popup.is-tarot {
    width: min(92vw, 360px);
    padding-bottom: 20px;
}

.api-popup.is-tarot .api-popup-title {
    margin-bottom: 10px;
}

.api-popup.is-tarot .api-popup-content {
    margin-top: 0;
    padding: 0;
    border: none;
    background: transparent;
    max-height: none;
    overflow: visible;
    text-align: center;
}

.api-popup.is-tarot .api-popup-actions {
    margin-top: 16px;
}

.api-popup-line {
    white-space: pre-wrap;
}

.api-popup-line + .api-popup-line {
    margin-top: 12px;
}

.api-popup-line.has-label {
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.api-popup-line-label {
    flex-shrink: 0;
}

.api-popup-line-text {
    min-width: 0;
    white-space: pre-wrap;
}

.api-popup-line.is-right {
    text-align: right;
}

.api-popup-line.is-right .api-popup-line-text {
    display: block;
    width: 100%;
}

.api-popup-line.is-poem-title {
    text-align: center;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.api-popup-line.is-poem-meta {
    text-align: center;
    color: rgba(226, 232, 240, 0.74);
    font-size: .88rem;
}

.api-popup-line.is-poem-body {
    text-align: center;
    line-height: 2;
}

.api-popup-line.is-poem-body .api-popup-line-text {
    display: block;
}

.api-popup-line.is-emoji-idiom {
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.api-popup-line.is-emoji-idiom .api-popup-line-text {
    font-size: 2rem;
    letter-spacing: 4px;
    line-height: 1.4;
}

.api-popup-guess-image-wrap {
    display: flex;
    justify-content: center;
}

.api-popup-guess-image {
    display: block;
    max-width: 100%;
    max-height: min(42vh, 320px);
    border-radius: 14px;
    object-fit: contain;
}

.api-popup-answer-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 16px 0 0 auto;
    padding: 0;
    border: none;
    background: transparent;
    color: #93c5fd;
    font-size: .9rem;
    cursor: pointer;
}

.api-popup-answer-content {
    display: none;
    margin-top: 12px;
    white-space: pre-wrap;
}

.api-popup-content.is-answer-visible .api-popup-answer-content {
    display: block;
}

.api-popup-tarot {
    display: flex;
    justify-content: center;
}

.api-popup-tarot-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
}

body.light .api-popup-content {
    background: rgba(248, 250, 252, 0.92);
    border-color: rgba(148, 163, 184, 0.24);
    color: #0f172a;
}

body.light .api-popup-answer-toggle {
    color: #0284c7;
}

body.light .api-popup-line.is-poem-meta {
    color: rgba(51, 65, 85, 0.78);
}

/* 当前时间。 */
.current-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    text-align: center;
    color: var(--text);
    font-size: .95rem;
    letter-spacing: 0.5px;
}

.current-time-icon {
    width: 14px;
    height: 14px;
    filter: brightness(0) invert(1);
}

body.light .current-time-icon {
    filter: none;
}

/* 稳定运行时间。 */
.uptime-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    text-align: center;
    color: var(--soft);
    font-size: .9rem;
    letter-spacing: 0.5px;
}

.uptime-icon {
    width: 14px;
    height: 14px;
    filter: brightness(0) invert(1);
}

body.light .uptime-icon {
    filter: none;
}

body.light .uptime-text {
    color: rgba(51, 65, 85, 0.9);
}

body.light .footer-info {
    color: rgba(51, 65, 85, 0.9);
}

body.light .footer-link {
    color: rgba(30, 41, 59, 0.92);
}

/* 左侧抽屉菜单主体。 */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    padding: 28px 22px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    box-shadow: 16px 0 40px rgba(0, 0, 0, 0.25);
    transform: translateX(calc(-100% - 40px));
    transition: transform .28s ease, background .25s ease, border-color .25s ease;
    z-index: 50;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* 菜单打开时滑入屏幕。 */
.sidebar.is-open {
    transform: translateX(0);
}

/* 抽屉菜单头部。 */
.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

/* 侧边栏 logo 尺寸控制。 */
.sidebar-logo {
    display: block;
    height: 56px;
    width: auto;
    max-width: 220px;
}

/* 抽屉菜单链接列表。 */
.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 16px;
}

/* 抽屉菜单单项字号。 */
.sidebar-nav li {
    font-size: 1.35rem;
}

/* 抽屉菜单链接样式。 */
.sidebar-nav a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    margin-bottom: 4px;
    transition: .4s;
}

/* 菜单项前面的图标。 */
.sidebar-nav-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
}

/* 下划线装饰 SVG。 */
.sidebar-nav svg {
    display: block;
    pointer-events: none;
    transition: .5s;
}

/* 下划线路径动画。 */
.sidebar-nav path {
    transition: stroke-dasharray .5s, stroke-dashoffset .5s, opacity .5s;
}

/* 第二条路径默认半透明，增强层次。 */
.sidebar-nav path:last-child {
    opacity: .2;
}

/* 链接悬停高亮。 */
.sidebar-nav a:hover,
.sidebar-nav a:focus {
    color: #00bc9b;
}

/* 链接悬停时显示下划线 SVG。 */
.sidebar-nav a:hover + svg,
.sidebar-nav a:focus + svg {
    opacity: 1;
}

/* 链接悬停时播放下划线描边动画。 */
.sidebar-nav a:hover + svg path,
.sidebar-nav a:focus + svg path {
    stroke-dashoffset: 0;
}

/* 抽屉菜单打开时的遮罩层。 */
.sidebar-mask {
    position: fixed;
    inset: 0;
    background: var(--sidebar-mask-bg);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, background .25s ease;
    z-index: 40;
    overscroll-behavior: contain;
}

/* 遮罩层显示状态。 */
.sidebar-mask.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* 主题切换按钮包裹层，用于承载 tooltip。 */
.theme-toggle-wrap {
    position: relative;
    flex-shrink: 0;
}

/* 主题切换按钮毛玻璃 tooltip。 */
.theme-toggle-wrap::before {
    content: '切换为日间模式';
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    padding: 5px 12px;
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #f1f5f9;
    font-size: .78rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .2s ease, transform .2s ease;
    z-index: 10;
}

.theme-toggle-wrap:hover::before {
    opacity: 1;
    transform: translateY(0);
}

body.light .theme-toggle-wrap::before {
    content: '切换为夜间模式';
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(148, 163, 184, 0.25);
    color: #0f172a;
}

/* 主题切换按钮外壳。 */
#button-wrapper {
    --x: 4px;
    --y: 6px;
    --spread: 6px;
    --offset: 0;
    --button-width: 22px;
    position: relative;
    width: 72px;
    height: 28px;
    border-radius: 999px;
    border: none;
    overflow: hidden;
    isolation: isolate;
    cursor: pointer;
    flex-shrink: 0;
    background-color: var(--clr-background-day);
    box-shadow:
        var(--x) var(--y) var(--spread) var(--offset) rgb(0 0 0 / 0.15),
        var(--x) var(--y) var(--spread) var(--offset) rgb(0 0 0 / 0.25),
        inset var(--x) var(--y) var(--spread) var(--offset) rgb(255 255 255 / 0.35);
    transition:
        background-color .75s var(--theme-ease),
        box-shadow .75s var(--theme-ease);
    will-change: background-color, box-shadow;
}

/* 按钮背景中的云朵装饰。 */
#button-wrapper::before,
#button-wrapper::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background-color: #fff;
    transition:
        transform .75s var(--theme-ease),
        opacity .75s var(--theme-ease);
    z-index: 1;
    will-change: transform, opacity;
}

/* 云朵第一层。 */
#button-wrapper::before {
    width: 22px;
    height: 22px;
    right: -6px;
    bottom: 2px;
    box-shadow:
        -10px 10px 0 -3px #fff,
        -20px 12px 0 -6px #fff,
        -30px 15px 0 -3px #fff,
        -40px 15px 0 -7px #fff,
        -50px 18px 0 -6px #fff;
    opacity: .5;
    transform: translate3d(0, 0, 0) scale(1);
}

/* 云朵第二层。 */
#button-wrapper::after {
    width: 22px;
    height: 22px;
    right: -10px;
    bottom: -2px;
    box-shadow:
        -10px 10px 0 -3px #fff,
        -20px 12px 0 -6px #fff,
        -30px 15px 0 -3px #fff,
        -40px 15px 0 -7px #fff,
        -50px 18px 0 -6px #fff;
    transform: translate3d(0, 0, 0) scale(1);
}

/* 夜间模式下切换外壳背景。 */
#button-wrapper[data-time="night"] {
    background-color: var(--clr-background-night);
}

/* 夜间模式下云朵移出视区。 */
#button-wrapper[data-time="night"]::before {
    transform: translate3d(94px, 14px, 0) scale(2);
}

/* 夜间模式下第二层云朵移出视区。 */
#button-wrapper[data-time="night"]::after {
    transform: translate3d(90px, 24px, 0) scale(3);
}

/* 可滑动的太阳/月亮主体。 */
#button {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translate3d(0, -50%, 0);
    width: var(--button-width);
    height: var(--button-width);
    border-radius: 50%;
    background: radial-gradient(var(--clr-sun-lgt), transparent);
    background-color: var(--clr-sun);
    box-shadow:
        0 0 0 6px rgb(255 255 255 / 0.2),
        0 0 0 12px rgb(255 255 255 / 0.2),
        0 0 0 18px rgb(255 255 255 / 0.2),
        0 0 6px 0 #fff;
    transition:
        transform .75s var(--switch-ease),
        background-color .55s var(--theme-ease),
        box-shadow .75s var(--theme-ease);
    z-index: 3;
    pointer-events: none;
    will-change: transform, background-color, box-shadow;
}

/* 月亮上的陨石坑效果。 */
#button::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 55%;
    width: 25%;
    height: 25%;
    background-color: transparent;
    border-radius: 50%;
    transition:
        background-color .3s ease,
        box-shadow .3s ease;
    box-shadow:
        -13px -10px 0 1px transparent,
        1px -14px 0 -1px transparent;
}

/* 夜间模式下滑块移动到右侧并切换为月亮。 */
#button-wrapper[data-time="night"] #button {
    transform: translate3d(42px, -50%, 0);
    background: radial-gradient(#eee, transparent);
    background-color: var(--clr-moon);
    box-shadow:
        0 0 0 8px rgb(255 255 255 / 0.1),
        0 0 0 16px rgb(255 255 255 / 0.1),
        0 0 0 24px rgb(255 255 255 / 0.1),
        0 0 6px 0 #fff;
}

/* 夜间模式下显示月亮表面纹理。 */
#button-wrapper[data-time="night"] #button::after {
    transition-delay: .5s;
    background-color: #c5c5c5;
    box-shadow:
        -13px -10px 0 1px #d5d5d5,
        1px -14px 0 -1px #d5d5d5;
}

/* 星空动画画布。 */
#stars {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity .75s var(--theme-ease);
    z-index: 0;
}

body:not(.theme-ready) #button-wrapper,
body:not(.theme-ready) #button-wrapper::before,
body:not(.theme-ready) #button-wrapper::after,
body:not(.theme-ready) #button,
body:not(.theme-ready) #button::after,
body:not(.theme-ready) #stars {
    transition: none;
}

/* 夜间模式才显示星空画布。 */
#button-wrapper[data-time="night"] #stars {
    opacity: 1;
}

/* 接口列表区域外层。 */
.api-section {
    padding: 0 0 40px;
}

/* 接口列表大盒子。 */
.api-panel {
    width: 100%;
    margin: 0;
    padding: 28px 24px;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
}

/* 接口列表头部。 */
.api-panel-head {
    margin-bottom: 22px;
}

.api-panel-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text);
}

.api-panel-subtitle {
    margin-top: 8px;
    color: var(--muted);
    font-size: .98rem;
}

/* 16 个接口网格，每行 4 个。 */
.api-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

/* 单个接口卡片。 */
.api-card {
    position: relative;
    min-height: 196px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--card-bg);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    display: flex;
    flex-direction: column;
    transition: border-color .3s ease, box-shadow .3s ease;
}

/* 卡片悬停时边框渐变发光。 */
.api-card:hover {
    border-color: rgba(0, 188, 155, 0.5);
    box-shadow:
        0 12px 30px rgba(15, 23, 42, 0.12),
        0 0 0 1px rgba(0, 188, 155, 0.3),
        0 0 20px rgba(94, 174, 253, 0.15);
}

/* 含维护状态的卡片悬停时边框红色发光。 */
.api-card:has(.api-status.maintain):hover {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow:
        0 12px 30px rgba(15, 23, 42, 0.12),
        0 0 0 1px rgba(239, 68, 68, 0.3),
        0 0 20px rgba(239, 68, 68, 0.15);
}

.api-card-head {
    position: absolute;
    top: 18px;
    right: 18px;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0;
}

.api-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
}

.api-status.normal {
    background: rgba(34, 197, 94, 0.18);
    color: #bbf7d0;
}

.api-status.maintain {
    background: rgba(245, 158, 11, 0.18);
    color: #fde68a;
}

.api-card-name {
    margin-top: 0;
    margin-bottom: 8px;
    padding-right: 68px;
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--text);
}

.api-card-path {
    margin-bottom: 10px;
    padding-right: 68px;
    color: var(--path-text);
    font-size: .94rem;
    word-break: break-all;
}

.api-card-desc {
    padding-right: 12px;
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.65;
}

.api-card-bottom {
    margin-top: auto;
    padding-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.api-feedback {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

/* 反馈按钮毛玻璃气泡 tooltip 文字。 */
.api-feedback::before {
    content: '反馈';
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    padding: 5px 12px;
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #f1f5f9;
    font-size: .78rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .2s ease, transform .2s ease;
}

/* 浅色主题下毛玻璃 tooltip。 */
body.light .api-feedback::before {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(148, 163, 184, 0.25);
    color: #0f172a;
}

/* 悬停时显示 tooltip。 */
.api-feedback:hover::before {
    opacity: 1;
    transform: translateY(0);
}

.api-feedback img {
    width: 14px;
    height: 14px;
    display: block;
    filter: brightness(0) invert(1);
}

body.light .api-feedback img {
    filter: none;
}

.api-view {
    min-width: 72px;
    height: 34px;
    padding: 0 14px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.18);
    color: var(--tag-text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    font-weight: 600;
}

.api-view-disabled {
    background: rgba(245, 158, 11, 0.14);
    color: #fcd34d;
    cursor: not-allowed;
}

/* 右下角悬浮返回顶部按钮。 */
.floating-backtop {
    position: fixed;
    right: 24px;
    bottom: 84px;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity .25s ease, transform .25s ease;
    z-index: 60;
}

.floating-backtop.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.floating-backtop::before {
    content: '返回顶部';
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    padding: 5px 12px;
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #f1f5f9;
    font-size: .78rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .2s ease, transform .2s ease;
}

.floating-backtop:hover::before {
    opacity: 1;
    transform: translateY(0);
}

.floating-backtop img {
    width: 18px;
    height: 18px;
    display: block;
    filter: brightness(0) invert(1);
}

body.light .floating-backtop {
    background: rgba(255, 255, 255, 0.6);
}

body.light .floating-backtop::before {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(148, 163, 184, 0.25);
    color: #0f172a;
}

body.light .floating-backtop img {
    filter: none;
}

/* 右下角悬浮搜索按钮。 */
.floating-search {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 60;
}

.floating-search::before {
    content: attr(data-tooltip);
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    padding: 5px 12px;
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #f1f5f9;
    font-size: .78rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .2s ease, transform .2s ease;
}

.floating-search:hover::before {
    opacity: 1;
    transform: translateY(0);
}

.floating-search img {
    width: 18px;
    height: 18px;
    display: block;
    filter: brightness(0) invert(1);
}

body.light .floating-search {
    background: rgba(255, 255, 255, 0.6);
}

body.light .floating-search::before {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(148, 163, 184, 0.25);
    color: #0f172a;
}

body.light .floating-search img {
    filter: none;
}

/* 搜索悬浮面板。 */
.search-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    width: min(560px, calc(100vw - 32px));
    min-height: 460px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(30, 41, 59, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, calc(-50% + 12px)) scale(.96);
    transition: opacity .25s ease, transform .25s ease;
    z-index: 59;
    overscroll-behavior: contain;
}

.search-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.search-panel-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text);
    font-size: 1.12rem;
    font-weight: 600;
}

.search-panel-icon {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
}

.search-panel-body {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.search-panel-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-size: .96rem;
    outline: none;
}

.search-panel-input::placeholder {
    color: var(--soft);
}

.search-panel-results {
    flex: 1;
    min-height: 300px;
    max-height: 420px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.search-panel-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    text-align: center;
    color: var(--soft);
    font-size: .92rem;
    line-height: 1.7;
}

.search-result-item {
    display: block;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    text-decoration: none;
}

.search-result-item + .search-result-item {
    margin-top: 10px;
}

.search-result-name {
    color: var(--text);
    font-size: .95rem;
    font-weight: 600;
}

.search-result-path {
    margin-top: 6px;
    color: var(--soft);
    font-size: .88rem;
}

body.light .search-panel {
    background: rgba(255, 255, 255, 0.72);
}

body.light .search-panel-icon {
    filter: none;
}

body.light .search-panel-input {
    background: rgba(15, 23, 42, 0.04);
}

body.light .search-panel-results {
    background: rgba(15, 23, 42, 0.03);
}

/* 更新日志页面。 */
.changelog-page {
    padding: 96px 24px 40px;
}

.changelog-shell {
    width: min(980px, 100%);
    margin: 0 auto;
}

.changelog-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--card-bg);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.14);
}

.changelog-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--tag-bg);
    color: var(--tag-text);
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .08em;
}

.changelog-title {
    margin: 14px 0 10px;
    color: var(--text);
    font-size: 2.2rem;
    line-height: 1.2;
}

.changelog-desc {
    margin: 0;
    color: var(--muted);
    font-size: .98rem;
    line-height: 1.8;
}

.changelog-hero-icon {
    width: 72px;
    height: 72px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.06);
    filter: brightness(0) invert(1);
}

body.light .changelog-hero-icon {
    filter: none;
    background: rgba(15, 23, 42, 0.04);
}

.changelog-timeline {
    position: relative;
    display: grid;
    gap: 18px;
    margin-top: 24px;
    padding-left: 20px;
}

.changelog-timeline::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 7px;
    width: 2px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(94, 174, 253, .75), rgba(0, 188, 155, .25));
}

.changelog-card {
    position: relative;
    padding: 22px 24px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card-bg);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
}

.changelog-card-dot {
    position: absolute;
    top: 28px;
    left: -19px;
    width: 14px;
    height: 14px;
    border: 3px solid rgba(94, 174, 253, .35);
    border-radius: 50%;
    background: #5eaefd;
    box-shadow: 0 0 0 6px rgba(94, 174, 253, .12);
}

.changelog-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.changelog-date {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.16);
    color: var(--tag-text);
    font-size: .84rem;
    font-weight: 700;
}

.changelog-card-title {
    margin: 0;
    color: var(--text);
    font-size: 1.18rem;
}

.changelog-list {
    margin: 16px 0 0;
    padding-left: 20px;
    color: var(--muted);
    line-height: 1.85;
    font-size: .95rem;
}

.changelog-list li + li {
    margin-top: 6px;
}

/* 文档详情页主体区域。 */
.doc-page {
    padding: 0 24px 40px;
}

.doc-shell {
    width: 100%;
    max-width: none;
    margin: 0;
}

.doc-container {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--card-bg);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.doc-hero {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    padding: 0 0 24px;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.doc-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--tag-bg);
    color: var(--tag-text);
    font-size: .85rem;
    font-weight: 700;
}

.doc-title {
    margin: 0 0 10px;
    font-size: 2rem;
    color: var(--text);
}

.doc-desc {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
    font-size: .96rem;
}

.doc-meta {
    width: 300px;
    flex-shrink: 0;
    display: grid;
    gap: 14px;
}

.doc-meta-item {
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
}

.doc-meta-label {
    display: block;
    margin-bottom: 8px;
    color: var(--soft);
    font-size: .85rem;
}

.doc-meta-value {
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
}

.doc-link {
    color: #5eaefd;
    text-decoration: none;
    font-weight: 600;
}

.doc-tabs {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.doc-tab {
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .94rem;
    font-weight: 600;
    cursor: pointer;
}

.doc-tab.is-active {
    background: rgba(59, 130, 246, 0.18);
    color: var(--tag-text);
}

.doc-card {
    display: none;
    margin-top: 18px;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.doc-card.is-active {
    display: block;
}

.doc-card-title {
    margin: 0 0 18px;
    font-size: 1.25rem;
    color: var(--text);
}

.doc-section-title {
    margin: 22px 0 12px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
}

.doc-table-wrap {
    overflow-x: auto;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
}

.doc-table th,
.doc-table td {
    padding: 14px 16px;
    border: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
    color: var(--text);
    font-size: .92rem;
    line-height: 1.7;
}

.doc-table th {
    width: 180px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    font-weight: 600;
}

.doc-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.doc-subtab {
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .92rem;
    font-weight: 600;
    cursor: pointer;
}

.doc-subtab.is-active {
    background: rgba(59, 130, 246, 0.18);
    color: var(--tag-text);
}

.doc-code-panel {
    display: none;
}

.doc-code-panel.is-active {
    display: block;
}

.doc-copy-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    word-break: break-all;
}

.doc-copy-row > span {
    flex: 1;
    min-width: 0;
}

.doc-copy-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.doc-copy-btn,
.doc-open-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 6px 14px rgba(15, 23, 42, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
}

.doc-open-btn {
    text-decoration: none;
    color: inherit;
}

.doc-copy-btn::before,
.doc-open-btn::before {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    padding: 5px 12px;
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.26);
    color: #f8fafc;
    font-size: .78rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .2s ease, transform .2s ease;
}

.doc-copy-btn::before {
    content: '复制';
}

.doc-open-btn::before {
    content: '跳转';
}

.doc-copy-btn:hover::before,
.doc-open-btn:hover::before {
    opacity: 1;
    transform: translateY(0);
}

.doc-copy-btn img,
.doc-open-btn img {
    width: 16px;
    height: 16px;
    display: block;
    filter: brightness(0) invert(1);
}

.doc-code-block {
    margin-top: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.5);
    overflow: hidden;
}

.doc-code-block:first-of-type {
    margin-top: 0;
}

.doc-code-block pre {
    margin: 0;
    padding: 18px;
    overflow-x: auto;
}

.doc-code-block code {
    color: #e2e8f0;
    font-family: Consolas, Monaco, monospace;
    font-size: .9rem;
    line-height: 1.8;
}

body.light .doc-meta-item,
body.light .doc-table th {
    background: rgba(15, 23, 42, 0.04);
}

body.light .doc-code-block {
    background: rgba(15, 23, 42, 0.9);
}

body.light .doc-copy-btn,
body.light .doc-open-btn {
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(15, 23, 42, 0.04);
    box-shadow: none;
}

body.light .doc-copy-btn::before,
body.light .doc-open-btn::before {
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    border-color: rgba(148, 163, 184, 0.22);
}

body.light .doc-copy-btn img,
body.light .doc-open-btn img {
    filter: none;
}

.doc-copy-btn.is-copied {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(34, 197, 94, 0.35);
}

.doc-copy-toast {
    position: fixed;
    top: 92px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    padding: 10px 18px;
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.26);
    color: #f8fafc;
    font-size: .95rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
    z-index: 70;
}

.doc-copy-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

body.light .doc-copy-toast {
    background: rgba(255, 255, 255, 0.88);
    color: #0f172a;
    border-color: rgba(148, 163, 184, 0.22);
}

/* 页脚。 */
.footer {
    margin-top: 40px;
    color: var(--soft);
    font-size: 13px;
    text-align: center;
}


/* 页脚包裹层。 */
.footer-wrap {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text);
    font-size: .85rem;
}

.footer-copyright {
    font-weight: 500;
}

.footer-info {
    margin-top: 6px;
    color: var(--soft);
    font-size: .8rem;
}

.footer-link {
    color: var(--soft);
    text-decoration: none;
    transition: color .2s ease;
}

.footer-link:hover {
    color: #00bc9b;
}

/* 移动端适配。 */
@media (max-width: 640px) {
    /* 缩小接口列表区域底部留白，避免手机端页面过长。 */
    .api-section {
        padding: 0 0 28px;
    }

    /* 收紧接口面板内边距，让手机屏幕能容纳更多内容。 */
    .api-panel {
        padding: 20px 16px;
        border-radius: 0;
    }

    .doc-page {
        padding: 0 16px 28px;
    }

    .doc-container {
        padding: 18px;
    }

    .doc-hero {
        flex-direction: column;
        padding: 0 0 18px;
    }

    .doc-title {
        font-size: 1.55rem;
    }

    .doc-meta {
        width: 100%;
    }

    .doc-tabs {
        gap: 10px;
    }

    .doc-tab {
        width: 100%;
    }

    .doc-card {
        padding: 18px;
    }

    .doc-table th,
    .doc-table td {
        padding: 12px 14px;
    }

    /* 手机端接口卡片改成单列显示。 */
    .api-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* 取消卡片最小高度限制，让卡片高度跟随内容自然伸缩。 */
    .api-card {
        min-height: 0;
    }

    /* 缩小顶部固定栏高度，减少手机端占屏空间。 */
    .page-header-shell {
        min-height: 64px;
    }

    /* 缩小顶部栏左右内边距。 */
    .page-header {
        padding: 0 16px;
    }

    /* 调整 logo 展示区与顶部栏的间距和整体内边距。 */
    .logo-box {
        margin-top: 64px;
        padding: 16px;
    }

    /* 手机端收紧 logo 展示区内部布局。 */
    .logo-box-inner {
        flex-direction: column;
        gap: 12px;
        padding: 20px;
    }

    /* 限制主视觉图片在手机端的最大显示尺寸。 */
    .logo-box-image {
        max-width: min(82vw, 420px);
        max-height: 180px;
    }

    /* 缩小顶部和侧边栏 logo 高度。 */
    .brand-logo,
    .sidebar-logo {
        height: 40px;
    }

    /* 缩小左上角菜单按钮尺寸。 */
    .menu-toggle {
        width: 30px;
        height: 30px;
    }

    /* 同步缩小菜单按钮中的图标尺寸。 */
    .menu-toggle img {
        width: 16px;
        height: 16px;
    }

    /* 缩小昼夜切换按钮尺寸，并同步调整滑块大小。 */
    #button-wrapper {
        width: 62px;
        height: 24px;
        --button-width: 18px;
    }
}
.api-popup.is-tarot .api-popup-content {
  max-height: none !important;
  overflow: visible !important;
}

.api-popup.is-tarot .api-popup-panel,
.api-popup.is-tarot .api-popup-card,
.api-popup.is-tarot .api-popup-dialog,
.api-popup.is-tarot .api-popup-container,
.api-popup.is-tarot .api-popup-body,
.api-popup.is-tarot .api-popup-main,
.api-popup.is-tarot .api-popup-inner,
.api-popup.is-tarot .api-popup-result {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.api-popup-tarot {
  display: flex;
  justify-content: center;
}

.api-popup-tarot-image {
  display: block;
  width: auto !important;
  max-width: min(86vw, 420px) !important;
  height: auto !important;
  max-height: calc(100vh - 180px) !important;
  object-fit: contain !important;
}

/* Tarot popup: left details block, right card image. */
.api-popup.is-tarot {
  width: min(94vw, 860px) !important;
}

.api-popup.is-tarot .api-popup-content {
  margin-top: 8px !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  text-align: left !important;
  max-height: none !important;
  overflow: visible !important;
}

.api-popup-tarot {
  display: grid !important;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 320px);
  align-items: stretch;
  justify-content: center;
  gap: 18px;
  width: 100%;
}

.api-popup-tarot-info {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.api-popup-tarot-info-item + .api-popup-tarot-info-item {
  margin-top: 0;
}

.api-popup-tarot-info-item {
  padding: 13px 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 15px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.72), rgba(30, 41, 59, 0.38)),
    rgba(2, 6, 23, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.api-popup-tarot-info-label {
  margin-bottom: 5px;
  color: rgba(226, 232, 240, 0.58);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.api-popup-tarot-info-value {
  color: #f8fafc;
  font-size: 0.94rem;
  line-height: 1.72;
  white-space: pre-wrap;
  word-break: break-word;
}

.api-popup-tarot-empty {
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.92rem;
}

.api-popup-tarot-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 10px;
  border-radius: 18px;
  background:
    radial-gradient(circle at top, rgba(251, 191, 36, 0.18), transparent 42%),
    rgba(15, 23, 42, 0.38);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.34);
}

.api-popup-tarot-image-wrap .api-popup-tarot-image {
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: min(calc(100vh - 220px), 640px) !important;
  border-radius: 12px;
  object-fit: contain !important;
}

body.light .api-popup-tarot-info-item {
  border-color: rgba(148, 163, 184, 0.26);
  background:
    linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.82)),
    rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body.light .api-popup-tarot-info-label {
  color: rgba(71, 85, 105, 0.66);
}

body.light .api-popup-tarot-info-value {
  color: #0f172a;
}

body.light .api-popup-tarot-empty {
  color: rgba(51, 65, 85, 0.76);
}

body.light .api-popup-tarot-image-wrap {
  background:
    radial-gradient(circle at top, rgba(245, 158, 11, 0.16), transparent 42%),
    rgba(248, 250, 252, 0.86);
  box-shadow: 0 18px 44px rgba(148, 163, 184, 0.28);
}

@media (max-width: 720px) {
  .api-popup.is-tarot {
    width: min(94vw, 420px) !important;
  }

  .api-popup-tarot {
    grid-template-columns: 1fr;
  }

  .api-popup-tarot-image-wrap {
    order: 2;
  }

  .api-popup-tarot-info {
    order: 1;
  }

  .api-popup-tarot-image-wrap .api-popup-tarot-image {
    max-height: min(48vh, 420px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.theme-ready,
  body.theme-ready::before,
  body.theme-ready::after,
  body.theme-ready *,
  body.theme-ready *::before,
  body.theme-ready *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
