* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.5;
    background-image: linear-gradient(to bottom, #f9f9f9, #e9e9e9);
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 15px;
    background-color: #fff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    margin-top: 15px;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
}

.container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, #b71c1c, #e57373);
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

/* Logo相关样式 */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.logo {
    width: 50px;
    height: 50px;
    margin-right: 15px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.title-container {
    text-align: left;
}

header h1 {
    color: #b71c1c;
    margin-bottom: 5px;
    font-size: 2rem;
    position: relative;
    padding-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    text-align: left;
}

header h1::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 3px;
    background-color: #b71c1c;
    transform: none;
}

.subtitle {
    color: #666;
    font-size: 1rem;
    margin-bottom: 0;
    text-align: left;
}

/* 计算器样式 */
.calculator {
    margin-bottom: 20px;
}

.form-section {
    margin-bottom: 15px;
    padding: 12px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.form-section:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.form-section h2 {
    text-align: center;
    color: #b71c1c;
    margin-bottom: 15px;
    font-size: 1.3rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 12px;
}

/* 新增样式：表单行，用于并排显示表单元素 */
.form-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.half-width {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.version-group {
    justify-content: space-between;
}

.version-group label {
    flex: 1;
    min-width: 0;
    text-align: center;
    justify-content: center;
}

label {
    display: inline-block;
    margin-right: 8px;
    font-weight: bold;
    color: #444;
    font-size: 0.95rem;
}

/* 原始select样式 */
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px; /* 使用16px避免iOS上缩放 */
    margin-top: 4px;
    background-color: #fff;
    color: #333;
    transition: border-color 0.3s;
    
    /* 移除自定义外观，使用浏览器原生控件 */
    -webkit-appearance: menulist !important;
    -moz-appearance: menulist !important;
    appearance: menulist !important;
    
    /* 确保正确的z-index */
    position: relative;
    z-index: 50;
}

/* 针对Chrome浏览器的特殊处理 */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    select {
        background-image: none; /* 移除自定义下拉箭头 */
        padding-right: 10px; /* 调整右侧内边距 */
        height: auto;
    }
    
    /* 特别为Chrome移动版优化hero-select */
    #hero-select {
        border: 1px solid #b71c1c;
    }
}

select:focus {
    outline: none;
    border-color: #b71c1c;
    box-shadow: 0 0 0 2px rgba(183, 28, 28, 0.2);
    z-index: 60;
}

/* 覆盖移动设备上的select样式 */
@media (max-width: 768px) {
    select {
        /* 增强移动设备上的可用性 */
        font-size: 16px; /* 防止iOS上自动缩放 */
        line-height: 1.3;
        height: auto;
        min-height: 40px; /* 确保足够的点击区域 */
        
        /* 强制使用原生控件，无自定义样式 */
        -webkit-appearance: menulist !important;
        -moz-appearance: menulist !important;
        appearance: menulist !important;
        background-image: none !important;
        background-size: 0 !important;
        
        /* 确保可见性 */
        opacity: 1;
        display: block;
    }
    
    /* Chrome特定样式优化 */
    #hero-select {
        background-color: #fff !important; 
        color: #333 !important;
    }
    
    /* 防止任何可能的父元素overflow:hidden造成的问题 */
    .form-group {
        overflow: visible;
    }
}

@media (max-width: 360px) {
    select {
        font-size: 14px;
        padding: 8px;
        min-height: 36px;
    }
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.radio-group label {
    display: inline-flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
    background-color: #f0f0f0;
    transition: all 0.2s;
    margin-right: 0;
    font-size: 0.9rem;
}

.radio-group label:hover {
    background-color: #e6e6e6;
}

.radio-group input[type="radio"] {
    margin-right: 6px;
}

.radio-group input[type="radio"]:checked + span {
    font-weight: bold;
    color: #b71c1c;
}

.radio-group label:has(input[type="radio"]:checked) {
    background-color: #fff;
    border: 1px solid #b71c1c;
    box-shadow: 0 2px 5px rgba(183, 28, 28, 0.1);
}

/* 为不支持:has()选择器的浏览器添加兼容样式 */
.radio-group label.active {
    background-color: #fff;
    border: 1px solid #b71c1c;
    box-shadow: 0 2px 5px rgba(183, 28, 28, 0.1);
}

#bag-corner-container {
    margin-top: 15px;
    margin-bottom: 15px;
}

#bag-corner-container label {
    display: inline-flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 4px;
    background-color: #f0f0f0;
    transition: all 0.2s;
}

