/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    padding-top: 80px;
    padding-bottom: 100px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 主内容区 */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    flex: 1;
    justify-content: center;
}

/* 武学选择区 */
.martial-arts-section {
    background: #f5af19;
    padding: 10px 20px;
    width: 100%;
    max-width: 800px;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    box-sizing: border-box;
    border-radius: 0 0 12px 12px;
}

.martial-arts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    width: 100%;
}

.school-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex: 0 0 auto;
}

.weapon-select-form {
    flex: 1;
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
}
/* 上下10px，左右15px的内边距，控制内部文字与边框的距离 */
.school-select,
.weapon-select {
    padding: 10px 5px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
    width: 70%;
    text-align: center;
}

.school-select option,
.weapon-select option {
    color: #333;
    background: white;
}

.school-select:focus,
.weapon-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
}

.weapon-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    flex: 0 0 auto;
}

/* 等级选择区 */
.level-section {
    margin-bottom: 5%;
    width: 100%;
}

.level-inputs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.level-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.level-input,
.level-select {
    width: 100px;
    height: 50px;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    border: 2px solid #f5af19;
    border-radius: 8px;
    background: white;
    color: #f5af19;
}

.level-select {
    padding: 0 10px;
    cursor: pointer;
}

.level-input:focus,
.level-select:focus {
    outline: none;
    border-color: #f5af19;
}

.level-label {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.level-arrow {
    font-size: 2rem;
    color: #f5af19;
    font-weight: bold;
    align-self: flex-start;
    margin-top: 0;
    display: flex;
    align-items: center;
    height: 50px;
}

/* 材料区 */
.materials-section {
    background: #f5af19;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 50px;
    width: 100%;
}

.materials-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.single-material {
    display: flex;
    flex-direction: column;
}

.single-material h4 {
    font-size: 1.1rem;
    color: white;
    margin-bottom: 10px;
    text-align: center;
    font-weight: normal;
}

.single-material .material-name-title {
    color: white;
    font-weight: normal;
}

/* 价格预估区 */
.price-section-inner {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 800px;
    width: 100%;
    background: #f5af19;
    border-radius: 12px 12px 0 0;
    padding: 15px 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    box-sizing: border-box;
}

/* 材料展示布局 */
.material-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 0 0px 0px 0px;
    min-height: 200px;
}

.material-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 150px;
    max-width: 300px;
    gap: 0px;
    position: relative;
}

.material-name-below {
    color: white;
    font-weight: normal;
    font-size: 1rem;
    text-align: center;
    margin: 0;
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.material-icon {
    width: 100%;
    max-width: 250px;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    display: block;
}

.material-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
    max-width: 400px;
}

.material-info-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.info-label {
    font-size: 1.2rem;
    color: white;
    font-weight: bold;
    min-width: 100px;
    text-align: right;
    padding-top: 10px;
}

.info-input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.info-input {
    width: 120px;
    height: 30px;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.3);
    color: #333;
    padding: 0;
    box-sizing: border-box;
}

.info-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.5);
}

.info-value {
    width: 120px;
    height: 50px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    text-align: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

.info-hint {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: normal;
    text-align: center;
}

.price-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.price-estimate {
    background: #f5af19;
    padding: 10px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    min-width: 120px;
}

.price-label {
    font-size: 0.9rem;
    color: #333;
}

.price-value {
    font-size: 2rem;
    font-weight: bold;
    color: white;
}

.btn-add-more {
    background: white;
    color: #f5af19;
    border: 2px solid #f5af19;
    padding: 18px 25px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 120px;
    text-align: center;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    height: 60px;
    line-height: 1;
}

.btn-add-more:hover {
    background: #f5af19;
    color: white;
    transform: translateY(-2px);
}

.btn-checkout {
    background: white;
    color: #f5af19;
    border: 2px solid #f5af19;
    padding: 18px 25px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 120px;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: 60px;
    line-height: 1;
}

.btn-checkout:hover {
    background: #f5af19;
    color: white;
    transform: translateY(-2px);
}

.cart-link {
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: #333;
    position: relative;
    background: #f5af19;
    padding: 20px;
    border-radius: 12px;
    min-width: 80px;
    justify-content: center;
}

.cart-icon-img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.cart-badge {
    background: #333;
    color: #f5af19;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
    position: absolute;
    top: -1px;
    right: 5px;
}

/* 提示消息 */
.toast {
    position: fixed;
    bottom: 130px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(40, 167, 69, 0.9);
    color: white;
    padding: 10px 10px;
    border-radius: 25px;
    animation: slideUp 0.3s ease, fadeOut 0.3s ease 2.7s;
    z-index: 1000;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .martial-arts-header {
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 10px;
    }

    .weapon-select-form {
        flex: 1;
        min-width: 0;
    }

    .school-select,
    .weapon-select {
        flex: 1;
        min-width: 0;
    }

    .level-inputs {
        gap: 15px;
        flex-wrap: wrap;
    }

    .material-display {
        gap: 10px;
        padding: 10px;
        flex-direction: row;
        align-items: center;
        min-height: auto;
    }

    .material-image {
        min-width: 80px;
        max-width: 100px;
        flex: 0 0 auto;
        flex-direction: column;
        gap: 5px;
    }

    .material-name-below {
        font-size: 0.85rem;
        bottom: 5px;
    }

    .material-icon {
        max-width: 100px;
    }

    .material-info {
        width: 100%;
        max-width: 220px;
    }

    .material-info-row {
        gap: 5px;
        justify-content: center;
        align-items: flex-start;
    }

    .info-label {
        font-size: 0.85rem;
        min-width: 60px;
        padding-top: 5px;
    }

    .info-input-wrapper {
        gap: 2px;
    }

    .info-input,
    .info-value {
        width: 60px;
        height: 25px;
        font-size: 1rem;
    }

    .info-hint {
        font-size: 0.65rem;
    }

    .price-actions {
        gap: 8px;
        flex-wrap: nowrap;
    }

    .price-estimate {
        flex: 0 0 auto;
        min-width: 80px;
        padding: 5px;
    }

    .btn-add-more {
        flex: 0 0 auto;
        min-width: 80px;
        padding: 8px 10px;
        font-size: 0.9rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 40px;
        line-height: 1;
    }

    .btn-checkout {
        flex: 0 0 auto;
        min-width: 80px;
        padding: 8px 10px;
        font-size: 0.9rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 40px;
        line-height: 1;
    }

    .cart-link {
        font-size: 1.5rem;
        padding: 10px;
    }
}
