/* ============================================================
   富文本排版清理工具 - 页面专属样式
   桌面端导航/页脚样式由 ../../style.css 提供，此处不重写
   ============================================================ */

/* ===== 页头 ===== */
.tc-header {
    background: linear-gradient(180deg, #f0f5ff 0%, #ffffff 100%);
}
.tc-header h1 .hl {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.tc-badges {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}
.tc-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(26, 110, 255, 0.08);
    border: 1px solid rgba(26, 110, 255, 0.15);
    padding: 5px 14px;
    border-radius: 100px;
}

/* ===== 主区 ===== */
.tc-main { padding-top: 48px; }

/* 本地运行提示条 */
.tc-notice {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: linear-gradient(135deg, #e8f1ff 0%, #f0f5ff 100%);
    border: 1.5px solid rgba(26, 110, 255, 0.15);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 28px;
}
.tc-notice-icon {
    width: 40px; height: 40px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tc-notice-icon svg { width: 22px; height: 22px; color: white; }
.tc-notice h4 { font-size: 15px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.tc-notice p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; margin: 0; }

/* 统计面板 */
.tc-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 28px;
}
.tc-stat { text-align: center; }
.tc-stat-value {
    font-size: 26px;
    font-weight: 900;
    color: #ff6b35;
    line-height: 1.1;
    font-family: 'SFMono-Regular', Consolas, monospace;
}
.tc-stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 6px;
}

/* ===== 规则面板 ===== */
.tc-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 28px;
}
.tc-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.tc-panel-title .dot {
    width: 7px; height: 7px;
    background: var(--primary);
    border-radius: 50%;
}
.tc-panel-tip {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-light);
}
.tc-presets {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 22px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--border);
}
.tc-preset {
    padding: 9px 20px;
    border-radius: 100px;
    border: 1.5px solid var(--border);
    background: white;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}
.tc-preset:hover { border-color: var(--primary); color: var(--primary); }
.tc-preset.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 14px rgba(26, 110, 255, 0.3);
}
.tc-preset em {
    font-style: normal;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.22);
    padding: 1px 8px;
    border-radius: 100px;
    margin-left: 6px;
}
.tc-preset:not(.active) em { background: var(--primary-light); color: var(--primary); }

.tc-rules {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.tc-rule-group {
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
}
.tc-rule-group h5 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
}
.g-ico {
    width: 26px; height: 26px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

/* 复选框 */
.tc-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 0;
    cursor: pointer;
    user-select: none;
}
.tc-check input { display: none; }
.tc-check i {
    width: 16px; height: 16px;
    border: 1.5px solid var(--border);
    border-radius: 5px;
    background: white;
    position: relative;
    flex-shrink: 0;
    transition: var(--transition);
}
.tc-check input:checked + i {
    background: var(--primary-gradient);
    border-color: transparent;
}
.tc-check input:checked + i::after {
    content: '';
    position: absolute;
    left: 4.5px; top: 1.5px;
    width: 4px; height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* 下拉字段 */
.tc-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 0;
    font-size: 13px;
    color: var(--text-secondary);
}
.tc-field select {
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    padding: 5px 8px;
    max-width: 170px;
    cursor: pointer;
}
.tc-field select:focus { outline: none; border-color: var(--primary); }

/* ===== 工作区 ===== */
.tc-workspace { margin-bottom: 64px; }
.tc-editor {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}
.tc-editor:focus-within {
    border-color: rgba(26, 110, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(26, 110, 255, 0.08);
}
.tc-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    background: var(--bg-warm);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.tc-editor-tag {
    font-size: 13px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 100px;
}
.tc-editor-tag.in { background: #fff3ed; color: #ff6b35; }
.tc-editor-tag.out { background: #f0fdf4; color: #16a34a; }
.tc-editor-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.tc-mini-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}
.tc-mini-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.tc-mini-btn.danger:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-light);
}
.tc-mini-btn.ok {
    border-color: var(--success);
    color: var(--success);
    background: var(--success-light);
}
.tc-editor textarea {
    display: block;
    width: 100%;
    min-height: 260px;
    max-height: 520px;
    border: none;
    outline: none;
    resize: vertical;
    padding: 18px 20px;
    font-family: 'SFMono-Regular', Consolas, 'Noto Sans SC', monospace;
    font-size: 13px;
    line-height: 1.8;
    color: var(--text);
    background: white;
}
.tc-editor-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 18px;
    background: var(--bg-warm);
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-light);
}
.tc-auto {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
}
.tc-auto input { display: none; }
.tc-auto i {
    width: 14px; height: 14px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    background: white;
    position: relative;
    transition: var(--transition);
}
.tc-auto input:checked + i { background: var(--primary-gradient); border-color: transparent; }
.tc-auto input:checked + i::after {
    content: '';
    position: absolute;
    left: 4px; top: 1px;
    width: 3px; height: 7px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.tc-status {
    font-weight: 600;
    color: var(--text-light);
}
.tc-status.busy { color: var(--warning); }
.tc-status.done { color: var(--success); }
.tc-status.err { color: var(--danger); }

/* 操作栏 */
.tc-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 18px 0;
    flex-wrap: wrap;
}
.tc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 30px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 11px;
    cursor: pointer;
    transition: var(--transition);
}
.tc-btn.primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 6px 20px rgba(26, 110, 255, 0.32);
}
.tc-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(26, 110, 255, 0.42);
}
.tc-btn.primary:active { transform: translateY(0); }
.format-field {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 11px;
    padding: 8px 14px;
}
.format-field select {
    border: none;
    font-size: 13px;
    font-weight: 600;
    max-width: 130px;
}
.tc-swap-note {
    font-size: 12px;
    color: var(--text-light);
    margin-left: auto;
}

