/* ==========================================================================
   虾壳统一样式 - unified.css
   适用于所有子页面，提供统一的视觉风格
========================================================================== */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #edf2f7;
    color: #282a2d;
    line-height: 1.6;
    min-height: 100vh;
}

/* ==========================================================================
   头部（复刻 www.xiake.pro：固定 74px 白底导航）
========================================================================== */

.header-nav {
    display: block;
}

.page-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1030;
    background: #fff;
    box-shadow: 0 0 25px 5px rgba(10, 10, 10, 0.05);
    transition: background-color 0.3s;
}

.page-header ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.page-header .navbar {
    height: 74px;
    padding: 0 16px;
    display: flex;
    align-items: center;
}

/* 左侧 Logo 列：基准 220px，与原站 .navbar-collapse.logo 一致可伸缩 */
.xk-logo-col {
    flex: 1 1 auto;
    width: 220px;
    min-width: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.header-mini-btn {
    height: 74px;
    width: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.header-mini-btn label {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 74px;
    width: 40px;
}

.header-mini-btn svg {
    margin: 0 -20px;
    height: 74px;
    width: 74px;
}

.header-mini-btn input[type="checkbox"] {
    display: none;
}

.header-mini-btn path {
    fill: none;
    stroke: #888;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    --length: 24;
    --offset: -38;
    stroke-dasharray: var(--length) var(--total-length);
    stroke-dashoffset: var(--offset);
    transition: all 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.header-mini-btn .line--1,
.header-mini-btn .line--3 {
    --total-length: 126.38166809082031;
}

.header-mini-btn .line--2 {
    --total-length: 80;
}

.header-mini-btn input:checked + svg .line--1,
.header-mini-btn input:checked + svg .line--3 {
    --length: 12.602325267;
}

.logo-expanded {
    display: block;
    line-height: 74px;
    white-space: nowrap;
}

.logo-expanded img {
    height: 40px;
    vertical-align: middle;
}

.logo-dark {
    display: none;
}

/* 导航主体：与原站 .container-fluid 一致，basis 100% 使 Logo 列按比例收缩 */
.xk-nav-main {
    flex: 0 1 auto;
    width: 100%;
    min-width: 0;
    position: relative;
    display: flex;
    align-items: center;
}

.site-menu {
    display: flex;
    align-items: center;
    margin-right: 24px;
}

.site-menu a {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 500;
    color: #282a2d;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}

.site-menu a:hover {
    color: #4169E1;
}

.site-menu a i {
    font-size: 21px;
    margin-right: 4px;
    line-height: 1;
}

.page-header .xk-right-menu {
    margin-left: auto;
    display: flex;
    align-items: center;
    list-style: none;
}

.nav-login a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 16px;
    color: #777;
    text-decoration: none;
}

.nav-login a:hover {
    color: #4169E1;
}

.nav-login i {
    font-size: 21px;
}

/* 移动端专属：居中小 Logo + 左侧分类按钮 */
.xk-mobile-logo,
.xk-mobile-cat {
    display: none;
    text-decoration: none;
}

/* 固定头部占位 */
.header-nav .placeholder {
    height: 74px;
}

/* ==========================================================================
   左侧抽屉导航（复刻原站 #sidebar / .sidebar-nav）
========================================================================== */

.xk-drawer-mask {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.xk-drawer-mask.open {
    opacity: 1;
    visibility: visible;
}

.xk-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1050;
    width: 260px;
    max-width: 82vw;
    background: #f0f2f4;
    transform: translateX(-100%);
    transition: transform 0.3s ease, background-color 0.3s;
}

.xk-drawer.open {
    transform: translateX(0);
}

/* 对应原站 .sidebar-nav-inner：白色内层 + 纵向 flex */
.xk-drawer-inner {
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s;
}

/* 对应原站 .sidebar-logo：74px 高、底部细线 */
.xk-drawer-head {
    height: 74px;
    flex-shrink: 0;
    padding: 0 10px 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-bottom: 1px solid rgba(130, 130, 130, 0.15);
    transition: background-color 0.3s;
}

.xk-drawer-head a {
    display: flex;
    align-items: center;
}

.xk-drawer-logo {
    max-height: 40px;
    height: 40px;
    width: auto;
}

.xk-drawer-close {
    border: none;
    background: none;
    font-size: 18px;
    color: #777;
    cursor: pointer;
    padding: 6px 10px;
}

.xk-drawer-close:hover {
    color: #dd3333;
}

/* 对应原站 .sidebar-menu：中部可滚动 */
.xk-drawer-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 5px 0;
}

.xk-side-menu,
.xk-side-item ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.xk-side-item {
    position: relative;
    display: block;
}

.xk-side-item ul {
    display: none;
}

.xk-side-item.sidebar-show > ul {
    display: block;
}

/* 对应原站 .sidebar-menu-inner a / .flex-bottom a */
.xk-drawer-inner a {
    display: flex;
    overflow: hidden;
    padding: 8px 10px;
    margin: 1.5px 8px;
    color: #515c6b;
    font-size: 14px;
    align-items: center;
    white-space: nowrap;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
}

.xk-side-menu > .xk-side-item > a {
    padding: 12px 10px;
}

.xk-drawer-inner a span {
    margin-left: 8px;
}

/* 二级项缩进：对应原站 ul li ul li a { margin-left: 36px } */
.xk-side-item > ul li a {
    margin-left: 36px;
}

.xk-drawer-inner a:hover,
.xk-side-item li > a:hover {
    color: #dd3333;
    background: rgba(0, 0, 0, 0.06);
}

/* 对应原站 .sidebar-more：右侧箭头，展开时旋转 90° */
.xk-side-more {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0 16px;
    line-height: 48px !important;
    font-size: 14px;
    color: #282a2d;
    cursor: pointer;
    transform: scale(0.8);
    transition: transform 0.3s;
}

.xk-side-item.sidebar-show > .xk-side-more {
    transform: scale(0.8) rotate(90deg);
}

/* io 图标（原站侧栏分类图标） */
.xk-drawer .io {
    font-family: "io" !important;
    font-size: 16px;
    font-style: normal;
    -webkit-font-smoothing: antialiased;
}

.xk-drawer .icon-lg {
    font-size: 1.333rem;
    line-height: 1.333rem;
}

.xk-drawer .icon-fw {
    text-align: center;
    width: 1.25em;
    flex-shrink: 0;
}

/* 对应原站 .border-top.py-2 .flex-bottom：底部平台链接 */
.xk-drawer-bottom {
    flex-shrink: 0;
    padding: 8px 0;
    background: #fff;
    border-top: 1px solid rgba(130, 130, 130, 0.15);
    transition: background-color 0.3s;
}

.xk-drawer-bottom ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   底部（版权条 + 右下悬浮圆形工具）
========================================================================== */

.main-footer {
    background: #fff;
    padding: 24px;
}

.footer-copyright {
    font-size: 12px;
    color: #282a2d;
}

.footer-copyright a {
    color: inherit;
    text-decoration: none;
}

.footer-copyright a:hover {
    color: #4169E1;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.footer-note {
    font-size: 12px;
    color: #282a2d;
    text-align: center;
}

#footer-tools {
    position: fixed;
    right: 10px;
    bottom: 20px;
    z-index: 1020;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#footer-tools .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    color: #555;
    background: rgba(210, 210, 210, 0.5);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

#footer-tools .btn i {
    line-height: 1;
}

#footer-tools .btn:hover {
    color: #333;
    background: rgba(190, 190, 190, 0.7);
}

