/* ============ 摸鱼冲浪舱 v3.1 · 干净问答站风格（无顶部工具栏） ============ */

/* ---- 布局：保留顶部导航与页脚，冲浪舱首屏占满 ---- */
body.browser-full .detail-wrap {
    padding: 0;
}
body.browser-full .detail-wrap .container {
    max-width: none;
    width: 100%;
    padding: 0;
}

/* ---- 冲浪舱外壳 ---- */
.browser-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
    background: #fbfcfe;
    color: #1a202c;
    overflow: hidden;
}

/* ============ 浏览区 ============ */
.browser-viewport {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: #fbfcfe;
}

/* ============ 起始欢迎页 ============ */
.browser-welcome {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: auto;
    padding: 9vh 24px 56px;
}
.welcome-inner {
    max-width: 920px;
    margin: 0 auto;
}
.welcome-hero {
    text-align: center;
    margin-bottom: 44px;
}
.welcome-hero h1 {
    margin: 0 0 14px;
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #1e3a5f;
}
.welcome-sub {
    margin: 0 auto;
    font-size: 13.5px;
    line-height: 1.9;
    color: #64748b;
    max-width: 560px;
}
.welcome-sub b {
    color: #1e3a5f;
    font-weight: 700;
}

/* ---- 搜索框包装器 ---- */
.welcome-search-wrap {
    position: relative;
    max-width: 560px;
    margin: 0 auto 38px;
}

/* ---- 主页搜索框（居中） ---- */
.welcome-search {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 2px solid #e4e9f0;
    border-radius: 14px;
    padding: 7px 7px 7px 18px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.welcome-search:focus-within {
    border-color: #1e3a5f;
    box-shadow: 0 0 0 4px rgba(30, 58, 95, 0.06);
}
.welcome-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 15px;
    color: #1a202c;
}
.welcome-search input::placeholder {
    color: #9aa4b5;
}
.welcome-search select {
    flex: none;
    border: 0;
    outline: 0;
    background: #f1f5f9;
    color: #1e3a5f;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 9px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 26px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231e3a5f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}
.welcome-search #welcomeGo {
    flex: none;
    border: 0;
    background: #1e3a5f;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 26px;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
}
.welcome-search #welcomeGo:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
.welcome-search #welcomeGo:active {
    transform: translateY(0);
}

/* ---- 搜索联想下拉 ---- */
.browser-suggest {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
    overflow: hidden;
    z-index: 60;
}
.suggest-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    transition: background 0.12s;
}
.suggest-item .s-ico {
    font-size: 12px;
    opacity: 0.5;
}
.suggest-item:hover,
.suggest-item.is-active {
    background: #f8fafc;
}

/* 欢迎页主体：左热搜 + 右提示，两栏布局 */
.welcome-body {
    display: grid;
    grid-template-columns: 1fr 264px;
    gap: 22px;
    align-items: start;
}
.welcome-main {
    min-width: 0;
}

/* 区块标题 */
.block-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef1f6;
}
.block-ico {
    font-size: 15px;
}
.block-title {
    font-size: 15px;
    font-weight: 800;
    color: #1e3a5f;
}
.hot-meta {
    margin-left: auto;
    font-size: 11.5px;
    color: #9aa4b5;
}

