* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', serif;
    background-image: url('../assets/images/page_backgrounds/hre-background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    color: #333;
    transition: opacity 0.5s ease;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 10px;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2.5rem;
    color: white;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 
        1px 1px 2px rgba(0, 0, 0, 0.8),
        2px 2px 4px rgba(0, 0, 0, 0.6),
        4px 4px 8px rgba(0, 0, 0, 0.4);
    font-family: 'Noto Serif SC', 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'WenQuanYi Micro Hei', Arial, sans-serif;
}



/* 民族旗帜按钮容器 */
.civ-buttons-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 30px;
}

/* 民族旗帜按钮样式 */
.civ-buttons {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 10px;
    scrollbar-width: thin;
    scrollbar-color: #ddd #f5f5f5;
    min-height: 70px;
    max-width: fit-content;
}

/* 滚动条样式 */
.civ-buttons {  
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.6) rgba(0, 0, 0, 0.2);
}

.civ-buttons::-webkit-scrollbar {
    height: 8px;
    background-color: rgba(0, 0, 0, 0.2);
}

.civ-buttons::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.civ-buttons::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.civ-buttons::-webkit-scrollbar-track {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.civ-btn {
    width: 80px;
    height: 50px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    overflow: hidden;
    padding: 0;
}

.civ-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.civ-btn.active {
    transform: scale(1.05);
    border-color: #ffff00;
    box-shadow: 0 0 0 2px rgba(136, 136, 136, 0.2);
}

/* 民族特性栏样式 */
.civ-feature-bar {
    text-align: center;
    color: #87cefa;
    font-size: 16px;
    margin-bottom: 20px;
    padding: 10px 0;
    min-height: 20px;
    transition: all 0.3s ease;
}

/* 卡牌容器 */
.cards-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1740px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

/* 卡牌行 */
.card-row {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: #ddd #f5f5f5;
    min-height: 260px;
    align-items: flex-start;
}

.card-row.fixed-row {
    overflow-x: auto;
    justify-content: flex-start;
    flex-wrap: nowrap;
    margin: 0 0 20px 0;
    padding: 0;
}

.card-row.fixed-row.fixed-row-1 {
    max-width: calc(200px * 6 + 15px * 5);
}

.card-row.fixed-row.fixed-row-2 {
    max-width: calc(200px * 6 + 15px * 5);
}

.card-row.fixed-row.fixed-row-3 {
    max-width: calc(200px * 8 + 15px * 7);
}

/* 卡牌防重叠 */
.card {
    box-sizing: border-box;
    flex-shrink: 0;
    flex-grow: 0;
}

/* 卡牌行滚动条样式 */
.card-row {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.6) rgba(0, 0, 0, 0.2);
}

.card-row::-webkit-scrollbar {
    height: 8px;
    background-color: rgba(0, 0, 0, 0.2);
}

.card-row::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.card-row::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.card-row::-webkit-scrollbar-track {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

/* 按钮样式 */
.tools-switcher {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.tools-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50px;
    padding: 10px 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* 按钮bar边框 */
.tools-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50px;
    padding: 2px;
    background: #664422;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.tools-toggle {
    position: relative;
    background: transparent;
    border: none; 
    outline: none; 
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
    padding: 0; 
    margin: 0; 
    -webkit-appearance: none; 
    -moz-appearance: none; 
    appearance: none; 
}

.tools-toggle:hover {
    transform: scale(1.1);
}

.tools-icon {
    width: 36px;
    height: 36px;
    display: block;
    border: none; 
    outline: none; 
}

.tools-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: none; 
    outline: none; 
    background: transparent; 
}

/* 其它工具图标上色 */
.utils-icon img {
    filter: invert(85%) sepia(56%) saturate(364%) hue-rotate(350deg) brightness(105%) contrast(95%);
}

/* 更新信息图标上色 */
.infos-icon img {
    filter: invert(85%) sepia(56%) saturate(364%) hue-rotate(350deg) brightness(105%) contrast(95%);
}

/* 更新信息文字样式 */
.tools-information a{
    color: white;
    text-decoration: none;
    display: block;
    margin: 5px 0;
    font-size: 14px;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

/* 按钮无轮廓 */
.tools-toggle:focus,
.tools-toggle:active,
.tools-toggle:hover {
    outline: none;
    border: none;
}

.tools-menu {
    position: absolute;
    top: -210px;
    left: -10px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: row;
    gap: 20px;
    transition: all 0.3s ease;
}

/* 工具栏边框效果 */
.tools-menu::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    padding: 2px;
    background: #664422;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: all 0.3s ease;
}

.tools-menu:not(.fade-out) {
    opacity: 1;
    transform: translateY(0);
}

.tools-menu.fade-out {
    opacity: 0;
    transform: translateY(10px);
}

.tools-menu::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 18px;
    border-width: 10px;
    border-style: solid;
    border-color: #664422 transparent transparent transparent;
    z-index: 0;
    pointer-events: none;
}

