*{box-sizing:border-box}
.calculator-page{min-height:100vh;padding:28px 16px 42px;background:linear-gradient(145deg,#f5f8fd,#eaf0f8);color:#17243a;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif}
.calculator-card{width:min(100%,720px);margin:0 auto;padding:28px;border:1px solid rgba(255,255,255,.8);border-radius:24px;background:rgba(255,255,255,.86);box-shadow:0 18px 50px rgba(47,74,112,.13);backdrop-filter:blur(12px)}
.calculator-header{display:flex;justify-content:space-between;align-items:flex-start;gap:20px}.eyebrow{margin:0 0 7px;color:#657694;font-size:11px;letter-spacing:.18em;font-weight:700}.calculator-header h1{margin:0;font-size:28px;letter-spacing:.02em}.calculator-subtitle{margin:8px 0 0;color:#7b879b;font-size:13px}.calculator-mark{display:grid;place-items:center;width:50px;height:50px;border-radius:15px;background:#eaf0ff;color:#4263c5;font-size:26px;font-weight:700}
.calculator-display{min-height:126px;margin-top:25px;padding:18px 20px;border-radius:16px;background:#17243a;color:#fff;text-align:right;overflow:hidden}.calc-expression{min-height:28px;color:#9dacc5;font-size:15px;white-space:nowrap;overflow-x:auto}.calc-result{display:block;margin-top:10px;font-size:38px;font-weight:650;white-space:nowrap;overflow-x:auto}
.calculator-mode{display:flex;align-items:center;gap:6px;margin:14px 0}.mode-button{padding:7px 10px;border:0;border-radius:7px;background:#edf1f7;color:#77849a;font-weight:700;font-size:11px;cursor:pointer}.mode-button.active{background:#dce6ff;color:#4263c5}.mode-hint{margin-left:8px;color:#8b96a8;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.calculator-keys{display:grid;grid-template-columns:repeat(5,1fr);gap:9px}.key{min-height:48px;border:0;border-radius:12px;background:#f0f3f8;color:#263750;font-size:17px;font-weight:600;cursor:pointer;transition:transform .1s,background .1s}.key:hover{background:#e3e9f3}.key:active{transform:scale(.96)}.key.function{color:#4161bd;background:#e9efff;font-size:14px}.key.operator{color:#4161bd;background:#e6edff}.key.control{color:#c55656;background:#fff0f0}.key.equal{grid-column:span 5;background:#4263c5;color:#fff}.calculator-error{min-height:20px;margin:12px 2px 0;color:#c55656;font-size:13px;text-align:right}
@media(max-width:560px){.calculator-page{padding:14px 10px 26px}.calculator-card{padding:20px 14px;border-radius:18px}.calculator-header h1{font-size:24px}.calculator-subtitle{font-size:12px}.calculator-mark{width:42px;height:42px}.calculator-keys{gap:6px}.key{min-height:45px;border-radius:10px}.mode-hint{display:none}}
