/* ==================== 组件样式 ==================== */

.domain-filter,
.form-select,
.modal-form-control,
.ajax-form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    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='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: calc(100% - 12px) center !important;
    background-size: 12px !important;
    padding-right: 32px !important;
    cursor: pointer;
    transition: var(--transition-fast);
}

.domain-filter:hover,
.form-select:hover,
.modal-form-control:hover,
.ajax-form-control:hover,
.domain-filter:focus,
.form-select:focus,
.modal-form-control:focus,
.ajax-form-control:focus,
.domain-filter:active,
.form-select:active,
.modal-form-control:active,
.ajax-form-control:active {
    background-position: calc(100% - 12px) center !important;
}

.domain-filter:focus,
.form-select:focus,
.modal-form-control:focus,
.ajax-form-control:focus {
    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='%233b82f6' d='M6 4l5 5H1z'/%3E%3C/svg%3E") !important;
}

.domain-filter option,
.form-select option,
.modal-form-control option,
.ajax-form-control option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 10px;
    font-size: var(--text-sm);
}

.domain-filter option:hover,
.domain-filter option:focus,
.domain-filter option:checked,
.form-select option:hover,
.form-select option:focus,
.form-select option:checked,
.modal-form-control option:hover,
.modal-form-control option:focus,
.modal-form-control option:checked,
.ajax-form-control option:hover,
.ajax-form-control option:focus,
.ajax-form-control option:checked {
    background: var(--accent-blue);
    color: white;
}

.domain-filter::-webkit-scrollbar,
.form-select::-webkit-scrollbar,
.modal-form-control::-webkit-scrollbar,
.ajax-form-control::-webkit-scrollbar {
    width: 8px;
}

.domain-filter::-webkit-scrollbar-track,
.form-select::-webkit-scrollbar-track,
.modal-form-control::-webkit-scrollbar-track,
.ajax-form-control::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}

.domain-filter::-webkit-scrollbar-thumb,
.form-select::-webkit-scrollbar-thumb,
.modal-form-control::-webkit-scrollbar-thumb,
.ajax-form-control::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: var(--radius-full);
}

.domain-filter::-webkit-scrollbar-thumb:hover,
.form-select::-webkit-scrollbar-thumb:hover,
.modal-form-control::-webkit-scrollbar-thumb:hover,
.ajax-form-control::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

[data-theme="dark"] .domain-filter,
[data-theme="dark"] .form-select,
[data-theme="dark"] .modal-form-control,
[data-theme="dark"] .ajax-form-control {
    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='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

[data-theme="dark"] .domain-filter:hover,
[data-theme="dark"] .form-select:hover,
[data-theme="dark"] .modal-form-control:hover,
[data-theme="dark"] .ajax-form-control:hover {
    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='%23e5e7eb' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.domain-filter:disabled,
.form-select:disabled,
.modal-form-control:disabled,
.ajax-form-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-tertiary);
    border-color: var(--border-glass);
}

[data-theme="dark"] .domain-filter:disabled,
[data-theme="dark"] .form-select:disabled,
[data-theme="dark"] .modal-form-control:disabled,
[data-theme="dark"] .ajax-form-control:disabled {
    background: var(--bg-tertiary);
    opacity: 0.6;
}

.status-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    vertical-align: middle;
}

.status-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.status-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--accent-red);
    transition: var(--transition-normal);
    border-radius: 24px;
}

.status-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition-normal);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.status-switch input:checked + .status-switch-slider {
    background-color: var(--accent-green);
}

.status-switch input:checked + .status-switch-slider:before {
    transform: translateX(20px);
}

.status-switch input:focus + .status-switch-slider {
    box-shadow: 0 0 1px var(--accent-green);
}

[data-theme="dark"] .status-switch-slider:before {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.mobile-card-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.mobile-card-footer .btn-xs {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 30px;
    box-shadow: none;
}

.mobile-card-footer .btn-xs:hover {
    box-shadow: none;
    transform: translateY(-1px);
}

.demo-section {
    margin-bottom: 24px;
}

.demo-section h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.demo-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.icon-category-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 20px 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-glass);
}

.icon-category-title:first-of-type {
    margin-top: 0;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-item:hover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.icon-item:active {
    transform: translateY(0);
}

.icon-item svg {
    color: var(--text-primary);
    flex-shrink: 0;
}

.icon-item span {
    font-size: 10px;
    color: var(--text-tertiary);
    text-align: center;
    line-height: 1.2;
    word-break: break-all;
}

@media (max-width: 640px) {
    .icon-grid {
        grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
        gap: 6px;
    }

    .icon-item {
        padding: 8px 2px;
    }

    .icon-item svg {
        width: 20px;
        height: 20px;
    }

    .icon-item span {
        font-size: 9px;
    }
}
