/* ===== 工具详情落地页(/tool/{slug}) ===== */

.detail-wrap { padding: 32px 0 80px; }

/* 面包屑（统一胶囊式） */
.detail-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    font-size: 13px;
}
.detail-breadcrumb a,
.detail-breadcrumb .current {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 10px;
    border-radius: 6px;
    transition: all 0.16s ease;
}
.detail-breadcrumb a {
    color: var(--c-text-sub);
    background: var(--c-bg-soft);
}
.detail-breadcrumb a:hover {
    color: var(--c-primary);
    background: color-mix(in srgb, var(--c-primary) 10%, var(--c-bg-soft));
}
.detail-breadcrumb .current {
    color: var(--c-primary);
    background: color-mix(in srgb, var(--c-primary) 8%, transparent);
    font-weight: 600;
}
.detail-breadcrumb .sep {
    color: var(--c-text-muted);
    opacity: 0.5;
    font-size: 12px;
}

/* 顶部双栏 */
.detail-top {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 44px;
}

.detail-main { min-width: 0; }

/* 标题行：图标 + 标题 */
.detail-title-row {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
}

.detail-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 32px;
    color: #fff;
    background: var(--icon-bg, var(--c-primary));
    box-shadow: 0 10px 24px var(--icon-shadow, rgba(0, 102, 255, 0.3));
    flex-shrink: 0;
}

.detail-title-row h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: var(--c-primary-soft);
    color: var(--c-primary);
}
.badge.b-hot { background: #fff0f4; color: #ff4d79; }
.badge.b-new { background: #e6fbef; color: var(--c-accent-green); }
.badge.b-cat { background: #f0f1f5; color: var(--c-text-sub); }

.detail-desc {
    font-size: 16px;
    color: var(--c-text-sub);
    line-height: 1.8;
    margin-bottom: 26px;
}
.detail-desc--flush { margin-bottom: 0; }

.aside-note {
    text-align: center;
    margin-top: 14px;
}

/* 元数据行 */
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 28px;
    padding: 18px 22px;
    background: var(--c-bg-soft);
    border-radius: var(--radius-md);
    margin-bottom: 28px;
}
.detail-meta .item { display: flex; flex-direction: column; gap: 2px; }
.detail-meta .k { font-size: 12px; color: var(--c-text-muted); }
.detail-meta .v { font-size: 14px; font-weight: 600; color: var(--c-text); }

/* 主 CTA 行 */
.detail-cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* 右侧吸顶卡 */
.detail-aside {
    position: sticky;
    top: 90px;
}

.aside-card {
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-md);
}

.aside-price {
    padding: 26px 26px 20px;
    text-align: center;
    background: linear-gradient(180deg, #f7f9fc, #fff);
    border-bottom: 1px solid var(--c-border);
}
.aside-price .free-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    background: #e6fbef;
    color: var(--c-accent-green);
    margin-bottom: 10px;
}
.aside-price .price {
    font-size: 30px;
    font-weight: 800;
    color: var(--c-text);
    letter-spacing: -0.02em;
}
.aside-price .price .unit { font-size: 15px; color: var(--c-text-sub); font-weight: 600; margin-left: 4px; }
.aside-price .note { font-size: 13px; color: var(--c-text-muted); margin-top: 6px; }

.aside-body { padding: 22px 26px 26px; }
.aside-body .btn { width: 100%; margin-bottom: 14px; }

.aside-info { list-style: none; }
.aside-info li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    font-size: 13.5px;
    color: var(--c-text-sub);
    border-top: 1px dashed var(--c-border);
}
.aside-info li:first-child { border-top: none; }
.aside-info .ico {
    width: 26px; height: 26px; border-radius: 8px;
    background: var(--c-primary-soft); color: var(--c-primary);
    display: grid; place-items: center; font-size: 14px;
    flex-shrink: 0;
}
.aside-info b { color: var(--c-text); font-weight: 600; }