/* ===== 能力说明 ===== */
.tc-features { margin-bottom: 64px; }
.tc-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.tc-feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    transition: var(--transition);
}
.tc-feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(26, 110, 255, 0.2);
}
.tc-feature-card .f-ico {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.tc-feature-card .f-ico svg {
    width: 24px; height: 24px;
    color: var(--primary);
}
.tc-feature-card h4 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.tc-feature-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.8; margin: 0; }

/* ===== 使用步骤 ===== */
.tc-steps { margin-bottom: 32px; }
.tc-step-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.tc-step-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    position: relative;
    transition: var(--transition);
}
.tc-step-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: rgba(26, 110, 255, 0.2);
}
.tc-step-card:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 44px;
    right: -14px;
    width: 8px; height: 8px;
    border-top: 2px solid var(--primary);
    border-right: 2px solid var(--primary);
    transform: rotate(45deg);
    opacity: 0.4;
}
.tc-step-card .s-num {
    width: 44px; height: 44px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 900;
    margin: 0 auto 14px;
    box-shadow: 0 6px 16px rgba(26, 110, 255, 0.3);
}
.tc-step-card h4 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.tc-step-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; margin: 0; }

/* ===== 出现动画 ===== */
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   移动端适配（规则与官网 drill.html 内联样式保持一致）
   ============================================================ */
@media (max-width: 1024px) {
    .tc-rules { grid-template-columns: repeat(2, 1fr); }
    .tc-feature-grid { grid-template-columns: repeat(2, 1fr); }
    .tc-stats { grid-template-columns: repeat(3, 1fr); gap: 14px; }
    /* 页脚：官网断点规则 */
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    /* 顶部导航：官网汉堡菜单规则 */
    .nav-links {
        display: none;
        position: absolute;
        top: 72px;
        left: 0; right: 0;
        background: white;
        flex-direction: column;
        padding: 16px 24px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
        gap: 4px;
        border-bottom: 1px solid var(--border);
        z-index: 999;
    }
    .nav-links.active { display: flex; }
    .mobile-toggle { display: flex; }

    .tc-header { padding: 120px 0 40px; }
    .tc-main { padding-top: 32px; }
    .tc-notice { flex-direction: column; gap: 12px; padding: 16px 18px; }
    .tc-stats { grid-template-columns: repeat(2, 1fr); padding: 18px; }
    .tc-stat-value { font-size: 20px; }
    .tc-panel { padding: 18px 16px; }
    .tc-presets { gap: 8px; }
    .tc-preset { padding: 7px 14px; font-size: 12px; }
    .tc-rules { grid-template-columns: 1fr; }
    .tc-editor textarea { min-height: 200px; font-size: 12px; padding: 14px; }
    .tc-editor-head { padding: 10px 12px; }
    .tc-editor-tools { width: 100%; }
    .tc-mini-btn { flex: 1; justify-content: center; padding: 7px 8px; }
    .tc-actions { flex-direction: column; align-items: stretch; gap: 12px; }
    .tc-btn.primary { width: 100%; justify-content: center; }
    .format-field { justify-content: space-between; }
    .format-field select { max-width: none; flex: 1; }
    .tc-swap-note { margin-left: 0; text-align: center; }
    .tc-editor-foot { flex-wrap: wrap; }
    .tc-feature-grid { grid-template-columns: 1fr; }
    .tc-step-grid { grid-template-columns: 1fr; }
    .tc-step-card:not(:last-child)::after { display: none; }

    /* 页脚：官网断点规则 */
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 480px) {
    .tc-stats { grid-template-columns: 1fr 1fr; }
    .tc-stat-value { font-size: 18px; }
}
