/* ============================================================
 * 工具详情页专属样式
 * 原 tool.php 内联 <style> 拆分至此
 * ============================================================ */

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 详情页容器 ---------- */
.detail-container {
    max-width: 1200px;
    margin: 20px auto 60px;
    padding: 0 20px;
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
    font-size: 14px;
    color: #888;
    margin-bottom: 16px;
}
.breadcrumb a {
    color: #6349ff;
    text-decoration: none;
}
.breadcrumb a:hover {
    text-decoration: underline;
}
.breadcrumb .sep {
    margin: 0 8px;
    color: #ccc;
}

/* ---------- 详情卡片 ---------- */
.detail-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    border: 1px solid #f0f0f5;
}
.detail-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6349ff, #9b7dff, #6349ff);
}

.detail-header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 24px;
}
.detail-icon {
    width: 84px;
    height: 84px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #e8e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(99, 73, 255, 0.15);
}
.detail-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.detail-info {
    flex: 1;
    min-width: 0;
}
.detail-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.detail-badge {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    color: #fff;
    font-weight: 500;
}
.badge-top { background: #ff7d00; }
.badge-rec { background: #e53e3e; }

.detail-cat {
    display: inline-block;
    font-size: 13px;
    color: #6349ff;
    background: #eef0ff;
    padding: 3px 10px;
    border-radius: 6px;
    margin-bottom: 10px;
}
.detail-desc {
    font-size: 15px;
    color: #555;
    line-height: 1.7;
    margin-bottom: 20px;
}
.detail-seo-text {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13px;
    color: #888;
    line-height: 1.8;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f8f7ff, #f3f0ff);
    border-radius: 10px;
    border: 1px solid #ebe8ff;
    color: #7a7299;
}
.detail-seo-text svg {
    color: #6349ff;
    flex-shrink: 0;
    margin-top: 2px;
}

.detail-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    background: linear-gradient(135deg, #6349ff, #7c5cff);
    color: #fff;
    border-radius: 10px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: 0.2s;
    box-shadow: 0 4px 14px rgba(99, 73, 255, 0.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #5238e6, #6b49e6);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 73, 255, 0.35);
}
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #fff;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 10px;
    text-decoration: none;
    font-size: 15px;
    transition: 0.2s;
}
.btn-secondary:hover {
    border-color: #6349ff;
    color: #6349ff;
}
.detail-url {
    font-size: 13px;
    color: #999;
    margin-top: 16px;
    word-break: break-all;
}

/* ---------- 相关推荐 ---------- */
.related-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.related-refresh {
    margin-left: auto;
    font-size: 13px;
    color: #999;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}
.related-refresh:hover { color: #6349ff; }
.related-refresh svg { transition: transform .4s; }
.related-refresh.loading svg { transform: rotate(360deg); }

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.rel-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 10px;
    text-decoration: none;
    transition: .2s;
}
.rel-card:hover {
    border-color: #6349ff;
    box-shadow: 0 2px 8px rgba(99, 73, 255, .1);
    transform: translateY(-1px);
}
.rel-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.rel-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.rel-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#relatedGrid {
    opacity: 1;
    transition: opacity .2s;
}
#relatedGrid.loading { opacity: .4; }

/* ---------- 站点信息 ---------- */
.site-info-card { margin-top: 16px; }
.site-info-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #222;
    margin: 0 0 14px 0;
}
.site-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
.site-info-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    color: #555;
    padding: 12px 14px;
    background: #f9f9fc;
    border-radius: 10px;
    border: 1px solid #f0f0f5;
    line-height: 1.5;
}
.site-info-label {
    color: #999;
    font-size: 12px;
    font-weight: 500;
}
.site-info-link {
    color: #6349ff;
    text-decoration: none;
    word-break: break-all;
    font-size: 13px;
}
.site-info-link:hover { text-decoration: underline; }
.site-info-row .site-info-link {
    font-size: 13px;
    word-break: break-all;
}
.site-warning {
    background: #fff8e0;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    color: #8a6d00;
    line-height: 1.7;
    margin-top: 12px;
}
.site-warning strong { color: #d48806; }
.site-feedback-btn-wrap {
    margin-top: 14px;
    text-align: right;
}
.btn-feedback {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all .2s;
}
.btn-feedback:hover {
    border-color: #6349ff;
    color: #6349ff;
}

/* ---------- 反馈弹窗 ---------- */
.feedback-mask {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.feedback-dialog {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .15);
}
.feedback-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #f0f0f0;
}
.feedback-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #222;
}
.feedback-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}
.feedback-close:hover {
    background: #f5f5f5;
    color: #666;
}
.feedback-body { padding: 18px; }
.feedback-subtitle {
    font-size: 13px;
    color: #999;
    margin: 0 0 14px 0;
}
.feedback-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.feedback-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 6px;
    transition: background .15s;
}
.feedback-option:hover { background: #f9f9f9; }
.feedback-option input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #6349ff;
    cursor: pointer;
}
.feedback-option span {
    font-size: 14px;
    color: #333;
}
.feedback-remark {
    width: 100%;
    margin-top: 14px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: #333;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}
.feedback-remark:focus {
    outline: none;
    border-color: #6349ff;
}
.feedback-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 18px;
    border-top: 1px solid #f0f0f0;
}
.feedback-btn-cancel {
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all .15s;
}
.feedback-btn-cancel:hover {
    border-color: #999;
    color: #333;
}
.feedback-btn-submit {
    background: #6349ff;
    border: 1px solid #6349ff;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 14px;
    color: #fff;
    cursor: pointer;
    transition: all .15s;
}
.feedback-btn-submit:hover { background: #5238e6; }
.feedback-btn-submit:disabled {
    background: #b3a8ff;
    cursor: not-allowed;
}

/* ---------- 评论区 ---------- */
.comment-section { margin-bottom: 24px; }
.comment-section h3 {
    font-size: 18px;
    margin-bottom: 16px;
    padding-left: 10px;
    border-left: 4px solid #6349ff;
    color: #222;
}
.comment-form {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, .04);
}
.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: .2s;
    margin-bottom: 10px;
    box-sizing: border-box;
    background: #fff;
    color: #333;
}
.comment-form input:focus,
.comment-form textarea:focus { border-color: #6349ff; }
.comment-form textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}
.comment-form button {
    padding: 9px 24px;
    background: #6349ff;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}
.comment-form button:hover { background: #5238e6; }
.comment-form .c-msg {
    margin-left: 12px;
    font-size: 13px;
}
.comment-form .c-msg.ok { color: #16a34a; }
.comment-form .c-msg.err { color: #dc2626; }

.comment-list {
    background: #fff;
    border-radius: 16px;
    padding: 8px 24px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, .04);
}
.comment-item {
    padding: 14px 0;
    border-bottom: 1px solid #f3f4f6;
}
.comment-item:last-child { border-bottom: none; }
.comment-item .c-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.comment-item .c-name {
    font-weight: 600;
    font-size: 16px;
    color: #1f2937;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.comment-item .c-time {
    font-size: 12px;
    color: #9ca3af;
}
.comment-item .c-body {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    word-break: break-word;
}
.comment-empty {
    text-align: center;
    padding: 30px;
    color: #9ca3af;
    font-size: 14px;
}
.comment-count {
    font-size: 14px;
    color: #6b7280;
    font-weight: normal;
    margin-left: 8px;
}

/* ============================================================
 * 响应式
 * ============================================================ */
@media (max-width: 900px) {
    .related-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-card { padding: 20px; }
    .detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .detail-title { justify-content: center; }
}
@media (max-width: 600px) {
    .related-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-icon { width: 64px; height: 64px; }
    .detail-title { font-size: 20px; }
    .site-info-grid { grid-template-columns: 1fr; }
    .comment-form { padding: 16px; }
    .comment-list { padding: 8px 16px; }
}

/* ============================================================
 * 深色模式
 * ============================================================ */
html[data-theme="dark"] .detail-card {
    background: #171920;
    border-color: #2a2a3e;
}
html[data-theme="dark"] .detail-desc { color: #bbb; }
html[data-theme="dark"] .detail-url { color: #777; }
html[data-theme="dark"] .btn-secondary {
    background: #222834;
    border-color: #333948;
    color: #ccc;
}
html[data-theme="dark"] .btn-secondary:hover {
    border-color: #6349ff;
    color: #6349ff;
}
html[data-theme="dark"] .detail-cat {
    background: #20304c;
    color: #4096ff;
}
html[data-theme="dark"] .detail-icon {
    border-color: #333948;
    box-shadow: 0 4px 20px rgba(99, 73, 255, 0.2);
}
html[data-theme="dark"] .detail-seo-text {
    background: linear-gradient(135deg, #1e1e30, #252540);
    border-color: #333355;
    color: #aaa;
}
html[data-theme="dark"] .detail-seo-text svg { color: #8b7aff; }

html[data-theme="dark"] .site-info-title { color: #e0e0e0; }
html[data-theme="dark"] .site-info-row {
    background: #1e2130;
    border-color: #2a2d3e;
    color: #ccc;
}
html[data-theme="dark"] .site-info-label { color: #777; }
html[data-theme="dark"] .site-warning {
    background: #2a2a1a;
    color: #c9a227;
}
html[data-theme="dark"] .site-warning strong { color: #e0b030; }
html[data-theme="dark"] .btn-feedback {
    background: #1a1a2e;
    border-color: #333;
    color: #aaa;
}
html[data-theme="dark"] .btn-feedback:hover {
    border-color: #6349ff;
    color: #8b7aff;
}

html[data-theme="dark"] .feedback-dialog { background: #1a1a2e; }
html[data-theme="dark"] .feedback-header { border-color: #2a2a3e; }
html[data-theme="dark"] .feedback-header h4 { color: #e0e0e0; }
html[data-theme="dark"] .feedback-close:hover {
    background: #2a2a3e;
    color: #ccc;
}
html[data-theme="dark"] .feedback-subtitle { color: #888; }
html[data-theme="dark"] .feedback-option:hover { background: #22223a; }
html[data-theme="dark"] .feedback-option span { color: #ccc; }
html[data-theme="dark"] .feedback-remark {
    background: #16162a;
    border-color: #333;
    color: #ccc;
}
html[data-theme="dark"] .feedback-footer { border-color: #2a2a3e; }
html[data-theme="dark"] .feedback-btn-cancel {
    background: #1a1a2e;
    border-color: #333;
    color: #aaa;
}

html[data-theme="dark"] .rel-card {
    background: #1e2130;
    border-color: #2a2d3e;
}
html[data-theme="dark"] .rel-name { color: #ddd; }

html[data-theme="dark"] .comment-section h3 { color: #e0e0e0; }
html[data-theme="dark"] .comment-form,
html[data-theme="dark"] .comment-list { background: #171920; }
html[data-theme="dark"] .comment-form input,
html[data-theme="dark"] .comment-form textarea {
    background: #222834;
    border-color: #333948;
    color: #e5e7eb;
}
html[data-theme="dark"] .comment-item .c-name { color: #f3f4f6; }
html[data-theme="dark"] .comment-item .c-body { color: #d1d5db; }
html[data-theme="dark"] .comment-item { border-bottom-color: #2a2a3e; }
