/* ========== components.css ========== */

/* 卡片样式 */
.card {
    position: relative;
    background: rgba(12, 20, 32, .72);
    border: 1px solid rgba(95, 133, 189, .08);
    border-radius: 22px;
    padding: 20px;
    box-shadow: var(--shadow-soft);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.card:hover {
    transform: translateY(-1px);
    box-shadow: var(--hover-shadow);
    border-color: rgba(111, 153, 214, .12);
    background: rgba(16, 28, 46, .94);
}
.card h3 {
    margin: 0 0 14px;
    font-size: 19px;
    color: #f8fafc;
    font-weight: 900;
    letter-spacing: -.2px;
    position: relative;
    z-index: 1;
}
.sub-card-title {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 900;
    color: #f4f8ff;
}

.page-shell {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}
.page-shell::before {
    content: none !important;
}
.page-shell:hover {
    transform: none;
    box-shadow: none !important;
    border-color: transparent !important;
    background: transparent !important;
}
.page-shell > h3 {
    margin: 0 0 16px;
    padding-left: 4px;
    font-size: 20px;
    color: #f7fbff;
}
.page-shell > .rich-box,
.page-shell > .telethon-hero,
.page-shell > .forward-top-actions,
.page-shell > #forwardRulesContainer,
.page-shell > .status-line {
    margin-left: 0;
    margin-right: 0;
}

/* 仪表盘统计卡片 */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
.dashboard-stat {
    background: rgba(10, 17, 28, .78);
    border: 1px solid rgba(99, 135, 189, .07);
    border-radius: 18px;
    padding: 16px;
    min-height: 112px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.dashboard-stat:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, .12);
    border-color: rgba(111, 153, 214, .10);
}
.dashboard-stat-k {
    color: #90a4c4;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
}
.dashboard-stat-v {
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    line-height: 1.25;
}
.dashboard-stat-d {
    margin-top: 8px;
    color: #a5b7d1;
    font-size: 12px;
    line-height: 1.6;
}

/* 状态列表 */
.status-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.status-item {
    background: rgba(10, 17, 28, .78);
    border: 1px solid rgba(96, 129, 176, .07);
    border-radius: 18px;
    padding: 16px;
}
.status-item .label {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 8px;
    font-weight: 700;
}
.status-item .value {
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.5;
    word-break: break-word;
}

/* 开关行 */
.toggle-line {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #d9e3f4;
    font-size: 12px;
    font-weight: 800;
    min-height: 30px;
    flex-wrap: wrap;
}
.toggle-label-on {
    color: #9fe4b5;
}
.toggle-label-off {
    color: #9fb0c8;
}
.toggle-switch {
    position: relative;
    width: 46px;
    height: 26px;
    display: inline-block;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.toggle-slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #44556f;
    border: 1px solid rgba(255, 255, 255, .10);
    transition: .22s ease;
    cursor: pointer;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, .25);
}
.toggle-slider:before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 2px;
    top: 2px;
    border-radius: 50%;
    background: #fff;
    transition: .22s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .28);
}
.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(90deg, #2fcf72 0%, #59dc89 100%);
    border-color: rgba(82, 215, 38, .35);
}
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* 通用滑动开关（供基础设置 / AI辅助识别使用，不影响旧逻辑） */
.switch {
    position: relative;
    width: 46px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    vertical-align: middle;
}
.switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #44556f;
    border: 1px solid rgba(255, 255, 255, .10);
    transition: .22s ease;
    cursor: pointer;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, .25);
}
.slider::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 2px;
    top: 2px;
    border-radius: 50%;
    background: #fff;
    transition: .22s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .28);
}
.switch input:checked + .slider {
    background: linear-gradient(90deg, #2fcf72 0%, #59dc89 100%);
    border-color: rgba(82, 215, 38, .35);
}
.switch input:checked + .slider::before {
    transform: translateX(20px);
}
.switch input:focus-visible + .slider {
    box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, .25),
        0 0 0 3px rgba(79, 131, 255, .12);
}
.switch:hover .slider {
    border-color: rgba(255, 255, 255, .16);
}

