/* 
   Main Stylesheet 
   Theme: HIT Academic Red & Modern Clean
*/

:root {
    --primary-color: #a72025;       /* 哈工大红 */
    --primary-dark: #7a1519;
    --secondary-color: #1a252f;     /* 深蓝灰 */
    --text-main: #333333;
    --text-light: #666666;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --gold: #c5a065;                /* 装饰金 */
    --transition: all 0.3s ease;
    --shadow-card: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
}

body {
    font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-main);
    background-color: var(--white);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Ensure Main grows to fill space, pushing footer down */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%; /* Ensure container takes full available width */
}

/* --- Header (Immersive Gradient) --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0) 100%);
    transition: background-color 0.4s ease, padding 0.4s ease, box-shadow 0.4s ease;
    padding: 15px 0 30px 0;
}

.site-header.scrolled {
    background: var(--primary-color);
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

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

/* Logo Area */
.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--white);
    text-decoration: none;
}

.logo-img {
    height: 120px; /* Slightly larger */
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-text h1 {
    font-size: 20px; /* Adjusted for length */
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
    white-space: nowrap;
}

.logo-text span {
    font-size: 16px;
    font-weight: 500;
    opacity: 0.95;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

/* Nav Menu */
.main-nav {
    flex: 1;
    margin-left: 40px;
}

.nav-list {
    display: flex;
    gap: 25px;
    justify-content: flex-end; /* Align right closer to search */
    margin-right: 20px;
}

.nav-list a {
    color: rgba(255,255,255,0.9);
    font-size: 16px;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    transition: var(--transition);
}

.nav-list a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--white);
    transition: width 0.3s;
}

.nav-list a:hover, .nav-list a.active {
    color: var(--white);
}

.nav-list a:hover::after, .nav-list a.active::after {
    width: 100%;
}

/* Header Tools */
.header-tools {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 4px 12px;
    backdrop-filter: blur(5px);
    transition: var(--transition);
}

.search-box:focus-within {
    background: rgba(255,255,255,0.95);
    border-color: var(--white);
}

.search-box:focus-within input {
    color: var(--text-main);
}
.search-box:focus-within button {
    filter: invert(1);
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--white);
    width: 120px;
    font-size: 13px;
}

.search-box input::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-box button {
    color: var(--white);
    font-size: 14px;
    padding-left: 5px;
}

.login-btn {
    font-size: 14px;
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.6);
    padding: 5px 15px;
    border-radius: 20px;
    transition: var(--transition);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.login-btn:hover {
    background: var(--white);
    color: var(--primary-color);
    border-color: var(--white);
}

.mobile-menu-btn {
    display: none;
    color: var(--white);
    font-size: 24px;
}

/* --- Mobile Menu Overlay --- */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 250px;
    height: 100%;
    background: var(--primary-color);
    z-index: 2000;
    transition: right 0.3s ease;
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    padding: 20px;
}

.mobile-nav-overlay.active {
    right: 0;
}

.close-mobile-nav {
    color: white;
    font-size: 30px;
    position: absolute;
    top: 15px;
    right: 20px;
}

.mobile-nav-list {
    margin-top: 50px;
}

.mobile-nav-list li {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-nav-list a {
    display: block;
    color: white;
    padding: 15px 0;
    font-size: 16px;
}

/* --- Hero Carousel --- */
.hero-banner-carousel {
    position: relative;
    height: 100vh;
    min-height: 600px;
    max-height: 800px;
    overflow: hidden;
    background: #000;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    text-decoration: none;
    z-index: 1;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 2;
}

.carousel-slide.active {
    animation: zoomEffect 10s linear infinite alternate;
}

@keyframes zoomEffect {
    from { background-size: 100% auto; }
    to { background-size: 110% auto; }
}

@media (min-aspect-ratio: 16/9) {
    .carousel-slide.active { animation: zoomEffectCover 10s linear infinite alternate; }
    @keyframes zoomEffectCover {
        from { background-size: cover; transform: scale(1); }
        to { background-size: cover; transform: scale(1.05); }
    }
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 3;
    padding-top: 60px;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 15px;
    letter-spacing: 5px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out 0.3s;
}

.carousel-slide.active .hero-title {
    opacity: 1;
    transform: translateY(0);
}

.hero-subtitle-en {
    font-size: 14px;
    letter-spacing: 2px;
    opacity: 0;
    font-weight: 300;
    margin-bottom: 20px;
    transform: translateY(30px);
    transition: all 0.8s ease-out 0.5s;
}

.carousel-slide.active .hero-subtitle-en {
    opacity: 0.9;
    transform: translateY(0);
}

.hero-divider {
    width: 0;
    height: 3px;
    background: var(--primary-color);
    margin: 0 auto 20px;
    transition: width 0.8s ease-out 0.7s;
}

.carousel-slide.active .hero-divider {
    width: 60px;
}

.hero-subtitle-cn {
    font-size: 20px;
    letter-spacing: 5px;
    font-weight: 400;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out 0.9s;
}

.carousel-slide.active .hero-subtitle-cn {
    opacity: 1;
    transform: translateY(0);
}

.carousel-indicators {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.dot.active, .dot:hover {
    background: var(--primary-color);
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(167,32,37,0.5);
}

/* --- Hero Banner (Subpages) --- */
.hero-banner {
    position: relative;
    height: 100vh;
    min-height: 600px;
    max-height: 800px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-align: center;
}

.hero-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

/* --- Subpage Banner --- */
.sub-banner {
    position: relative;
    height: 350px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    margin-top: 0;
}

.sub-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1;
}

.sub-banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding-top: 60px;
}

