/* 代理配置页：复用 admin.css 的蔚蓝玻璃风格，补充开关、模式徽标与行内编辑 */

.form__hint {
    color: var(--ink-faint);
    font-size: 0.6875rem;
    line-height: 1.6;
}

/* ---- 全局开关 ---- */

.switch {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
    background: rgba(255, 255, 255, 0.66);
    cursor: pointer;
    transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.switch:hover {
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.86);
}

.switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.switch__track {
    position: relative;
    flex: none;
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.2);
    transition: background-color 0.2s var(--ease);
}

.switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(11, 28, 57, 0.28);
    transition: transform 0.2s var(--ease);
}

.switch input:checked + .switch__track {
    background: linear-gradient(140deg, var(--accent-deep), var(--accent));
}

.switch input:checked + .switch__track::after {
    transform: translateX(18px);
}

.switch input:focus-visible + .switch__track {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

.switch__copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.switch__title {
    color: var(--ink);
    font-size: 0.8125rem;
    font-weight: 600;
}

.switch__desc {
    color: var(--ink-faint);
    font-size: 0.6875rem;
    line-height: 1.4;
}

/* ---- 筛选 ---- */

.filters .search {
    flex: 1 1 220px;
    min-width: 150px;
}

.search input {
    width: 100%;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink);
    font-family: inherit;
    font-size: 0.8125rem;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.search input::placeholder {
    color: #8aa0c0;
}

.search input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

/* ---- 模式与生效出口 ---- */

.mode-select {
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink);
    font-family: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.mode-select:hover {
    border-color: var(--line-strong);
}

.mode-select:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 240px;
    padding: 3px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mode-badge::before {
    content: "";
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.mode-badge--direct {
    border-color: rgba(74, 100, 136, 0.24);
    background: rgba(74, 100, 136, 0.1);
    color: var(--ink-faint);
}

.mode-badge--global {
    border-color: rgba(37, 99, 235, 0.3);
    background: var(--accent-soft);
    color: var(--accent-deep);
}

.mode-badge--self {
    border-color: var(--info-line);
    background: var(--info-soft);
    color: var(--info);
}

.mode-badge--warn {
    border-color: var(--warn-line);
    background: var(--warn-soft);
    color: var(--warn);
}

/* ---- 分组筛选（复用 admin.css 的 group-tab 样式） ---- */

.list-panel .group-tabs {
    margin-top: 14px;
    padding: 0 20px;
}

/* .group-tabs 是 flex，[hidden] 的默认 display:none 会被压掉 */
.list-panel .group-tabs[hidden] {
    display: none;
}


/* ---- 行内代理编辑 ---- */

.editor-row > td {
    padding: 4px 10px 18px;
    border-top: 0;
    background: rgba(37, 99, 235, 0.045);
}

.proxy-editor {
    display: grid;
    grid-template-columns: 100px minmax(150px, 1.6fr) 90px minmax(110px, 1fr) minmax(110px, 1fr);
    gap: 10px;
    align-items: end;
    padding: 12px 12px 10px;
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.55);
}

.proxy-editor .field {
    gap: 4px;
}

.proxy-editor .field input,
.proxy-editor .field select {
    height: 36px;
    font-size: 0.8125rem;
}

.proxy-editor__hint {
    grid-column: 1 / -1;
    color: var(--ink-faint);
    font-size: 0.6875rem;
    line-height: 1.5;
}

@media (max-width: 1080px) {
    .proxy-editor {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .proxy-editor {
        grid-template-columns: 1fr;
    }
}
