/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 导航栏样式 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav {
    padding: 1rem;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo a {
    font-size: 1.5rem;
    color: #333;
    text-decoration: none;
    font-weight: bold;
}

.nav-menu ul {
    display: flex;
    list-style: none;
}

.nav-menu li a {
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
}

.nav-menu li a:hover {
    color: #007bff;
}

.nav-right a {
    margin-left: 1rem;
    text-decoration: none;
}

.login-btn {
    color: #007bff;
}

.register-btn {
    color: #fff;
    background-color: #007bff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

/* 主要内容区样式 */
.container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 1rem;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
}

/* 计算器容器样式 */
.calculator-container {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-field label {
    font-weight: bold;
    color: #555;
}

.input-field input {
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1.1rem;
    font-family: monospace;
}

.input-tip {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

.button-group {
    display: flex;
    gap: 1rem;
}

.calculate-btn, .clear-btn {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.calculate-btn {
    background-color: #007bff;
    color: #fff;
}

.clear-btn {
    background-color: #dc3545;
    color: #fff;
}

.calculate-btn:hover {
    background-color: #0056b3;
}

.clear-btn:hover {
    background-color: #c82333;
}

/* 结果显示区域 */
.results {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #ddd;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.result-details {
    margin-top: 1rem;
}

.result-details h3 {
    color: #007bff;
    margin-bottom: 1rem;
}

/* 元素周期表样式 */
.periodic-table {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.element-grid {
    display: grid;
    grid-template-columns: repeat(18, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.element {
    padding: 0.5rem;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
    font-size: 0.8rem;
}

.element:hover {
    transform: scale(1.1);
}

.element-spacer {
    grid-column: span 10;
}

/* 元素类型颜色 */
.nonmetal { background-color: #ffeb3b; }
.noble-gas { background-color: #90caf9; }
.alkali-metal { background-color: #ff9800; }
.alkaline-earth { background-color: #ffd54f; }
.transition { background-color: #81c784; }
.post-transition { background-color: #a5d6a7; }
.metalloid { background-color: #80cbc4; }
.halogen { background-color: #80deea; }

/* 使用说明样式 */
.info-section {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.usage-tips h3 {
    color: #007bff;
    margin: 1rem 0 0.5rem;
}

.usage-tips ul {
    list-style: none;
    margin-left: 1rem;
}

.usage-tips li {
    margin-bottom: 0.5rem;
    color: #666;
}

/* 广告容器样式 */
.ad-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 1rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ad-content {
    text-align: center;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

/* 底部版权样式 */
.footer {
    background-color: #333;
    color: #fff;
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer a {
    color: #fff;
    text-decoration: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .nav-menu.active {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #fff;
        padding: 1rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        z-index: 100;
    }

    .nav-menu.active ul {
        flex-direction: column;
    }

    .nav-menu.active li {
        margin: 0.5rem 0;
    }

    .button-group {
        flex-direction: column;
    }

    .element-grid {
        grid-template-columns: repeat(9, 1fr);
        font-size: 0.7rem;
    }

    .element-spacer {
        display: none;
    }
}

/* 标签按钮样式 */
.calc-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.tab-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background: none;
    color: #666;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #007bff, #0056b3);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    border-radius: 6px;
}

.tab-btn span {
    position: relative;
    z-index: 2;
}

.tab-btn:hover {
    color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.tab-btn.active {
    color: #fff;
    background: linear-gradient(45deg, #007bff, #0056b3);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.tab-btn.active::before {
    opacity: 1;
}

.tab-btn:not(.active):hover {
    transform: translateY(-2px);
}

/* 添加动画效果 */
@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calc-form {
    animation: tabFadeIn 0.3s ease-out;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .calc-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .tab-btn {
        width: 100%;
        padding: 0.8rem 1rem;
    }
} 