/* TableGIS 文档站统一外壳：板块 tab / 侧栏 / 本页目录 / 站内搜索
   全站 46 页共用，样式只改这一处。正文样式仍在 docs.css、feature.css 里。 */

/* ── 页面底色：正文纯白，左栏浅灰（对比分区，不靠边框）── */
body { margin: 0; padding: 0; background: #fff; }
.wrapper, .dwrapper {
    display: flex;
    align-items: flex-start;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    background: linear-gradient(to right, #f7f8fa 0, #f7f8fa 300px, #fff 300px);
}

/* ── 顶部品牌栏（全站统一；兼容 .nav 与 .header-nav 两种写法）── */
.header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid #ecedf0;
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px; max-width: 1280px; margin: 0 auto; padding: 0 20px;
}
.header .logo {
    display: flex; align-items: center; gap: 9px;
    font-size: 17px; font-weight: 700; color: #1677FF; letter-spacing: -.01em;
}
.header .logo img, .header .logo-img { width: 28px; height: 28px; border-radius: 50%; }
.header .nav, .header .header-nav { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.header .nav a, .header .header-nav a { color: #5a5f66; transition: color .18s; }
.header .nav a:hover, .header .header-nav a:hover { color: #1677FF; text-decoration: none; }
.header .nav-cta {
    background: #1677FF; color: #fff !important;
    padding: 7px 16px; border-radius: 7px; font-weight: 500;
}
.header .nav-cta:hover { background: #0d5fd6; }

/* ── 板块 tab（吸顶在 header 下）── */
.docsnav {
    position: sticky; top: 64px; z-index: 90;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid #ecedf0;
}
.docsnav-inner {
    display: flex; align-items: center; gap: 2px;
    height: 48px; max-width: 1280px; margin: 0 auto; padding: 0 20px;
}
.dn-tab {
    position: relative; display: inline-flex; align-items: center; height: 48px;
    padding: 0 14px; font-size: 14px; color: #4b5563;
    transition: color .15s;
}
.dn-tab:hover { color: #1677FF; text-decoration: none; }
.dn-tab.active { color: #1677FF; font-weight: 600; }
.dn-tab.active::after {
    content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px;
    height: 2px; background: #1677FF; border-radius: 2px 2px 0 0;
}
.dn-search {
    margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
    height: 32px; padding: 0 8px 0 11px; border: 1px solid #e3e6ea; border-radius: 8px;
    background: #fafbfc; color: #8a9099; font-size: 13px; font-family: inherit;
    cursor: pointer; transition: border-color .15s, background .15s, color .15s;
}
.dn-search:hover { border-color: #c9d3e0; background: #fff; color: #4b5563; }
.dn-search svg { flex-shrink: 0; }
.dn-search kbd {
    font-family: inherit; font-size: 11px; color: #9aa1ab; background: #fff;
    border: 1px solid #e3e6ea; border-radius: 4px; padding: 1px 5px; line-height: 1.5;
}

/* ── 侧栏：浅灰通高块 + 胶囊高亮 ── */
.sidebar, .dsidebar {
    width: 240px; flex-shrink: 0; box-sizing: border-box;
    position: sticky; top: 112px; height: calc(100vh - 112px);
    overflow-y: auto; overflow-x: hidden;
    padding: 18px 12px 40px 0; margin-right: 40px;
    background: transparent; border: 0;
}
.sidebar::-webkit-scrollbar, .dsidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb, .dsidebar::-webkit-scrollbar-thumb { background: #dcdfe4; border-radius: 2px; }
.sidebar h3, .dsidebar h3 { display: none; }
.sidebar a, .dsidebar a {
    display: block; padding: 7px 10px; margin-bottom: 1px;
    font-size: 14px; color: #42474e; border: 0; border-radius: 6px;
    line-height: 1.45; text-decoration: none;
    transition: background .15s, color .15s;
}
.sidebar a:hover, .dsidebar a:hover { background: #eceff3; color: #1677FF; text-decoration: none; }
.sidebar a.active, .dsidebar a.active { background: #e8f0ff; color: #1677FF; font-weight: 600; }
.sidebar a.parent, .dsidebar a.parent { font-weight: 600; color: #2f3540; }
.sidebar a.sub, .dsidebar a.sub { padding-left: 22px; font-size: 13.5px; color: #5b6270; }
.sidebar a.sub.active, .dsidebar a.sub.active { color: #1677FF; font-weight: 600; background: #e8f0ff; }

/* ── 正文列宽：给右侧目录留位置 ── */
.main { flex: 1; min-width: 0; max-width: 760px; }
.dwrapper { flex-wrap: wrap; }
.dwrapper .container { flex: 1; min-width: 0; max-width: 760px; margin: 0; }
/* 教程页的 footer 被包在 .dwrapper 里，让它独占一行 */
.dwrapper .footer { flex: 0 0 100%; width: 100%; }

/* ── 右侧本页目录 ── */
.toc {
    width: 180px; flex-shrink: 0;
    position: sticky; top: 112px; max-height: calc(100vh - 140px);
    overflow-y: auto; margin-left: 20px; padding: 18px 0 40px;
    font-size: 12.5px;
}
.toc::-webkit-scrollbar { width: 4px; }
.toc::-webkit-scrollbar-thumb { background: #dcdfe4; border-radius: 2px; }
.toc-t {
    font-size: 11.5px; font-weight: 600; color: #98a2b3;
    letter-spacing: .06em; margin-bottom: 8px; padding-left: 10px;
}
.toc a {
    display: block; padding: 4px 0 4px 10px;
    color: #6b7280; line-height: 1.5; border-left: 2px solid #ecedf0;
    text-decoration: none; transition: color .15s, border-color .15s;
}
.toc a:hover { color: #1677FF; text-decoration: none; }
.toc a.on { color: #1677FF; border-left-color: #1677FF; font-weight: 500; }

/* 锚点跳转时给吸顶条留出空间 */
.main h2, .container h2 { scroll-margin-top: 132px; }

/* ── 搜索弹层 ── */
.ds-mask {
    position: fixed; inset: 0; z-index: 900;
    background: rgba(17, 24, 39, .38);
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 12vh;
    opacity: 0; pointer-events: none; transition: opacity .16s;
}
.ds-mask.on { opacity: 1; pointer-events: auto; }
.ds-box {
    width: min(620px, 92vw); background: #fff; border-radius: 12px;
    box-shadow: 0 12px 48px -8px rgba(16, 24, 40, .28), 0 0 0 1px rgba(16, 24, 40, .06);
    overflow: hidden; transform: translateY(-6px); transition: transform .16s;
}
.ds-mask.on .ds-box { transform: none; }
.ds-head {
    display: flex; align-items: center; gap: 10px;
    padding: 0 14px; height: 54px; border-bottom: 1px solid #eef0f3; color: #98a2b3;
}
.ds-input {
    flex: 1; border: 0; outline: 0; font-size: 15px; font-family: inherit;
    color: #1f2329; background: transparent;
}
.ds-input::placeholder { color: #a8afb9; }
.ds-esc {
    border: 1px solid #e3e6ea; background: #fff; border-radius: 5px;
    font-size: 11px; color: #9aa1ab; padding: 2px 6px; cursor: pointer;
    font-family: inherit;
}
.ds-list { max-height: 46vh; overflow-y: auto; padding: 6px; }
.ds-item {
    display: block; padding: 9px 11px; border-radius: 8px; text-decoration: none;
    transition: background .12s;
}
.ds-item:hover, .ds-item.sel { background: #f4f7fc; text-decoration: none; }
.ds-item b { display: block; font-size: 14px; color: #1f2329; font-weight: 600; line-height: 1.5; }
.ds-item span { display: block; font-size: 12.5px; color: #8a9099; line-height: 1.6; margin-top: 1px; }
.ds-item em { font-style: normal; color: #1677FF; }
.ds-tag {
    display: inline-block !important; font-size: 11px !important; color: #1677FF !important;
    background: #eef4ff; border-radius: 4px; padding: 0 5px; margin-right: 6px;
    vertical-align: 1px;
}
.ds-empty { padding: 28px 16px; text-align: center; color: #98a2b3; font-size: 13.5px; }
.ds-foot {
    display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid #eef0f3;
    font-size: 11.5px; color: #98a2b3; background: #fcfcfd;
}
.ds-foot kbd {
    font-family: inherit; font-size: 11px; background: #fff; border: 1px solid #e3e6ea;
    border-radius: 4px; padding: 0 4px; margin-right: 3px;
}
body.ds-open { overflow: hidden; }

/* ── 响应式 ── */
@media (max-width: 1260px) {
    .toc { display: none; }
    .main, .dwrapper .container { max-width: 860px; }
}
@media (max-width: 1000px) {
    .sidebar, .dsidebar { display: none; }
    .wrapper, .dwrapper { display: block; background: #fff; }
    .docsnav { position: static; }
    .dn-search span { display: none; }
}
