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

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

/* ================= 🌟 卡片风格 ================= */
.px-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 20px; padding: 28px; box-shadow: 0 4px 16px rgba(0,0,0,0.03); display: flex; flex-direction: column; box-sizing: border-box; }
.px-panel-title { font-weight: 700; color: var(--text-main); font-size: 1.1rem; border-bottom: 1px solid var(--border-color); padding-bottom: 16px; margin-bottom: 24px; display: flex; justify-content: space-between; align-items: center; }

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

.px-input-box { display: flex; align-items: center; background: var(--bg-body); border: 2px solid var(--border-color); border-radius: 10px; padding: 0 16px; transition: 0.2s; }
.px-input-box:focus-within { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1); }
.px-input { flex: 1; width: 100%; min-width: 0; padding: 12px 0; border: none; background: transparent; color: var(--text-main); font-size: 1.3rem; font-weight: 700; font-family: monospace; outline: none; }
.px-input::-webkit-outer-spin-button, .px-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.px-unit-badge { font-weight: 700; color: var(--text-muted); font-size: 1.1rem; user-select: none; }

.px-select { 
    width: 100%; box-sizing: border-box; padding: 12px 14px; 
    border: 2px solid var(--border-color); border-radius: 10px; 
    background: var(--bg-body); color: var(--text-main); 
    font-size: 0.95rem; font-weight: 600; transition: 0.2s; outline: none; cursor: pointer;
}
.px-select:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1); }

/* 热门尺寸标签胶囊 (Chips) */
.px-chips-container { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.px-chip { 
    background: var(--bg-body); border: 1px solid var(--border-color); 
    border-radius: 20px; padding: 6px 14px; font-size: 0.85rem; font-weight: 600; 
    color: var(--text-main); cursor: pointer; transition: 0.2s; 
}
.px-chip:hover { border-color: var(--primary-color); color: var(--primary-color); transform: translateY(-1px); }

/* ================= 🌟 结果面板 ================= */
.px-result-box { 
    background: rgba(var(--primary-rgb), 0.05); border: 2px dashed rgba(var(--primary-rgb), 0.3); 
    border-radius: 16px; padding: 32px 20px; text-align: center; margin-bottom: 8px; 
    display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1;
}
.px-result-label { font-size: 0.95rem; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.px-res-main { font-size: clamp(2.4rem, 4vw, 3.2rem); font-weight: 800; color: var(--primary-color); font-family: monospace; word-break: break-all; line-height: 1.2; margin-bottom: 8px; }
.px-res-formula { font-size: 0.95rem; color: var(--text-muted); font-family: monospace; margin-bottom: 24px; }

.px-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; }
.px-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: 220px; }
.px-history-list { list-style: none; padding: 0; margin: 0; max-height: 200px; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 8px; padding-right: 6px; }
.px-history-list::-webkit-scrollbar { width: 6px; }
.px-history-list::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.hist-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 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-info { display: flex; align-items: center; flex: 1; min-width: 0; cursor: pointer; padding: 4px 0; }
.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; transition: color 0.2s; }
.hist-num { font-family: monospace; font-size: 1.1rem; font-weight: 800; color: var(--text-main); margin-right: 16px; white-space: nowrap; transition: color 0.2s; }

.hist-info:hover .hist-formula { color: var(--text-main); }
.hist-info:hover .hist-num { color: var(--primary-color); }

.hist-copy { background: transparent; border: none; color: var(--text-muted); cursor: pointer; transition: 0.2s; font-size: 1.1rem; flex-shrink: 0; padding: 6px; }
.hist-copy:hover { color: var(--primary-color); transform: scale(1.1); }
.px-link-btn { font-size: 0.85rem; color: var(--primary-color); cursor: pointer; font-weight: 600; transition: 0.2s; }
.px-link-btn:hover { opacity: 0.7; }

/* ================= 🌟 SEO 文章与表格 ================= */
.px-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%; }
.px-seo-box h2 { font-size: 1.25rem; margin-bottom: 16px; color: var(--text-main); margin-top: 24px; }
.px-seo-box h2:first-child { margin-top: 0; }
.px-seo-box p { color: var(--text-muted); line-height: 1.8; margin-bottom: 16px; }

.px-table-wrapper { overflow-x: auto; margin-top: 16px; }
.px-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.95rem; }
.px-table th, .px-table td { padding: 12px 16px; border-bottom: 1px solid var(--border-color); }
.px-table th { background: var(--bg-body); color: var(--text-main); font-weight: 700; }
.px-table td { color: var(--text-muted); font-family: monospace; }