/* 指向箭头内填充 */
.tools-menu::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    padding: 2px;
    background: #664422;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1;
}

/* 内部黑色箭头 */
.tools-menu-inner-arrow {
    position: absolute;
    bottom: -16px;
    left: 20px;
    border-width: 8px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
    z-index: 2;
    pointer-events: none;
}

.tools-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tools-section a {
    color: white;
    text-decoration: none;
    display: block;
    margin: 0;
    font-size: 15px;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

.tools-section-title {
    font-size: 16px;
    font-weight: bold;
    color: #f9d787;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 4px;
    border-bottom: 1px solid transparent;
    background-image: linear-gradient(to right, rgba(249, 215, 135, 0.3), rgba(249, 215, 135, 0.8), rgba(249, 215, 135, 0.3));
    background-size: 100% 1px;
    background-repeat: no-repeat;
    background-position: bottom;
}

.tool-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    text-align: left;
    white-space: nowrap;
    text-decoration: none;
    min-width: 160px;
    font-weight: bold;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(5px);
    text-decoration: none;
}

.tool-btn:active {
    text-decoration: none;
}

/* 当前壁纸标记样式 */
.current-theme {
    color: #ffff00;
    font-size: 12px;
    margin-left: 5px;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tools-switcher {
        bottom: 20px;
        left: 20px;
    }
    
    .tools-bar {
        padding: 8px 12px;
        gap: 8px;
    }
    
    .tools-toggle {
        width: 40px;
        height: 40px;
    }
    
    .tools-icon {
        width: 28px;
        height: 28px;
    }
    
    .tools-menu {
        padding: 16px;
        gap: 15px;
    }
    
    .tool-btn {
        font-size: 16px;
        padding: 6px 10px;
        min-width: 120px;
    }
    
    .tools-section-title {
        font-size: 16px;
    }
}

/* 卡牌样式 */
.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 2px;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 200px;
    aspect-ratio: 4 / 5;
    min-width: 150px;
    min-height: 187.5px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 卡牌边框效果 */
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    padding: 2px;
    background: #664422;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* 卡牌内容样式 */
.card-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    padding: 0;
    margin: 0;
}

/* 特定卡牌对比度提升 */
.civ-3 .card-content, 
.civ-8 .card-content, 
.civ-25 .card-content  
{
    background: 
        linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.1) 30%, rgba(0, 0, 0, 0) 100%),
        linear-gradient(to top, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.1) 30%, rgba(0, 0, 0, 0) 100%);
}

/* 统一首行外元素字体样式 */
.card-row-2, .card-row-3, .card-tech, .card-unit {
    font-size: 16px;
    font-weight: normal;
    line-height: 1.2;
    margin: 0;
    padding: 0;
    word-wrap: break-word;
    white-space: normal;
}

/* 首行样式 */
.card-row-1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    margin: 0;
    height: auto;
    color: #f9d787;
}

.card-level {
    font-size: 22px;
    font-weight: bold;
    margin: 0;
    padding: 0;
    line-height: 1.5;
    color: #f9d787;
}

.card-id {
    text-align: center;
    font-size: 15px;
    font-weight: bold;
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.5;
    color: #f9d787;
   justify-content: center;
    color: #f9d787;
}

