:root {
    --primary-color: #007AFF;
    --secondary-color: #5856D6;
    --background-color: #F5F5F7;
    --text-color: #1D1D1F;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
}

.calculator-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 1rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    max-width: 340px;
    margin: 0 auto;
    position: relative;
}

.display input {
    font-size: 1.5rem;
    text-align: right;
    background: transparent;
    border: none;
    border-bottom: 2px solid #eee;
    border-radius: 0;
    font-family: 'Roboto Mono', monospace;
    transition: all 0.3s ease;
    padding: 0.3rem;
    margin-bottom: 0.5rem;
}

.btn {
    border-radius: 8px;
    font-size: 1rem;
    padding: 0.5rem;
    transition: all 0.3s ease;
    margin: 1px;
}

.btn-light {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #eee;
}

.btn-primary {
    background-color: var(--primary-color);
    border: none;
}

.btn-success {
    background-color: var(--secondary-color);
    border: none;
}

.navbar {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0.8rem 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--primary-color) !important;
}

.navbar-brand i {
    font-size: 1.4rem;
}

.nav-link {
    position: relative;
    padding: 0.5rem 1rem !important;
    margin: 0 0.2rem;
    color: var(--text-color) !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

/* 下拉菜单样式 */
.dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.dropdown-item {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(0, 122, 255, 0.1);
    color: var(--primary-color);
    transform: translateX(5px);
}

/* 移动端适配 */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: rgba(255, 255, 255, 0.98);
        border-radius: 12px;
        padding: 1rem;
        margin-top: 1rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }

    .nav-link::after {
        display: none;
    }

    .nav-link {
        padding: 0.8rem 1rem !important;
        border-radius: 8px;
    }

    .nav-link:hover {
        background-color: rgba(0, 122, 255, 0.1);
    }

    .dropdown-menu {
        box-shadow: none;
        border: none;
        padding: 0;
        margin: 0;
    }

    .dropdown-item {
        padding: 0.8rem 1rem;
        margin: 0.2rem 0;
    }
}

/* 滚动时导航栏效果 */
.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    padding: 0.6rem 0;
}

/* 导航栏图标动画 */
.navbar-brand i {
    transition: transform 0.3s ease;
}

.navbar-brand:hover i {
    transform: rotate(360deg);
}

.footer {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.footer a {
    color: var(--text-color);
    text-decoration: none;
}

.footer a:hover {
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .calculator-container {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.8rem;
        font-size: 1rem;
    }
}

#history {
    font-size: 0.875rem;
    color: #666;
    height: 1.5rem;
}

.btn-secondary {
    background-color: #5856D6;
    color: white;
}

.btn-info {
    background-color: #64D2FF;
    color: white;
}

.btn:active {
    transform: scale(0.95);
}

.btn-light:hover {
    background-color: #e9ecef;
}

.btn {
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

.copy-tooltip {
    position: absolute;
    top: -30px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    animation: fadeInOut 1.5s ease;
}

.btn.active {
    transform: scale(0.95);
    opacity: 0.8;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

.display input:hover {
    background: rgba(0, 0, 0, 0.02);
    cursor: pointer;
}

@media (max-width: 576px) {
    .btn {
        padding: 0.6rem;
        font-size: 1rem;
    }
    
    .display input {
        font-size: 1.5rem;
        padding: 0.4rem;
    }
}

.feature-card {
    transition: transform 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    color: var(--primary-color);
}

.timeline .card {
    border-left: 4px solid var(--primary-color);
}

kbd {
    background-color: #f8f9fa;
    color: #212529;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    border: 1px solid #dee2e6;
}

.accordion-button:not(.collapsed) {
    background-color: rgba(0, 122, 255, 0.1);
    color: var(--primary-color);
}

.accordion-button:focus {
    box-shadow: none;
    border-color: rgba(0, 122, 255, 0.25);
}

.feature-card, .card, .accordion-item {
    animation: fadeInUp 0.6s ease-out;
}

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

/* 添加新的计算器样式 */
.scientific-calculator {
    max-width: 320px !important;
    padding: 10px !important;
    margin: 0 auto;
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 显示屏样式 */
.calc-display {
    background: #fff;
    border-radius: 5px;
    padding: 5px;
    margin-bottom: 10px;
}

.calc-display .history {
    font-size: 12px;
    height: 20px;
    padding: 2px 5px;
    color: #666;
    border: none;
    background: transparent;
}

.calc-display .display {
    font-size: 20px;
    height: 35px;
    padding: 2px 5px;
    text-align: right;
    border: none;
    background: transparent;
    font-family: 'Roboto Mono', monospace;
}

/* 按钮基本样式 */
.calc-buttons .btn {
    width: 100%;
    height: 35px;
    padding: 0;
    margin: 1px;
    font-size: 13px;
    line-height: 1;
    border-radius: 5px;
    border: none;
    transition: all 0.15s ease;
}

/* 不同类型按钮样式 */
.btn-mode {
    background: #e9ecef;
    color: #495057;
}

.btn-mem {
    background: #cfe2ff;
    color: #0d6efd;
}

.btn-fn {
    background: #d3d3d3;
    color: #333;
}

.btn-num {
    background: #fff;
    color: #212529;
    border: 1px solid #dee2e6;
}

.btn-op {
    background: #e7f5ff;
    color: #0d6efd;
}

.btn-clear {
    background: #dc3545;
    color: #fff;
}

.btn-eq {
    background: #0d6efd;
    color: #fff;
}

/* 按钮悬停效果 */
.calc-buttons .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    opacity: 0.9;
}

.calc-buttons .btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* 按钮激活状态 */
.btn-mode.active {
    background: #0d6efd;
    color: #fff;
}

/* 响应式调整 */
@media (max-width: 576px) {
    .scientific-calculator {
        max-width: 100% !important;
        margin: 0;
        padding: 8px !important;
    }

    .calc-buttons .btn {
        height: 32px;
        font-size: 12px;
    }

    .calc-display .display {
        font-size: 18px;
        height: 32px;
    }
}

/* 行间距调整 */
.calc-buttons .row {
    margin: 1px 0;
}

/* 列间距调整 */
.calc-buttons [class*="col-"] {
    padding: 1px;
}

/* 调整按钮间距 */
.row.g-2 {
    --bs-gutter-x: 0.25rem;
    --bs-gutter-y: 0.25rem;
}

.mt-1 {
    margin-top: 0.15rem !important;
}

/* 调整历史记录按钮 */
.text-end.mb-2 {
    margin-bottom: 0.5rem !important;
    margin-top: 0.5rem;
}

/* 添加历史记录模态框样式 */
.modal-content {
    border: none;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.modal-footer {
    border-top: 1px solid rgba(0,0,0,0.1);
}

#historyList .list-group-item {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding: 0.75rem 1rem;
}

#historyList .list-group-item:last-child {
    border-bottom: none;
}

#historyList .btn-link {
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

#historyList .btn-link:hover {
    background: rgba(0,122,255,0.1);
    border-radius: 4px;
} 