/* 模态框 */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(3, 10, 22, .70);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    padding: 20px;
    backdrop-filter: blur(4px);
}
.modal-mask.show {
    display: flex;
}
.modal-card {
    width: 100%;
    max-width: 460px;
    background: #101b2d;
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 24px 56px rgba(0, 0, 0, .32);
    max-height: min(92vh, 720px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.modal-title {
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 6px;
}
.modal-sub {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 16px;
    line-height: 1.7;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}
.modal-status {
    margin-top: 12px;
    min-height: 20px;
    font-size: 13px;
    color: #93c5fd;
    line-height: 1.6;
}
.confirm-accent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 95, 97, .12) 0%, rgba(255, 110, 114, .20) 100%);
    border: 1px solid rgba(255, 110, 114, .20);
    color: #ffb8ba;
    font-size: 20px;
    margin-bottom: 12px;
}

/* Toast */
.toast {
    position: fixed;
    right: 24px;
    bottom: max(24px, calc(var(--safe-bottom) + 16px));
    min-width: 260px;
    max-width: 420px;
    background: #101b2d;
    border: 1px solid #334155;
    color: #fff;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: var(--shadow);
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: .25s ease;
    z-index: 9999;
    font-size: 14px;
    font-weight: 700;
}
.toast.show {
    transform: translateY(0);
    opacity: 1;
}
.toast.success {
    border-color: rgba(34, 197, 94, .45);
}
.toast.error {
    border-color: rgba(239, 68, 68, .45);
}

/* 日志覆盖层 */
.log-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 10, 22, .62);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9997;
    padding: 18px;
    backdrop-filter: blur(5px);
}
.log-overlay.show {
    display: flex;
}
.log-panel {
    width: min(1220px, 98vw);
    height: min(740px, 92vh);
    background:
        linear-gradient(180deg, rgba(15, 23, 39, .98) 0%, rgba(14, 22, 37, .98) 100%);
    border: 1px solid rgba(79, 131, 255, .11);
    border-radius: 22px;
    box-shadow: 0 22px 64px rgba(0, 0, 0, .36);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px 10px;
}
.log-title {
    font-size: 17px;
    font-weight: 900;
    color: #f4f8ff;
    letter-spacing: -.2px;
}
.log-close {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 12px;
    background: transparent;
    color: #71a6ff;
    box-shadow: none;
    border: 0;
    font-size: 32px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.log-close:hover {
    transform: none;
    box-shadow: none;
    background: rgba(255, 255, 255, .05);
    color: #9ec2ff;
}

.log-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    padding: 10px 18px 14px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(255, 255, 255, .04);
}

.log-level-tabs {
    display: inline-flex;
    align-items: stretch;
    gap: 0;
    height: 46px;
    background: rgba(9, 16, 29, .86);
    border: 1px solid rgba(115, 146, 198, .12);
    border-radius: 12px;
    overflow: hidden;
    margin-left: auto;
    flex: 0 0 auto;
}
.log-tab {
    height: 44px;
    padding: 0 18px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #7f92ad;
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    min-width: 66px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.log-tab.active {
    background: #4e78d8;
    color: #fff;
}

.log-actions {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 14px !important;
    flex-wrap: wrap !important;
    margin-top: 0 !important;
    flex: 0 0 auto;
}

.log-actions > div:first-child {
    position: relative;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    min-height: 46px;
    padding-top: 0;
}

.log-actions > div:last-child {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
}

.log-actions label[for="logTypeSelect"] {
    position: absolute;
    left: 16px;
    top: 0;
    transform: translateY(-50%);
    padding: 0 8px;
    margin: 0;
    background: linear-gradient(180deg, rgba(15, 23, 39, .98) 0%, rgba(14, 22, 37, .98) 100%);
    color: #8fa5c7;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .2px;
    pointer-events: none;
    z-index: 3;
    white-space: nowrap;
}

#logTypeSelect {
    min-width: 176px !important;
    height: 46px;
    padding: 14px 42px 10px 14px !important;
    border-radius: 12px !important;
    background:
        linear-gradient(180deg, rgba(17, 26, 43, .98) 0%, rgba(15, 23, 38, .98) 100%) !important;
    border: 1px solid rgba(124, 151, 198, .16) !important;
    color: #edf4ff !important;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: none !important;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    outline: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #a9bce0 50%),
        linear-gradient(135deg, #a9bce0 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 2px),
        calc(100% - 12px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}
#logTypeSelect:hover {
    border-color: rgba(135, 163, 214, .28) !important;
    background-color: rgba(17, 27, 46, .98) !important;
}
#logTypeSelect:focus {
    border-color: rgba(94, 146, 255, .52) !important;
    box-shadow: 0 0 0 3px rgba(79, 131, 255, .12) !important;
}