.card-question {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-question::before {
    content: '?';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 2px solid #f9d787;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    line-height: 14px;
    margin: 0;
    padding: 0;
    color: #f9d787;
}

/* 每轮新增行样式 */
.card-row-2 {
    font-size: 16px;
    margin: 0;
    padding: 0;
    line-height: 1.2;
    color: white;
}

/* 公共卡卡牌描述样式 */
.card-row-2-desc {
    font-size: 15px;
    margin: 0;
    padding: 0;
    line-height: 1.2;
    color: white;
}

/* 卡牌单位行样式 */
.card-row-3 {
    font-size: 16px;
    font-weight: normal;
    margin: 0;
    padding: 0;
    line-height: 1.2;
    color: #f19c01;
    word-wrap: break-word;
    white-space: normal;
}

/* 卡牌词条行样式 */
.card-row-1-5 {
    font-size: 16px;
    font-weight: normal;
    line-height: 1.2;
    margin: 0;
    padding: 0;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    width: 100%;
    min-width: 100%;
    word-wrap: break-word;
    white-space: normal;
}

/* 词条容器 */
.card-stats {
    display: block;
    margin: 5px 0;
    line-height: 1;
    width: 100%;
}

/* 卡牌词条文字样式 */
.stat-text {
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: normal;
    margin: 0 -2px 0 0;
    padding: 0;
    display: inline;
    line-height: 1;
}

/* 词条默认颜色 */
.stat-text.stat-AUTARKY1,
.card-row-1-6.stat-AUTARKY1 {
    color: #6baf74 !important;
}

.stat-text.stat-AUTARKY3,
.card-row-1-6.stat-AUTARKY3 {
    color: #6baf74 !important;
}

.stat-text.stat-AUTARKY1_dragon,
.card-row-1-6.stat-AUTARKY1_dragon {
    color: #6baf74 !important;
}

.stat-text.stat-Will_of_the_victor,
.card-row-1-6.stat-Will_of_the_victor {
    color: #2277a1 !important;
}

.stat-text.stat-Transfer,
.card-row-1-6.stat-Transfer {
    color: #2277a1 !important;
}

.stat-text.stat-Resilience,
.card-row-1-6.stat-Resilience {
    color: #2277a1 !important;
}

.stat-text.stat-Burning_Fate,
.card-row-1-6.stat-Burning_Fate,
.stat-text.stat-Burning_Fate_dragon,
.card-row-1-6.stat-Burning_Fate_dragon {
    color: #e18b08 !important;
}

.stat-text.stat-Scratch_card2,
.card-row-1-6.stat-Scratch_card2 {
    color: #00e8e8 !important;
}

.stat-text.stat-Scratch_card4,
.card-row-1-6.stat-Scratch_card4 {
    color: #00e8e8 !important;
}

.stat-text.stat-Technology_Transfer,
.card-row-1-6.stat-Technology_Transfer {
    color: #2277a1 !important;
}

.stat-text.stat-Bloodbath,
.card-row-1-6.stat-Bloodbath {
    color: #2277a1 !important;
}

.stat-text.stat-DIVERCITY,
.card-row-1-6.stat-DIVERCITY {
    color: #6baf74 !important;
}

.stat-text.stat-DIVERCITY_dragon,
.card-row-1-6.stat-DIVERCITY_dragon {
    color: #6baf74 !important;
}

.stat-text.stat-Support,
.card-row-1-6.stat-Support {
    color: #6baf74 !important;
}

.stat-text.stat-AURA,
.card-row-1-6.stat-AURA {
    color: #f65bb2 !important;
}

/* 词条描述行样式 */
.card-row-1-6 {
    font-size: 13px;
    font-weight: normal;
    line-height: 1.2;
    margin: 2px 0;
    padding: 0;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    word-wrap: break-word;
    white-space: normal;
}

/* 词条描述颜色 */
.stat-text.stat-AUTARKY1 {
    color: #6baf74 !important;
}

.stat-text.stat-AUTARKY3 {
    color: #6baf74 !important;
}

.stat-text.stat-AUTARKY1_dragon {
    color: #6baf74 !important;
}

.stat-text.stat-Will_of_the_victor {
    color: #2277a1 !important;
}

.stat-text.stat-Transfer {
    color: #2277a1 !important;
}

.stat-text.stat-Resilience {
    color: #2277a1 !important;
}

.stat-text.stat-Burning_Fate,
.stat-text.stat-Burning_Fate_dragon {
    color: #e18b08 !important;
}

.stat-text.stat-Scratch_card2 {
    color: #00e8e8 !important;
}

.stat-text.stat-Scratch_card4 {
    color: #00e8e8 !important;
}

.stat-text.stat-Technology_Transfer {
    color: #2277a1 !important;
}

.stat-text.stat-Bloodbath {
    color: #2277a1 !important;
}

.stat-text.stat-DIVERCITY {
    color: #6baf74 !important;
}

.stat-text.stat-DIVERCITY_dragon {
    color: #6baf74 !important;
}

.stat-text.stat-Support {
    color: #6baf74 !important;
}

.stat-text.stat-AURA {
    color: #f65bb2 !important;
}

/* 卡牌科技/单位行样式 */
.card-footer {
    margin-top: auto;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0;
    padding-top: 5px;
    border-top: none;
    padding-left: 0;
}

.card-tech {
    font-size: 16px;
    text-align: left;
    margin: 0;
    padding: 0;
    color: #84c8f3;
}

.card-unit {
    font-size: 16px;
    text-align: left;
    margin: 0;
    padding: 0;
    color: #84c8f3;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Tooltip样式 */
.tooltip-wrapper {
    position: relative;
    display: inline-block;
    z-index: 1000;
}

.tooltip-trigger {
    cursor: help;
}

.tooltip-content {
    position: fixed;
    transform: translate(-50%, 0);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 9999;
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent rgba(0, 0, 0, 0.8) transparent;
}

/* ayycmp单位行字体颜色 */
.card.civ-3 .card-row-3 {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.card.civ-3 .card-unit-quantity {
    color: #ffffff;
}

/* cursader单位行字体颜色 */
.card.civ-8 .card-row-3 {
    color: #cc0000;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.card.civ-8 .card-unit-quantity {
    color: #cc0000;
}

/* 选中的词条文字颜色 */
.stat-text.active {
    color: #ffff00 !important;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 255, 0, 0.8);
}

/* 响应式设计 */
@media (max-width: 768px) {

    h1 {
        font-size: 1.8rem;
    }
}