.card-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Microsoft YaHei', sans-serif;
}

.card-category {
    margin-bottom: 30px;
}

.card-category h3, .denomination-container h3, .card-submit-container h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 0;
}

.category-item {
    width: 128px;
    height: 88px;
    border-radius: 6px;
    border: 2px solid #f0f0f0;
    box-shadow: none;
    padding: 6px 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-item:hover {
    border-color: #1890ff;
    background: #f5faff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.15);
}

.category-item:hover .card-type-logo {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.category-item.active {
    border-color: #1890ff;
    background: #fff;
    color: #1890ff;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.2);
}

.category-item.active .card-type-logo {
    box-shadow: 0 3px 6px rgba(24, 144, 255, 0.3);
}

.card-type-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card-logo-container {
    height: 48px;
    width: 48px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-type-logo {
    max-height: 44px;
    max-width: 44px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card-type-name {
    font-size: 15px !important;
    min-height: 22px !important;
    text-align: center;
    width: 100%;
    color: #333;
    margin-top: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3 !important;
    transition: all 0.2s;
    align-items: center;
    justify-content: center;
    word-break: break-all;
    font-weight: 400 !important;
}

.card-type-name.only-text {
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    min-height: 22px !important;
    height: auto;
    display: block;
    text-align: center;
    white-space: normal;
    word-break: break-all;
    padding: 0 6px;
    margin: auto 0;
    color: #333;
}

.category-item.active .card-type-name {
    color: #1890ff;
}

.denomination-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.denomination-item {
    padding: 12px 15px;
    border: 1px solid #eee;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.denomination-item:hover {
    border-color: #1890ff;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.1);
}

.denomination-item.active {
    background: #e6f7ff;
    border-color: #1890ff;
}

.denomination-value {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.denomination-discount {
    color: #666;
    margin-bottom: 5px;
    font-size: 14px;
}

.denomination-recycle {
    color: #ff4d4f;
    font-weight: bold;
    font-size: 15px;
}

.recycle-amount {
    color: #f56c6c;
    font-weight: bold;
    font-size: 15px;
}

.card-submit-container {
    margin-top: 30px;
    padding: 25px;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #f9f9f9;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    background-color: #fff;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: #1890ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.form-control::placeholder {
    color: #aaa;
}

#recycle-amount {
    background-color: #f5f5f5;
    color: #f56c6c;
    font-weight: bold;
}

/* 新增和改进的协议部分样式 */
.agreement-container {
    margin: 25px 0 15px;
}

.agreement-item {
    margin-bottom: 15px;
}

.custom-checkbox {
    display: block;
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
    line-height: 1.5;
    color: #555;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #eee;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.custom-checkbox:hover input ~ .checkmark {
    background-color: #e6f7ff;
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: #1890ff;
    border-color: #1890ff;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.custom-checkbox .checkmark:after {
    left: 6px;
    top: 2px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.agreement-link {
    color: #1890ff;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.agreement-link:hover {
    color: #40a9ff;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 25px;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    border-radius: 8px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 10;
    border: none;
    background: transparent;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close::before, .close::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: #aaa;
    transition: all 0.3s;
}

.close::before {
    transform: rotate(45deg);
}

.close::after {
    transform: rotate(-45deg);
}

.close:hover::before, 
.close:hover::after {
    background-color: #333;
    width: 28px;
}

.agreement-text {
    margin-top: 20px;
    line-height: 1.6;
    font-size: 14px;
    color: #555;
}

.agreement-text h4 {
    margin-bottom: 15px;
    color: #333;
}

.agreement-text p {
    margin-bottom: 10px;
}

.submit-btn {
    text-align: center;
    margin-top: 25px;
}

.btn-primary {
    background-color: #1890ff;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    width: 100%;
    max-width: 300px;
    font-weight: bold;
}

.btn-primary:hover {
    background-color: #40a9ff;
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.loading-text, .error-text {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 16px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .category-item {
        min-width: 100px;
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .denomination-list {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    
    .card-container {
        padding: 15px;
    }
    
    .face-value {
        font-size: 15px;
    }
    
    .recycle-amount {
        font-size: 14px;
    }
    
    .modal-content {
        width: 90%;
        margin: 15% auto;
        padding: 20px;
    }
    
    .btn-primary {
        padding: 10px 20px;
        max-width: 100%;
    }
    
    .main-type-btn {
        font-size: 13px;
        padding: 6px 0;
        height: 38px;
    }
    
    .main-type-btn .icon {
        font-size: 14px;
        margin-right: 4px;
    }
    
    .main-type-row {
        gap: 6px;
        margin-bottom: 6px;
    }

    .card-type-search-bar {
        display: flex;
        height: 40px;
        border: 1px solid #e0e0e0;
        border-radius: 4px;
        max-width: 100%;
    }

    .card-type-search-bar input {
        width: calc(100% - 80px);
        border: none;
        margin-bottom: 0;
    }

    #card-type-clear-btn {
        right: 85px;
    }

    #card-type-search-btn {
        width: 80px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* 主分类面板样式 */
.main-type-panel {
    margin-bottom: 15px;
    overflow: hidden;
}

.main-type-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: nowrap;
}

/* 主分类按钮样式 */
.main-type-btn {
    flex: 1;
    margin: 0;
    font-size: 15px;
    padding: 8px 0;
    border-radius: 8px;
    border: none;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
    opacity: 0.9;
    min-width: 80px;
    max-width: none;
    height: 42px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.main-type-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    opacity: 1;
}

.main-type-btn.active {
    box-shadow: 0 4px 16px rgba(24, 144, 255, 0.18);
    border: 2px solid #fff;
    filter: brightness(1.1);
    opacity: 1;
    transform: scale(1.05);
    z-index: 2;
}

.main-type-btn .icon {
    font-size: 16px;
    margin-right: 6px;
}

/* 主分类按钮颜色样式 - 改善对比度 */
.main-type-btn.type-huafei { background: linear-gradient(90deg,#9470d8 0%,#d966c8 100%); }
.main-type-btn.type-jiayou { background: linear-gradient(90deg,#25a384 0%,#0c4c87 100%); }
.main-type-btn.type-youxi { background: linear-gradient(90deg,#00b8b0 0%,#3a6ad8 100%); }
.main-type-btn.type-dianshang { background: linear-gradient(90deg,#e07c14 0%,#ffb700 100%); }
.main-type-btn.type-shangchao { background: linear-gradient(90deg,#e0399e 0%,#a01864 100%); }
.main-type-btn.type-meishi { background: linear-gradient(90deg,#e07c14 0%,#ffb700 100%); }
.main-type-btn.type-chuxing { background: linear-gradient(90deg,#3380cc 0%,#56ccf2 100%); }
.main-type-btn.type-yinyin { background: linear-gradient(90deg,#25a384 0%,#0c4c87 100%); }
.main-type-btn.type-other { background: #8662d8; }

/* 卡券搜索框样式 */
.card-type-search-bar {
    margin-bottom: 15px;
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 0;
    background: #f9f9f9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
    max-width: 600px;
}

.card-type-search-bar input {
    flex: 1;
    border: none;
    height: 40px;
    padding: 0 40px 0 15px;
    background: transparent;
    font-size: 14px;
}

.card-type-search-bar input:focus {
    outline: none;
    background: #fff;
}

#card-type-clear-btn {
    position: absolute;
    right: 90px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #666;
    font-size: 18px;
    width: 22px;
    height: 22px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    z-index: 2;
    background: #e0e0e0;
    display: none;
    transition: all 0.2s;
}

#card-type-clear-btn:hover {
    color: #333;
    background: #ccc;
    transform: translateY(-50%) scale(1.1);
}

#card-type-search-btn {
    margin: 0;
    border: none;
    height: 40px;
    width: 80px;
    border-radius: 0;
    background: #1890ff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

#card-type-search-btn:hover {
    background: #40a9ff;
}

#no-card-type-result {
    color: #999;
    margin: 10px 0;
    text-align: center;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 4px;
}

#submit-card.submitting {
    cursor: not-allowed;
    opacity: 0.75;
    position: relative;
}

#submit-card.submitting .fa-spinner {
    display: inline-block;
    margin-right: 5px;
}

/* 禁用悬停效果 */
#submit-card.submitting:hover {
    opacity: 0.75;
}