/* ----------------------------------------------------------------
    Input + Button 组合样式 - 现代扁平风格
    所有类名带 hc- 前缀，方便识别
-----------------------------------------------------------------*/

/* ==================== 现代扁平风格 ==================== */
.hc-input-group-modern {
    display: flex;
    align-items: stretch;
    width: 100%;
    background: #f8f9fa;
    border-radius: 0.1rem;
    overflow: visible;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

.hc-input-group-modern:focus-within {
    background: #fff;
    box-shadow: 0 0.25rem 1rem rgba(14, 88, 173, 0.15);
}

.hc-input-group-modern .form-control {
    border: none;
    background: transparent;
    padding: 0.7rem 0.875rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 0;
}

.hc-input-group-modern .form-control:focus {
    outline: none;
    box-shadow: none;
}

.hc-input-group-modern .form-control::placeholder {
    color: #868e96;
}

.hc-input-group-modern .form-select {
    border: none;
    border-right: 0.0625rem solid #e9ecef;
    background: transparent;
    padding: 0.7rem 0.7rem;
    font-size: 0.875rem;
    min-width: 7.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0;
}

.hc-input-group-modern .form-select:focus {
    outline: none;
    box-shadow: none;
}

.hc-input-group-modern.has-select .form-select:focus {
    outline: none;
    box-shadow: none;
    background-color: transparent;
}

.hc-input-group-modern.has-input-icon .form-control.hc-pl-3 {
    padding-left: 1.5rem;
}

.hc-input-group-modern .btn {
    border: none;
    border-radius: 0;
    padding: 0.7rem 1.225rem;
    font-size: 0.875rem;
    font-weight: 600;
    background: #0078D7;
    color: #fff;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}

.hc-input-group-modern .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.hc-input-group-modern .btn:hover {
    background: #0a4a8f;
}

.hc-input-group-modern .btn:hover::before {
    left: 100%;
}


/* ==================== 前置图标样式 ==================== */
.hc-input-group-modern .hc-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.525rem 0 0.7rem;
    color: #868e96;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.hc-input-group-modern .hc-input-icon i,
.hc-input-group-modern .hc-input-icon svg {
    width: 0.875rem;
    height: 0.875rem;
}

.hc-input-group-modern:focus-within .hc-input-icon {
    color: #0e58ad;
}

.hc-input-group-modern.has-icon .form-control {
    padding-left: 0.5rem;
}

/* 自定义下拉选择组件 */
.hc-custom-select {
    position: static;
    flex-shrink: 0;
    min-width: 7rem;
    max-width: 11rem;
    cursor: pointer;
    user-select: none;
}

.hc-custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    height: 100%;
}

.hc-custom-select-text {
    font-size: 1rem;
    color: #495057;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hc-custom-select-arrow {
    width: 0.75rem;
    height: 0.75rem;
    margin-left: 1rem;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%230e58ad' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: transform 0.2s ease;
}

.hc-custom-select.open .hc-custom-select-arrow {
    transform: rotate(180deg);
}

.hc-custom-select-dropdown {
    position: absolute;
    top: calc(100% + 0.0625rem);
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    padding: 0.375rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.5rem);
    transition: all 0.2s ease;
    z-index: 100;
}

.hc-custom-select.open .hc-custom-select-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hc-custom-select-option {
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    color: #495057;
    transition: all 0.15s ease;
}

.hc-custom-select-option:hover {
    background: rgba(14, 88, 173, 0.08);
    color: #0e58ad;
}

.hc-custom-select-option.selected {
    background: rgba(14, 88, 173, 0.05);
    color: #0e58ad;
    font-weight: 500;
}

.hc-custom-select-option.selected::before {
    content: '✓';
    margin-right: 0.5rem;
    color: #0e58ad;
}

/* 下拉选择区域 */
.hc-select-wrapper {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    border-right: 0.0625rem solid #e9ecef;
}

.hc-select-wrapper .hc-input-icon {
    padding: 0 0.5rem 0 0.75rem;
    color: #2196F3;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.hc-select-wrapper .hc-input-icon i {
    width: 1.125rem;
    height: 1.125rem;
}

