/* ============================================================
 * 按钮、设置弹窗、Toast 提示
 * ============================================================ */

/* ===== 按钮 ===== */
.btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.btn {
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border);
    transition: all var(--transition);
    letter-spacing: 0.03em;
    font-family: inherit;
    white-space: nowrap;
}

.btn-add {
    background: var(--blue-bg);
    color: var(--blue);
    border-color: var(--blue-border);
}

.btn-add:hover {
    background: var(--blue-bg-hover);
    border-color: var(--blue);
    box-shadow: 0 0 16px var(--blue-glow);
}

.btn-reset {
    background: transparent;
    color: var(--text-muted);
}

.btn-reset:hover {
    color: var(--red);
    border-color: var(--red-border);
    background: var(--red-bg-soft);
}

.btn-clear-cache {
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 6px 14px;
}

.btn-clear-cache:hover {
    color: var(--orange);
    border-color: var(--orange-border);
}

/* ===== 通用弹窗（抽卡规划 / 默认抽数设置共用） ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-panel {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-modal);
    transform: translateY(20px);
    transition: transform 0.25s ease;
    max-height: 90vh;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.modal-overlay.show .modal-panel {
    transform: translateY(0);
}

/* 右上角关闭按钮 */
.modal-close {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 0.85rem;
    line-height: 1;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition);
}

.modal-close:hover {
    color: var(--red);
    border-color: var(--red-border);
    background: var(--red-bg-soft);
}

/* ===== 抽卡规划弹窗 ===== */
.plan-modal {
    width: min(840px, 100%);
    padding: 20px 22px 18px;
}

.plan-modal .modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.plan-modal .modal-head h3 {
    font-size: 1.1rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-modal .modal-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 10px 0 14px;
}

/* 版本列表区域可滚动，弹窗本身不超出视口 */
.plan-modal .modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
    margin-right: -4px;
}

.plan-modal .modal-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.plan-modal .modal-foot .btn-clear-cache {
    margin-left: auto;
}

/* ===== 默认抽数设置弹窗 ===== */
.settings-modal {
    padding: 28px 32px;
    min-width: 320px;
    max-width: 90vw;
}

.settings-modal h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-modal .setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.settings-modal .setting-row label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.settings-modal .setting-row input {
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.95rem;
    color: var(--text);
    font-family: var(--font-mono);
    width: 90px;
    text-align: center;
    outline: none;
    transition: all var(--transition);
}

.settings-modal .setting-row input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--blue-focus-ring);
}

.settings-modal .setting-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.settings-modal .setting-hint b {
    color: var(--purple);
    font-weight: 600;
}

/* 默认抽数与功能开关之间的分隔线 */
.settings-modal .setting-divider {
    height: 1px;
    background: var(--border);
    margin: 18px 0 16px;
}

/* 开关行：标签与复选框两端对齐 */
.settings-modal .setting-row-switch {
    margin-bottom: 8px;
}

.settings-modal .setting-row-switch label {
    font-weight: 600;
}

.settings-modal input[type="checkbox"].setting-switch {
    width: 20px;
    height: 20px;
    padding: 0;
    accent-color: var(--purple);
    cursor: pointer;
    flex-shrink: 0;
}

.settings-modal .setting-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.settings-modal .setting-actions button {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border);
    transition: all var(--transition);
    font-family: inherit;
}

.settings-modal .btn-save-settings {
    background: var(--accent-bg-mid);
    color: var(--accent);
    border-color: var(--accent-border);
}

.settings-modal .btn-save-settings:hover {
    background: var(--accent-bg-strong);
    border-color: var(--accent);
}

.settings-modal .btn-cancel-settings {
    background: transparent;
    color: var(--text-muted);
}

.settings-modal .btn-cancel-settings:hover {
    color: var(--text);
    border-color: var(--border-hover);
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    padding: 10px 22px;
    border-radius: 24px;
    font-size: 0.85rem;
    color: var(--text);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: var(--shadow);
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(-6px);
}
