/**
 * 详情页样式：复用首页（posw）设计语言，确保整站视觉统一
 * 设计令牌与首页保持一致：--theme-color / --card-bg / --card-blur / --card-radius 等
 * 仅“站点大图标”等个别类名加 detail- 前缀，避免与首页 .site-logo 冲突
 */

/* ===== 设计令牌（与首页 posw 同源） ===== */
:root {
    --theme-color: #2f6fed;
    --text-color: #333;
    --text-muted: #6b7280;
    --card-bg: rgba(255, 255, 255, .55);
    --card-blur: 16px;
    --card-radius: 14px;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, .08);
    --gap: 12px;
    /* 详情页组件别名（与首页同源，避免类名冲突） */
    --bg: #f4f8fb;
    --text: var(--text-color);
    --sub: var(--text-muted);
    --line: rgba(0, 0, 0, .10);
    --card: #fff;
    --ink: var(--theme-color);
    --accent: var(--theme-color);
    --accent-2: var(--theme-color);
    --tagcolor: var(--theme-color);
    --tagbacolor: rgba(47, 111, 237, .14);
    --tagbacolorborder: 1px solid rgba(47, 111, 237, .40);
}

/* ===== 夜间模式（同时覆盖首页令牌，保证一致） ===== */
html.night-mode {
    --theme-color: #4d8bff;
    --text-color: #e8eaed;
    --text-muted: #9aa3b2;
    --card-bg: rgba(28, 32, 40, .55);
    --card-shadow: 0 2px 14px rgba(0, 0, 0, .4);
    --bg: #101216;
    --text: #e8eaed;
    --sub: #9aa3b2;
    --line: rgba(255, 255, 255, .12);
    --card: rgba(20, 24, 32, .7);
    --tagbacolor: rgba(120, 150, 255, .16);
    --tagbacolorborder: 1px solid rgba(150, 170, 255, .40);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    transition: background .3s, color .3s;
}

a {
    color: var(--theme-color);
    text-decoration: none;
}

ul {
    list-style: none;
}

/* ===== 背景层（与首页一致） ===== */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.bg-layer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bg-gradient {
    position: absolute;
    inset:0;
    background-image: linear-gradient(rgba(255, 255, 255, 0) 0%, rgba(244, 248, 251, .25) 50%, rgba(244, 248, 251, .88) 100%);
}

html.night-mode .bg-gradient {
    background-image: linear-gradient(rgba(16, 18, 22, 0) 0%, rgba(16, 18, 22, .42) 50%, rgba(16, 18, 22, .92) 100%);
}

/* ===== 顶部导航（毛玻璃，与首页一致） ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border-bottom: 1px solid rgba(255,255,255,.45);
    box-shadow: 0 2px 16px rgba(0, 0, 0, .06);
    transition: background .3s ease, box-shadow .3s ease;
}

html.night-mode .site-header {
    background: rgba(20, 24, 32, .72);
    border-bottom-color: rgba(255, 255, 255, .08);
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: bold;
}

.site-logo img {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.site-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.site-nav a {
    position: relative;
    color: var(--text-color);
    transition: color .2s ease;
}

.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--theme-color);
    transition: width .25s ease;
}

.site-nav a:hover {
    color: var(--theme-color);
}

.site-nav a:hover::after {
    width: 100%;
}

/* 夜间切换按钮 */
.night-mode-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    margin-left: 10px;
    cursor: pointer;
    color: var(--text);
    transition: color .2s ease;
}

.night-mode-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--text);
}

.night-mode-btn:hover {
    color: var(--theme-color);
}

.night-mode-btn .icon-moon {
    display: none;
}

html.night-mode .night-mode-btn .icon-sun {
    display: none;
}

html.night-mode .night-mode-btn .icon-moon {
    display: block;
}

html.night-mode .night-mode-btn svg {
    stroke: #fff;
}

/* ===== 内容容器（居中阅读列，复用首页圆角/阴影观感） ===== */
.detail-wrap {
    max-width: 920px;
    margin: 0 auto;
    padding: 28px 24px 48px;
}

/* ===== 面包屑 ===== */
.crumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 14px;
    padding: 6px 0 18px;
    color: var(--sub);
}

.crumb a {
    color: var(--sub);
    transition: color .2s;
}

.crumb a:hover {
    color: var(--theme-color);
}

.crumb .sep {
    opacity: .5;
}

.crumb .cur {
    color: var(--text);
    font-weight: 500;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== 通用卡片（毛玻璃，与首页 notice/announce 一致） ===== */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--card-blur)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--card-blur)) saturate(140%);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(255, 255, 255, .45);
    padding: 22px 26px 26px;
    margin-bottom: 18px;
    color: var(--text);
    transition: background .3s, border-color .3s;
}

html.night-mode .card {
    border-color: rgba(255, 255, 255, .08);
}

.card-title {
    position: relative;
    margin: 0 0 16px;
    padding-left: 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.card-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    border-radius: 2px;
    background: var(--theme-color);
}

/* ===== 主卡片：站点头部 ===== */
.site-head {
    display: flex;
    align-items: center;
    gap: 22px;
}

/* 站点大图标（detail- 前缀避免与首页 .site-logo 冲突） */
.detail-logo {
    flex-shrink: 0;
    width: 92px;
    height: 92px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .02);
    overflow: hidden;
}

.detail-logo img,
.detail-logo svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.site-titles {
    min-width: 0;
}

.site-name {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    margin-bottom: 6px;
}

