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

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

/* ================= 🌟 计算器主体 (Chassis) ================= */
.sci-chassis { 
    width: 100%; max-width: 440px; background: #1e1e24; 
    border-radius: 24px; padding: 24px 20px; 
    box-shadow: 0 12px 32px rgba(0,0,0,0.2), inset 0 2px 4px rgba(255,255,255,0.1); 
    display: flex; flex-direction: column; gap: 20px; border: 1px solid #333;
}

/* 🌟 屏幕区域 */
.sci-screen { 
    background: #e9f0e3; /* 经典的 LCD 屏幕绿灰色 */
    border-radius: 12px; padding: 16px; display: flex; flex-direction: column; 
    align-items: flex-end; justify-content: flex-end; height: 110px; 
    box-shadow: inset 0 4px 10px rgba(0,0,0,0.15); border: 2px solid #5a5a66;
    position: relative; font-family: 'Courier New', Courier, monospace; overflow: hidden;
}
.sci-screen-status { position: absolute; top: 10px; left: 12px; font-size: 0.8rem; font-weight: bold; color: #444; }
.sci-screen-history { font-size: 1.1rem; color: #666; width: 100%; text-align: right; white-space: nowrap; overflow: hidden; margin-bottom: 4px; }
.sci-screen-input { font-size: 2.2rem; font-weight: 800; color: #111; width: 100%; text-align: right; white-space: nowrap; overflow-x: auto; }
.sci-screen-input::-webkit-scrollbar { display: none; } /* 隐藏滚动条 */

/* 🌟 键盘区域 */
.sci-keypad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }

/* 🌟 按键通用样式 */
.sci-key { 
    border: none; border-radius: 8px; font-size: 1.1rem; font-weight: 700; 
    cursor: pointer; padding: 16px 0; transition: 0.1s; 
    box-shadow: 0 4px 0 rgba(0,0,0,0.3); user-select: none;
}
.sci-key:active { transform: translateY(4px); box-shadow: 0 0 0 rgba(0,0,0,0.3); }

/* 具体按键分类配色 */
.sci-key-num { background: #3a3a44; color: #fff; }
.sci-key-num:hover { background: #4a4a56; }

.sci-key-op { background: #ff9f43; color: #fff; font-size: 1.3rem; }
.sci-key-op:hover { background: #ffb162; }

.sci-key-func { background: #2d3436; color: #a4b0be; font-size: 1rem; }
.sci-key-func:hover { background: #3c4547; color: #fff; }

.sci-key-ctrl { background: #4b6584; color: #fff; font-size: 1rem; }
.sci-key-ctrl:hover { background: #5a7b9f; }

.sci-key-danger { background: #ff4757; color: #fff; }
.sci-key-danger:hover { background: #ff6b81; }

.sci-key-equal { background: #2ed573; color: #fff; grid-column: span 2; font-size: 1.4rem; }
.sci-key-equal:hover { background: #3ee583; }

.sci-key-zero { grid-column: span 2; text-align: left; padding-left: 24px; }

/* ================= 🌟 右侧：历史面板 ================= */
.sci-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; height: 100%; }
.sci-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: 16px; display: flex; justify-content: space-between; align-items: center; }

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

.sci-history-list { list-style: none; padding: 0; margin: 0; flex: 1; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 8px; padding-right: 6px; }
.sci-history-list::-webkit-scrollbar { width: 6px; }
.sci-history-list::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.hist-item { display: flex; flex-direction: column; gap: 6px; padding: 12px; background: var(--bg-body); border-radius: 10px; border: 1px solid var(--border-color); transition: 0.2s; }
.hist-item:hover { border-color: var(--primary-color); box-shadow: inset 3px 0 0 var(--primary-color); }
.hist-top { display: flex; justify-content: space-between; align-items: center; }
.hist-formula { font-size: 0.9rem; color: var(--text-muted); font-family: monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 85%; }
.hist-ans { font-family: monospace; font-size: 1.2rem; font-weight: 800; color: var(--text-main); text-align: right; }
.hist-copy { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; }
.hist-copy:hover { color: var(--primary-color); }

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