/* ========== Global Base Styles ========== */
body {
    font-family: 'Georgia', serif;
    background-color: #F8F8F8;
    color: #333;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Skip Link（跳过导航） - 默认隐藏，聚焦时显示 */
.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 999;
}
.skip-link:focus {
    left: 0;
    top: 0;
    width: auto;
    height: auto;
    padding: 10px;
    background: #333;
    color: #fff;
    text-decoration: none;
    outline: none;
    border-radius: 4px;
}

/* Main Content Wrapper */
.wrapper {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    background: white;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

/* ========== 3-Column Layout ========== */
.container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

/* Left Sidebar */
.sidebar-left {
    width: 25%;
    background-color: #F8F8F8;
    color: black;
    padding: 20px;
    border-radius: 8px;
    text-align: left;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Main Content Area */
.main-content {
    width: 50%;
}

/* Right Sidebar */
.sidebar-right {
    width: 20%;
    background-color: #B66532;
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Responsive Design: Single Column Layout on Smaller Screens */
@media screen and (max-width: 1024px) {
    .container {
        flex-direction: column;
        align-items: center;
    }
    .sidebar-left, .main-content, .sidebar-right {
        width: 100%;
        text-align: center;
    }
}

/* ========== Header Styles ========== */
header {
    text-align: center;
    padding-bottom: 15px;
}
header h1 {
    font-size: 32px;
    font-weight: bold;
    color: #3D3D3D;
}
header p {
    font-size: 18px;
    color: #B66532;
    font-weight: bold;
}

/* ========== Navigation Bar ========== */
nav ul {
    padding: 0;
    list-style: none;
    background: black;
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    border-radius: 8px;
}
nav ul li {
    display: inline;
    margin: 0 10px;
}
nav ul li a {
    text-decoration: none;
    font-weight: bold;
    color: white;
    padding: 10px 15px;
    text-transform: uppercase;
    transition: background 0.3s, color 0.3s;
}
nav ul li a:hover {
    background: white;
    color: black;
    border-radius: 5px;
    padding: 8px 15px;
}
nav ul li a.current {
    background: white;
    color: black;
    font-weight: bold;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
}

/* 小屏幕下导航垂直排列 */
@media screen and (max-width: 768px) {
    nav ul {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    nav ul li {
        display: block;
        margin: 10px 0;
    }
}

/* Main Image Styling */
.main-image {
    width: 100%;
    max-width: 550px;
    height: auto;
    display: block;
    margin: 0 auto 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
/* Responsive Image on Small Screens */
@media screen and (max-width: 768px) {
    .main-image {
        max-width: 100%;
    }
}

/* ========== Button Styles ========== */
.fancy-button {
    background: #B66532;
    color: white;
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    text-transform: uppercase;
    transition: background 0.3s, transform 0.2s;
}
.fancy-button:hover {
    background: #944E24;
    transform: scale(1.05);
}

/* ========== Back to Top Button ========== */
#backToTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: black;
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    cursor: pointer;
    display: none;
    transition: background 0.3s, transform 0.2s;
    font-size: 14px;
    border: none;
    outline: none;
}
#backToTop:hover {
    background: #444;
    transform: scale(1.1);
}

/* ========== Dark Mode ========== */
.dark-mode {
    background-color: #121212;
    color: #E0E0E0;
}
.dark-mode .wrapper {
    background-color: #222;
    color: #E0E0E0;
}
.dark-mode nav ul {
    background: #222;
}
.dark-mode nav ul li a {
    color: #E0E0E0;
}
.dark-mode nav ul li a.current {
    background: #E0E0E0;
    color: black;
}
.dark-mode .sidebar-left, .dark-mode .sidebar-right {
    background-color: #B66532;
    color: white;
}
.dark-mode .fancy-button {
    background: #E0E0E0;
    color: black;
}
.dark-mode .fancy-button:hover {
    background: #C4C4C4;
}
.dark-mode #backToTop {
    background: white;
    color: black;
}
.dark-mode #backToTop:hover {
    background: #DDD;
}
.dark-mode footer {
    background-color: #181818;
    color: #E0E0E0;
}
.dark-mode footer a {
    color: #B66532;
}

/* Center Text */
.center-text {
    text-align: center;
}

/* ========== Form Styling ========== */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 让输入框与文本域自适应父容器并避免溢出 */
input, textarea, select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}

/* Label 与分组的默认样式 */
label {
    font-weight: bold;
    margin-top: 8px;
}
.radio-group, .checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}
.radio-group input[type="radio"],
.checkbox-group input[type="checkbox"] {
    margin-right: 4px;
}

/* fieldset + legend，利于无障碍与分块 */
fieldset.section_border {
    border: 2px solid #B66532;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}
legend.section_title {
    font-weight: bold;
    color: #B66532;
    padding: 0 5px;
}

/* 夜间模式下：输入框、文本域、下拉、标签等颜色调整 */
.dark-mode input,
.dark-mode textarea,
.dark-mode select {
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
}
.dark-mode label {
    color: #fff;
}

/* Sidebar Links Styling */
.sidebar-left h3, .sidebar-left p, .sidebar-left a, .sidebar-right a {
    color: #B66532;
}
.sidebar-left p {
    font-size: 14px;
    margin-bottom: 10px;
}
.sidebar-left a, .sidebar-right a {
    color: #111112;
    text-decoration: none;
    font-weight: bolds
}
.sidebar-left a:hover, .sidebar-right a:hover {
    text-decoration: underline;
}

/* 夜间模式下的返回顶部按钮 */
.dark-mode #backToTop {
    background: white;
    color: black;
}
.dark-mode #backToTop:hover {
    background: #DDD;
}
