@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: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calculator {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 32px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    width: 400px;
    padding: 35px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.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: rgba(0, 0, 0, 0.3);
    color: white;
    border-radius: 24px;
    box-shadow: inset 0 10px 20px rgba(0,0,0,0.2);
}

.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: rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
}

button:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.25);
}

button:active {
    transform: translateY(2px);
}

.btn.operator {
    background: rgba(255, 140, 0, 0.6);
}

.btn.operator:hover {
    background: rgba(255, 140, 0, 0.8);
}

.btn.clear {
    background: rgba(255, 80, 80, 0.6);
}

.btn.clear:hover {
    background: rgba(255, 80, 80, 0.8);
}

.btn.equal {
    background: rgba(80, 200, 120, 0.7);
}

.btn.equal:hover {
    background: rgba(80, 200, 120, 0.9);
}

/* 關鍵：等號在最右邊（第4欄），垂直跨4行（從第2行到第5行） */
.tall {
    grid-row: 2 / span 4;     /* 從第2行開始，跨4行 */
    grid-column: 4 / 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; }
}