.log-actions .secondary,
.log-actions .danger,
.log-actions .warning,
.log-actions button {
    min-height: 46px;
    border-radius: 999px;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .2px;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}
.log-actions .secondary {
    background: linear-gradient(90deg, #3d6ed7 0%, #4f83ff 100%);
    border: 1px solid rgba(110, 156, 255, .22);
    color: #fff;
}
.log-actions .secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(53, 102, 201, .24);
}
.log-actions .danger {
    background: linear-gradient(90deg, #1fa8f2 0%, #2dc3ff 100%);
    border: 1px solid rgba(89, 205, 255, .22);
    color: #fff;
}
.log-actions .danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(39, 170, 231, .24);
}

.log-list {
    flex: 1;
    overflow: auto;
    padding: 0 18px 18px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.log-list-inner {
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
    padding-top: 8px;
}
.log-row {
    display: grid;
    grid-template-columns: 110px 110px 1fr;
    gap: 16px;
    align-items: center;
    padding: 14px 8px 14px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, .04);
    font-size: 14px;
    user-select: text;
    -webkit-user-select: text;
}
.log-row:last-child {
    border-bottom: 0;
}
.log-row:hover {
    background: rgba(255, 255, 255, .02);
}
.log-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    color: #fff;
    letter-spacing: .2px;
}
.log-badge.info { background: #69d714; }
.log-badge.error { background: #ff4d4f; }
.log-badge.warning { background: #f59e0b; }
.log-badge.debug { background: #3b82f6; }
.log-badge.all { background: #64748b; }
.log-time {
    color: #d7e5fb;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .2px;
}
.log-msg {
    color: #dce7f8;
    line-height: 1.72;
    word-break: break-word;
    white-space: pre-wrap;
}
.empty-log {
    padding: 48px 20px;
    color: #89a0bd;
    text-align: center;
    font-size: 14px;
}

/* Telethon 组件 */
.telethon-hero {
    background: rgba(10, 17, 28, .78);
    border: 1px solid rgba(79, 131, 255, .08);
    border-radius: 18px;
    padding: 18px;
}
.telethon-hero-title {
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 8px;
    color: #f8fbff;
}
.telethon-hero-sub {
    color: #a8bad3;
    font-size: 13px;
    line-height: 1.8;
}
.telethon-note {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #0b1626;
    border: 1px solid rgba(96, 129, 176, .07);
    color: #b7c7dd;
    font-size: 12px;
    line-height: 1.8;
}
.telethon-account-box {
    background: rgba(10, 17, 28, .78);
    border: 1px solid rgba(96, 129, 176, .07);
    border-radius: 16px;
    padding: 14px;
    color: #d3deef;
    font-size: 13px;
    line-height: 1.8;
    min-height: 196px;
}
.telethon-account-box b {
    color: #fff;
}
.telethon-inline-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.telethon-simple-status {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 2px;
}
.telethon-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}
.telethon-pill.ok {
    background: rgba(82, 215, 38, .14);
    color: #9fe4b5;
    border: 1px solid rgba(82, 215, 38, .20);
}
.telethon-pill.warn {
    background: rgba(245, 158, 11, .12);
    color: #ffd48a;
    border: 1px solid rgba(245, 158, 11, .20);
}
.telethon-pill.fail {
    background: rgba(255, 77, 79, .12);
    color: #ff9f9f;
    border: 1px solid rgba(255, 77, 79, .18);
}

/* 规则卡片等组件 */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}
.rule-card {
    background: rgba(12, 20, 32, .72);
    border: 1px solid rgba(105, 127, 160, .08);
    border-radius: 20px;
    padding: 16px 16px 18px;
    box-shadow: var(--shadow-soft);
    min-width: 0;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.rule-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--hover-shadow);
    border-color: rgba(111, 153, 214, .12);
}
.rule-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.rule-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 900;
    color: #f5f8ff;
    min-width: 0;
}
.rule-drag {
    color: #90a4c4;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}
.rule-head-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
    justify-content: flex-end;
}
.rule-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.rule-block {
    margin-top: 14px;
}
.rule-block-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 800;
    color: #dfe8f5;
    margin-bottom: 10px;
}
.rule-switch-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}
.mini-switch-card {
    background: rgba(10, 17, 28, .78);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 14px;
    padding: 12px;
    min-width: 0;
}
.mini-switch-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.mini-switch-title {
    font-size: 13px;
    font-weight: 800;
    color: #eef4ff;
    line-height: 1.5;
    min-width: 0;
    word-break: break-word;
}
.mini-switch-desc {
    margin-top: 6px;
    color: #93a6c4;
    font-size: 12px;
    line-height: 1.6;
}
.id-row, .tag-row {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, .06);
    background: rgba(10, 17, 28, .78);
    border-radius: 14px;
    padding: 10px 12px;
    margin-top: 8px;
}
.id-row-main, .tag-row-main {
    flex: 1;
    min-width: 0;
}
.id-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.id-input-wrap input {
    flex: 1;
    min-width: 0;
    background: #101d31;
    border: 1px solid rgba(111, 137, 173, .16);
    height: 40px;
    padding: 10px 12px;
    font-size: 13px;
}
.id-meta {
    margin-top: 6px;
    font-size: 12px;
    color: #aab7cb;
    line-height: 1.45;
}
.id-meta.ok {
    color: #98e6b2;
}
.id-meta.fail {
    color: #ff9c9c;
}
.empty-box {
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 14px;
    padding: 12px;
    text-align: center;
    color: #a7b4c8;
    background: rgba(10, 17, 28, .78);
    font-size: 13px;
}
.keyword-textarea {
    width: 100%;
    min-height: 92px;
    background: rgba(10, 17, 28, .78);
    border: 1px solid rgba(87, 126, 198, .16);
    border-radius: 14px;
    padding: 12px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
    resize: vertical;
    margin-top: 10px;
}
.keyword-note {
    font-size: 12px;
    color: #9eb1cc;
    line-height: 1.6;
    margin-top: 8px;
}
.keyword-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
.forward-top-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 13px;
    background: #0b1626;
    border: 1px solid rgba(96, 129, 176, .07);
    border-radius: 14px;
    min-height: 48px;
}
.check-row input {
    width: auto;
    margin: 0;
    transform: scale(1.08);
}
.icon-mini {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    padding: 0;
    border: 1px solid rgba(88, 120, 168, .10);
    background: #0f1b2d;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #eaf1fb;
    font-size: 16px;
    font-weight: 900;
    position: relative;
    overflow: hidden;
}
.icon-mini::before {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 999px;
    border: 1.4px solid transparent;
    background: linear-gradient(135deg, rgba(79, 131, 255, .92), rgba(18, 200, 255, .92)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: .84;
    pointer-events: none;
}
.icon-mini:hover {
    transform: none;
    box-shadow: 0 10px 20px rgba(0, 0, 0, .14);
    background: #122038;
}
.delete-btn {
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 110, 114, .18);
    background: linear-gradient(135deg, rgba(255, 95, 97, .10) 0%, rgba(255, 110, 114, .16) 100%);
    color: #ffb8ba;
    box-shadow: none;
    font-size: 12px;
    font-weight: 800;
}
.delete-btn:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, rgba(255, 95, 97, .16) 0%, rgba(255, 110, 114, .22) 100%);
    border-color: rgba(255, 110, 114, .30);
    box-shadow: 0 10px 20px rgba(120, 26, 26, .14);
}
.add-btn {
    background: #4f83ff;
    box-shadow: none;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 10px;
    margin-bottom: 8px;
}
.soft-btn {
    background: #32445f;
    box-shadow: none;
    padding: 9px 14px;
    font-size: 13px;
    border-radius: 999px;
    color: #e7eefb;
}
.trash-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    padding: 0;
    background: transparent;
    color: #ff6262;
    box-shadow: none;
    border: 0;
    font-size: 17px;
    flex-shrink: 0;
}
.trash-btn:hover {
    transform: none;
    background: rgba(255, 99, 99, .08);
}
.hint-line {
    color: #95a7c0;
    font-size: 12px;
    margin-top: 6px;
    line-height: 1.6;
}
.rich-box, pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    font-size: 13px;
    line-height: 1.78;
    color: #d2dced;
    max-height: 560px;
    overflow: auto;
    user-select: text;
    -webkit-user-select: text;
}
.rich-box b, .rich-box strong {
    color: #fff;
}

