/* ===== tool_detail.css - 工具详情页 ===== */
/* 布局:渐变头部主视觉 + 悬浮数据条 + 左内容 / 右吸顶栏
   配色圆角沿用 css/style.css 的 CSS 变量,保证与全站一致 */

/* 宽度与文章页外层容器(.article-container 1600px)对齐:
   内容区 1600-80 = 1520px,扣除右侧栏 320 + 间距后,
   正文列 ≈ 1176px,与文章正文 .article-content-wrapper 的 1200px 基本一致,
   视觉上不再"比文章页小一圈" */
.td-main {
    /* body 是 column flex,交叉轴的 auto margin 会取消 stretch、把元素收缩成内容宽,
       必须显式 width:100% 才能撑满(同 .article-container 的做法) */
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 30px 40px 70px;
}

/* 进场:头部先落,其余区块依次跟上 */
.td-main > * { animation: tdUp .45s ease both; }
.td-main > *:nth-child(2) { animation-delay: .06s; }
.td-main > *:nth-child(3) { animation-delay: .12s; }
.td-main > *:nth-child(n+4) { animation-delay: .18s; }
@keyframes tdUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- 头部主视觉(渐变大卡) ---------- */
.td-hero {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 46px 48px;
    color: #fff;
    background: linear-gradient(135deg, #1f6fd0 0%, #3a86ff 48%, #22b8e6 100%);
    box-shadow: 0 20px 44px -20px rgba(31, 111, 208, .7);
}
/* 两团高光,给纯色渐变一点层次(纯装饰,不拦截点击) */
.td-hero-deco {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 88% 12%, rgba(255,255,255,.30), transparent 45%),
        radial-gradient(circle at 8% 92%, rgba(255,255,255,.16), transparent 50%);
}
.td-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 26px;
    align-items: flex-start;
}

/* 玻璃质感图标 */
.td-hero-icon {
    flex: 0 0 92px;
    height: 92px;
    border-radius: 24px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    color: #fff;
    box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .4);
    animation: tdPop .5s cubic-bezier(.34, 1.4, .64, 1) both .1s;
}
@keyframes tdPop {
    from { opacity: 0; transform: scale(.85); }
    to   { opacity: 1; transform: none; }
}

.td-hero-text { flex: 1; min-width: 0; }

.td-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.td-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-full, 9999px);
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
}
.td-hero-tag i { font-size: 0.7rem; }
.td-tag-lock  { background: rgba(255, 193, 7, .24); border-color: rgba(255, 193, 7, .55); }
.td-tag-free2 { background: rgba(16, 185, 129, .24); border-color: rgba(16, 185, 129, .55); }
.td-tag-vip2  { background: rgba(255, 215, 79, .26); border-color: rgba(255, 215, 79, .6); }
.td-tag-perm2 { background: rgba(92, 193, 230, .26); border-color: rgba(92, 193, 230, .6); }

.td-hero-title {
    font-size: 2.3rem;
    font-weight: 800;
    letter-spacing: .5px;
    margin: 14px 0 8px;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .12);
}
.td-hero-desc {
    color: rgba(255, 255, 255, .92);
    line-height: 1.75;
    font-size: 1rem;
    max-width: 780px;
}

.td-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

/* ---------- 按钮 ---------- */
.td-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 11px 22px;
    border-radius: var(--radius-full, 9999px);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-base, .25s ease);
}
.td-btn:disabled { opacity: .6; cursor: not-allowed; }

