/* public/assets/css/math/calculator.css */

.calc-wrapper { padding: 32px; border-radius: var(--radius-lg); position: relative; }
.calc-header { text-align: center; margin-bottom: 32px; }
.calc-title { font-size: 2.2rem; font-weight: 800; color: var(--text-main); margin-bottom: 12px; letter-spacing: -0.5px; }
.calc-subtitle { font-size: 1.05rem; color: var(--text-muted); max-width: 700px; margin: 0 auto; line-height: 1.6; }

/* 计算器工作区布局：左侧计算器，右侧历史记录 */
.calc-workspace { max-width: 900px; margin: 0 auto; display: flex; gap: 24px; align-items: stretch; justify-content: center; flex-wrap: wrap; }

/* 🌟 计算器实体设备设计 */
.calc-device { flex: 1; min-width: 320px; max-width: 450px; background: linear-gradient(145deg, #1e293b, #0f172a); border: 1px solid #334155; border-radius: 24px; padding: 24px; box-shadow: 0 20px 50px rgba(0,0,0,0.2), inset 0 2px 4px rgba(255,255,255,0.05); display: flex; flex-direction: column; gap: 20px; }

/* 屏幕区域 (复古荧光绿屏感) */
.calc-screen { background: #022c22; border: 2px solid #064e3b; border-radius: 12px; padding: 20px 24px; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; min-height: 120px; box-shadow: inset 0 4px 15px rgba(0,0,0,0.6); overflow: hidden; position: relative; }
.screen-history { font-family: 'Courier New', Courier, monospace; font-size: 1rem; color: #10b981; opacity: 0.7; width: 100%; text-align: right; min-height: 1.2rem; word-break: break-all; margin-bottom: 8px; }
.screen-current { font-family: 'Courier New', Courier, monospace; font-size: 3rem; font-weight: 800; color: #34d399; line-height: 1; width: 100%; text-align: right; text-shadow: 0 0 10px rgba(16, 185, 129, 0.4); overflow-x: auto; white-space: nowrap; }
.screen-current::-webkit-scrollbar { display: none; }

/* 键盘网格布局 (5 列) */
.calc-keyboard { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }

/* 按钮通用样式 */
.key-btn { font-family: 'Inter', sans-serif; font-size: 1.3rem; font-weight: 700; border: none; border-radius: 12px; cursor: pointer; transition: all 0.1s; user-select: none; display: flex; align-items: center; justify-content: center; min-height: 54px; box-shadow: 0 4px 0 rgba(0,0,0,0.2); }
.key-btn:active { transform: translateY(4px); box-shadow: 0 0 0 rgba(0,0,0,0); }

/* 各类按钮配色 */
.key-num { background: #334155; color: #f8fafc; border: 1px solid #475569; }
.key-num:hover { background: #475569; }

.key-op { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); font-size: 1.6rem; }
.key-op:hover { background: rgba(59, 130, 246, 0.25); }

.key-act { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); font-size: 1.1rem; }
.key-act:hover { background: rgba(245, 158, 11, 0.25); }
#keyClear { color: #ef4444; background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.3); }

.key-sci { background: #1e293b; color: #94a3b8; border: 1px solid #334155; font-size: 0.95rem; font-family: 'Courier New', Courier, monospace; }
.key-sci:hover { background: #334155; color: #cbd5e1; }

.key-equal { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; font-size: 1.8rem; box-shadow: 0 4px 0 #1d4ed8, 0 10px 20px rgba(59, 130, 246, 0.4); border: none; }
.key-equal:active { transform: translateY(4px); box-shadow: 0 0 0 #1d4ed8, 0 5px 10px rgba(59, 130, 246, 0.4); }

/* 🌟 右侧：历史记录纸带面板 */
.calc-history-panel { flex: 1; min-width: 280px; max-width: 350px; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 24px; padding: 20px; display: flex; flex-direction: column; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.hist-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 16px; border-bottom: 1px dashed var(--border-color); margin-bottom: 16px; }
.hist-header span { font-weight: 800; color: var(--text-main); font-size: 1.1rem; }
.btn-clear-hist { background: transparent; color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 700; cursor: pointer; transition: 0.2s; }
.btn-clear-hist:hover { background: #ef4444; color: #fff; }

.hist-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; max-height: 480px; padding-right: 8px; }
.hist-list::-webkit-scrollbar { width: 6px; }
.hist-list::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
.hist-empty { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-top: 40px; font-style: italic; }

.hist-item { display: flex; flex-direction: column; align-items: flex-end; background: var(--bg-body); padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border-color); position: relative; }
.hist-item:hover .hist-copy { opacity: 1; }
.hist-expr { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; word-break: break-all; text-align: right; width: 100%; }
.hist-res { font-size: 1.3rem; font-weight: 800; color: #3b82f6; font-family: 'Courier New', Courier, monospace; word-break: break-all; }
.hist-copy { position: absolute; left: 12px; bottom: 12px; font-size: 0.7rem; background: var(--border-color); color: var(--text-main); padding: 2px 8px; border-radius: 4px; cursor: pointer; opacity: 0; transition: 0.2s; border: none; }
.hist-copy:hover { background: #3b82f6; color: #fff; }

.calc-info-card { background: var(--bg-surface); padding: 24px; border-radius: 16px; border: 1px solid var(--border-color); max-width: 900px; margin: 0 auto; box-sizing: border-box; }
.keyboard-hints { margin-top: 16px; padding: 12px 16px; background: rgba(59, 130, 246, 0.05); border-left: 4px solid #3b82f6; border-radius: 4px; font-size: 0.9rem; color: var(--text-main); }
.keyboard-hints code { background: var(--bg-body); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border-color); font-family: monospace; color: #3b82f6; }

@media (max-width: 768px) {
    .calc-workspace { flex-direction: column; align-items: center; }
    .calc-device { width: 100%; max-width: 100%; }
    .calc-history-panel { width: 100%; max-width: 100%; max-height: 300px; }
    .key-btn { min-height: 48px; font-size: 1.2rem; }
}