/* 登录相关组件 */
.login-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 18%, rgba(79, 131, 255, .18), transparent 28%),
        radial-gradient(circle at 82% 0%, rgba(18, 200, 255, .11), transparent 22%),
        linear-gradient(180deg, rgba(5, 12, 22, .20) 0%, rgba(5, 12, 22, .48) 100%);
    pointer-events: none;
}
.login-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, .04) 0%, transparent 30%, transparent 68%, rgba(79, 131, 255, .05) 100%);
    pointer-events: none;
}
.login-brand {
    width: fit-content;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 16px;
    border: 1px solid rgba(98, 161, 255, .32);
    background: linear-gradient(180deg, rgba(8, 18, 34, .72) 0%, rgba(7, 16, 29, .52) 100%);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .02) inset, 0 10px 28px rgba(3, 10, 20, .20);
}
.login-brand .logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
}
.login-brand .logo-text {
    font-size: 32px;
}
.login-card h2,
.login-card p,
.login-card label {
    display: none;
}
.login-field {
    position: relative;
    margin-bottom: 16px;
}
.login-input {
    width: 100%;
    height: 56px;
    padding: 0 18px;
    border-radius: 14px;
    border: 1px solid rgba(120, 150, 220, .25);
    background: rgba(7, 15, 28, .58);
    color: #f4f8ff;
    font-size: 16px;
    line-height: 56px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02);
}
.login-input::placeholder {
    color: transparent;
}
.login-input:hover {
    border-color: rgba(122, 166, 242, .40);
    background: rgba(9, 17, 31, .70);
}
.login-input:focus {
    border-color: rgba(96, 150, 255, .85);
    box-shadow: 0 0 0 3px rgba(79, 131, 255, .10), 0 0 18px rgba(79, 131, 255, .08);
    background: rgba(9, 17, 31, .78);
}