/* Tab 区 */
.detail-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--c-border);
    margin-bottom: 30px;
    overflow-x: auto;
}
.detail-tab {
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--c-text-sub);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
    cursor: pointer;
}
.detail-tab:hover { color: var(--c-text); }
.detail-tab.active { color: var(--c-primary); border-bottom-color: var(--c-primary); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* 简介面板：特性网格 */
.tab-block-head {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 18px;
}

.feature-chips {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}
.feature-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--c-text);
    font-weight: 600;
}
.feature-chip .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--c-primary);
    flex-shrink: 0;
}

/* 玩法步骤 */
.steps-list { list-style: none; counter-set: step; }
.steps-list li {
    position: relative;
    padding: 0 0 24px 52px;
    counter-increment: step;
}
.steps-list li::before {
    content: counter(step);
    position: absolute;
    left: 0; top: 0;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--c-primary-soft);
    color: var(--c-primary);
    font-size: 14px;
    font-weight: 700;
    display: grid; place-items: center;
}
.steps-list li::after {
    content: "";
    position: absolute;
    left: 15px; top: 32px;
    width: 2px; bottom: 0;
    background: var(--c-border);
}
.steps-list li:last-child { padding-bottom: 0; }
.steps-list li:last-child::after { display: none; }
.steps-list li .step-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--c-text);
    margin-bottom: 4px;
}
.steps-list li .step-desc {
    font-size: 14px;
    color: var(--c-text-sub);
    line-height: 1.65;
}

/* 更新记录 */
.changelog { list-style: none; }
.changelog li {
    padding: 14px 0;
    border-bottom: 1px dashed var(--c-border);
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.changelog .ver {
    font-size: 12px; font-weight: 700;
    padding: 3px 10px; border-radius: 999px;
    background: var(--c-primary-soft); color: var(--c-primary);
    flex-shrink: 0;
}
.changelog .date { font-size: 13px; color: var(--c-text-muted); margin-right: 10px; }
.changelog .txt { font-size: 14px; color: var(--c-text-sub); }

/* 留言占位 */
.comment-empty {
    text-align: center;
    padding: 56px 24px;
    border: 1px dashed var(--c-border);
    border-radius: var(--radius-md);
    color: var(--c-text-muted);
}
.comment-empty .emoji { font-size: 40px; margin-bottom: 12px; opacity: 0.6; }
.comment-empty p { font-size: 14px; margin-bottom: 16px; }

/* ===================== 工具留言区 ===================== */
.cm-wrap { display: flex; flex-direction: column; gap: 26px; }

.cm-head-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.cm-title { font-size: 18px; font-weight: 800; color: var(--c-text); }
.cm-count {
    display: inline-block;
    min-width: 22px;
    text-align: center;
    font-size: 12px;
    color: var(--c-primary);
    background: var(--c-primary-soft);
    border-radius: 999px;
    padding: 1px 8px;
    margin-left: 4px;
}
.cm-note { font-size: 12px; color: var(--c-text-muted); }

.cm-list { display: flex; flex-direction: column; gap: 12px; }
.cm-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: var(--c-surface-soft, #f8fafc);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
}
.cm-avatar {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent-cyan, #00d4ff));
    user-select: none;
}
.cm-main { min-width: 0; flex: 1; }
.cm-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.cm-name { font-size: 14px; font-weight: 700; color: var(--c-text); }
.cm-tag {
    font-size: 11px;
    padding: 0 8px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #64748b;
    line-height: 18px;
}
.cm-tag-user {
    background: var(--c-primary-soft);
    color: var(--c-primary);
}
.cm-time { margin-left: auto; font-size: 12px; color: var(--c-text-muted); }
.cm-content {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--c-text-sub);
    white-space: pre-wrap;
    word-break: break-word;
}

/* 留言表单 */
.cm-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    background: var(--c-surface, #fff);
}
.cm-form-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.cm-form-title { font-size: 15px; font-weight: 800; color: var(--c-text); }
.cm-login-tip { font-size: 12px; color: var(--c-text-muted); }
.cm-login-tip b { color: var(--c-primary); }
.cm-login-tip a { color: var(--c-primary); }

