@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Noto Sans TC', sans-serif;
    background: #121212; /* 深黑背景 */
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calculator {
    background: #1e1e1e; /* 深灰主體 */
    border-radius: 32px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    width: 400px;
    padding: 35px;
    border: 1px solid #333;
}

.display {
    margin-bottom: 30px;
}

#result {
    width: 100%;
    height: 100px;
    font-size: 3.5em;
    font-weight: 300;
    text-align: right;
    padding: 0 25px;
    border: none;
    background: #000; /* 純黑顯示螢幕 */
    color: white;
    border-radius: 24px;
    box-shadow: inset 0 10px 30px rgba(0,0,0,0.8);
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

button {
    height: 75px;
    font-size: 2em;
    font-weight: 500;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #2d2d2d; /* 深灰按鈕 */
    color: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

button:hover {
    background: #3a3a3a;
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
}

button:active {
    transform: translateY(2px);
    background: #1f1f1f;
}

/* 運算符號按鈕（稍微亮一點灰） */
.btn.operator {
    background: #404040;
}

.btn.operator:hover {
    background: #505050;
}

/* 清除按鈕（淺灰突出） */
.btn.clear {
    background: #a0a0a0;
    color: #000;
    font-weight: 700;
}

.btn.clear:hover {
    background: #b0b0b0;
}

/* 等號按鈕（純白突出） */
.btn.equal {
    background: #ffffff;
    color: #000;
    font-weight: 700;
}

.btn.equal:hover {
    background: #f0f0f0;
}

/* 垂直長等號 */
.tall {
    grid-row: 2 / span 4;
    grid-column: 4 / 4;
    height: auto;
    border-radius: 24px;
}

/* 手機優化 */
@media (max-width: 480px) {
    .calculator { width: 95%; padding: 25px; }
    button { height: 65px; font-size: 1.8em; }
    #result { height: 90px; font-size: 3em; }
}