/* 原生select样式（保留备用） */
.hc-input-group-modern.has-select .form-select {
    border-right: none;
    border-left: none;
    width: auto;
    min-width: 6.5rem;
    max-width: 9rem;
    flex-shrink: 0;
    padding-right: 2rem;
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%230e58ad' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 1rem 0.7rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* 输入框区域 */
.hc-input-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.hc-input-wrapper .hc-input-icon {
    padding: 0 0.25rem 0 0.75rem;
    flex-shrink: 0;
}

.hc-input-group-modern.has-input-icon .form-control {
    padding-left: 0.25rem;
}


/* ==================== 尺寸变体 ==================== */

/* 小尺寸 */
.hc-input-group-modern.hc-input-group-sm .form-control,
.hc-input-group-modern.hc-input-group-sm .form-select {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.hc-input-group-modern.hc-input-group-sm .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.hc-input-group-modern.hc-input-group-sm .hc-input-icon {
    padding: 0 0.5rem 0 0.75rem;
    font-size: 0.875rem;
}

.hc-input-group-modern.hc-input-group-sm .hc-input-icon i,
.hc-input-group-modern.hc-input-group-sm .hc-input-icon svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* 大尺寸 */
.hc-input-group-modern.hc-input-group-lg .form-control,
.hc-input-group-modern.hc-input-group-lg .form-select {
    padding: 1rem 1.25rem;
    font-size: 1.125rem;
}

.hc-input-group-modern.hc-input-group-lg .btn {
    padding: 1rem 1.75rem;
    font-size: 1.125rem;
}

.hc-input-group-modern.hc-input-group-lg .hc-input-icon {
    padding: 0 1rem 0 1.25rem;
    font-size: 1.25rem;
}

.hc-input-group-modern.hc-input-group-lg .hc-input-icon i,
.hc-input-group-modern.hc-input-group-lg .hc-input-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* ==================== 紧凑尺寸变体 ==================== */
.hc-input-group-compact {
    display: flex;
    align-items: stretch;
    width: 100%;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0.25rem;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.hc-input-group-compact:focus-within {
    background: rgba(255, 255, 255, 0.8);
}

.hc-input-group-compact .form-control {
    border: none;
    background: transparent;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 0;
}

.hc-input-group-compact .form-control:focus {
    outline: none;
    box-shadow: none;
}

.hc-input-group-compact .form-control::placeholder {
    color: #868e96;
}

.hc-input-group-compact .btn {
    border: none;
    border-radius: 0.2rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    background: #4a9af5;
    color: #fff;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}

.hc-input-group-compact .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.hc-input-group-compact .btn:hover {
    background: #3a8ae0;
}

.hc-input-group-compact .btn:hover::before {
    left: 100%;
}

.hc-input-group-compact .btn-reset {
    background: transparent;
    color: #666;
    background: rgba(0, 0, 0, 0.08) !important;
    margin-left: 0.5rem;
    border-radius: 0;
    padding: 0.625rem 1rem;
}

.hc-input-group-compact .btn-reset::before {
    display: none;
}

.hc-input-group-compact .btn-reset:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #555;
}

.hc-input-group-compact:focus-within .btn {
    background: #4a9af5;
}

.hc-input-group-compact .hc-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem 0 0.75rem;
    color: #868e96;
    font-size: 1rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.hc-input-group-compact .hc-input-icon i,
.hc-input-group-compact .hc-input-icon svg {
    width: 1rem;
    height: 1rem;
}

.hc-input-group-compact:focus-within .hc-input-icon {
    color: #0e58ad;
}


/* ==================== 状态变体 ==================== */

/* 禁用状态 */
.hc-input-group-modern.disabled,
.hc-input-group-modern[disabled] {
    opacity: 0.6;
    pointer-events: none;
}

/* 只读状态 */
.hc-input-group-modern .form-control[readonly] {
    background: rgba(0, 0, 0, 0.02);
    cursor: not-allowed;
}

/* 成功状态 */
.hc-input-group-modern.is-valid .form-control,
.hc-input-group-modern.is-valid .form-select {
    border-color: #198754;
}

.hc-input-group-modern.is-valid:focus-within {
    box-shadow: 0 0.25rem 1rem rgba(25, 135, 84, 0.15);
}

.hc-input-group-modern.is-valid .hc-input-icon {
    color: #198754;
}

/* 错误状态 */
.hc-input-group-modern.is-invalid .form-control,
.hc-input-group-modern.is-invalid .form-select {
    border-color: #dc3545;
}

.hc-input-group-modern.is-invalid:focus-within {
    box-shadow: 0 0.25rem 1rem rgba(220, 53, 69, 0.15);
}

.hc-input-group-modern.is-invalid .hc-input-icon {
    color: #dc3545;
}

/* ==================== 搜索行容器 ==================== */
.hc-search-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
}

.hc-search-row .hc-input-group-modern {
    flex: 1;
    min-width: 0;
}

/* ==================== 馆藏目录内联按钮 ==================== */
.hc-catalog-inline-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.7rem 1rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(14, 88, 173, 0.15);
    border-radius: 0.1rem;
    color: #777;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
    white-space: nowrap;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.hc-catalog-inline-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    transition: left 0.5s ease;
}

.hc-catalog-inline-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(14, 88, 173, 0.3);
    color: #0a4080;
    box-shadow: 0 0.25rem 1rem rgba(14, 88, 173, 0.15);
    transform: translateY(-0.125rem);
}

.hc-catalog-inline-btn:hover::before {
    left: 100%;
}

.hc-catalog-inline-btn i {
    font-size: 0.875rem;
    color: #2196F3;
    transition: all 0.3s ease;
}

.hc-catalog-inline-btn:hover i {
    color: #0e58ad;
    transform: scale(1.1);
}
