* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === 电脑版默认样式 === */
body {
    width: 1000px;
    margin: 0 auto;
    font-size: 14px;
    line-height: 1.6;
}

header {
    width: 1000px;
    background-image: url(/img/油田井场.jpg);
    text-align: left;
    text-indent: 1em;
    color: white;
    padding: 26px 0;
    margin: 0 auto;
    background-size: cover; /* 添加背景图片自适应 */
    background-position: center; /* 背景图片居中 */
}

nav {
    width: 1000px;
    margin: 0 auto;
    display: flex;
    background-color: #003056;
}

nav a {
    display: block;
    width: 250px;
    text-align: center;
    color: white;
    font-size: 20px;
    padding: 15px 0;
    text-decoration: none;
}

nav a:hover {
    background-color: #ef220f;
}

article {
    width: 1000px;
    margin: 30px auto;
    font-size: 18px;
    line-height: 1.6em;
}

/* 其他通用样式 */
h3 { text-align: center; }
h4 { text-align: left; }
h5 { text-align: left; }
p { text-indent: 2em; }

table {
    border-collapse: collapse;
    width: 100%;
}

table th, table td {
    border: 1px solid #000 !important;
    padding: 8px 12px;
}

table th { background-color: #f0f0f0; }

ol { list-style: decimal inside none; margin-left: 0em; }
ul { list-style: disc inside none; margin-left: 0em; }
dl { margin-left: 2em; }

.imgbox { text-align: center; }
dt .imgbox { text-align: center; }

footer {
    background-color: black;
    text-align: center;
    padding: 20px 0;
    color: #939393;
}

div a {
    text-decoration: none;
    color: #939393;
    display: inline-block;
    height: 20px;
    line-height: 20px;
}

/* 图片响应式 */
img {
    max-width: 100%;
    height: auto;
}

address img {
    max-width: 150px;
}

/* === 移动端样式 - 增强优先级 === */
@media (max-width: 1000px) {
    body {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 15px;
    }
    
    header {
        width: 100% !important;
        max-width: 100% !important;
        background-size: cover;
        background-position: center;
        text-indent: 0.5em;
        padding: 20px 0;
        margin: 0 auto;
    }
    
    h1 {
        font-size: 2em;
        word-wrap: break-word;
        line-height: 1.3;
    }
    
    h1 small {
        font-size: 0.7em;
        display: block;
        margin-top: 8px;
        line-height: 1.4;
    }
    
    nav {
        width: 100% !important;
        max-width: 100% !important;
        flex-direction: column;
        margin: 0 auto;
    }
    
    nav a {
        width: 100% !important;
        max-width: 100% !important;
        border-bottom: 1px solid rgba(255,255,255,0.3);
        box-sizing: border-box;
    }
    
    nav a:last-child {
        border-bottom: none;
    }
    
    article {
        width: 100% !important;
        max-width: 100% !important;
        margin: 20px auto;
        font-size: 16px;
    }
    
    /* 确保所有固定宽度元素都变为自适应 */
    header, nav, article, footer {
        box-sizing: border-box;
    }
}

/* === 小屏手机优化 === */
@media (max-width: 480px) {
    body {
        padding: 0 10px;
    }
    
    header {
        padding: 15px 0;
    }
    
    h1 {
        font-size: 1.6em;
    }
    
    h1 small {
        font-size: 0.75em;
    }
    
    nav a {
        font-size: 16px;
        padding: 12px 0;
    }
    
    article {
        font-size: 14px;
        margin: 15px auto;
        line-height: 1.5;
    }
    
    p {
        text-indent: 1.5em;
    }
}

/* 回到顶部按钮样式 - 添加到mystyle.css文件末尾 */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
}

#backToTop:hover {
    background-color: #3498db;
    transform: translateY(-2px);
}