#footer-tools .go-up {
    display: none;
}

/* ==========================================================================
   搜索弹窗
========================================================================== */
.xk-search-mask {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 18vh;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.xk-search-mask.open {
    display: flex;
    opacity: 1;
}

.xk-search-box {
    width: 90%;
    max-width: 560px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    padding: 16px 18px;
    transform: translateY(-12px);
    transition: transform 0.2s ease;
}

.xk-search-mask.open .xk-search-box {
    transform: translateY(0);
}

#xk-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.xk-search-ico {
    font-size: 18px;
    color: #999;
    flex-shrink: 0;
}

#xk-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
    color: #282a2d;
    padding: 6px 0;
}

#xk-search-input::placeholder {
    color: #b0b3b8;
}

.xk-search-close {
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
}

.xk-search-close:hover {
    color: #555;
}

/* 夜间模式下搜索弹窗 */
html.io-black-mode .xk-search-box {
    background: #2c2e2f;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

html.io-black-mode #xk-search-input {
    color: #c6c9cf;
}

html.io-black-mode #xk-search-input::placeholder {
    color: #6b6e73;
}

html.io-black-mode .xk-search-ico,
html.io-black-mode .xk-search-close {
    color: #8a8d93;
}

/* ==========================================================================
   通用容器
========================================================================== */