.sub-banner h2 {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.sub-banner p {
    font-size: 16px;
    opacity: 0.9;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* --- Subpage Layout & Sidebar --- */
.page-container {
    padding: 60px 0;
    /* This makes the container take up remaining space, pushing footer down */
    flex: 1; 
    display: flex;
    flex-direction: column;
}

.breadcrumb {
    margin-bottom: 40px;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.breadcrumb a {
    color: #666;
    transition: 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb span {
    margin: 0 8px;
    color: #ccc;
    font-size: 12px;
}

.breadcrumb .current {
    color: var(--primary-color);
    font-weight: 600;
}

.page-layout {
    display: flex;
    gap: 40px;
    /* Stretch to fill container height visually */
    flex: 1; 
    min-height: 600px;
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 20px;
    color: var(--white);
    background: var(--primary-color);
    padding: 15px 20px;
    font-weight: 600;
    border-radius: 4px 4px 0 0;
}

.sidebar-menu {
    border: 1px solid #eee;
    border-top: none;
    border-radius: 0 0 4px 4px;
    background: #fff;
    overflow: hidden;
}

.sidebar-menu li {
    border-bottom: 1px solid #f5f5f5;
}

.sidebar-menu li:last-child {
    border-bottom: none;
}

.sidebar-menu a {
    display: block;
    padding: 15px 20px;
    color: #444;
    transition: var(--transition);
    position: relative;
    font-size: 15px;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background: #fff;
    color: var(--primary-color);
    padding-left: 25px;
}

.sidebar-menu a.active {
    font-weight: 600;
    border-left: 3px solid var(--primary-color);
}

.main-content-area {
    flex: 1;
    min-width: 0;
    /* 强制横排，解决竖排问题 */
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    direction: ltr !important;
    text-align: left !important;
    /* 可选：限制最大宽度，提升阅读体验 */
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-title {
    font-size: 28px;
    margin-bottom: 30px;
    color: var(--text-main);
    font-weight: 700;
    position: relative;
    padding-bottom: 15px;
}

.content-title::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 50px;
    height: 4px;
    background: var(--primary-color);
}

/* --- News List --- */
.news-list-vertical .news-item {
    display: flex;
    gap: 25px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.news-item-img {
    width: 240px;
    height: 150px;
    overflow: hidden;
    border-radius: 4px;
    flex-shrink: 0;
}

.news-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.news-item:hover .news-item-img img {
    transform: scale(1.05);
}

.news-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.news-item-content h3 {
    font-size: 20px;
    color: var(--text-main);
    line-height: 1.4;
    margin-bottom: 10px;
}

.news-item-content h3 a:hover {
    color: var(--primary-color);
}

.news-item-desc {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    gap: 15px;
}

/* --- Power Table --- */
.power-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    font-size: 15px;
}

.power-table th, .power-table td {
    padding: 15px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.power-table th {
    background: #f9f9f9;
    color: var(--primary-color);
    font-weight: 700;
    width: 25%;
}

.power-table tr:hover td {
    background: #fafafa;
}

/* --- Rules List --- */
.rules-list {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.rules-list li {
    padding: 18px 0;
    border-bottom: 1px dashed #e0e0e0;
}

.rules-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    color: var(--text-main);
}

.rules-list a:hover {
    color: var(--primary-color);
}

.rules-list .rule-icon {
    margin-right: 10px;
    color: #ccc;
}

.rules-list .rule-date {
    font-size: 13px;
    color: #999;
}

/* --- Contact Grid --- */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.contact-card {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    transition: var(--transition);
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.contact-icon {
    font-size: 40px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.contact-card h4 {
    margin-bottom: 10px;
    font-size: 18px;
}

.contact-card p {
    color: var(--text-light);
    font-size: 14px;
}

/* --- Common Section --- */
.section-container {
    padding: 80px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    position: relative;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
}

.center-header {
    justify-content: center;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.center-header::after {
    left: 50%;
    transform: translateX(-50%);
}

.header-title-group h3, .center-header h3 {
    font-size: 32px;
    color: var(--text-main);
    font-weight: 700;
    margin-bottom: 5px;
}

.en-title {
    display: block;
    font-size: 12px;
    color: #999;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.more-link {
    font-size: 14px;
    color: var(--text-light);
    transition: var(--transition);
}

.more-link:hover {
    color: var(--primary-color);
}

/* --- News Grid --- */
.news-grid {
    display: grid;
    grid-template-columns: 5fr 4fr;
    gap: 40px;
}

.news-card.featured {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    height: 100%;
}

.news-card.featured:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

.card-image-wrapper {
    position: relative;
    flex: 1;
    min-height: 250px;
    overflow: hidden;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.news-card.featured:hover .card-image-wrapper img {
    transform: scale(1.05);
}

.date-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--primary-color);
    color: white;
    padding: 8px 15px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(167, 32, 37, 0.4);
    border-radius: 4px;
}

.date-badge .day {
    display: block;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.date-badge .year-month {
    font-size: 12px;
    opacity: 0.9;
}

.card-content {
    padding: 30px;
}

.card-content h4 {
    font-size: 22px;
    margin-bottom: 15px;
    color: var(--text-main);
    line-height: 1.4;
}

.news-desc {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.read-more .arrow {
    transition: transform 0.3s;
}

.read-more:hover .arrow {
    transform: translateX(5px);
}

.news-list-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

.side-card {
    display: flex;
    background: var(--white);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    flex: 1; 
    min-height: 120px;
}

.side-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateX(5px);
}

.side-image-wrapper {
    width: 160px;
    flex-shrink: 0;
}

.side-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.side-content {
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.date-small {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.side-content h4 {
    font-size: 16px;
    color: var(--text-main);
    line-height: 1.4;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Service Grid (Updated) --- */
.service-section {
    background: var(--white);
}

.service-grid {
    display: grid;
    /* Responsive grid that handles both full width and sidebar layouts nicely */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.service-card {
    position: relative;
    height: 220px;
    border-radius: 8px;
    overflow: hidden;
    display: block;
    box-shadow: var(--shadow-card);
}

.service-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
}

.service-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.2));
    transition: background 0.3s;
}

.service-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 25px;
    color: var(--white);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    z-index: 2;
}

.icon-circle {
    font-size: 24px;
    margin-bottom: 10px;
    background: rgba(255,255,255,0.2);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    backdrop-filter: blur(5px);
    transition: var(--transition);
}

.service-card h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.service-card p {
    font-size: 12px;
    opacity: 0.8;
}

.service-card:hover .service-bg {
    transform: scale(1.1);
}

.service-card:hover .service-overlay {
    background: rgba(167, 32, 37, 0.9);
}

.service-card:hover .icon-circle {
    background: var(--white);
    color: var(--primary-color);
    transform: scale(1.1);
}

/* --- Footer --- */
.site-footer {
    background-color: #8a0005;
    color: #fff;
    padding-top: 50px;
    border-top: none;
    font-size: 14px;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 30px;
    gap: 20px;
    border-bottom: none;
}

/* Col 1: Logo */
.footer-logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1.5; /* Increased flex */
}

.footer-logo-img {
    height: 100px;
    object-fit: contain;
}

.footer-logo-text-large {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    border-left: 1px solid rgba(255,255,255,0.3);
    padding-left: 15px;
    line-height: 1.2;
}

/* Col 2: Contact */
.footer-contact {
    flex: 1.5;
}

.footer-contact h5 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #fff;
}

.footer-contact p {
    font-size: 13px;
    line-height: 2;
    opacity: 0.9;
    margin: 0;
}
.footer-contact .indent {
    padding-left: 55px; /* Visual alignment for contacts */
}

/* Col 3: Links */
.footer-links {
    flex: 0.8;
}

.footer-links h5 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #fff;
}

.link-dropdown {
    background: rgba(255,255,255,0.1);
    padding: 8px 15px;
    margin-bottom: 10px;
    border-radius: 2px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s;
}

.link-dropdown:hover {
    background: rgba(255,255,255,0.2);
}

/* Col 4: QR */
.footer-qr {
    flex: 0.6;
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Align right */
    text-align: center;
}

.qr-box {
    background: #fff;
    padding: 5px;
    width: 100px;
    height: 100px;
    margin-bottom: 10px;
}

.qr-box img {
    width: 100%;
    height: 100%;
}

.footer-qr span {
    font-size: 12px;
    opacity: 0.8;
}

/* Footer Bottom */
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.15);
    text-align: center;
    padding: 20px 0;
    font-size: 12px;
    opacity: 0.7;
    margin-top: 20px;
    background: transparent;
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .nav-list { display: none; }
    .mobile-menu-btn { display: block; }
    .news-grid { grid-template-columns: 1fr; }
    .side-card { height: auto; }
    .service-grid { grid-template-columns: repeat(2, 1fr); }
    .header-tools { margin-left: auto; }
    .page-layout { flex-direction: column; }
    .sidebar { width: 100%; }
}

@media (max-width: 768px) {
    .hero-title { font-size: 32px; }
    .hero-subtitle-cn { font-size: 16px; letter-spacing: 2px; }
    .footer-content { flex-direction: column; gap: 40px; }
    .footer-right { flex-direction: column; gap: 30px; }
    .search-box { display: none; }
    .service-grid { grid-template-columns: 1fr; }
    .sub-banner h2 { font-size: 28px; }
    .contact-grid { grid-template-columns: 1fr; }
    .carousel-indicators { bottom: 20px; }
    
    .footer-logo-area, .footer-contact, .footer-links, .footer-qr {
        align-items: center;
        text-align: center;
    }
    .footer-logo-text-large { border-left: none; padding-left: 0; display: block; margin-top: 10px;}
    .footer-logo-area { flex-direction: column; }
    .footer-contact .indent { padding-left: 0; }
    .footer-qr { align-items: center; }
}
/* --- Footer QR Code Adjustment --- */
.footer-qr .qr-box {
    margin-right: 25px; /* 向左偏移 */
    width: 100px;
    height: 100px;
    background: #fff;
    padding: 5px;
    margin-bottom: 10px;
}

.footer-qr span {
    display: block;
    text-align: right;
    padding-right: 15px;
    font-size: 12px;
    opacity: 0.8;
}

/* ==========================================================================
   CSS Masterpiece: Ultra-Responsive Refactor
   ========================================================================== */

/* 1. 基础布局修正：防止水平溢出 */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* 2. 响应式网格与布局 (核心) */
@media (max-width: 1024px) {
    .container { padding: 0 15px; }
    
    /* 头部紧凑化 */
    .site-header { padding: 10px 0; background: var(--primary-color); } /* 平板及以下直接用主色 */
    .logo-img { height: 50px !important; } /* 强制统一缩放 */
    .logo-text h1 { font-size: 16px; }
    .logo-text span { font-size: 11px; }

    /* 侧边栏转为顶部/底部排列 */
    .page-layout { flex-direction: column; gap: 30px; }
    .sidebar { width: 100%; }
    .main-content-area { padding: 0; max-width: 100%; }
}

@media (max-width: 768px) {
    /* 导航栏处理：隐藏 PC 菜单，利用已有的 mobile-nav-overlay */
    .main-nav, .search-box { display: none; }
    .mobile-menu-btn { 
        display: block !important; 
        font-size: 28px; 
        padding: 5px;
    }

    /* 栅格系统一键降维 */
    .news-grid, .service-grid, .contact-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    /* 列表项优化 */
    .news-item { flex-direction: column; }
    .news-item-img { width: 100%; height: 200px; }

    /* 表格响应式：允许横向滚动防止撑破布局 */
    .power-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Banner 字体自适应缩放 */
    .hero-title { font-size: 24px !important; letter-spacing: 2px; }
    .sub-banner { height: 180px; }
    .sub-banner h2 { font-size: 24px; }

    /* 页脚垂直居中排版 */
    .footer-content { 
        flex-direction: column; 
        text-align: center; 
        align-items: center; 
    }
    .footer-logo-area { flex-direction: column; border: none; }
    .footer-logo-text-large { border-left: none; padding: 10px 0; }
    .footer-contact .indent { padding-left: 0; }
    .footer-qr { align-items: center; margin-top: 20px; }
    .footer-qr .qr-box { margin: 0 auto 10px; }
}

/* 3. 细节交互优化 */
@media (hover: none) {
    /* 针对触摸屏取消复杂的悬停位移，改为更稳定的点击反馈 */
    .contact-card:hover, .service-card:hover {
        transform: none;
    }
    .service-overlay {
        background: rgba(167, 32, 37, 0.7); /* 移动端默认半透明可见，不依赖 hover */
    }
}

/* 4. 极端小屏适配 (Width < 350px) */
@media (max-width: 350px) {
    .logo-text { display: none; } /* 只保留 Logo 图标 */
    .login-btn { padding: 4px 8px; font-size: 11px; }
}