#bag-corner-container label:hover {
    background-color: #e6e6e6;
}

#bag-corner-container input[type="checkbox"] {
    margin-right: 8px;
}

#bag-corner-container input[type="checkbox"]:checked + span {
    font-weight: bold;
    color: #b71c1c;
}

#bag-corner-container label:has(input[type="checkbox"]:checked) {
    background-color: #fff;
    border: 1px solid #b71c1c;
    box-shadow: 0 2px 5px rgba(183, 28, 28, 0.1);
}

/* 为不支持:has()选择器的浏览器添加兼容样式 */
#bag-corner-container label.active {
    background-color: #fff;
    border: 1px solid #b71c1c;
    box-shadow: 0 2px 5px rgba(183, 28, 28, 0.1);
}

.form-actions {
    margin-top: 15px;
}

.primary-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #b71c1c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.primary-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transition: all 0.6s;
}

.primary-btn:hover {
    background-color: #8c1515;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(140, 21, 21, 0.3);
}

.primary-btn:hover::before {
    left: 100%;
}

.primary-btn:active {
    transform: translateY(1px);
}

.result-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #b71c1c;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: none;
}

.result-section.active {
    opacity: 1;
}

.result-section h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #b71c1c;
    font-size: 1.6rem;
    position: relative;
    padding-bottom: 10px;
}

.result-section h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background-color: #b71c1c;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-info {
    margin-bottom: 15px;
    font-size: 0.95rem;
    line-height: 1.6;
    background-color: #fff;
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.card-info p {
    margin-bottom: 8px;
}

.card-info p:last-child {
    margin-bottom: 0;
}

.card-info strong {
    color: #444;
    display: inline-block;
    width: 80px;
}

