/* 计算器样式 */
.calculator-section {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 20px;
}

.calculator-section .container {
    max-width: 500px;
    margin: 0 auto;
}

/* 页面头部 */
.calculator-header {
    text-align: center;
    margin-bottom: 30px;
}

.header-content {
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calculator-title {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.calculator-title i {
    font-size: 28px;
}

.calculator-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 16px;
}

.calculator-badge {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.badge-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 14px;
    border-radius: 16px;
    font-size: 12px;
    color: #fff;
    backdrop-filter: blur(10px);
}

/* 计算主体 */
.calculator-main {
    background: #1a1a1a;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* 显示区域 */
.calculator-display {
    background: #0d0d0d;
    padding: 24px;
}

.display-screen {
    text-align: right;
}

.display-history {
    font-size: 16px;
    color: #666;
    min-height: 24px;
    margin-bottom: 8px;
    font-family: 'Monaco', 'Menlo', monospace;
}

.display-current {
    font-size: 48px;
    font-weight: 300;
    color: #fff;
    font-family: 'Monaco', 'Menlo', monospace;
    word-wrap: break-word;
    min-height: 56px;
}

/* 键盘区域 */
.calculator-keys {
    padding: 16px;
}

.key-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.key-row:last-child {
    margin-bottom: 0;
}

.key {
    flex: 1;
    height: 56px;
    border-radius: 14px;
    font-size: 20px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.key:active {
    transform: scale(0.96);
}

.key-number {
    background: #333;
    color: #fff;
}

.key-number:hover {
    background: #404040;
}

.key-number.key-negative,
.key-number.key-decimal {
    background: #333;
}

.key-operator {
    background: #ff9500;
    color: #fff;
    font-size: 24px;
}

.key-operator:hover {
    background: #ffad33;
}

.key-operator.key-equals {
    background: #ff6b6b;
}

.key-operator.key-equals:hover {
    background: #ff8585;
}

.key-function {
    background: #666;
    color: #fff;
    font-size: 18px;
}

.key-function:hover {
    background: #737373;
}

.key-function.key-clear i {
    font-size: 18px;
}

.key-function.key-all-clear {
    background: #ff3b30;
}

.key-function.key-all-clear:hover {
    background: #ff524a;
}

/* 科学计算器 */
.calculator-scientific {
    border-top: 1px solid #333;
}

.scientific-toggle {
    padding: 12px;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    width: 100%;
    justify-content: center;
}

.btn-secondary {
    background: #333;
    color: #fff;
}

.btn-secondary:hover {
    background: #404040;
}

.scientific-keys {
    display: none;
    padding: 0 16px 16px;
}

.scientific-keys.show {
    display: block;
}

.key-scientific {
    background: #262626;
    color: #fff;
    font-size: 16px;
}

.key-scientific:hover {
    background: #333;
}

/* 使用说明 */
.calculator-info {
    background: #0d0d0d;
    padding: 20px;
}

.details-title {
    font-size: 14px;
    font-weight: 600;
    color: #888;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.details-title i {
    font-size: 14px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.info-item {
    font-size: 12px;
    color: #666;
}

.info-item h4 {
    margin: 0 0 8px 0;
    color: #888;
    font-size: 13px;
}

.info-item ul {
    margin: 0;
    padding-left: 16px;
    line-height: 1.6;
}

.info-item li {
    margin-bottom: 4px;
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #333;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 9999;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* 响应式 */
@media (max-width: 480px) {
    .calculator-section {
        padding: 20px 10px;
    }

    .calculator-title {
        font-size: 24px;
    }

    .calculator-main {
        border-radius: 20px;
    }

    .calculator-display {
        padding: 20px;
    }

    .display-current {
        font-size: 36px;
    }

    .key {
        height: 50px;
        font-size: 18px;
    }

    .key-row {
        gap: 8px;
        margin-bottom: 8px;
    }

    .calculator-keys {
        padding: 12px;
    }
}