.login-float-field {
    position: relative;
}
.login-float-label {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    max-width: calc(100% - 72px);
    padding: 0 2px;
    color: rgba(219, 232, 251, .72);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    pointer-events: none;
    transition:
        top .18s ease,
        transform .18s ease,
        font-size .18s ease,
        color .18s ease,
        background-color .18s ease,
        opacity .18s ease;
    z-index: 2;
    white-space: nowrap;
}
.login-float-field:focus-within .login-float-label,
.login-float-field.has-value .login-float-label,
.login-input:not(:placeholder-shown) + .login-float-label {
    top: 0;
    transform: translateY(-50%);
    font-size: 12px;
    color: #73a8ff;
    background: #101a2b;
    opacity: 1;
}
.login-float-field:focus-within .login-float-label {
    color: #84b4ff;
}

.login-password-wrap {
    position: relative;
}
.login-password-wrap .login-input {
    padding-right: 56px;
}
.login-password-wrap .login-float-label {
    max-width: calc(100% - 96px);
}

.login-eye {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    padding: 0;
    background: transparent;
    box-shadow: none;
    color: rgba(220, 232, 251, .78);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    z-index: 3;
}
.login-eye svg {
    width: 20px;
    height: 20px;
    stroke: rgba(218, 228, 245, .76);
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    transition: opacity .18s ease, transform .18s ease, stroke .18s ease;
    flex-shrink: 0;
}
.login-eye .eye-closed {
    display: none;
}
.login-eye.is-visible .eye-open {
    display: none;
}
.login-eye.is-visible .eye-closed {
    display: block;
}
.login-eye:hover {
    transform: translateY(-50%);
    background: rgba(255, 255, 255, .04);
    box-shadow: none;
}
.login-eye:hover svg {
    stroke: #eef5ff;
}
.login-eye:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 131, 255, .12);
}

#loginBtn {
    width: 100%;
    height: 52px;
    margin-top: 6px;
    border-radius: 14px;
    background: linear-gradient(90deg, #4c7ff6 0%, #5e92ff 55%, #6aa9ff 100%);
    box-shadow: 0 12px 30px rgba(41, 92, 191, .24);
    font-size: 16px;
    letter-spacing: .6px;
}

/* 网页端通用浮动表单样式（沿用登录页交互，不影响登录页） */
.plugin-form-float-field,
.plugin-form-float-select {
    position: relative;
}

.plugin-form-float-field .plugin-float-input,
.plugin-form-float-select select {
    width: 100%;
    height: 56px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid rgba(120, 150, 220, .25);
    background: rgba(7, 15, 28, .58);
    color: #f4f8ff;
    font-size: 16px;
    line-height: 56px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02);
    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        background .18s ease,
        color .18s ease;
}

.plugin-form-float-field .plugin-float-input::placeholder {
    color: transparent;
}

.plugin-form-float-field .plugin-float-input:hover,
.plugin-form-float-select select:hover {
    border-color: rgba(122, 166, 242, .40);
    background: rgba(9, 17, 31, .70);
}

