/* ================= 🌟 基础与排版 ================= */
.dt-wrapper { padding: 32px 0; }
.dt-header { text-align: center; margin-bottom: 32px; }
.dt-title { font-size: 1.8rem; font-weight: 800; color: var(--text-main); margin-bottom: 12px; }
.dt-subtitle { color: var(--text-muted); max-width: 800px; margin: 0 auto; line-height: 1.6; }

/* ================= 🌟 网格布局 ================= */
.dt-workspace { display: grid; grid-template-columns: 460px 1fr; gap: 24px; align-items: stretch; }
.dt-col-left { display: flex; flex-direction: column; gap: 20px; }
.dt-col-right { display: flex; flex-direction: column; gap: 20px; height: 100%; min-height: 0; min-width: 0; }
@media(max-width: 900px) { .dt-workspace { grid-template-columns: 1fr; } }

/* ================= 🌟 卡片风格 ================= */
.dt-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 20px; padding: 24px; box-shadow: 0 4px 16px rgba(0,0,0,0.03); display: flex; flex-direction: column; box-sizing: border-box; transition: 0.3s; }
.dt-card:focus-within { border-color: rgba(var(--primary-rgb), 0.5); box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.08); }

.dt-panel-title { font-weight: 700; color: var(--text-main); font-size: 1.1rem; border-bottom: 1px solid var(--border-color); padding-bottom: 14px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; }

/* ================= 🌟 表单组件 ================= */
.dt-form-group { margin-bottom: 16px; }
.dt-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dt-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.dt-label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }

.dt-input, .dt-select { 
    width: 100%; box-sizing: border-box; padding: 10px 14px; 
    border: 2px solid var(--border-color); border-radius: 10px; 
    background: var(--bg-body); color: var(--text-main); 
    font-size: 1.05rem; font-weight: 600; font-family: monospace; 
    transition: 0.2s; outline: none;
}
.dt-input:focus, .dt-select:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1); }
.dt-num { text-align: center; }
.dt-num::-webkit-outer-spin-button, .dt-num::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Checkbox */
.dt-checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.95rem; color: var(--text-main); font-weight: 600; user-select: none; }
.dt-checkbox input { display: none; }
.chk-mark { width: 18px; height: 18px; border: 2px solid var(--border-color); border-radius: 4px; display: flex; align-items: center; justify-content: center; transition: 0.2s; background: var(--bg-body); }
.dt-checkbox input:checked + .chk-mark { background: var(--primary-color); border-color: var(--primary-color); }
.dt-checkbox input:checked + .chk-mark::after { content: '✓'; color: #fff; font-size: 0.8rem; font-weight: bold; }

.dt-link-btn { font-size: 0.85rem; color: var(--primary-color); cursor: pointer; font-weight: 600; transition: 0.2s; }
.dt-link-btn:hover { opacity: 0.7; }

/* ================= 🌟 生成结果区 ================= */
.dt-result-box { 
    background: rgba(var(--primary-rgb), 0.05); border: 2px dashed rgba(var(--primary-rgb), 0.3); 
    border-radius: 16px; padding: 24px; text-align: center; margin-bottom: 8px; 
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 100%; box-sizing: border-box; overflow: hidden; flex: 1;
}
.dt-result-label { font-size: 0.9rem; font-weight: 700; color: var(--text-muted); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px; }

.dt-result-textarea { 
    width: 100%; max-width: 100%; box-sizing: border-box;
    height: auto; min-height: 60px; padding: 10px; 
    background: transparent; border: none; resize: none; 
    font-size: clamp(2rem, 3vw, 2.5rem); font-weight: 800; color: var(--primary-color); 
    font-family: monospace; text-align: center; 
    outline: none; line-height: 1.3; margin-bottom: 20px; transition: 0.3s;
    white-space: pre-wrap; word-break: break-all; overflow: hidden; 
}

.dt-btn-copy { padding: 10px 24px; background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 20px; font-weight: 600; color: var(--text-main); cursor: pointer; transition: 0.2s; flex-shrink: 0; }
.dt-btn-copy:hover { border-color: var(--primary-color); color: var(--primary-color); box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.15); }

/* ================= 🌟 历史列表 ================= */
.history-card { display: flex; flex-direction: column; min-height: 250px; }
.dt-history-list { 
    list-style: none; padding: 0; margin: 0; max-height: 240px; 
    overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 8px; padding-right: 6px; 
}
.dt-history-list::-webkit-scrollbar { width: 6px; }
.dt-history-list::-webkit-scrollbar-track { background: var(--bg-body); border-radius: 4px; }
.dt-history-list::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
.dt-history-list::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }

.hist-item { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 12px 16px; background: var(--bg-body); border-radius: 10px; 
    border: 1px solid var(--border-color); transition: 0.2s; 
    width: 100%; box-sizing: border-box; min-width: 0;
}
.hist-item:hover { border-color: var(--primary-color); box-shadow: inset 3px 0 0 var(--primary-color); }

.hist-formula { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); margin-right: 8px; flex: 1 1 0%; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-num { 
    font-family: monospace; font-size: 1.1rem; font-weight: 800; color: var(--text-main); margin-right: 16px; white-space: nowrap; 
}
.hist-copy { background: transparent; border: none; color: var(--text-muted); cursor: pointer; transition: 0.2s; font-size: 1.1rem; flex-shrink: 0; }
.hist-copy:hover { color: var(--primary-color); transform: scale(1.1); }

/* ================= 🌟 SEO 文章 ================= */
.dt-seo-box { margin-top: 32px; background: var(--bg-surface); padding: 32px; border-radius: 20px; border: 1px solid var(--border-color); box-sizing: border-box; width: 100%; }
.dt-seo-box h2 { font-size: 1.25rem; margin-bottom: 16px; color: var(--text-main); margin-top: 24px; }
.dt-seo-box h2:first-child { margin-top: 0; }
.dt-seo-box p, .dt-seo-box li { color: var(--text-muted); line-height: 1.8; margin-bottom: 12px; }
.dt-seo-box ul { padding-left: 20px; }