/**
 * ThingOrigin 文档主题：视觉向 three.js 官网 docs 靠拢
 * 基于 TypeDoc 默认主题，通过 CSS 变量 + 布局微调实现
 */

@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500;700&display=swap');

/* ========== three.js 配色变量 ========== */
:root {
    --to-blue: #049ef4;
    --to-bg: #ffffff;
    --to-bg-secondary: #f7f7f7;
    --to-text: #444444;
    --to-text-secondary: #9e9e9e;
    --to-border: #e8e8e8;
    --to-panel-width: 300px;
    --to-header-height: 48px;
    --to-font: 'Roboto Mono', ui-monospace, monospace;

    /* 覆盖 TypeDoc light 主题 */
    --light-color-background: var(--to-bg);
    --light-color-background-secondary: var(--to-bg-secondary);
    --light-color-background-active: #eef6fc;
    --light-color-accent: var(--to-border);
    --light-color-text: var(--to-text);
    --light-color-contrast-text: #222;
    --light-color-text-aside: var(--to-text-secondary);
    --light-color-link: var(--to-blue);
    --light-color-focus-outline: var(--to-blue);
    --light-color-active-menu-item: #eef6fc;

    --light-color-ts-class: var(--to-blue);
    --light-color-ts-interface: var(--to-blue);
    --light-color-ts-function: var(--to-blue);
    --light-color-ts-method: var(--to-blue);
    --light-color-ts-property: #666;
    --light-color-ts-constructor: var(--to-blue);
    --light-color-ts-type-alias: #088;
    --light-color-ts-enum: #666;
    --light-color-ts-variable: #666;
    --light-color-ts-module: var(--to-blue);
    --light-color-ts-namespace: var(--to-blue);

    --dim-toolbar-contents-height: var(--to-header-height);
}

html.dark {
    --to-bg: #222222;
    --to-bg-secondary: #2e2e2e;
    --to-text: #bbbbbb;
    --to-text-secondary: #666666;
    --to-border: #444444;

    --dark-color-background: var(--to-bg);
    --dark-color-background-secondary: var(--to-bg-secondary);
    --dark-color-background-active: #1a3344;
    --dark-color-accent: var(--to-border);
    --dark-color-text: var(--to-text);
    --dark-color-contrast-text: #ddd;
    --dark-color-text-aside: var(--to-text-secondary);
    --dark-color-link: var(--to-blue);
    --dark-color-focus-outline: var(--to-blue);
    --dark-color-active-menu-item: #1a3344;

    --dark-color-ts-class: var(--to-blue);
    --dark-color-ts-interface: var(--to-blue);
    --dark-color-ts-function: var(--to-blue);
    --dark-color-ts-method: var(--to-blue);
    --dark-color-ts-constructor: var(--to-blue);
    --dark-color-ts-module: var(--to-blue);
}