.plugin-form-float-field .plugin-float-input:focus,
.plugin-form-float-select select:focus {
    border-color: rgba(96, 150, 255, .85);
    box-shadow: 0 0 0 3px rgba(79, 131, 255, .10), 0 0 18px rgba(79, 131, 255, .08);
    background: rgba(9, 17, 31, .78);
}

.plugin-form-float-field .plugin-float-label,
.plugin-form-float-select .plugin-float-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    max-width: calc(100% - 72px);
    padding: 0 2px;
    color: rgba(219, 232, 251, .72);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    pointer-events: none;
    transition:
        top .18s ease,
        transform .18s ease,
        font-size .18s ease,
        color .18s ease,
        background-color .18s ease,
        opacity .18s ease;
    z-index: 2;
    white-space: nowrap;
}

.plugin-form-float-field:focus-within .plugin-float-label,
.plugin-form-float-field.has-value .plugin-float-label,
.plugin-form-float-field .plugin-float-input:not(:placeholder-shown) + .plugin-float-label {
    top: 0;
    transform: translateY(-50%);
    font-size: 12px;
    color: #73a8ff;
    background: #101a2b;
    opacity: 1;
}

.plugin-form-float-field:focus-within .plugin-float-label {
    color: #84b4ff;
}

/* 下拉框没有 placeholder 机制，默认保持浮起，视觉与整站统一 */
.plugin-form-float-select .plugin-float-label {
    top: 0;
    transform: translateY(-50%);
    font-size: 12px;
    color: #97accd;
    background: #101a2b;
    opacity: 1;
}

.plugin-form-float-select:focus-within .plugin-float-label {
    color: #84b4ff;
}

/* 导航按钮 */
.nav-title {
    position: relative;
    color: #6d82a2;
    font-size: 12px;
    margin: 20px 12px 10px;
    font-weight: 800;
    letter-spacing: .4px;
}
.nav-btn {
    width: 100%;
    text-align: left;
    background: transparent;
    box-shadow: none;
    border: 1px solid transparent;
    color: #dbe8fb;
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    transition: all .18s ease;
}
.nav-btn::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f83ff, #12c8ff);
    box-shadow: 0 0 10px rgba(18, 200, 255, .28);
    flex-shrink: 0;
}
.nav-btn:hover {
    background: rgba(255, 255, 255, .04);
    border-color: rgba(255, 255, 255, .04);
}
.nav-btn.active {
    background: linear-gradient(90deg, rgba(77, 126, 232, .92) 0%, rgba(95, 150, 255, .92) 100%);
    border-color: rgba(123, 177, 255, .18);
    color: #fff;
    box-shadow: none;
}
.nav-btn.active::before {
    background: #fff;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, .10);
}

/* ===== 插件页专属样式：只新增，不碰登录页 ===== */
.plugin-header-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 16px;
}
.plugin-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.plugin-header-title {
    font-size: 18px;
    font-weight: 900;
    color: #f5f9ff;
}
.plugin-header-subnav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.plugin-subnav-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #8fa9d8;
    font-size: 13px;
    font-weight: 800;
}
.plugin-subnav-item.active {
    color: #4f8fff;
}

#pluginPage .plugin-market-card {
    width: min(760px, 100%);
    margin: 0;
    background: linear-gradient(180deg, rgba(9, 23, 44, .96) 0%, rgba(7, 18, 35, .98) 100%);
    border: 1px solid rgba(79, 131, 255, .10);
    border-radius: 18px;
    padding: 20px 20px 18px;
    box-shadow:
        0 12px 28px rgba(0, 0, 0, .18),
        inset 0 1px 0 rgba(255, 255, 255, .02);
}
#pluginPage .plugin-market-title {
    text-align: left;
    font-size: 16px;
    font-weight: 900;
    color: #f3f8ff;
    margin-bottom: 14px;
}