/* 头部里的主按钮:白底,在深色渐变上最跳 */
.td-btn-use {
    background: #fff;
    color: #1f6fd0;
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, .35);
}
.td-btn-use:hover { color: #1f6fd0; transform: translateY(-2px); }

.td-btn-vip {
    background: linear-gradient(135deg, #ffd54f, #ff9800);
    color: #7a4b00;
    box-shadow: 0 12px 24px -10px rgba(255, 152, 0, .6);
}
.td-btn-vip:hover { color: #7a4b00; transform: translateY(-2px); }

/* 头部里的次级按钮:玻璃描边 */
.td-btn-glass {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .35);
    color: #fff;
}
.td-btn-glass:hover { background: rgba(255, 255, 255, .26); color: #fff; transform: translateY(-2px); }
.td-btn-glass.active {
    background: rgba(255, 215, 79, .92);
    border-color: transparent;
    color: #7a4b00;
}

/* 白底区块里的主按钮(发表评论) */
.td-btn-primary { background: var(--primary, #3a86ff); color: #fff; }
.td-btn-primary:hover { background: var(--primary-dark, #2666cc); }

/* ---------- 悬浮数据条 ---------- */
.td-stats {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: -32px auto 0;
    max-width: calc(100% - 64px);
}
.td-stat {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-light, #eef2f6);
    border-radius: 14px;
    padding: 16px 10px;
    text-align: center;
    box-shadow: var(--shadow-lg, 0 4px 16px rgba(0,0,0,.06));
    transition: transform var(--transition-base, .25s ease);
}
.td-stat:hover { transform: translateY(-3px); }
.td-stat-num {
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--text-primary, #1f2937);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.td-stat-num i { color: var(--primary, #3a86ff); font-size: 0.82rem; }
.td-stat-label { font-size: 0.74rem; color: var(--text-muted, #9ca3af); margin-top: 4px; }

/* ---------- VIP 锁定提示 ---------- */
.td-lock-tip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding: 14px 20px;
    border-radius: var(--radius-lg, 14px);
    background: linear-gradient(135deg, rgba(249,115,22,.08), rgba(255,179,71,.12));
    border: 1px solid rgba(249,115,22,.25);
    color: #9a5b12;
    font-size: 0.88rem;
}
.td-lock-tip i { color: var(--accent, #f97316); }
.td-lock-tip a { color: var(--accent, #f97316); font-weight: 600; margin-left: auto; }

/* ---------- 双栏布局 ---------- */
.td-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    margin-top: 24px;
    align-items: start;
}
.td-col-main { min-width: 0; }
.td-col-main > .td-panel + .td-panel { margin-top: 18px; }
/* 侧栏吸顶:滚评论时评分卡始终可见,随时能打分 */
.td-col-side {
    position: sticky;
    top: 78px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ---------- 通用区块 ---------- */
.td-panel {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-light, #eef2f6);
    border-radius: 18px;
    box-shadow: var(--shadow-md, 0 2px 8px rgba(0,0,0,.04));
    padding: 30px 34px;
    transition: box-shadow var(--transition-base, .25s ease);
}
.td-panel:hover { box-shadow: var(--shadow-lg, 0 4px 16px rgba(0,0,0,.06)); }
.td-panel-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-primary, #1f2937);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.td-panel-title > i {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--primary-bg, rgba(58,134,255,.08));
    color: var(--primary, #3a86ff);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}
.td-panel-count {
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-bg, rgba(58,134,255,.08));
    color: var(--primary, #3a86ff);
    padding: 2px 10px;
    border-radius: var(--radius-full, 9999px);
}

.td-detail-text {
    color: var(--text-secondary, #4b5563);
    line-height: 2;
    font-size: 1rem;
}

.td-empty {
    text-align: center;
    padding: 30px 14px;
    color: var(--text-muted, #9ca3af);
    border: 1px dashed var(--border-default, #e5e7eb);
    border-radius: var(--radius-lg, 14px);
    background: var(--bg-gray-50, #fafafa);
}
.td-empty i { font-size: 1.7rem; margin-bottom: 10px; display: block; color: var(--primary-light, #6ea8fe); }
.td-empty p { margin: 0 0 6px; font-size: 0.9rem; }
.td-empty a { color: var(--primary, #3a86ff); font-size: 0.85rem; font-weight: 600; }
.td-empty-sm { padding: 22px 10px; }

/* ---------- 评分卡(侧栏) ---------- */
.td-rating-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--border-divider, #eceef2);
}
.td-rating-avg {
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--primary, #3a86ff), var(--sky-blue, #00b4d8));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.td-rating-side { flex: 1; min-width: 0; }
.td-rating-stars { margin-bottom: 4px; }
.td-stars-view .fa-star, .td-mine-stars .fa-star {
    color: #ffc107;
    font-size: 0.95rem;
    margin: 0 1px;
}
.td-stars-view .fa-star.off, .td-mine-stars .fa-star.off { color: var(--light-gray, #e5e7eb); }
.td-rating-count { font-size: 0.76rem; color: var(--text-muted, #9ca3af); }

.td-rating-dist { padding: 14px 0; }
.td-dist-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 9px;
}
.td-dist-label { font-size: 0.76rem; color: var(--text-tertiary, #6b7280); width: 32px; }
.td-dist-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-gray-150, #f5f5f5);
    border-radius: var(--radius-full, 9999px);
    overflow: hidden;
}
.td-dist-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd54f, #ff9800);
    border-radius: var(--radius-full, 9999px);
    transition: width var(--transition-slow, .35s ease);
}
.td-dist-num { font-size: 0.76rem; color: var(--text-muted, #9ca3af); width: 26px; text-align: right; }

.td-rating-mine {
    text-align: center;
    padding: 14px 12px;
    border-radius: var(--radius-lg, 14px);
    background: var(--bg-gray-50, #fafafa);
    border: 1px solid var(--border-light, #eef2f6);
}
.td-mine-label { font-size: 0.8rem; color: var(--text-tertiary, #6b7280); font-weight: 600; margin-bottom: 8px; }
.td-mine-stars .td-star {
    font-size: 1.45rem;
    cursor: pointer;
    margin: 0 3px;
    transition: transform .15s ease;
}
.td-mine-stars .td-star:hover { transform: scale(1.2); }
.td-mine-tip { font-size: 0.76rem; color: var(--text-muted, #9ca3af); margin-top: 8px; min-height: 1.2em; }
.td-mine-tip a { color: var(--primary, #3a86ff); }

/* ---------- 评论 ---------- */
.td-login-tip {
    padding: 16px;
    text-align: center;
    background: var(--bg-gray-50, #fafafa);
    border: 1px dashed var(--border-default, #e5e7eb);
    border-radius: var(--radius-md, 10px);
    font-size: 0.88rem;
    color: var(--text-tertiary, #6b7280);
    margin-bottom: 18px;
}
.td-login-tip a { color: var(--primary, #3a86ff); font-weight: 600; }

.td-comment-form textarea {
    width: 100%;
    min-height: 92px;
    padding: 13px 15px;
    border: 1px solid var(--border-default, #e5e7eb);
    border-radius: var(--radius-md, 10px);
    font-size: 0.92rem;
    font-family: inherit;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
    background: var(--bg-gray-50, #fafafa);
    transition: border-color var(--transition-fast, .2s ease), box-shadow var(--transition-fast, .2s ease);
}
.td-comment-form textarea:focus {
    border-color: var(--primary, #3a86ff);
    background: var(--bg-card, #fff);
    box-shadow: 0 0 0 3px var(--primary-bg, rgba(58,134,255,.08));
}
.td-comment-form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.td-form-hint { font-size: 0.78rem; color: var(--text-muted, #9ca3af); }
.td-form-msg {
    display: none;
    margin-top: 8px;
    font-size: 0.82rem;
    padding: 8px 12px;
    border-radius: var(--radius-sm, 6px);
}
.td-form-msg.show { display: block; }
.td-form-msg.ok  { background: rgba(16,185,129,.1);  color: #0f9d58; }
.td-form-msg.err { background: rgba(239,68,68,.1);   color: #dc2626; }

.td-comment-list { margin-top: 18px; }
.td-comment-item {
    display: flex;
    gap: 12px;
    padding: 14px 2px;
    border-top: 1px solid var(--border-divider, #eceef2);
}
.td-comment-item:first-child { border-top: none; }
.td-comment-new { animation: tdUp .35s ease both; }

.td-comment-avatar {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-gray-150, #f5f5f5);
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.td-avatar-txt {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light, #6ea8fe), var(--primary, #3a86ff));
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}
.td-comment-main { flex: 1; min-width: 0; }
.td-comment-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}
.td-comment-name { font-weight: 600; font-size: 0.9rem; color: var(--text-primary, #1f2937); }
.td-comment-time { font-size: 0.75rem; color: var(--text-muted, #9ca3af); margin-left: auto; }
.td-tag {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: var(--radius-full, 9999px);
    font-weight: 600;
}
.td-tag-vip  { background: linear-gradient(135deg, #ffecb3, #ffd54f); color: #8a5a00; }
.td-tag-perm { background: linear-gradient(135deg, #5cc1e6, #1e7ed2); color: #fff; }
.td-tag-admin { background: rgba(239,68,68,.1); color: #dc2626; }
.td-del-btn {
    background: none;
    border: none;
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    font-size: 0.78rem;
    padding: 2px 4px;
    transition: color var(--transition-fast, .2s ease);
}
.td-del-btn:hover { color: #dc2626; }
/* 气泡式正文:左上角直角、其余圆角,像对话气泡 */
.td-comment-content {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-secondary, #4b5563);
    word-break: break-word;
    background: var(--bg-gray-50, #fafafa);
    border: 1px solid var(--border-light, #eef2f6);
    border-radius: 4px 14px 14px 14px;
    padding: 10px 14px;
}
.td-comment-foot { margin-top: 8px; }
.td-like-btn {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-default, #e5e7eb);
    border-radius: var(--radius-full, 9999px);
    padding: 4px 12px;
    font-size: 0.78rem;
    color: var(--text-tertiary, #6b7280);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all var(--transition-fast, .2s ease);
}
.td-like-btn:hover { border-color: var(--primary, #3a86ff); color: var(--primary, #3a86ff); transform: translateY(-1px); }
.td-like-btn.liked {
    background: rgba(58,134,255,.1);
    border-color: var(--primary, #3a86ff);
    color: var(--primary, #3a86ff);
}

/* ---------- 同类工具(侧栏竖排) ---------- */
.td-side-list .td-related-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.td-related-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-light, #eef2f6);
    border-radius: var(--radius-md, 10px);
    background: var(--bg-card, #fff);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-base, .25s ease);
}
.td-related-card:hover {
    border-color: var(--primary, #3a86ff);
    background: var(--primary-bg, rgba(58,134,255,.05));
    transform: translateX(3px);
}
.td-related-icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-lighter, #e8f0fe), var(--primary-bg, rgba(58,134,255,.08)));
    color: var(--primary, #3a86ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all var(--transition-base, .25s ease);
}
.td-related-card:hover .td-related-icon {
    background: linear-gradient(135deg, var(--primary-light, #6ea8fe), var(--primary, #3a86ff));
    color: #fff;
}
.td-related-text { min-width: 0; }
.td-related-name {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.td-related-desc {
    font-size: 0.73rem;
    color: var(--text-muted, #9ca3af);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- 响应式 ---------- */
/* 大屏收一点,普通笔记本再收,别让内容贴边 */
@media (max-width: 1680px) {
    .td-main { padding: 28px 32px 64px; }
}

@media (max-width: 1280px) {
    .td-main { padding: 24px 24px 56px; }
}

@media (max-width: 900px) {
    .td-layout { grid-template-columns: 1fr; }
    .td-col-side { position: static; }
}

@media (max-width: 768px) {
    .td-main { padding: 14px 12px 44px; }
    .td-hero { padding: 22px 18px; border-radius: 18px; }
    .td-hero-inner { flex-direction: column; gap: 14px; }
    .td-hero-icon { flex: 0 0 64px; width: 64px; height: 64px; font-size: 1.7rem; border-radius: 18px; }
    .td-hero-title { font-size: 1.35rem; margin: 10px 0 6px; }
    .td-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin: -24px auto 0;
        max-width: calc(100% - 20px);
    }
    .td-panel { padding: 18px 16px; border-radius: var(--radius-lg, 14px); }
    .td-btn { padding: 10px 16px; font-size: 0.85rem; }
    .td-lock-tip a { margin-left: 0; }
}
