/* ============================================================
   theme.css v13 - 完全重写
   ============================================================ */

#darkToggle{display:none !important}
#bgToggle{display:none !important}
body[data-layout="classic"] #settingsToggle{display:none !important}
body[data-layout="compact"] #appearanceToggle{display:none !important}

.theme-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:6px 0}

.theme-btn{
    position:relative;
    display:flex;align-items:center;gap:8px;
    padding:10px 12px;border-radius:10px;
    background:var(--btn-gray);color:var(--text-ai);
    font-size:14px;text-align:left;
    border:none;cursor:pointer;
    font-family:inherit;line-height:1.4;
    transition: background .18s ease, color .18s ease, transform .12s ease;
}
.theme-btn:active{transform:scale(.97)}
.theme-btn small{display:block;font-size:11px;opacity:.7;font-weight:400}

/* 主题按钮（配色）：每个按钮自带 --btn-active-bg/fg */
.theme-btn[data-theme-key].active{
    background: var(--btn-active-bg, var(--btn-gray));
    color: var(--btn-active-fg, var(--text-ai));
}
.theme-btn[data-theme-key].active small{color:inherit;opacity:.85}
.theme-btn[data-theme-key].active::after{
    content:'✓';position:absolute;top:6px;right:10px;
    font-size:16px;font-weight:bold;line-height:1;color:inherit;
}

/* 布局按钮（经典/紧凑）：选中态跟随当前主题特征色 */
.theme-btn[data-layout-key].active,
.settings-inline-btn.active{
    background: var(--cur-sel-bg, #1e2129);
    color: var(--cur-sel-fg, #ffffff);
}
.theme-btn[data-layout-key].active::after{
    content:'✓';position:absolute;top:6px;right:10px;
    font-size:16px;font-weight:bold;line-height:1;color:inherit;
}

.theme-dot{width:14px;height:14px;border-radius:50%;flex-shrink:0;
           box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}

.settings-list{display:flex;flex-direction:column;gap:6px;margin:6px 0}
.settings-group-title{
    font-size:12px;color:var(--text-ai);opacity:.55;
    margin:10px 2px 2px;font-weight:600;letter-spacing:.5px;
}
.settings-group-title:first-child{margin-top:0}
.settings-item{
    padding:12px 16px;border-radius:10px;
    background:var(--btn-gray);color:var(--text-ai);
    font-size:14px;text-align:left;border:none;cursor:pointer;
    font-family:inherit;min-height:44px;
    transition: background .18s ease, transform .12s ease;
}
.settings-item:active{transform:scale(.98);background:var(--btn-gray-active)}
.settings-item.danger{color:#ff4d4f}

.settings-inline-row{display:flex;gap:8px;margin:2px 0 4px}
.settings-inline-btn{
    flex:1;padding:12px 16px;border-radius:10px;
    background:var(--btn-gray);color:var(--text-ai);
    font-size:14px;text-align:center;
    border:none;cursor:pointer;
    font-family:inherit;min-height:44px;
    transition: background .18s ease, color .18s ease, transform .12s ease;
}
.settings-inline-btn:active{transform:scale(.98)}

.send-btn.stopping{
    background:#ff4d4f !important;color:#fff !important;
    box-shadow:0 2px 8px rgba(255,77,79,.4);
}
.send-btn.stopping:active{transform:scale(.9)}


/* v15 只有浅色主题（含自动+浅色系统）给选中按钮加灰描边 */
body[data-theme-key="light"] .theme-btn.active,
body[data-theme-key="auto"]:not(.dark) .theme-btn.active,
body[data-theme-key="light"] .settings-inline-btn.active,
body[data-theme-key="auto"]:not(.dark) .settings-inline-btn.active{
    box-shadow: inset 0 0 0 2px rgba(0,0,0,.15);
}

/* v17 紧凑模式：顶栏只留模型选择器 + ⚙️ 设置 */
body[data-layout="compact"] .btn-group-left,
body[data-layout="compact"] #bgToggle,
body[data-layout="compact"] #darkToggle,
body[data-layout="compact"] #appearanceToggle{
    display: none !important;
}

/* v18 抽屉模式：模型选择器也隐藏 */
body[data-layout="compact"] #modelSelect{display:none !important}

/* FINAL 抽屉模式：顶栏只留 ⚙️ 设置 */
body[data-layout="compact"] .btn-group-left,
body[data-layout="compact"] #modelSelect,
body[data-layout="compact"] #bgToggle,
body[data-layout="compact"] #darkToggle,
body[data-layout="compact"] #appearanceToggle{
    display: none !important;
}