.cm-field { position: relative; }
.cm-input,
.cm-textarea {
    width: 100%;
    border: 1px solid var(--c-border);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--c-text);
    background: var(--c-surface, #fff);
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.cm-input:focus,
.cm-textarea:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.cm-textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
.cm-count-row {
    position: absolute;
    right: 12px;
    bottom: 10px;
    font-size: 12px;
    color: var(--c-text-muted);
    background: var(--c-surface, #fff);
    padding: 0 4px;
}

.cm-captcha-row { display: flex; gap: 12px; align-items: stretch; }
.cm-input-captcha { max-width: 220px; letter-spacing: 2px; }
.cm-captcha-img {
    height: 42px;
    width: 120px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid var(--c-border);
    transition: transform .15s ease;
}
.cm-captcha-img:hover { transform: scale(1.04); }

.cm-err { font-size: 12px; color: #ef4444; margin-top: 6px; min-height: 0; }

.cm-submit {
    align-self: flex-start;
    border: none;
    cursor: pointer;
    padding: 11px 26px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent-cyan, #00d4ff));
    box-shadow: 0 6px 16px var(--c-primary-soft);
    transition: transform .15s ease, box-shadow .2s ease;
}
.cm-submit:hover { transform: translateY(-1px); box-shadow: 0 10px 22px var(--c-primary-soft); }
.cm-submit:disabled { opacity: .65; cursor: not-allowed; transform: none; }

.cm-success {
    text-align: center;
    padding: 34px 24px;
    border: 1px dashed var(--c-primary);
    border-radius: var(--radius-md);
    background: var(--c-primary-soft);
}
.cm-success .emoji { font-size: 38px; margin-bottom: 8px; }
.cm-success h4 { font-size: 17px; font-weight: 800; color: var(--c-text); margin-bottom: 6px; }
.cm-success p { font-size: 13px; color: var(--c-text-muted); margin-bottom: 16px; }

@media (max-width: 640px) {
    .cm-captcha-row { flex-direction: column; }
    .cm-input-captcha { max-width: none; }
    .cm-captcha-img { width: 100%; height: 46px; }
}

/* 相关工具 */
.related { padding-top: 8px; margin-top: 60px; border-top: 1px solid var(--c-border); }
.related h2 { font-size: 22px; font-weight: 800; margin-bottom: 22px; letter-spacing: -0.01em; }

/* 返回顶部 */
.back-to-top {
    position: fixed;
    right: 28px;
    bottom: 28px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--c-border);
    box-shadow: var(--shadow-md);
    color: var(--c-text);
    font-size: 20px;
    display: grid;
    place-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s, transform 0.2s;
    z-index: 80;
}
.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { transform: translateY(-3px); color: var(--c-primary); }

/* ===== 响应式 ===== */
@media (max-width: 960px) {
    .detail-top { grid-template-columns: 1fr; }
    .detail-aside { position: static; }
    .detail-title-row h1 { font-size: 26px; }
    .feature-chips { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .detail-title-row { flex-wrap: wrap; }
    .detail-icon { width: 52px; height: 52px; font-size: 26px; border-radius: 14px; }
    .detail-title-row h1 { font-size: 22px; }
    .detail-meta { gap: 12px 20px; }
    .back-to-top { right: 16px; bottom: 16px; }
}

/* ===== 深色模式（工具详情页通用） ===== */
[data-theme="dark"] .aside-card { background: var(--c-bg-card); }
[data-theme="dark"] .aside-price {
    background: linear-gradient(180deg, var(--c-surface-soft), var(--c-bg-card));
}
[data-theme="dark"] .badge.b-hot { background: rgba(255, 77, 121, 0.14); color: #ff7a9e; }
[data-theme="dark"] .badge.b-new { background: rgba(16, 185, 129, 0.14); }
[data-theme="dark"] .badge.b-cat { background: rgba(148, 163, 184, 0.14); color: var(--c-text-sub); }
[data-theme="dark"] .back-to-top {
    background: var(--c-bg-card);
    border-color: rgba(255, 255, 255, 0.10);
}
