/* 移动端响应式样式 */
/* 为Northgard网站提供优化的移动端体验 */

/* ==================== 基础响应式设置 ==================== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    overflow-x: hidden;
    padding: 0;
    margin: 0;
}

/* ==================== 通用响应式类 ==================== */
.hidden-mobile {
    display: block;
}

.visible-mobile {
    display: none;
}

/* ==================== 头部导航响应式 ==================== */
.main-header {
    background-color: #2c3e50;
    color: #ffffff;
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.main-header .container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0 10px;
}

.logo {
    margin-bottom: 0.5rem;
}

.logo h1 {
    font-size: 1.5rem;
    margin-bottom: 0;
    color: #4a90e2;
}

.logo p {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 0;
}

.main-nav {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.nav-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}

.nav-content ul {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    list-style: none;
    margin: 0 0 0.5rem 0;
    padding: 0;
    justify-content: center;
}

.nav-content ul li {
    margin: 0.2rem;
}

.nav-content ul li a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    display: block;
    text-align: center;
    font-size: 0.9rem;
}

.nav-content ul li a:hover,
.nav-content ul li a.active {
    background-color: #4a90e2;
}

.search-box {
    width: 100%;
    margin: 0 0 0.5rem 0;
    display: flex;
}

.search-box input {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 6px 0 0 6px;
    width: calc(100% - 60px);
    font-size: 0.9rem;
}

.search-box button {
    background-color: #e67e22;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.search-box button:hover {
    background-color: #d35400;
}

.user-actions {
    width: 100%;
    text-align: center;
    margin-bottom: 0.5rem;
}

.user-actions .login-btn {
    background-color: transparent;
    color: #ffffff;
    border: 1px solid #4a90e2;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    font-weight: 500;
    width: auto;
    text-align: center;
    font-size: 0.9rem;
}

.user-actions .login-btn:hover {
    background-color: #4a90e2;
}

/* ==================== 主要内容区域 ==================== */
.hero-banner {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
    margin: 1rem auto;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    max-width: 100%;
}

.carousel-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.carousel-slides {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 1;
}

.carousel-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(76, 47, 77, 0.3); /* 淡灰色半透明遮光效果 */
    z-index: 1;
}

.carousel-slide .banner-content {
    position: relative;
    z-index: 2;
    max-width: 100%;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.banner-content h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: fadeInDown 1s ease-out;
    letter-spacing: 1px;
    font-weight: 700;
}

.banner-content p {
    font-size: 1rem;
    margin-bottom: 1rem;
    max-width: 100%;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease-out 0.3s both;
    color: white;
    line-height: 1.5;
    font-weight: 300;
}

/* 轮播控制按钮 */
.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 3;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    opacity: 0.7;
}

.carousel-prev:hover,
.carousel-next:hover {
    opacity: 1;
}

.carousel-prev {
    left: 15px;
}

.carousel-next {
    right: 15px;
}

.carousel-prev:hover,
.carousel-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* 轮播指示器 */
.carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 3;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.indicator.active {
    background-color: white;
}

.indicator:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

/* ==================== 种族概览 ==================== */
.races-overview {
    padding: 1rem 0;
    background-color: #e6edf6;
    position: relative;
}

.races-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.race-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(187, 240, 199, 0.1);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.race-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.race-card .card-image {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.race-card .card-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
}

