/* shared_css: 网站全局共享样式 */

/* 基础重置和盒模型 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 全局字体和颜色变量 */
:root {
    --primary-color: #3498db; /* 蓝色 */
    --secondary-color: #2ecc71; /* 绿色 */
    --accent-color: #e74c3c; /* 红色 */
    --text-color: #333;
    --light-text-color: #ecf0f1;
    --background-color: #f4f7f6;
    --header-footer-bg: #2c3e50; /* 深蓝色 */
    --border-color: #ddd;
    --font-family-sans-serif: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-family-serif: 'Georgia', serif;
}

body {
    font-family: var(--font-family-sans-serif);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 链接样式 */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--light-text-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #27ae60;
    border-color: #27ae60;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--light-text-color);
}

/* 表单元素基础样式 */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1em;
    font-family: var(--font-family-sans-serif);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

/* 容器和布局 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5em;
    font-weight: 700;
    color: #2c3e50; /* 深色标题 */
}

h1 { font-size: 2.5em; }
h2 { font-size: 2em; }
h3 { font-size: 1.75em; }
h4 { font-size: 1.5em; }

/* 图像响应式 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 列表样式 */
ul, ol {
    list-style-position: inside;
    margin-bottom: 1em;
}

/* 辅助类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.hidden { display: none; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* 媒体查询示例 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    h1 { font-size: 2em; }
    h2 { font-size: 1.75em; }
}

@media (max-width: 480px) {
    .btn {
        width: 100%;
        display: block;
    }
    h1 { font-size: 1.8em; }
    h2 { font-size: 1.5em; }
}

/* 滚动到顶部按钮样式 */
#scrollToTopBtn {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    font-size: 18px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

#scrollToTopBtn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@media (max-width: 768px) {
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}