#pluginPage .plugin-market-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    width: min(520px, 100%);
    margin: 0;
}
#pluginPage .plugin-select-group {
    position: relative;
    flex: 1 1 auto;
    min-width: 220px;
}
#pluginPage .plugin-select-group label {
    position: absolute;
    left: 12px;
    top: 0;
    transform: translateY(-50%);
    padding: 0 7px;
    background: linear-gradient(180deg, rgba(9, 23, 44, .98) 0%, rgba(7, 18, 35, .98) 100%);
    color: #95a9c8;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    z-index: 2;
    pointer-events: none;
}
#plugin115AppSelect {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid rgba(117, 138, 174, .42);
    background: rgba(18, 28, 49, .96);
    color: #f3f7ff;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    appearance: auto;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    cursor: pointer;
    box-shadow: none;
}
#plugin115AppSelect:hover {
    border-color: rgba(137, 159, 199, .60);
}
#plugin115AppSelect:focus {
    border-color: rgba(93, 148, 255, .72);
    box-shadow: 0 0 0 3px rgba(79, 131, 255, .12);
}

#pluginPage .plugin-start-btn {
    flex: 0 0 auto;
    min-width: 70px;
    height: 36px;
    padding: 0 18px;
    border-radius: 6px;
    border: 1px solid rgba(103, 148, 255, .18);
    background: linear-gradient(90deg, #4b77ea 0%, #5a8dff 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}
#pluginPage .plugin-start-btn:hover {
    box-shadow: 0 10px 20px rgba(74, 118, 234, .24);
}
#pluginPage .plugin-start-btn:disabled {
    opacity: .7;
    cursor: not-allowed;
    box-shadow: none;
}

#pluginPage .plugin-result-wrap {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
}
#pluginPage .plugin-qrcode-panel {
    background: rgba(8, 17, 31, .96);
    border: 1px solid rgba(72, 96, 136, .16);
    border-radius: 14px;
    padding: 12px;
}
#pluginPage .plugin-status-panel {
    background: rgba(8, 17, 31, .96);
    border: 1px solid rgba(72, 96, 136, .16);
    border-radius: 14px;
    padding: 12px;
}
#pluginPage .plugin-qrcode-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 180px;
    margin: 0 auto;
    border-radius: 12px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
#pluginPage .plugin-qrcode-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
#pluginPage .plugin-qrcode-placeholder {
    color: #8ea1bf;
    font-size: 12px;
    line-height: 1.7;
    padding: 0 12px;
    text-align: center;
}
#pluginPage .plugin-actions {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}
#pluginPage .plugin-actions button {
    min-height: 36px;
    border-radius: 999px;
    padding: 0 14px;
    font-weight: 800;
    font-size: 13px;
}

#pluginPage .plugin-status-box {
    min-height: 180px;
    color: #dce7f8;
}
#pluginPage .plugin-status-empty {
    min-height: 150px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    color: #f3f7ff;
    font-size: 14px;
    line-height: 1.8;
}
#pluginPage .plugin-status-list {
    display: grid;
    gap: 10px;
}
#pluginPage .plugin-status-item {
    background: rgba(14, 24, 39, .90);
    border: 1px solid rgba(255, 255, 255, .05);
    border-radius: 12px;
    padding: 10px 12px;
}
#pluginPage .plugin-status-label {
    color: #93a6c4;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}
#pluginPage .plugin-status-value {
    color: #f2f7ff;
    font-size: 13px;
    line-height: 1.7;
    word-break: break-word;
}
#pluginPage .plugin-cookie-box {
    margin-top: 8px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(9, 16, 29, .92);
    border: 1px solid rgba(100, 131, 182, .12);
    color: #dfe8f8;
    font-size: 12px;
    line-height: 1.7;
    word-break: break-all;
    max-height: 220px;
    overflow: auto;
}
#pluginPage .plugin-badge-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
#pluginPage .plugin-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .2px;
}
#pluginPage .plugin-badge.ok {
    background: rgba(82, 215, 38, .14);
    color: #9fe4b5;
    border: 1px solid rgba(82, 215, 38, .20);
}
#pluginPage .plugin-badge.wait {
    background: rgba(79, 131, 255, .14);
    color: #a8c7ff;
    border: 1px solid rgba(79, 131, 255, .20);
}
#pluginPage .plugin-badge.fail {
    background: rgba(255, 77, 79, .12);
    color: #ffb2b2;
    border: 1px solid rgba(255, 77, 79, .18);
}

.success-text {
    color: #8fe2ae !important;
}
.error-text {
    color: #ffadad !important;
}
.warning-text {
    color: #ffd48a !important;
}

