*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.calculator-container {
    width: 100%;
    max-width: 600px; /* 从400px放大到600px */
    padding: 15px;
}

.calculator {
    background-color: #e9ecef;
    border-radius: 30px; /* 从20px放大到30px */
    box-shadow: 0 7.5px 22.5px rgba(0, 0, 0, 0.1); /* 放大阴影 */
    overflow: hidden;
    padding: 22.5px; /* 从15px放大到22.5px */
}

.display {
    background-color: white;
    border-radius: 18px; /* 从12px放大到18px */
    margin-bottom: 22.5px; /* 从15px放大到22.5px */
    padding: 22.5px; /* 从15px放大到22.5px */
    text-align: right;
    box-shadow: inset 0 0 7.5px rgba(0, 0, 0, 0.05);
    height: 120px; /* 从80px放大到120px */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.previous-operand {
    color: #6c757d;
    font-size: 1.35rem; /* 从0.9rem放大到1.35rem */
    min-height: 30px; /* 从20px放大到30px */
}

.current-operand {
    color: #212529;
    font-size: 3.3rem; /* 从2.2rem放大到3.3rem */
    font-weight: 500;
}

.buttons-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-gap: 12px; /* 从8px放大到12px */
}

button {
    cursor: pointer;
    font-size: 1.5rem;
    border: none;
    outline: none;
    padding: 18px 7.5px;
    border-radius: 15px; /* 从22.5px减小到15px */
    transition: background-color 0.2s, transform 0.1s;
    font-weight: 500;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1), 
                inset 0 1px 1px rgba(255, 255, 255, 0.5); /* 增强阴影效果 */
    border-bottom: 2px solid rgba(0, 0, 0, 0.1); /* 添加底部边框增强立体感 */
}

button:active {
    transform: scale(0.98) translateY(2px); /* 添加下移效果增强按压感 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.number {
    background-color: white;
    color: #212529;
}

.number:hover {
    background-color: #f8f9fa;
}

.function {
    background-color: #d8dce0;
    color: #1f2937;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1), 
                inset 0 1px 1px rgba(255, 255, 255, 0.5); /* 与button保持一致 */
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.function:hover {
    background-color: #c7ccd4;
}

.function.active {
    background-color: #bbc1ca;
}

.operator {
    background-color: #d8dce0;
    color: #1f2937;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1), 
                inset 0 1px 1px rgba(255, 255, 255, 0.5); /* 与button保持一致 */
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.operator:hover {
    background-color: #c7ccd4;
}

.equals {
    background-color: #4361ee;
    color: white;
    box-shadow: 0 4px 8px rgba(67, 97, 238, 0.3), 
                inset 0 1px 1px rgba(255, 255, 255, 0.3); /* 特殊阴影 */
    border-bottom: 2px solid rgba(0, 0, 0, 0.2);
}

.clear {
    background-color: #ffa62b;
    color: white;
    box-shadow: 0 4px 8px rgba(255, 166, 43, 0.3), 
                inset 0 1px 1px rgba(255, 255, 255, 0.3); /* 特殊阴影 */
    border-bottom: 2px solid rgba(0, 0, 0, 0.2);
}

.clear:hover {
    background-color: #ff9500;
}

.decimal {
    background-color: white;
    color: #212529;
}

/* 删除计算器底部文字 */
.calculator-footer {
    display: none;
}

sup {
    font-size: 0.9rem; /* 从0.6rem放大到0.9rem */
    position: relative;
    top: -0.6em;
}

@media (max-width: 600px) { /* 从400px调整到600px */
    .buttons-grid {
        grid-gap: 9px; /* 从6px放大到9px */
    }
    
    button {
        padding: 15px 4.5px; /* 从10px 3px放大到15px 4.5px */
        font-size: 1.35rem; /* 从0.9rem放大到1.35rem */
    }
}