.card-price {
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    color: #b71c1c;
    background-color: #fff;
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.price {
    font-size: 28px;
    color: #b71c1c;
    font-weight: bold;
    display: inline-block;
    margin-left: 10px;
    background: linear-gradient(120deg, #b71c1c, #e57373);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

#price-display {
    position: relative;
    display: inline-block;
}

.estimated-notice {
    font-size: 14px;
    color: #777;
    margin-top: 10px;
    font-style: italic;
    text-align: center;
    padding: 5px 10px;
    background-color: rgba(255, 248, 225, 0.5);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.estimated-notice:hover {
    background-color: rgba(255, 248, 225, 0.8);
}

/* 页脚样式 */
footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 14px;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-logo {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.footer-logo:hover {
    transform: scale(1.1);
}

footer p {
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 12px;
    }
    
    .logo {
        width: 40px;
        height: 40px;
        margin-right: 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
        padding-bottom: 8px;
    }
    
    header h1::after {
        width: 60px;
        height: 2px;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .form-section {
        padding: 10px;
    }
    
    .form-section h2 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .form-group {
        margin-bottom: 10px;
    }
    
    label {
        font-size: 0.9rem;
    }
    
    .radio-group {
        gap: 8px;
    }
    
    .radio-group label {
        padding: 5px 10px;
        font-size: 0.85rem;
        width: auto; /* 改为自适应宽度，不再是100% */
        flex: 1;
        min-width: 80px;
        justify-content: center;
        text-align: center;
    }
    
    .radio-group input[type="radio"] {
        margin-right: 4px;
    }
    
    .primary-btn {
        padding: 10px;
        font-size: 15px;
    }
    
    .card-info {
        font-size: 0.9rem;
        padding: 10px;
    }
    
    .card-info strong {
        width: auto;
        margin-right: 5px;
        min-width: 70px;
    }
    
    .card-price {
        font-size: 20px;
        padding: 10px;
    }
    
    .price {
        font-size: 24px;
    }
    
    /* 调整版本选择器在手机上的显示 */
    .form-group:has(.radio-group) .radio-group {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    /* 针对表单行的移动端调整 */
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .half-width {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .half-width:last-child {
        margin-bottom: 0;
    }
    
    .version-group label {
        flex-basis: 30%;
        padding: 5px 8px;
    }
    
    .history-toggle-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    footer {
        margin-top: 20px;
        padding-top: 12px;
        font-size: 12px;
    }
    
    .footer-logo {
        width: 25px;
        height: 25px;
        margin-right: 8px;
    }
}

/* 针对特小屏幕设备的调整 */
@media (max-width: 360px) {
    .container {
        margin: 5px;
        padding: 10px;
    }
    
    .logo {
        width: 35px;
        height: 35px;
        margin-right: 8px;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    .logo-container {
        flex-direction: column;
        margin-bottom: 5px;
    }
    
    .title-container {
        text-align: center;
    }
    
    header h1::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .subtitle {
        text-align: center;
    }
    
    .radio-group label {
        padding: 4px 8px;
        font-size: 0.8rem;
        min-width: 70px;
    }
    
    .card-info {
        font-size: 0.85rem;
    }
    
    .card-price {
        font-size: 18px;
    }
    
    .price {
        font-size: 22px;
    }
    
    .version-group label {
        flex-basis: 32%;
        min-width: 0;
        padding: 4px 4px;
    }
    
    .history-toggle-btn {
        padding: 5px 10px;
        font-size: 12px;
        top: auto;
        right: 5px;
        margin-top: 10px;
        position: relative;
        display: block;
        width: 100%;
        max-width: 150px;
        margin: 0 auto;
    }
    
    header {
        padding-bottom: 45px;
    }
    
    footer {
        margin-top: 15px;
        padding-top: 10px;
    }
    
    .footer-logo {
        width: 22px;
        height: 22px;
        margin-right: 6px;
    }
}

.info-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #b71c1c;
    color: white;
    text-align: center;
    line-height: 18px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
    transition: all 0.2s;
    opacity: 0.8;
    font-weight: bold;
    position: relative;
}

.info-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

.tooltip {
    position: absolute;
    left: 50%;
    top: 25px;
    transform: translateX(-50%);
    z-index: 100;
    width: 260px;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    padding: 15px;
    display: none;
    font-weight: normal;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    border-left: 3px solid #b71c1c;
}

/* 添加小三角形指示器 */
.tooltip::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent white transparent;
}

.tooltip p {
    margin-bottom: 8px;
}

.tooltip p:last-child {
    margin-bottom: 0;
}

.info-icon:hover + .tooltip,
.tooltip:hover {
    display: block;
}

/* 历史记录相关样式 */
.history-toggle-btn {
    position: absolute;
    top: 0;
    right: 0;
    padding: 8px 15px;
    background-color: #b71c1c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.history-toggle-btn:hover {
    background-color: #8c1515;
    transform: translateY(-2px);
}

.history-panel {
    display: none;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    border-left: 4px solid #b71c1c;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.history-header h3 {
    color: #b71c1c;
    margin: 0;
}

.clear-history-btn {
    padding: 5px 10px;
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.clear-history-btn:hover {
    background-color: #eee;
    color: #333;
}

.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}

.history-list li {
    margin-bottom: 10px;
    padding: 10px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s;
}

.history-list li:hover {
    background-color: #f5f5f5;
    transform: translateY(-2px);
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
}

.history-list li:last-child {
    margin-bottom: 0;
}

.history-item {
    position: relative;
}

.history-date {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.history-hero {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.history-details {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.history-price {
    font-size: 16px;
    font-weight: bold;
    color: #b71c1c;
}

.price-value {
    color: #b71c1c;
    font-size: 18px;
}

.estimated-tag {
    font-size: 12px;
    color: #ff9800;
    font-weight: normal;
    margin-left: 5px;
}

.empty-history {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

/* 特别为hero-select添加样式 */
#hero-select {
    max-height: none; /* 移除高度限制，交给浏览器原生控件处理 */
    overflow: visible; /* 移除overflow限制 */
    z-index: 50; /* 确保下拉列表在最上层 */
    background-color: #fff;
    color: #333; /* 确保文本颜色可见 */
}

/* 水浒英雄下拉框专用容器 */
.hero-select-container {
    position: relative;
    overflow: visible;
    z-index: 50;
}

.hero-select-container select {
    display: block;
    width: 100%;
    background-color: #fff !important;
    color: #333 !important;
}

/* 针对Chrome的特殊样式 */
@supports (-webkit-appearance:none) {
    #hero-select {
        -webkit-appearance: menulist !important;
        appearance: menulist !important;
        background-color: #fff !important;
        color: #333 !important;
        border: 1px solid #ddd;
    }
    
    #hero-select:focus {
        border-color: #b71c1c;
    }
}

/* 确保Chrome响应式支持 */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    @media (max-width: 768px) {
        .hero-select-container select,
        #hero-select {
            font-size: 16px !important;
            padding: 10px !important;
            -webkit-appearance: menulist !important;
            appearance: menulist !important;
            height: auto !important;
            border: 1px solid #b71c1c !important;
        }
    }
} 