/* 演示申请弹出框样式 */
.demo-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.demo-popup-overlay.show {
    display: flex;
    opacity: 1;
}

.demo-popup-container {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(240, 77, 30, 0.3);
    border: 1px solid rgba(240, 77, 30, 0.2);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.demo-popup-overlay.show .demo-popup-container {
    transform: scale(1);
}

.demo-popup-header {
    text-align: center;
    margin-bottom: 30px;
}

.demo-popup-title {
    font-size: 28px;
    color: #fff;
    margin-bottom: 10px;
    font-weight: 600;
}

.demo-popup-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.demo-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.demo-popup-close:hover {
    background: rgba(240, 77, 30, 0.3);
    transform: rotate(90deg);
}

.demo-form-group {
    margin-bottom: 20px;
}

.demo-form-label {
    display: block;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
}

.demo-form-label .required {
    color: #f04d1e;
    margin-left: 2px;
}

.demo-form-input,
.demo-form-textarea {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.demo-form-select {
    width: 100%;
    padding: 12px 40px 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* 完全移除transition避免闪烁 */
    transition: none !important;
}

.demo-form-input:focus,
.demo-form-textarea:focus {
    outline: none;
    border-color: #f04d1e;
    background: rgba(255, 255, 255, 0.08);
}

/* 单独处理select的focus状态，避免背景色变化 */
.demo-form-select:focus {
    outline: none;
    border-color: #f04d1e;
    /* 保持背景色和图片不变，只改变边框 */
    background: rgba(255, 255, 255, 0.05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E") no-repeat right 15px center !important;
}

/* 完全禁用select的hover和active状态变化 */
.demo-form-select:hover,
.demo-form-select:active,
.demo-form-select:focus:active {
    background: rgba(255, 255, 255, 0.05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E") no-repeat right 15px center !important;
    border-color: rgba(255, 255, 255, 0.1);
    transition: none !important;
}

.demo-form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* 修复下拉选项背景色 */
.demo-form-select option {
    background: #1a1a2e;
    color: #fff;
    padding: 8px;
}

.demo-form-select optgroup {
    background: #0f0f1e;
    color: #f04d1e;
    font-weight: bold;
    padding: 8px;
}

/* 防止option选中时的闪烁 */
.demo-form-select option:checked,
.demo-form-select option:hover {
    background: rgba(240, 77, 30, 0.3) !important;
    color: #fff;
}

/* 自定义下拉框样式 */
.demo-custom-select {
    position: relative;
    width: 100%;
}

.demo-select-trigger {
    width: 100%;
    padding: 12px 40px 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.3s ease;
}

.demo-select-trigger:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.demo-select-trigger.active {
    border-color: #f04d1e;
}

.demo-select-arrow {
    position: absolute;
    right: 15px;
    color: rgba(255, 255, 255, 0.6);
    transition: transform 0.3s ease;
}

.demo-select-trigger.active .demo-select-arrow {
    transform: rotate(180deg);
}

.demo-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.demo-select-option {
    padding: 12px 15px;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.demo-select-option:hover {
    background: rgba(240, 77, 30, 0.3);
}

.demo-select-option.selected {
    background: rgba(240, 77, 30, 0.2);
    font-weight: 600;
}

.demo-select-options::-webkit-scrollbar {
    width: 8px;
}

.demo-select-options::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.demo-select-options::-webkit-scrollbar-thumb {
    background: rgba(240, 77, 30, 0.5);
    border-radius: 4px;
}

/* 强制覆盖所有select状态，彻底防止闪烁 */
.demo-form-select,
.demo-form-select:hover,
.demo-form-select:focus,
.demo-form-select:active,
.demo-form-select:focus:hover,
.demo-form-select:focus:active,
.demo-form-select[open] {
    background-color: rgba(255, 255, 255, 0.05) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
    transition: none !important;
    animation: none !important;
}

/* 禁用浏览器默认的focus样式 */
.demo-form-select::-moz-focus-inner {
    border: 0;
}

.demo-form-select:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 #fff;
}

.demo-form-textarea {
    min-height: 100px;
    resize: vertical;
}

.demo-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.demo-products-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
}

.demo-products-container::-webkit-scrollbar {
    width: 8px;
}

.demo-products-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.demo-products-container::-webkit-scrollbar-thumb {
    background: rgba(240, 77, 30, 0.5);
    border-radius: 4px;
}

.demo-product-category {
    margin-bottom: 20px;
}

.demo-category-header {
    display: flex;
    align-items: center;
    padding: 10px;
    background: rgba(240, 77, 30, 0.1);
    border-radius: 6px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.demo-category-header:hover {
    background: rgba(240, 77, 30, 0.2);
}

.demo-category-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
}

.demo-category-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    flex: 1;
}

.demo-category-toggle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    transition: transform 0.3s ease;
}

.demo-category-header.collapsed .demo-category-toggle {
    transform: rotate(-90deg);
}

.demo-subcategory-list {
    margin-left: 30px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    transition: all 0.3s ease;
}

.demo-category-header.collapsed + .demo-subcategory-list {
    display: none;
}

.demo-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.demo-product-checkbox {
    display: flex;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.demo-product-checkbox:hover {
    background: rgba(240, 77, 30, 0.1);
}

.demo-product-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
}

.demo-product-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
}

.demo-form-submit {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #f04d1e, #ff6b3d);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.demo-form-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(240, 77, 30, 0.4);
}

.demo-form-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.demo-error-message {
    color: #ff6b6b;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.demo-error-message.show {
    display: block;
}

.demo-success-message {
    text-align: center;
    padding: 40px;
    display: none;
}

.demo-success-icon {
    font-size: 64px;
    color: #4caf50;
    margin-bottom: 20px;
}

.demo-success-title {
    font-size: 24px;
    color: #fff;
    margin-bottom: 10px;
}

.demo-success-text {
    color: rgba(255, 255, 255, 0.7);
}

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

    .demo-form-row {
        grid-template-columns: 1fr;
    }

    .demo-products-grid {
        grid-template-columns: 1fr;
    }
}