/* 重置样式 */
* {
    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;
}

/* 主要内容区样式 */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

/* 向量输入区域样式 */
.vector-inputs {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.vector-group {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.vector-group label {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.coordinate-inputs {
    display: flex;
    gap: 1rem;
}

.input-field {
    flex: 1;
    position: relative;
}

.input-field input {
    width: 100%;
    padding: 0.8rem;
    padding-right: 2rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-field input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.coordinate-label {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    font-style: italic;
    color: #666;
}

/* 标签按钮样式 */
.calc-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.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;
    background: #f8f9fa;
    color: #666;
}

.tab-btn.active {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.tab-btn:hover:not(.active) {
    background-color: #e9ecef;
    transform: translateY(-2px);
}

/* 按钮组样式 */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.calculate-btn, .clear-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.calculate-btn {
    background-color: #007bff;
    color: #fff;
    flex: 2;
}

.calculate-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.clear-btn {
    background-color: #f8f9fa;
    color: #666;
    flex: 1;
}

.clear-btn:hover {
    background-color: #e2e6ea;
}

/* 结果显示区域样式 */
.results {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.result-item {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.result-item span:first-child {
    font-weight: 500;
    margin-right: 1rem;
}

.result-details, .geometric-meaning {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

/* 公式区域样式 */
.formula-section {
    margin-top: 3rem;
    padding: 2rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.formula-item {
    margin-bottom: 2rem;
}

.formula-item:last-child {
    margin-bottom: 0;
}

.formula-item p {
    font-family: "Courier New", monospace;
    margin: 0.5rem 0;
}

.formula-item ul {
    list-style-type: disc;
    margin-left: 1.5rem;
}

/* 广告容器样式 */
.ad-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.ad-content {
    background-color: #f8f9fa;
    padding: 2rem;
    text-align: center;
    border-radius: 8px;
}

/* 底部版权样式 */
.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) {
    .coordinate-inputs {
        flex-direction: column;
    }

    .vector-group {
        padding: 1rem;
    }

    .calc-tabs {
        flex-direction: column;
    }

    .button-group {
        flex-direction: column;
    }

    .calculate-btn, .clear-btn {
        width: 100%;
    }
}

/* 介绍部分样式 */
.intro-section {
    background: linear-gradient(to bottom right, #ffffff, #f8f9fa);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.intro-content {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.intro-text {
    flex: 2;
}

.intro-image {
    flex: 1;
    text-align: center;
}

.intro-image img {
    max-width: 200px;
    height: auto;
}

.usage-steps {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
}

.step {
    flex: 1;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.step-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.step-content h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

/* 公式部分样式 */
.formula-section {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 3rem;
}

.formula-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.formula-badge {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.formula-content {
    display: flex;
    gap: 2rem;
}

.formula-main {
    flex: 1;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    font-family: "Courier New", monospace;
}

.formula {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.formula-explanation {
    flex: 1;
}

.formula-explanation h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.formula-explanation ul {
    list-style-type: none;
    padding-left: 0;
}

.formula-explanation li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.formula-explanation li::before {
    content: "•";
    color: #007bff;
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .intro-content, .usage-steps, .formula-content {
        flex-direction: column;
    }

    .step {
        margin-bottom: 1rem;
    }

    .formula-main {
        margin-bottom: 1.5rem;
    }
} 