/* 学习计划向导弹窗样式 */

/* 弹窗覆盖层 */
#studyWizardModal {
    position: fixed; inset: 0; background: rgba(0,0,0,.65);
    display: flex; align-items: center; justify-content: center;
    z-index: 300; backdrop-filter: blur(2px);
}
#studyWizardModal .sw-dialog {
    background: var(--bg-panel); border: 1px solid var(--border); border-radius: 16px;
    width: 600px; max-width: 94vw; max-height: 85vh; display: flex; flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
}

/* 头部 */
.sw-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 22px 14px; border-bottom: 1px solid var(--border);
}
.sw-header-title { font-size: 16px; font-weight: bold; }
.sw-close {
    background: none; border: none; color: var(--text-dim); font-size: 20px;
    cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: all .15s;
}
.sw-close:hover { color: var(--text-main); background: var(--bg-card); }

/* 步骤指示器 */
.sw-steps {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; padding: 14px 22px 10px;
}
.sw-step-item {
    display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim);
    transition: color .2s;
}
.sw-step-item.active { color: var(--primary); font-weight: bold; }
.sw-step-item.done { color: var(--success); }
.sw-step-num {
    width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: bold; border: 2px solid var(--border); background: var(--bg-card);
    transition: all .2s;
}
.sw-step-item.active .sw-step-num { border-color: var(--primary); background: var(--primary); color: #000; }
.sw-step-item.done .sw-step-num { border-color: var(--success); background: var(--success); color: #000; }
.sw-step-line { width: 30px; height: 2px; background: var(--border); }
.sw-step-item.done + .sw-step-line { background: var(--success); }

/* 内容区域 */
.sw-body { flex: 1; overflow-y: auto; padding: 16px 22px; }

/* 底部操作栏 */
.sw-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 22px; border-top: 1px solid var(--border);
}
.sw-btn {
    padding: 9px 22px; border-radius: 8px; border: none; font-size: 13px;
    font-weight: bold; cursor: pointer; transition: all .15s;
}
.sw-btn-ghost { background: var(--bg-card); color: var(--text-dim); border: 1px solid var(--border); }
.sw-btn-ghost:hover { color: var(--text-main); border-color: #555; }
.sw-btn-primary { background: var(--primary); color: #000; }
.sw-btn-primary:hover { opacity: .85; }
.sw-btn:disabled { opacity: .4; cursor: not-allowed; }
.sw-selected-count { font-size: 12px; color: var(--text-dim); }

/* ── 步骤1：资料选择 ── */
.sw-group {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
    margin-bottom: 10px; overflow: hidden;
}
.sw-group-header {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px;
    cursor: pointer; user-select: none; transition: background .15s;
}
.sw-group-header:hover { background: rgba(255,255,255,.03); }
.sw-group-icon { font-size: 18px; }
.sw-group-name { flex: 1; font-size: 14px; font-weight: bold; }
.sw-group-toggle {
    font-size: 12px; color: var(--text-dim); transition: transform .2s;
}
.sw-group.collapsed .sw-group-toggle { transform: rotate(-90deg); }
.sw-group-items { padding: 0 14px 10px; }
.sw-group.collapsed .sw-group-items { display: none; }

.sw-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px;
    border-radius: 8px; cursor: pointer; transition: background .15s; user-select: none;
}
.sw-item:hover { background: rgba(255,255,255,.04); }
.sw-item-check {
    width: 18px; height: 18px; border: 2px solid var(--border); border-radius: 4px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: all .15s; font-size: 12px; color: transparent;
}
.sw-item.selected .sw-item-check {
    border-color: var(--primary); background: var(--primary); color: #000;
}
.sw-item-info { flex: 1; }
.sw-item-name { font-size: 13px; }
.sw-item-desc { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.sw-item-total {
    font-size: 12px; color: var(--text-dim); white-space: nowrap;
    background: rgba(255,255,255,.05); padding: 2px 8px; border-radius: 10px;
}

/* ── 步骤2：目标设置 ── */
.sw-target-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
    padding: 14px 16px; margin-bottom: 10px;
}
.sw-target-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
}
.sw-target-name { font-size: 14px; font-weight: bold; }
.sw-target-unit { font-size: 12px; color: var(--text-dim); }

.sw-mode-tabs {
    display: flex; gap: 6px; margin-bottom: 12px;
}
.sw-mode-tab {
    flex: 1; padding: 8px; text-align: center; border-radius: 8px;
    border: 1px solid var(--border); background: none; color: var(--text-dim);
    font-size: 12px; cursor: pointer; transition: all .15s;
}
.sw-mode-tab.active { border-color: var(--primary); color: var(--primary); background: rgba(0,255,157,.08); }
.sw-mode-tab:hover:not(.active) { border-color: #555; color: var(--text-main); }

.sw-target-row {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.sw-target-input {
    width: 80px; padding: 6px 8px; background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: 6px; color: var(--text-main); font-size: 13px; text-align: center;
}
.sw-target-input:focus { outline: none; border-color: var(--primary); }
.sw-target-hint { font-size: 11px; color: var(--text-dim); margin-top: 6px; }

/* ── 步骤3：日期安排 ── */
.sw-form-group { margin-bottom: 14px; }
.sw-form-label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 5px; }
.sw-form-input {
    width: 100%; padding: 10px 12px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text-main); font-size: 14px; font-family: inherit;
}
.sw-form-input:focus { outline: none; border-color: var(--primary); }
.sw-date-row { display: flex; gap: 12px; }
.sw-date-row .sw-form-group { flex: 1; }

.sw-summary {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
    padding: 14px 16px; margin-top: 16px;
}
.sw-summary-title { font-size: 13px; font-weight: bold; margin-bottom: 8px; color: var(--primary); }
.sw-summary-row {
    display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0;
}
.sw-summary-label { color: var(--text-dim); }
.sw-summary-value { font-weight: bold; }

/* 加载状态 */
.sw-loading {
    text-align: center; padding: 40px 0; color: var(--text-dim); font-size: 14px;
}
.sw-loading::before { content: '⏳ '; }

/* 响应式 */
@media (max-width: 640px) {
    #studyWizardModal .sw-dialog { width: 100%; max-width: 100%; max-height: 100vh; border-radius: 0; }
    .sw-date-row { flex-direction: column; gap: 0; }
}

/* ── 步骤3：计划模式与惩罚开关 ── */
.sw-mode-hint {
    font-size: 12px; color: var(--text-dim); margin-top: 6px;
    padding: 6px 10px; background: rgba(255,255,255,.03); border-radius: 6px;
}

/* Toggle 开关行 */
.sw-toggle-row {
    display: flex; align-items: center; justify-content: space-between;
}
.sw-toggle-label { font-size: 13px; color: var(--text-main); }

/* Toggle 开关组件 */
.sw-toggle {
    position: relative; display: inline-block; width: 42px; height: 22px; cursor: pointer;
}
.sw-toggle.disabled { opacity: .4; cursor: not-allowed; }
.sw-toggle input { opacity: 0; width: 0; height: 0; }
.sw-toggle-slider {
    position: absolute; inset: 0; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 22px; transition: all .2s;
}
.sw-toggle-slider::before {
    content: ''; position: absolute; width: 16px; height: 16px; left: 2px; bottom: 2px;
    background: var(--text-dim); border-radius: 50%; transition: all .2s;
}
.sw-toggle input:checked + .sw-toggle-slider {
    background: var(--primary); border-color: var(--primary);
}
.sw-toggle input:checked + .sw-toggle-slider::before {
    transform: translateX(20px); background: #000;
}

/* 惩罚提示 */
.sw-punishment-hint {
    font-size: 12px; color: var(--text-dim); margin-top: 6px;
    font-style: italic;
}
.sw-punishment-warn {
    font-size: 12px; color: var(--warning, #f0ad4e); margin-top: 6px;
    padding: 6px 10px; background: rgba(240,173,78,.08); border-radius: 6px;
}
.sw-punishment-ok {
    font-size: 12px; color: var(--success, #00ff9d); margin-top: 6px;
}