/* ---- 实时热搜：纵向卡片列表（全部平铺，无滚动限制） ---- */
.hot-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.hot-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    width: 100%;
    border: 1px solid #eef1f6;
    background: #fff;
    padding: 11px 14px;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.hot-item:hover {
    border-color: #dde3ec;
    box-shadow: 0 3px 10px rgba(30, 58, 95, 0.06);
    transform: translateY(-1px);
}
.hot-rank {
    flex: none;
    width: 27px;
    height: 27px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    border-radius: 8px;
    color: #64748b;
    background: #f1f5f9;
    font-variant-numeric: tabular-nums;
}
.hot-item:nth-child(1) .hot-rank { background: #dc2626; color: #fff; }
.hot-item:nth-child(2) .hot-rank { background: #ea580c; color: #fff; }
.hot-item:nth-child(3) .hot-rank { background: #ca8a04; color: #fff; }
.hot-title {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}
.hot-item:hover .hot-title {
    color: #1e3a5f;
}
.hot-go {
    flex: none;
    font-size: 11.5px;
    font-weight: 600;
    color: #1e3a5f;
    opacity: 0;
    transition: opacity 0.15s;
}
.hot-item:hover .hot-go {
    opacity: 1;
}
.hot-empty {
    padding: 26px 10px;
    text-align: center;
    color: #9aa4b5;
    font-size: 13px;
}

/* ---- 右侧提示栏 ---- */
.welcome-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.side-card {
    background: #fff;
    border: 1px solid #eef1f6;
    border-radius: 14px;
    padding: 18px;
}
.side-title {
    font-size: 13px;
    font-weight: 800;
    color: #1e3a5f;
    margin-bottom: 12px;
}
.side-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.side-list li {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    padding-left: 16px;
    position: relative;
}
.side-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #cbd5e1;
}
.side-list.side-keys li {
    padding-left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.side-list.side-keys li::before {
    display: none;
}
.side-list kbd {
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    color: #1e3a5f;
    background: #f1f5f9;
    border: 1px solid #e4e9f0;
    border-radius: 6px;
    padding: 2px 8px;
    white-space: nowrap;
}

/* ---- 快捷冲浪：常用站点入口 ---- */
.quick-nav {
    margin-top: 34px;
}
.quick-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}
.quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 10px 14px;
    background: #fff;
    border: 1px solid #eef1f6;
    border-radius: 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.quick-item i {
    font-style: normal;
    font-size: 22px;
    line-height: 1;
}
.quick-item:hover {
    border-color: #dde3ec;
    box-shadow: 0 3px 10px rgba(30, 58, 95, 0.06);
    transform: translateY(-2px);
    color: #1e3a5f;
}

.welcome-note {
    margin-top: 34px;
    font-size: 11.5px;
    color: #9aa4b5;
    text-align: center;
    line-height: 1.8;
}

/* ============ 搜索结果面板 ============ */
.browser-results {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: auto;
    padding: 28px 24px 48px;
    background: #fbfcfe;
}
.results-inner {
    max-width: 820px;
    margin: 0 auto;
}
.results-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eef1f6;
    flex-wrap: wrap;
}
.results-back {
    border: 0;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12.5px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.results-back:hover {
    background: #e4e9f0;
    color: #1e3a5f;
}
.results-title {
    font-size: 15.5px;
    font-weight: 800;
    color: #1e3a5f;
    word-break: break-all;
}
.results-meta {
    margin-left: auto;
    font-size: 11.5px;
    color: #9aa4b5;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.results-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 15px 16px;
    background: #fff;
    border: 1px solid #eef1f6;
    border-radius: 14px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.results-item:hover {
    border-color: #dde3ec;
    box-shadow: 0 3px 10px rgba(30, 58, 95, 0.06);
}
.ri-num {
    flex: none;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    color: #1e3a5f;
    background: #f1f5f9;
    font-variant-numeric: tabular-nums;
}
.ri-body {
    flex: 1;
    min-width: 0;
}
.ri-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e3a5f;
    line-height: 1.5;
    margin-bottom: 4px;
    transition: color 0.15s;
}
.results-item:hover .ri-title {
    color: #0f2c4e;
}
.ri-snippet {
    font-size: 13px;
    line-height: 1.7;
    color: #64748b;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ri-source {
    font-size: 11px;
    color: #9aa4b5;
    font-weight: 600;
}
.results-empty {
    padding: 46px 10px;
    text-align: center;
    color: #9aa4b5;
    font-size: 13.5px;
}
.results-note {
    margin-top: 24px;
    font-size: 11.5px;
    color: #9aa4b5;
    text-align: center;
}

/* ============ 浏览区 ============ */
.browser-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: none;
    background: #fff;
    z-index: 1;
}
.browser-frame.is-on {
    display: block;
}

.browser-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: #fbfcfe;
    color: #64748b;
    font-size: 13.5px;
    z-index: 20;
}
.browser-loading[hidden] {
    display: none;
}
.browser-spinner {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid #e4e9f0;
    border-top-color: #1e3a5f;
    animation: browser-spin 0.8s linear infinite;
}
@keyframes browser-spin {
    to { transform: rotate(360deg); }
}

/* ============ 加载进度条（渲染期确定性反馈） ============ */
.browser-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    z-index: 40;
    background: linear-gradient(90deg, #1e3a5f, #4f46e5, #1e3a5f);
    border-radius: 0 3px 3px 0;
    pointer-events: none;
}
.browser-progress[hidden] {
    display: none;
}
.browser-progress.run {
    width: 92%;
    transition: width 16s cubic-bezier(0.12, 0.8, 0.35, 1);
}
.browser-progress.done {
    width: 100%;
    transition: width 0.35s ease;
}