/* ========== 全局排版 ========== */
html,
body {
    font-family: var(--to-font) !important;
    font-size: 15px;
    line-height: 1.65;
    color: var(--to-text);
    background: var(--to-bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--to-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ========== 顶栏：仿 three.js header ========== */
.tsd-page-toolbar {
    height: var(--to-header-height) !important;
    border-bottom: 1px solid var(--to-border) !important;
    background: var(--to-bg) !important;
    box-shadow: none !important;
}

.tsd-page-toolbar .tsd-toolbar-contents {
    max-width: none !important;
    padding: 0 16px !important;
}

.tsd-page-toolbar a.title {
    color: var(--to-blue) !important;
    font-weight: 500 !important;
    font-size: 16px !important;
    letter-spacing: 0;
}

.tsd-page-toolbar a.title:hover {
    text-decoration: none;
}

/* 顶栏后加版本徽标感 */
.tsd-page-toolbar a.title::after {
    content: 'r2.3';
    display: inline-block;
    margin-left: 8px;
    padding: 0 4px;
    border: 1px solid var(--to-blue);
    border-radius: 4px;
    font-size: 11px;
    line-height: 16px;
    vertical-align: middle;
    color: var(--to-blue);
    font-weight: 500;
}

/* ========== 主布局：左侧导航面板感 ========== */
.container-main {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.col-sidebar {
    border-right: 1px solid var(--to-border);
    background: var(--to-bg);
    padding: 12px 0 24px !important;
}

.site-menu,
.page-menu {
    padding-left: 16px !important;
    padding-right: 12px !important;
}

.tsd-navigation a {
    color: var(--to-text) !important;
    font-size: 13px;
    border-radius: 0 !important;
    padding: 2px 8px !important;
}

.tsd-navigation a:hover,
.tsd-navigation a.current {
    color: var(--to-blue) !important;
    background: transparent !important;
    text-decoration: underline;
}

.tsd-navigation .tsd-accordion-summary {
    color: var(--to-blue) !important;
    font-weight: 500;
    font-size: 14px;
    border-top: none;
    margin-top: 12px;
    padding-top: 8px;
}

/* Settings 区弱化，贴近官网极简感 */
.tsd-navigation.settings {
    border-bottom: 1px solid var(--to-border);
    margin-bottom: 8px;
    padding-bottom: 8px;
}

.settings-label {
    color: var(--to-text-secondary) !important;
    font-size: 12px;
}

/* ========== 正文区 ========== */
.col-content {
    padding: 24px 40px 48px !important;
    max-width: 920px;
}

.tsd-page-title h1 {
    font-size: 18px !important;
    font-weight: 500 !important;
    color: var(--to-text) !important;
    margin: 0 0 16px !important;
}

.tsd-page-title h1 a,
.tsd-typography h1 a,
.tsd-typography h2 {
    color: var(--to-blue) !important;
}

.tsd-typography h2,
.col-content > section > h2,
.tsd-panel > h3,
.tsd-index-heading {
    color: var(--to-blue) !important;
    font-weight: 500 !important;
    font-size: 15px !important;
    border-bottom: none !important;
}

.tsd-typography h3,
.tsd-typography h4 {
    color: var(--to-text-secondary) !important;
    font-weight: 500 !important;
}

/* 成员卡片：去掉厚重卡片感，改成分隔列表 */
.tsd-panel,
.tsd-member {
    box-shadow: none !important;
    border: none !important;
    border-bottom: 1px solid var(--to-border) !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 16px 0 !important;
    margin: 0 !important;
}

.tsd-member:last-child {
    border-bottom: none !important;
}

.tsd-signature {
    background: var(--to-bg-secondary) !important;
    border: none !important;
    border-radius: 3px !important;
    font-family: var(--to-font) !important;
    font-size: 13px !important;
    padding: 10px 12px !important;
}

.tsd-signatures .tsd-signature {
    border-left: 3px solid var(--to-blue) !important;
}

.tsd-tag {
    border-radius: 2px !important;
    font-family: var(--to-font);
    font-size: 11px !important;
    font-weight: 500;
}

/* 代码块 */
pre,
code,
.tsd-typography pre,
.tsd-typography code {
    font-family: var(--to-font) !important;
}

pre {
    background: var(--to-bg-secondary) !important;
    border: 1px solid var(--to-border) !important;
    border-radius: 3px !important;
}

/* 表格 */
table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    border: 1px solid var(--to-border) !important;
    padding: 8px 10px !important;
}

th {
    background: var(--to-bg-secondary) !important;
    font-weight: 500;
}

/* 页脚极简 */
footer {
    border-top: 1px solid var(--to-border) !important;
    background: var(--to-bg) !important;
    color: var(--to-text-secondary) !important;
    font-size: 12px;
}

footer .tsd-generator {
    color: var(--to-text-secondary) !important;
}

/* 搜索弹层 */
#tsd-search {
    font-family: var(--to-font);
}

#tsd-search-input {
    font-family: var(--to-font) !important;
    border-color: var(--to-blue) !important;
}

/* 侧栏分组标题（Interfaces / Types / Utils / Classes） */
.tsd-navigation details > summary {
    color: var(--to-blue) !important;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
}

/* 移动端：保持可读 */
@media (max-width: 769px) {
    .col-content {
        padding: 16px !important;
    }

    .tsd-page-toolbar a.title::after {
        display: none;
    }
}