/* 响应式调整部分规则卡片在移动端的显示 */
@media (max-width: 1450px) {
    .rules-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 1180px) {
    .status-list {
        grid-template-columns: 1fr;
    }
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 980px) {
    .log-panel {
        width: 100%;
        height: 92vh;
    }
    .log-toolbar {
        align-items: flex-start;
        justify-content: flex-start;
    }
    .log-level-tabs {
        margin-left: 0;
    }
    .log-actions {
        width: 100%;
        justify-content: flex-start !important;
    }
    .log-actions > div:first-child,
    .log-actions > div:last-child {
        width: 100%;
        justify-content: flex-start !important;
    }
    .log-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 14px 6px;
    }
    .rules-grid {
        grid-template-columns: 1fr;
    }
    .rule-head {
        flex-direction: column;
        align-items: stretch;
    }
    .rule-head-right {
        justify-content: space-between;
        width: 100%;
    }
    .id-row, .tag-row, .id-input-wrap {
        flex-direction: column;
        align-items: stretch;
    }
    .trash-btn {
        align-self: flex-end;
    }
    .rule-switch-grid {
        grid-template-columns: 1fr;
    }

    #pluginPage .plugin-result-wrap {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 700px) {
    .telethon-hero {
        padding: 14px;
    }
    .telethon-hero-title {
        font-size: 18px;
    }
    .group-card {
        padding: 14px;
        border-radius: 16px;
    }
    .log-toolbar {
        align-items: flex-start;
        justify-content: flex-start;
    }
    .log-level-tabs {
        width: 100%;
        flex-wrap: wrap;
        height: auto;
    }
    .log-tab {
        flex: 1 1 auto;
        min-width: 56px;
        padding: 10px 8px;
        font-size: 11px;
        height: 40px;
    }
    .log-actions .secondary,
    .log-actions .danger,
    .log-actions .warning,
    .log-actions button {
        width: 100%;
    }
    #logTypeSelect {
        width: 100% !important;
        min-width: 0 !important;
    }
    .forward-top-actions {
        justify-content: stretch;
    }
    .forward-top-actions button {
        flex: 1 1 calc(50% - 10px);
    }
    .section-actions button,
    .telethon-inline-actions button {
        flex: 1 1 100%;
    }
    .telethon-account-box {
        min-height: auto;
    }
    .login-input {
        font-size: 15px;
    }
    .login-float-label {
        font-size: 15px;
    }

    .plugin-form-float-field .plugin-float-input,
    .plugin-form-float-select select {
        font-size: 15px;
    }

    .plugin-form-float-field .plugin-float-label,
    .plugin-form-float-select .plugin-float-label {
        font-size: 15px;
    }

    .plugin-form-float-field:focus-within .plugin-float-label,
    .plugin-form-float-field.has-value .plugin-float-label,
    .plugin-form-float-field .plugin-float-input:not(:placeholder-shown) + .plugin-float-label,
    .plugin-form-float-select .plugin-float-label {
        font-size: 12px;
    }

    #pluginPage .plugin-market-card {
        width: 100%;
        padding: 16px 14px 14px;
        border-radius: 16px;
    }
    #pluginPage .plugin-market-form {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    #pluginPage .plugin-start-btn {
        width: 100%;
        height: 40px;
        border-radius: 8px;
    }
    #pluginPage .plugin-qrcode-box {
        max-width: 180px;
    }
    #pluginPage .plugin-status-empty {
        min-height: auto;
    }
}

/* 移动端输入缩放修复：iOS Safari 点击小于 16px 的输入框会自动放大页面。
   仅在手机端作用于表单输入控件，不影响菜单、按钮、标题和普通卡片文字。 */
@media (max-width: 700px) {
    .page-shell input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
    .page-shell textarea,
    .page-shell select,
    .modal-card input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
    .modal-card textarea,
    .modal-card select,
    #forwardRulesContainer input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
    #forwardRulesContainer textarea,
    #forwardRulesContainer select,
    .plugin-form-float-field .plugin-float-input,
    .plugin-form-float-select select,
    .id-input-wrap input,
    .keyword-textarea,
    #logTypeSelect {
        font-size: 16px !important;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    .page-shell input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
    .page-shell select,
    .modal-card input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
    .modal-card select,
    #forwardRulesContainer input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
    #forwardRulesContainer select,
    .plugin-form-float-field .plugin-float-input,
    .plugin-form-float-select select,
    .id-input-wrap input,
    #logTypeSelect {
        min-height: 42px;
    }

    .page-shell textarea,
    .modal-card textarea,
    #forwardRulesContainer textarea,
    .keyword-textarea {
        line-height: 1.45 !important;
    }

    .keyword-textarea {
        min-height: 96px;
    }
}