.site-desc {
    font-size: 14px;
    color: var(--sub);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.site-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.site-keywords span {
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--tagbacolor);
    border: var(--tagbacolorborder);
    color: var(--tagcolor);
    font-size: 12px;
    font-weight: 500;
}

/* 操作按钮（与首页 msg-btn / search-btn 一致） */
.site-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    color: var(--text);
    transition: transform .2s, box-shadow .2s, background .2s, color .2s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.btn-primary {
    background: linear-gradient(135deg, var(--theme-color), #7b5cff);
    color: #fff;
    box-shadow: 0 6px 18px rgba(47, 111, 237, .28);
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.btn-ghost {
    background: rgba(255, 255, 255, .5);
    border-color: var(--line);
}

html.night-mode .btn-ghost {
    background: rgba(255, 255, 255, .08);
}

.btn-ghost:hover {
    border-color: var(--theme-color);
    color: var(--theme-color);
}

/* 二维码悬浮 */
.urls-tools-qr {
    position: relative;
}

#code {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px;
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    z-index: 60;
    border: 1px solid var(--line);
}

#code img {
    display: block;
}

.urls-tools-qr:hover #code {
    display: block;
}

/* ===== 网站信息 ===== */
.info-list {
    list-style: none;
}

.info-list li {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 13px 0;
    border-bottom: 1px dashed var(--line);
}

.info-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-label {
    flex-shrink: 0;
    width: 96px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--sub);
}

.info-label svg {
    width: 16px;
    height: 16px;
    flex: none;
    stroke: var(--theme-color);
}

.info-value {
    flex: 1;
    min-width: 0;
    font-size: 13.5px;
    color: var(--text);
    word-break: break-all;
    overflow-wrap: anywhere;
}

/* ===== 相关推荐 ===== */
.rel-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.rel-item {
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--tagbacolor);
    border: var(--tagbacolorborder);
    color: var(--tagcolor);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: transform .2s, color .2s;
}

.rel-item:hover {
    transform: translateY(-2px);
    color: var(--theme-color);
}

/* ===== 网页快照 ===== */
.shot-card .view_img {
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--line);
}

.shot-card .view_img img {
    display: block;
    width: 100%;
    border-radius: 12px;
    vertical-align: middle;
}

/* ===== 页脚 ===== */
.footer-inner {
    margin-top: 24px;
    padding: 26px 0 8px;
    text-align: center;
    color: var(--sub);
    font-size: 12.5px;
}

.footer-text p {
    margin: 3px 0;
}

.footer-text a.icp {
    color: var(--sub);
    text-decoration: none;
}

.footer-text a.icp:hover {
    color: var(--theme-color);
}

/* ===== toast ===== */
.toast-msg {
    position: fixed;
    left: 50%;
    bottom: 48px;
    transform: translateX(-50%) translateY(16px);
    padding: 10px 22px;
    border-radius: 999px;
    background: rgba(17, 24, 39, .85);
    color: #fff;
    font-size: 13.5px;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s, transform .3s;
}

.toast-msg.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== Markdown 渲染内容样式 ===== */
.intro-md {
    overflow: hidden;
}

.intro-md h1,
.intro-md h2,
.intro-md h3,
.intro-md h4 {
    margin: 18px 0 10px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
}

.intro-md h1 { font-size: 20px; }
.intro-md h2 { font-size: 18px; }
.intro-md h3 { font-size: 16px; }
.intro-md h4 { font-size: 15px; }

.intro-md p { margin: 10px 0; }
.intro-md ul, .intro-md ol { margin: 10px 0 10px 22px; }
.intro-md li { margin: 4px 0; }

.intro-md blockquote {
    margin: 12px 0;
    padding: 8px 14px;
    border-left: 3px solid var(--accent-2);
    background: var(--bg);
    color: var(--sub);
    border-radius: 0 8px 8px 0;
}

.intro-md img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 10px 0;
}

.intro-md pre {
    margin: 12px 0;
    padding: 12px 14px;
    overflow-x: auto;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
}

.intro-md code {
    padding: 2px 6px;
    background: var(--bg);
    border-radius: 5px;
    font-size: 13px;
}

.intro-md pre code {
    padding: 0;
    background: none;
}

.intro-md table {
    width: 100%;
    margin: 12px 0;
    border-collapse: collapse;
    font-size: 13.5px;
}

.intro-md th, .intro-md td {
    padding: 8px 10px;
    border: 1px solid var(--line);
    text-align: left;
}

.intro-md th {
    background: var(--bg);
    font-weight: 600;
}

.intro-md hr {
    margin: 18px 0;
    border: none;
    border-top: 1px solid var(--line);
}

.intro-text {
    font-size: 14px;
    line-height: 1.85;
    color: var(--text);
}

.intro-text strong {
    color: var(--text);
    font-weight: 600;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .site-header {
        padding: 8px 14px;
    }
    .detail-wrap {
        padding: 22px 16px 36px;
    }
    .card {
        padding: 20px 18px 22px;
        border-radius: 12px;
    }
    .site-head {
        flex-direction: column;
        text-align: center;
        gap: 14px;
    }
    .detail-logo {
        width: 76px;
        height: 76px;
    }
    .site-name { font-size: 20px; }
    .site-actions { justify-content: center; }
    .info-list li {
        flex-direction: column;
        gap: 4px;
    }
    .info-label { width: auto; }
    .crumb .cur { max-width: 160px; }
}

@media (max-width: 560px) {
    .site-nav { display: none; }
}