/* 容器：复刻原站 Bootstrap 容器分档（540/720/960/1140 含内边距）。
   原站内容卡 = 容器盒 - 20px（实测 .main-content 内缩 10px×2），
   故我们的分档值 = 原站 + 20（550/730/970/1150），使卡片宽度逐档相等：
   520 / 700 / 940 / 1120 */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 15px;
}

@media (min-width: 576px) {
    .container { max-width: 550px; }
}

@media (min-width: 768px) {
    .container { max-width: 730px; }
}

@media (min-width: 992px) {
    .container { max-width: 960px; }
}

@media (min-width: 1200px) {
    .container { max-width: 1130px; }
}

/* tool-header 自身就是 .container（卡片即容器）：宽度比视口内缩 30px（永不贴边），
   分档上限与 .container 内宽一致，保证与 .content-section 左右边线对齐 */
.tool-header.container {
    width: calc(100% - 30px);
    max-width: 1100px;
}

@media (min-width: 576px) {
    .tool-header.container { max-width: 520px; }
}

@media (min-width: 768px) {
    .tool-header.container { max-width: 700px; }
}

@media (min-width: 992px) {
    .tool-header.container { max-width: 930px; }
}

@media (min-width: 1200px) {
    .tool-header.container { max-width: 1100px; }
}

/* ==========================================================================
   工具详情头部卡（参考站风格，替代大 Hero）
========================================================================== */