/* ============ 底部悬浮导航条：浏览区内换站/导航，不用回舱 ============ */
.browser-dock {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: calc(100% - 24px);
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid #eef1f6;
    border-radius: 999px;
    padding: 6px 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.browser-dock[hidden] {
    display: none;
}
.dock-btn {
    flex: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #475569;
    font-size: 15px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.1s;
}
.dock-btn:hover {
    background: #f1f5f9;
    color: #1e3a5f;
}
.dock-btn:active {
    transform: scale(0.92);
}
.dock-home {
    background: #1e3a5f;
    color: #fff;
}
.dock-home:hover {
    background: #16294a;
    color: #fff;
}
.dock-form {
    display: flex;
    flex: 1;
    min-width: 0;
    margin: 0;
}
.dock-addr {
    flex: 1;
    min-width: 120px;
    width: 220px;
    max-width: 420px;
    border: 0;
    outline: 0;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px;
    color: #1a202c;
}
.dock-addr::placeholder {
    color: #9aa4b5;
}
.dock-addr:focus {
    background: #e9eef5;
}

/* ============ 暗黑模式 ============ */
::root[data-theme="dark"] .browser-shell {
    background: #0b1221;
}
::root[data-theme="dark"] .browser-welcome,
::root[data-theme="dark"] .browser-results {
    background: #0b1221;
}
::root[data-theme="dark"] .welcome-search {
    background: #0f1830;
    border-color: #1e2a45;
}
::root[data-theme="dark"] .browser-suggest {
    background: #101a2c;
    border-color: #1e2a45;
}
::root[data-theme="dark"] .hot-item,
::root[data-theme="dark"] .results-item,
::root[data-theme="dark"] .side-card,
::root[data-theme="dark"] .quick-item {
    background: #101a2c;
    border-color: #1e2a45;
}
::root[data-theme="dark"] .quick-item {
    color: #e2e8f0;
}
::root[data-theme="dark"] .hot-rank,
::root[data-theme="dark"] .ri-num,
::root[data-theme="dark"] .results-back,
::root[data-theme="dark"] .side-list kbd {
    background: #1a2740;
}
::root[data-theme="dark"] .hot-title,
::root[data-theme="dark"] .ri-title,
::root[data-theme="dark"] .block-title {
    color: #e2e8f0;
}
::root[data-theme="dark"] .welcome-hero h1,
::root[data-theme="dark"] .results-title {
    color: #f1f5f9;
}
::root[data-theme="dark"] .hot-meta,
::root[data-theme="dark"] .results-meta,
::root[data-theme="dark"] .welcome-note,
::root[data-theme="dark"] .results-note,
::root[data-theme="dark"] .ri-source {
    color: #7c8798;
}
::root[data-theme="dark"] .welcome-sub,
::root[data-theme="dark"] .ri-snippet,
::root[data-theme="dark"] .side-list li {
    color: #a5b0c3;
}
::root[data-theme="dark"] .welcome-search input {
    color: #e2e8f0;
}
::root[data-theme="dark"] .welcome-search input::placeholder {
    color: #64748b;
}
::root[data-theme="dark"] .block-head {
    border-bottom-color: #1e2a45;
}
:root[data-theme="dark"] .browser-dock {
    background: rgba(15, 24, 48, 0.9);
    border-color: #1e2a45;
}
:root[data-theme="dark"] .dock-btn {
    color: #cbd5e1;
}
:root[data-theme="dark"] .dock-btn:hover {
    background: #1a2740;
    color: #e2e8f0;
}
:root[data-theme="dark"] .dock-home {
    background: #1e3a5f;
    color: #fff;
}
:root[data-theme="dark"] .dock-home:hover {
    background: #2c4a75;
    color: #fff;
}
:root[data-theme="dark"] .dock-addr {
    background: #1a2740;
    color: #e2e8f0;
}
:root[data-theme="dark"] .dock-addr::placeholder {
    color: #64748b;
}

/* ============ 响应式 ============ */
@media (max-width: 860px) {
    .welcome-body {
        grid-template-columns: 1fr;
    }
    .welcome-side {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}
@media (max-width: 720px) {
    .quick-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .welcome-hero h1 {
        font-size: 26px;
    }
    .welcome-search {
        margin-bottom: 28px;
    }
    .welcome-side {
        grid-template-columns: 1fr;
    }
    .results-item {
        padding: 12px;
    }
    .welcome-hero {
        margin-bottom: 22px;
    }
    .browser-dock {
        bottom: 8px;
        padding: 5px 8px;
        border-radius: 22px;
    }
    .dock-btn {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    .dock-addr {
        min-width: 90px;
        width: 130px;
        padding: 7px 12px;
        font-size: 12px;
    }
}
