/* ============================================
   选择器 - 用于模型选择
   ============================================ */
.selector-section {
    background: rgba(255, 255, 255, 0.36);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-subtle);
    border: 1px solid var(--color-border-soft);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    margin-bottom: 2px;
}

.settings-tab-header {
    justify-content: flex-end;
    align-items: center;
}

.settings-tab-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.settings-tab-actions .btn-tool,
.settings-tab-actions .btn-tool-compact {
    width: auto;
}

.trash-header-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-end;
    width: auto;
    max-width: 100%;
    margin-left: auto;
}

.selector-header .trash-header-actions > .btn-tool,
.selector-header .trash-header-actions > .btn-tool-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    margin: 0;
    width: auto;
    min-width: 0;
    max-width: 100%;
    height: 32px;
    min-height: 32px;
    padding: 0 10px;
    line-height: 1;
    vertical-align: top;
    position: relative;
    top: 0;
    white-space: nowrap;
}

.selector-header .trash-header-actions > .btn-tool:not(:disabled):hover,
.selector-header .trash-header-actions > .btn-tool-compact:not(:disabled):hover {
    transform: none;
}

.selector-title {
    font-size: 11px;
    font-weight: var(--font-weight-secondary);
    color: var(--color-text-muted);
    text-transform: none;
    letter-spacing: 0.03em;
    opacity: 0.85;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selector-actions {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    column-gap: var(--spacing-xs);
    align-items: center;
    justify-content: end;
    white-space: nowrap;
    flex: 0 0 auto;
}

.selector-actions > .btn-tool,
.selector-actions > .btn-tool-compact {
    flex: 0 0 auto;
}

.sessions-header-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    white-space: nowrap;
}

.sessions-header-actions > .btn-tool,
.sessions-header-actions > .btn-tool-compact {
    display: inline-flex !important;
    width: auto !important;
    margin: 0 !important;
    white-space: nowrap;
    flex: 0 0 auto;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 10px !important;
    line-height: 1 !important;
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--color-border-soft) !important;
    background: rgba(255, 255, 255, 0.76) !important;
    font-size: 12px !important;
    font-weight: var(--font-weight-secondary) !important;
    color: var(--color-text-secondary) !important;
    box-shadow: none !important;
    letter-spacing: -0.01em !important;
    justify-content: center !important;
}

.health-report {
    margin-top: 10px;
    padding: 10px 0 0;
    border-radius: 0;
    border: 1px solid var(--color-border);
    border-width: 1px 0 0;
    background: transparent;
    display: grid;
    gap: 8px;
}

.health-remote-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-caption);
    color: var(--color-text-secondary);
}

.health-remote-toggle input {
    accent-color: var(--color-brand);
}

.health-ok {
    color: var(--color-success);
    font-weight: var(--font-weight-secondary);
}

.health-issue {
    background: #FEF2F2;
    border-left: 3px solid var(--color-error);
    padding: 8px 10px;
    border-radius: 8px;
}

.health-issue-title {
    font-size: var(--font-size-caption);
    font-weight: var(--font-weight-secondary);
    color: var(--color-text-primary);
    margin-bottom: 4px;
}

.health-issue-suggestion {
    font-size: var(--font-size-caption);
    color: var(--color-text-secondary);
    line-height: 1.4;
}

.btn-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: none;
    background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-dark) 100%);
    color: white;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast) var(--ease-spring);
    box-shadow: 0 8px 18px rgba(92, 68, 52, 0.12);
}

.btn-icon:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 12px 24px rgba(92, 68, 52, 0.16);
}

.btn-icon:active {
    transform: translateY(0) scale(0.98);
}

.model-select {
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    padding-right: 34px;
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: var(--font-weight-body);
    background-color: rgba(255, 255, 255, 0.72);
    color: var(--color-text-primary);
    outline: none;
    cursor: pointer;
    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='none' stroke='%23505A66' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
    transition: all var(--transition-fast) var(--ease-smooth);
    box-shadow: var(--shadow-subtle);
}

.model-select:hover {
    border-color: var(--color-border-strong);
    background-color: rgba(255, 255, 255, 0.9);
}

