/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    width: 100%;
}

/* 页头样式 */
.site-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 32px;
    color: #2ecc71;
}

.logo-text h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.logo-text h1 a {
    color: white;
    text-decoration: none;
}

.logo-text p {
    font-size: 14px;
    opacity: 0.8;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.main-nav a.active {
    background: rgba(255, 255, 255, 0.2);
    border-left: 3px solid #2ecc71;
}

/* 页脚样式 */
.site-footer {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: #ecf0f1;
    margin-bottom: 20px;
    font-size: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.footer-section p {
    line-height: 1.8;
    margin-bottom: 15px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #3498db;
    padding-left: 5px;
}

.tool-list {
    list-style: none;
}

.tool-list li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.tool-list li:before {
    content: "▶";
    color: #3498db;
    position: absolute;
    left: 0;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #34495e;
    color: #bdc3c7;
    font-size: 14px;
}

.footer-bottom a {
    color: #bdc3c7;
    text-decoration: none;
    margin: 0 5px;
}

.footer-bottom a:hover {
    text-decoration: underline;
}

/* 首页样式 */
.hero-section {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    margin-bottom: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.hero-section h1 {
    font-size: 36px;
    color: #2c3e50;
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 18px;
    color: #7f8c8d;
    max-width: 800px;
    margin: 0 auto 30px;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.tool-card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    color: inherit;
}

.tool-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.tool-icon {
    font-size: 48px;
    margin-bottom: 20px;
    color: #3498db;
}

.tool-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.tool-card p {
    color: #666;
    font-size: 14px;
}

/* 计算页面通用样式 */
.page-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 25px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.page-header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 28px;
}

.page-header p {
    color: #7f8c8d;
    max-width: 800px;
    margin: 0 auto;
}

.calculation-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.input-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.input-group span.unit {
    color: #7f8c8d;
    font-weight: normal;
    font-size: 14px;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 15px;
    color: #333;
    transition: all 0.3s ease;
    outline: none;
}

.input-group input:focus, .input-group select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.calculate-btn {
    flex: 1;
    min-width: 200px;
    padding: 16px;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calculate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

.reset-btn {
    flex: 1;
    min-width: 200px;
    padding: 16px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.results-section {
    margin-top: 40px;
    padding: 25px;
    background: #f8fafc;
    border-radius: 10px;
    display: none;
}

.results-section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.result-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    border-top: 4px solid #3498db;
}

.result-card h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 16px;
}

.result-value {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
}

.result-unit {
    color: #7f8c8d;
    font-size: 14px;
    margin-left: 5px;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.result-table th {
    background: #2c3e50;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.result-table td {
    padding: 15px;
    border-bottom: 1px solid #f1f1f1;
}

.result-table tr:last-child td {
    border-bottom: none;
}

.result-table tr:nth-child(even) {
    background-color: #f8fafc;
}

/* 关于页面样式 */
.about-content {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.about-section {
    margin-bottom: 40px;
}

.about-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f1f1;
}

.about-section p {
    line-height: 1.8;
    margin-bottom: 15px;
    color: #555;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.feature-item {
    text-align: center;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
}

.feature-item h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.contact-info {
    margin-top: 20px;
}

.contact-info p {
    margin-bottom: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .tool-grid {
        grid-template-columns: 1fr;
    }
    
    .input-section {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .result-summary {
        grid-template-columns: 1fr;
    }
    
    .result-table {
        display: block;
        overflow-x: auto;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .tool-list li {
        padding-left: 0;
    }
    
    .tool-list li:before {
        display: none;
    }
    
    .about-content {
        padding: 20px;
    }
}