* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.5;
    color: #333;
    min-height: 100vh;
    background-color: #f5f7fa;
}
h2{
    font-size: 1.5rem;
    color: #2c3e50;
}
h3{
    font-size: 1.3rem;
    color: #2c3e50;
}
h4{
    font-size: 1.1rem;
    color: #2c3e50;
}

p{
    font-size: 0.9rem;
    color: #666;
}

ul{
    list-style: none;
    padding: 0;
    font-size: 0.9rem;
    line-height: 2;
    color: #34495e;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.main-nav {
    position: relative;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.main-nav .logo{
    display: flex;
    align-items: center;
}

.main-nav .logo img{
    width: 2.5rem;
    height: auto;
    margin-right: 0.5rem;
}

.main-nav .logo h1{
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    gap: 2rem;
}

.nav-item {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
    padding: 10px 0;
}

.nav-item.has-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.nav-item.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: #2c3e50;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.dropdown-menu a:hover {
    background-color: #f5f7fa;
    color: #3498db;
}

.nav-item:hover {
    color: #3498db;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #3498db;
    transition: width 0.3s ease;
}

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

.nav-item.active{
    color: #3498db;
}
.nav-item.active::after {
    width: 100%;
}

.hero {
    display: flex;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #3498db, #2c3e50);
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
}

.hero .wrap{
    width: 90vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: center;
}

.hero-content {
    position: relative;
    z-index: 1;
    color: white;
    max-width: 50vw;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    transform: translateY(-20px);
    animation: fadeInUp 1s ease-out;
}

/* .hero-content:hover {
    transform: translateY(-5px);
     animation: fadeInUp 1s ease-out;
} */

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

.articles-banner {
    width: 100%;
    display: flex;
    /* align-items: center; */
    justify-content: space-between;
}

.articles-banner .item{
    flex: 1;
    margin: 0 1rem;
}

.articles-banner .item img{
    width: 100%;
    /* height: 366px; */
    
}

.results{
    width: 35vw;
}

.welcom-section h2 {
    margin-bottom: 1rem;
}

.welcom-section p {
    font-size: 1.2rem;
}

.features {
    margin-top: 0.5rem;
    list-style: none;
}

.features li {
    margin: 0;
    opacity: 0;
    line-height: 1.5;
    animation: fadeIn 0.5s ease-out forwards;
}

.features li:nth-child(1) { animation-delay: 0.2s; }
.features li:nth-child(2) { animation-delay: 0.4s; }
.features li:nth-child(3) { animation-delay: 0.6s; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.features li p{
    color: #34495e;
    font-size: 1.1rem;
}



.calculator-container {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    transition: transform 0.3s ease;
}

/* .calculator-container:hover {
    transform: translateY(-5px);
} */

.control-panel {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 0rem;
    display: flex;
    justify-content: space-around;
    gap: 1rem;
}

.panel-section {
    background: #fff;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.panel-title {
    font-size: 1.1rem;
    color: #2c3e50;
    font-weight: 600;
    text-align: center;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
    margin-top: 1rem;
}

.control-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #3498db;
    background: transparent;
    color: #3498db;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.8rem;
    min-width: 120px;
}

.control-btn:hover,
.control-btn.active {
    background: #3498db;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* .dimension-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.5rem;
    padding: 1rem;
} */
.dimension-fields {
    padding: 1rem;
}
.rectangle-fields-up{
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}
.rectangle-fields-down{
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}
.input-group {
    flex: 1;
}
.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.95rem;
}