.model-select:focus {
    background-color: var(--color-surface);
    border-color: var(--color-brand);
    box-shadow: var(--shadow-input-focus);
}

.model-input {
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: var(--font-weight-body);
    background-color: rgba(255, 255, 255, 0.72);
    color: var(--color-text-primary);
    outline: none;
    transition: all var(--transition-fast) var(--ease-smooth);
    box-shadow: var(--shadow-subtle);
}

.model-input:hover {
    border-color: var(--color-border-strong);
    background-color: rgba(255, 255, 255, 0.9);
}

.model-input:focus {
    background-color: var(--color-surface);
    border-color: var(--color-brand);
    box-shadow: var(--shadow-input-focus);
}

.config-template-hint {
    margin-top: 6px;
    margin-bottom: 4px;
    font-size: 11px;
    color: var(--color-text-tertiary);
    line-height: 1.35;
}

.codex-config-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    align-items: start;
}

.codex-config-field {
    min-width: 0;
    margin-bottom: 0;
}

.btn-template-editor {
    width: 100%;
    margin-top: 2px;
}

/* ============================================
   按钮
   ============================================ */
.btn-add {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px dashed rgba(137, 111, 94, 0.28);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.42);
    font-size: 13px;
    font-weight: var(--font-weight-secondary);
    color: var(--color-text-tertiary);
    cursor: pointer;
    transition: all var(--transition-normal) var(--ease-spring);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

.btn-add + .selector-section,
.selector-section + .btn-add,
.btn-add + .card-list,
.card-list + .btn-add {
    margin-top: 8px;
}

.btn-add:hover {
    border-color: var(--color-brand);
    color: var(--color-brand);
    background: linear-gradient(to bottom, rgba(200, 121, 99, 0.12) 0%, rgba(255, 255, 255, 0.52) 100%);
    transform: translateY(-1px);
}

.btn-add:active {
    transform: translateY(0) scale(0.99);
}

.btn-add .icon {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-normal) var(--ease-spring);
}

.btn-add:hover .icon {
    transform: rotate(90deg);
}

.btn-tool {
    min-height: 36px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-soft);
    background: rgba(255, 255, 255, 0.68);
    font-size: 13px;
    font-weight: var(--font-weight-secondary);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast) var(--ease-spring);
    box-shadow: var(--shadow-subtle);
    letter-spacing: -0.01em;
    width: 100%;
    text-align: center;
}

.selector-section .btn-tool + .btn-tool {
    margin-left: 0;
    margin-top: var(--spacing-xs);
}

.selector-header .settings-tab-actions > .btn-tool + .btn-tool,
.selector-header .settings-tab-actions > .btn-tool-compact + .btn-tool,
.selector-header .settings-tab-actions > .btn-tool + .btn-tool-compact,
.selector-header .settings-tab-actions > .btn-tool-compact + .btn-tool-compact {
    margin-top: 0;
}

.selector-header .trash-header-actions > .btn-tool + .btn-tool {
    margin-top: 0;
}

.btn-tool:not(:disabled):hover {
    border-color: var(--color-brand);
    color: var(--color-brand);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(92, 68, 52, 0.1);
}

.btn-tool:disabled,
.btn-tool[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-tool:disabled:hover,
.btn-tool[disabled]:hover,
.btn-tool:disabled:active,
.btn-tool[disabled]:active,
.btn-tool-compact:disabled:hover,
.btn-tool-compact[disabled]:hover,
.btn-tool-compact:disabled:active,
.btn-tool-compact[disabled]:active {
    border-color: var(--color-border-soft);
    color: var(--color-text-secondary);
    transform: none;
    box-shadow: var(--shadow-subtle);
}

.btn-tool-compact {
    padding: 7px 10px;
    font-size: 12px;
}

.selector-header .btn-tool-compact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 0;
    padding: 2px 6px;
    font-size: 10px;
    line-height: 1;
    box-shadow: none;
    height: 22px;
    min-height: 22px;
    white-space: nowrap;
}

.config-row {
    display: flex;
    gap: 12px;
}

@media (max-width: 640px) {
    .config-row {
        flex-direction: column;
    }
}