.race-card .race-name {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    color: white;
    font-size: 1.3rem;
    margin-bottom: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.race-card .image-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.race-card .card-content {
    padding: 0.8rem;
}

.race-card .card-content p {
    color: #666;
    margin-bottom: 0.8rem;
    min-height: 50px;
    line-height: 1.5;
    font-size: 0.9rem;
}

.race-card .stats {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #eee;
    padding-top: 0.8rem;
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-value {
    font-weight: bold;
    color: #4a90e2;
    font-size: 1.1rem;
}

.stat-label {
    font-size: 0.7rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== 特色内容 ==================== */
.featured-content {
    padding: 1rem 0;
    background-color: #ffffff;
    position: relative;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.content-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(187, 240, 199, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #eaeaea;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.content-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.content-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: all 0.3s ease;
}

.content-card:hover img {
    transform: scale(1.03);
}

.content-card h3 {
    padding: 0 0.8rem;
    margin-top: 0.8rem;
    font-size: 1.2rem;
    color: #2c3e50;
}

.content-card p {
    padding: 0 0.8rem;
    color: #666;
    margin-bottom: 0.8rem;
    min-height: 50px;
    flex-grow: 1;
    font-size: 0.9rem;
}

.read-more {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    color: #4a90e2;
    text-decoration: none;
    font-weight: bold;
    margin: 0 0.8rem 0.8rem;
    border: 2px solid #4a90e2;
    border-radius: 6px;
    transition: all 0.3s ease;
    align-self: flex-start;
    font-size: 0.9rem;
}

.read-more:hover {
    background-color: #4a90e2;
    color: white;
}

/* ==================== 页脚 ==================== */
.main-footer {
    background-color: #2c3e50;
    color: #ffffff;
    padding: 1.5rem 0 0.8rem;
    margin-top: 1.5rem;
    border-top: 3px solid #4a90e2;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.footer-section h3,
.footer-section h4 {
    color: #4a90e2;
    margin-bottom: 0.8rem;
    position: relative;
    padding-bottom: 0.4rem;
    font-size: 1.2rem;
}

.footer-section h3::after,
.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: #e67e22;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.4rem;
    padding: 0.2rem 0;
    font-size: 0.9rem;
}

.footer-section ul li a {
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    padding-left: 12px;
}

.footer-section ul li a::before {
    content: "▶";
    position: absolute;
    left: 0;
    color: #e67e22;
    font-size: 0.7rem;
    top: 2px;
    transition: all 0.3s ease;
}

.footer-section ul li a:hover {
    color: #e67e22;
    padding-left: 17px;
}

.footer-section ul li a:hover::before {
    transform: translateX(2px);
}

.copyright {
    text-align: center;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    opacity: 0.8;
}

/* ==================== 通用按钮 ==================== */
.cta-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: #e67e22;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 1;
    text-align: center;
    width: auto;
    margin: 0.5rem 0;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
    z-index: -1;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    background-color: #d35400;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.cta-button.secondary {
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
}

.cta-button.secondary:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* ==================== 动画效果 ==================== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 汉堡菜单按钮样式 */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: #ffffff;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* 汉堡菜单动画 */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* ==================== 响应式断点 ==================== */
/* 超小屏幕设备 (手机, 小于 480px) */
@media screen and (max-width: 479px) {
    .menu-toggle {
        display: flex;
    }
    
    .main-nav {
        display: none;
        width: 100%;
        background-color: #2c3e50;
        border-radius: 8px;
        margin-top: 0.5rem;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    }
    
    .main-nav.active {
        display: block;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .hero-banner {
        height: 250px;
    }
    
    .banner-content h2 {
        font-size: 1.5rem;
    }
    
    .banner-content p {
        font-size: 0.9rem;
    }
    
    .search-box input {
        width: calc(100% - 60px);
        padding: 0.4rem 0.8rem;
    }
    
    .search-box button {
        padding: 0.4rem 0.8rem;
    }
    
    .race-card .card-image {
        height: 150px;
    }
    
    .race-card .race-name {
        font-size: 1.2rem;
        bottom: 0.5rem;
        left: 0.5rem;
    }
    
    .content-card img {
        height: 150px;
    }
    
    .footer-section h3,
    .footer-section h4 {
        font-size: 1.2rem;
    }
    
    /* 圣物部分移动端优化 */
    .relics-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .relic-item {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
    
    .relic-image-module {
        flex: 0 0 auto;
        margin-bottom: 1rem;
    }
    
    .relic-content {
        width: 100%;
        gap: 0.8rem;
    }
    
    .relic-name-module,
    .relic-description-module {
        min-width: auto;
        width: 100%;
    }
    
    .relic-image {
        width: 100px;
        height: 120px;
    }
}

/* 小屏幕设备 (手机, 480px 及以上) */
@media screen and (min-width: 480px) and (max-width: 767px) {
    .menu-toggle {
        display: flex;
    }
    
    .main-nav {
        display: none;
        width: 100%;
        background-color: #2c3e50;
        border-radius: 8px;
        margin-top: 0.5rem;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    }
    
    .main-nav.active {
        display: block;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .hero-banner {
        height: 280px;
    }
    
    .banner-content h2 {
        font-size: 1.8rem;
    }
    
    .races-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    /* 圣物部分移动端优化 */
    .relics-container {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    
    .relic-item {
        flex-direction: column;
        text-align: center;
        padding: 1.2rem;
    }
    
    .relic-image-module {
        flex: 0 0 auto;
        margin-bottom: 1.2rem;
    }
    
    .relic-content {
        width: 100%;
        gap: 0.9rem;
    }
    
    .relic-name-module,
    .relic-description-module {
        min-width: auto;
        width: 100%;
    }
    
    .relic-image {
        width: 120px;
        height: 140px;
    }
}

/* 中等屏幕设备 (平板, 768px 及以上) */
@media screen and (min-width: 768px) {
    .hidden-mobile {
        display: block;
    }
    
    .visible-mobile {
        display: none;
    }
    
    .menu-toggle {
        display: none;
    }
    
    .main-nav {
        display: flex !important;
    }
    
    .main-header .container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 0 15px;
    }
    
    .logo {
        margin-bottom: 0;
    }
    
    .main-nav {
        flex-direction: row;
        align-items: center;
        width: auto;
    }
    
    .nav-content {
        flex-direction: row;
        align-items: center;
        width: auto;
    }
    
    .nav-content ul {
        flex-direction: row;
        margin-bottom: 0;
    }
    
    .nav-content ul li {
        margin: 0 0 0 1rem;
    }
    
    .nav-content ul li a {
        display: inline-block;
        padding: 0.5rem 1rem;
        text-align: left;
        font-size: 1rem;
    }
    
    .search-box {
        width: auto;
        margin: 0 1rem 0 0;
    }
    
    .search-box input {
        width: 200px;
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
    
    .search-box button {
        padding: 0.5rem 1rem;
        font-size: 1rem;
        border-radius: 0 8px 8px 0;
    }
    
    .user-actions {
        width: auto;
        text-align: left;
        margin-bottom: 0;
    }
    
    .user-actions .login-btn {
        width: auto;
        display: inline-block;
        padding: 0.5rem 1rem;
        font-size: 1rem;
        border-radius: 8px;
    }
    
    .hero-banner {
        height: 400px;
    }
    
    .banner-content h2 {
        font-size: 2.5rem;
    }
    
    .banner-content p {
        font-size: 1.2rem;
    }
    
    .races-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 2rem;
    }
    
    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 2rem;
    }
    
    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    /* 圣物部分在中等屏幕设备上的优化 */
    .relics-container {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .relic-item {
        flex-direction: column;
        text-align: center;
    }
    
    .relic-image-module {
        flex: 0 0 auto;
        margin-bottom: 1rem;
    }
    
    .relic-content {
        width: 100%;
        gap: 1rem;
    }
    
    .relic-name-module,
    .relic-description-module {
        min-width: auto;
        width: 100%;
    }
}

/* 大屏幕设备 (桌面, 1024px 及以上) */
@media screen and (min-width: 1024px) {
    .hero-banner {
        height: 500px;
    }
    
    .banner-content h2 {
        font-size: 3rem;
    }
    
    .banner-content p {
        font-size: 1.3rem;
    }
    
    .races-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
    
    /* 桌面端恢复原始布局 */
    .relics-container {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .relic-item {
        flex-direction: row;
        text-align: left;
    }
    
    .relic-image-module {
        flex: 0 0 150px;
        margin-bottom: 0;
    }
    
    .relic-content {
        width: auto;
    }
    
    .relic-name-module {
        min-width: 140px;
    }
    
    .relic-description-module {
        min-width: 220px;
    }
    
    .relic-image {
        width: 150px;
        height: 175px;
    }
}

/* 单位表格在超小屏幕设备上的优化 */
@media screen and (max-width: 479px) {
    /* 单位表格单元格在超小屏幕上进一步调整内边距和字体大小 */
    .units-table th,
    .units-table td {
        padding: 0.4rem;
        font-size: 0.7rem;
    }
    
    /* 确保表格内容在小屏幕上可读 */
    .units-table .inline-resource-icon {
        width: 24px;
        height: 24px;
    }
}