.input-group input {
    width: 100%;
    padding: 0.5rem 0.8rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

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

.calculate-btn {
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* .calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
} */

.results {
    background: #fff;
    border-radius: 15px;
    padding: 1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.5s ease-out;
}

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

.results h2 {
    margin-bottom: 1rem;
    text-align: center;
}

.results p {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #e1e8ed;
    font-size: 1.1rem;
}

.results p:last-child {
    border-bottom: none;
}

.parameter-annotations{
    text-align: left;
    margin-top: 1rem;
}
.parameter-annotations strong {
    color: #666;
    font-size: 0.8rem;
    line-height: 1.5;
    display: block;
}

.what-calculator{
    margin-bottom: 1rem;
}

.article-section {
    background: #fff;
    margin-top: 2rem;
}

.step-guide {
    margin-bottom: 1rem;
}

.step-guide h2{
    margin-bottom: 0.5rem;
}

.step {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 0.5rem 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.step h3 {
    margin-bottom: 0.5rem;
}

.calculation-example {
    margin-bottom: 1rem;
}

.calculation-example h2{
    margin-bottom: 1rem;
}

.calculation-example ul{
    list-style: none;
    padding-left: 0;
}

.benefits h2{
    margin-bottom: 1rem;
}

.formula {
    background: #e1e8ed;
    padding: 0.5rem;
    border-radius: 8px;
    margin: 0.5rem 0;
}

.example {
    background: #f1f5f9;
    padding: 0.5rem;
    border-radius: 8px;
    margin: 0.5rem 0;
}

.faq-section {
    background: #f8f9fa;
}

/* .faq-container {
    max-width: 800px;
    margin: 0 auto;
} */

.faq-item {
    background: #fff;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

/* .faq-item:hover {
    transform: translateY(-3px);
} */

.faq-content {
    padding: 10px 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin: 12px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.faq-section {
    margin: 1rem 0;
}
.faq-section h2{
    margin-bottom: 1rem;
}

.footer {
    background: #2c3e50;
    color: #fff;
    padding: 2rem 0 1rem;
}

.footer-container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.footer-section h2 {
    margin-bottom: 0.5rem;
    color: #fff;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
}

.footer-section a {
    color: #fff;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #fff;
}

.footer-section svg{
    color: #fff;
    background-color: #fff;
}

.footer-bottom {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-bottom p{
    color: rgba(255, 255, 255, 0.8);
}


.contact-container {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin: 3rem auto;
    max-width: 800px;
    animation: fadeInUp 0.5s ease-out;
}

.contact-intro {
    color: #34495e;
    font-size: 1.1rem;
    margin: 1rem 0;
}

.contact-form {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
}

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

.submit-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.articles-list li{
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e1e8ed;
}

.articles-list a{
    color: #34495e;
}

.article-container{
    background-color: #fff;
    padding: 1rem;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.article-content{
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    background-color: #e1e8ed;
}
.article-content h3{
    margin-bottom: 0.5rem;
    text-align: justify;  /* 两端对齐使环绕效果更好 */
    overflow: auto;
    clear: none;
}
.article-content p{
    background-color: #fff;
    padding: 0.5rem;
    border-radius: 8px;
    margin: 0.5rem 0;
}
.article-content ul{
    background-color: #fff;
    padding: 0.5rem;
    border-radius: 8px;
    margin: 0.5rem 0;
    text-align: justify;  /* 两端对齐使环绕效果更好 */
    overflow: auto;
    clear: none;
}

.article-content img{
    float: right;
    max-width: 100%;
    height: auto;
    margin: 0 0 0.5rem 0.5rem;
    shape-outside: margin-box;
    border-radius: 15px;
}

.article-content p{
    padding: 0.5rem;
    border-radius: 8px;
    margin: 0.5rem 0;
    text-align: justify;  /* 两端对齐使环绕效果更好 */
    overflow: auto;
    clear: none;
}

.article-content p a{
    color: #666;
}

.article-content h3 a{
    color: #2c3e50;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    overflow-x: auto;
    display: block;
}

table th, table td {
    padding: 0.75rem;
    text-align: center;
    border: 1px solid #ddd;
}

table caption {
    font-weight: bold;
    margin-bottom: 0.5rem;
}


.map{
    text-align: center;
    overflow: hidden;
}
.map img{
    width: 100%;
    height: auto;
}

.contact-info {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 2rem;
    margin-top: 2rem;
}

.contact-info h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

/* .info-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
} */

.info-item p {
    color: #34495e;
    font-size: 1.1rem;
    margin: 0;
}

/* 优化字体大小响应式 */
html {
    font-size: 16px;
}

/* 使用相对单位替换固定单位 */
:root {
    --spacing-unit: 0.25rem;
    --container-padding: 1vw;
    --section-spacing: 2rem;
}

/* 平板设备适配 */
@media screen and (min-width: 769px) and (max-width: 1199px) {
    .container {
        max-width: 98vw;
    }

    .hero{
        flex-wrap: wrap;
        padding: 2rem 1rem;
    }
    .hero-content {
        max-width: 60vw;
    }
    .hero .wrap{
        width: 100%;
    }
    
    .results{
        width: 30vw;
    }

    .control-panel {
        grid-template-columns: repeat(2, 1fr);
    }

    /* .dimension-fields {
        grid-template-columns: repeat(2, 1fr);
    } */
}

/* 表单和联系页面响应式优化 */
@media screen and (max-width: 768px) {
    .contact-container {
        margin: 10px;
        padding: 10px;
    }
    .contact-intro{
        margin: 10px 0;
    }

    .contact-info{
        margin-top: 10px;
        padding: 10px;
    }

    html {
        font-size: 14px;
    }

    h2{
        font-size: 20px;
    }
    h3{
        font-size: 18px;
    }
    h4{
        font-size: 16px;
    }

    p{
        font-size: 14px;
    }

    .contact-form {
        padding: 1rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .main-nav{
        justify-content: space-between;
        padding: 10px 20px;
    }
    
    .main-nav .logo h1{
        font-size: 1.4rem;
    }
    
    .nav-item{
        font-size: 14px;
    }

    .hero{
        padding: 10px;
        clip-path:polygon(0 0, 100% 0, 100% 99%, 0 100%);
        padding: 10px;
    }

    .hero-content{
        max-width: 100%;
        padding: 10px;
        transform: translateY(0);
        animation: none
    }

    .calculator-container{
        padding: 10px;
    }

    .control-panel{
        flex-wrap: wrap;
        gap: 10px;
    }

    .panel-section {
        width: 100%;
        padding: 5px; 
    }

    .panel-title{
        font-size: 1rem;
    }

    .control-btn{
        min-width: 100px;
        width: 100px;
        padding: 5px 0;
    }

    .button-group{
        margin-top: 10px;
    }
    
    .dimension-fields{
        padding: 10px;
    }

    .hero .wrap{
        width: 100%;
        flex-wrap: wrap;
    }

    .control-panel {
        padding: 0.5rem 0.5rem 0 0.5rem;
    }

    .article-section{
        margin-top: 10px;
    }

    .step-guide h2{
        margin-bottom: 10px;
    }
    
    .rectangle-fields-up{
        flex-wrap: wrap;
        gap: 0;
    }
    
    .input-group{
        width: 100%;
        flex: auto;
        display: flex;
        margin-bottom: 10px;
    }

    .input-group label{
        width: 30%;
        font-size: 14px;
        margin-bottom: 0;
    }

    .input-group input{
        width: 70%;
        padding: 5px;
        height: 30px;
        font-size: 14px;
    }

    .calculate-btn{
        padding: 10px;
        font-size: 14px;
    }

    .welcom-section p{
        font-size: 16px;
    }

    .welcom-section h2{
        margin-bottom: 10px;
    }

    .features{
        margin-top: 10px;
    }
    
    .features li p{
        font-size: 14px;
    }

    .rectangle-fields-down{
        flex-wrap: wrap;
        gap: 0;
    }
    .formula{
        margin: 10px 0 0 0;
    }

    .step-guide{
        margin-bottom: 0;
    }

    .calculation-example{
        margin-bottom: 10px;
    }

    .results{
        margin-top: 10px;
        width: 100%;
        padding: 10px;
    }

    .results h2 {
        margin-bottom: 0;
    }
    
    .results p{
        padding: 5px 10px;
        font-size: 14px;
    }

    .faq-item {
        padding: 10px;
        margin-bottom: 10px;
    }

    .faq-content{
        margin: 10px 0;
    }

    .step {
        padding: 5px 0;
    }

    .faq-section{
        margin: 10px 0;
    }

    .faq-section h2{
        margin-bottom: 10px;
    }

    .footer{
        padding: 10px 0;
    }

    .footer-container{
        width: 100%;
        padding: 0 10px;
        gap: 10px;
    }

    .footer-bottom{
        padding-top: 10px;
        margin-top: 10px;
    }

    .form-group input,
    .form-group textarea {
        padding: 10px;
    }

    .contact-info {
        padding: 10px;
    }

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

    .info-item{
        padding: 10px;
        margin-bottom: 10px;
    }

    .article-container{
        padding: 10px;
    }

    .article-content{
        padding: 10px;
    }

    .article-content img{
        width: 100%;
    }

    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table th, table td {
        min-width: 100px; /* 设置最小列宽 */
        white-space: nowrap;
    }
}

@media screen and (max-width: 520px) {
    .main-nav{
        flex-wrap: wrap;
        justify-content: center;
    }
    .control-btn {
        width: 100%;
        min-width: auto;
    }
}

.container {
    padding: var(--container-padding);
}

/* 高分辨率屏幕适配 */
@media screen and (min-width: 1440px) {
    .container {
        max-width: 80vw;
    }

    /* .hero-content {
        max-width: 80vw;
    } */
}