.tool-header {
    background: #fff;
    border: 1px solid #e9e9e9;
    border-radius: 16px;
    padding: 32px;
    margin: 16px auto 32px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.tool-header-logo {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    object-fit: contain;
    padding: 10px;
    background: #fff;
    border: 1px solid #e9e9e9;
    flex-shrink: 0;
}

.tool-header-info {
    flex: 1;
}

.tool-header-name {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 6px;
}

.tool-header-desc {
    font-size: 0.95rem;
    color: #6b7280;
    margin-bottom: 10px;
    line-height: 1.6;
}

.tool-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tool-tag {
    font-size: 0.72rem;
    font-weight: 600;
    color: #4169E1;
    background: #eef2ff;
    padding: 3px 10px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tool-tag:hover {
    background: #d9e2ff;
}

.tool-visit-btn {
    background: #4169E1;
    color: #fff;
    padding: 13px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.2rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tool-visit-btn:hover {
    background: #3654c4;
}

/* ==========================================================================
   工具截图区
========================================================================== */

.tool-screenshot-wrap {
    margin: 0 auto 32px;
    text-align: center;
}

.tool-screenshot {
    max-width: 100%;
    width: 600px;
    border-radius: 14px;
    border: 1px solid #e9e9e9;
    object-fit: cover;
}

/* ==========================================================================
   工具头部卡：介绍在左、截图在右（页面存在截图时由 JS 加 .has-shot）
========================================================================== */

.tool-header.has-shot {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 40px;
    align-items: center;
    padding: 36px 40px;
}

.tool-header-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.tool-header-top {
    display: flex;
    align-items: center;
    gap: 20px;
}

.tool-header-btns {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.tool-header-shot {
    min-width: 0;
}

.tool-header-shot .tool-screenshot {
    width: 100%;
    max-width: none;
    max-height: 300px;
    margin: 0;
    display: block;
    object-fit: contain;
}

/* ==========================================================================
   内容区块（参考站风格的多段内容区）
========================================================================== */

.content-section {
    background: #fff;
    border: 1px solid #e9e9e9;
    border-radius: 14px;
    padding: 32px;
    margin-bottom: 20px;
}

.content-section h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9e9e9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-section h2 i {
    color: #4169E1;
}

.content-section p {
    color: #4b5563;
    line-height: 1.8;
    margin-bottom: 14px;
    font-size: 0.95rem;
}

.content-section p:last-child {
    margin-bottom: 0;
}

.content-section strong {
    color: #1f2937;
    font-weight: 600;
}

/* ==========================================================================
   Key Features 紧凑列表（参考站风格）
========================================================================== */

.key-features {
    background: #fff;
    border: 1px solid #e9e9e9;
    border-radius: 14px;
    padding: 28px 32px;
    margin-bottom: 20px;
}

.key-features h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.key-features h2 i {
    color: #4169E1;
}

.key-features ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.key-features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #4b5563;
    font-size: 0.92rem;
    line-height: 1.6;
}

.key-features li i {
    color: #4169E1;
    font-size: 0.85rem;
    margin-top: 5px;
    flex-shrink: 0;
}

/* ==========================================================================
   功能卡片（保留但微调以适配新布局）
========================================================================== */

.features-grid-new {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.feature-card-new {
    padding: 20px;
    border: 1px solid #e9e9e9;
    border-radius: 12px;
    transition: border-color 0.2s ease;
    background: #fff;
}

.feature-card-new:hover {
    border-color: #b9c8f5;
}

.feature-card-new h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
}

.feature-card-new h3 i {
    color: #4169E1;
}

.feature-icon {
    font-size: 20px;
}

.feature-card-new p {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.7;
}

@media (max-width: 768px) {
    /* 头部移动端：与原站一致 —— 导航高 56px（8px 上下 padding + 40px 分类钮），
       桌面汉堡 Logo 列隐藏，占位条 66px */
    .page-header .navbar {
        height: auto;
        padding: 8px 16px;
    }

    .header-nav .placeholder {
        height: 66px;
    }

    .xk-logo-col {
        display: none;
    }

    .xk-mobile-logo,
    .xk-mobile-cat {
        display: inline-flex;
        align-items: center;
    }

    .xk-mobile-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .xk-mobile-cat {
        color: #777;
        font-size: 20px;
        height: 40px;
        padding: 0 4px;
    }

    .site-menu {
        display: none;
    }

    .main-footer {
        text-align: center;
    }

    /* 参考站风格元素移动端适配 */
    .tool-header {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
        gap: 16px;
    }

    .tool-header.has-shot {
        display: flex;
        flex-direction: column;
        text-align: left;
        gap: 24px;
    }

    .tool-header-top {
        align-items: flex-start;
    }

    .tool-header.has-shot .tool-header-logo {
        width: 72px;
        height: 72px;
    }

    .tool-header-shot {
        width: 100%;
        order: 2;
    }

    .tool-header-shot .tool-screenshot {
        max-height: none;
    }

    .tool-header.has-shot .tool-tags {
        justify-content: flex-start;
    }

    .tool-tags {
        justify-content: center;
    }

    .tool-screenshot {
        width: 100%;
    }

    .content-section {
        padding: 24px 20px;
    }

    .key-features {
        padding: 24px 20px;
    }

    .key-features ul {
        grid-template-columns: 1fr;
    }

    .features-grid-new {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   夜间模式（<html class="io-black-mode">，对齐 xiake.pro 配色）
========================================================================== */

html.io-black-mode body {
    background: #1b1d1f;
    color: #c6c9cf;
}

/* 头部 */
html.io-black-mode .page-header {
    background: #2c2e2f;
    box-shadow: 0 0 25px 5px rgba(10, 10, 10, 0.25);
}

html.io-black-mode .header-mini-btn path {
    stroke: #aaa;
}

html.io-black-mode .logo-light {
    display: none !important;
}

html.io-black-mode .logo-dark {
    display: initial !important;
}

html.io-black-mode .site-menu a {
    color: #c6c9cf;
}

html.io-black-mode .site-menu a:hover,
html.io-black-mode .nav-login a:hover {
    color: #8fabff;
}

html.io-black-mode .nav-login a,
html.io-black-mode .xk-mobile-cat {
    color: #989da1;
}

/* 抽屉（对齐原站 .io-black-mode .sidebar-nav） */
html.io-black-mode .xk-drawer,
html.io-black-mode .xk-drawer-inner,
html.io-black-mode .xk-drawer-head,
html.io-black-mode .xk-drawer-bottom {
    background: #2c2e2f;
}

html.io-black-mode .xk-drawer-head,
html.io-black-mode .xk-drawer-bottom {
    border-color: rgba(118, 118, 118, 0.15);
}

html.io-black-mode .xk-drawer-close {
    color: #989da1;
}

html.io-black-mode .xk-drawer-inner a {
    color: #b2b8be;
}

html.io-black-mode .xk-drawer-inner a:hover {
    color: #fff;
    background: rgba(0, 0, 0, 0.1);
}

html.io-black-mode .xk-side-more {
    color: #c6c9cf;
}

/* 底部 */
html.io-black-mode .main-footer {
    background: #2c2e2f;
}

html.io-black-mode .footer-copyright,
html.io-black-mode .footer-copyright a {
    color: #c6c9cf;
}

html.io-black-mode .footer-note {
    color: #c6c9cf;
}

html.io-black-mode #footer-tools .btn {
    color: #ccc;
    background: rgba(10, 10, 10, 0.4);
}

html.io-black-mode #footer-tools .btn:hover {
    color: #fff;
    background: rgba(10, 10, 10, 0.65);
}

/* 内容卡片 */
html.io-black-mode .tool-header,
html.io-black-mode .content-section,
html.io-black-mode .key-features,
html.io-black-mode .feature-card-new {
    background: #2c2e2f;
    border-color: rgba(255, 255, 255, 0.08);
}

html.io-black-mode .feature-card-new:hover {
    border-color: #3d56b8;
}

html.io-black-mode .tool-header-name {
    color: #f2f4f6;
}

html.io-black-mode .tool-header-desc,
html.io-black-mode .content-section p,
html.io-black-mode .key-features li {
    color: #bbb;
}

html.io-black-mode .content-section h2,
html.io-black-mode .key-features h2 {
    color: #f2f4f6;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html.io-black-mode .content-section strong {
    color: #e4e7ee;
}

html.io-black-mode .feature-card-new h3 {
    color: #f2f4f6;
}

html.io-black-mode .feature-card-new p {
    color: #bbb;
}

html.io-black-mode .tool-tag {
    color: #a9bcff;
    background: rgba(65, 105, 225, 0.28);
}

html.io-black-mode .tool-tag:hover {
    background: rgba(65, 105, 225, 0.42);
}

html.io-black-mode .tool-screenshot {
    border-color: rgba(255, 255, 255, 0.1);
}

/* 次级按钮 */
html.io-black-mode .tool-header-btns .tool-visit-btn + .tool-visit-btn {
    background: #23306b !important;
    color: #cdd9ff !important;
}
