/* ===== r29：两大卡片 + 按钮切换 ===== */
.automation-cat-root{display:block}
.automation-cat-hidden{display:none!important}
.automation-feature-source{display:none!important}

/* 大卡片：沿用墨线卡（暖纸底 + 墨边 + 内侧白环 + 硬偏移） */
.ac-hub{
  margin:0 0 16px;
  padding:16px 20px 18px;
  border:1px solid #3c4132;
  border-radius:14px;
  background:linear-gradient(125deg,#fdf3e2eb,#fdf7ebf0 60%,#f8f1e4ed);
  box-shadow:inset 0 0 0 2px #fffcf2,3px 4px 0 #c0b6a34a,0 3px 8px #52442c0d;
}
.ac-hub:last-child{margin-bottom:4px}

/* 大卡片标题行（可点击折叠） */
.ac-hub-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  cursor:pointer;
  user-select:none;
  border-radius:10px;
}
.ac-hub-head:focus-visible{outline:2px solid #9f684d;outline-offset:3px}
.ac-hub-head-main{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;min-width:0}
.ac-hub-chev{
  flex:0 0 22px;
  width:22px;height:22px;
  color:#6f7651;
  transform:rotate(90deg);
  transition:transform .2s ease;
  pointer-events:none;
}
.ac-hub.is-collapsed .ac-hub-chev{transform:rotate(0deg)}

.ac-hub-title{margin:0;color:#2f332a;font-size:22px;font-weight:700;line-height:1.3;letter-spacing:.01em}
.ac-hub-hint{color:#8d8676;font-size:13px;line-height:1.4}

/* 折叠：只隐藏内容区，DOM 保留（teleport 挂载点必须常驻） */
.ac-hub.is-collapsed .ac-tabs,
.ac-hub.is-collapsed .ac-panes{display:none}
.ac-hub.is-collapsed{padding-bottom:14px}

/* 按钮组：与页面顶部「自动化 / 策略」标签栏同一套 ink 样式
   按钮等分整行（flex:1 1 0），所以无论 3 个还是 4 个都正好铺成一排，不会换行 */
.ac-tabs{
  display:flex;
  flex-wrap:nowrap;
  gap:4px;
  margin:14px 0 0;
  padding:6px;
  border:1.2px solid var(--ink-page-border, #363b2e);
  border-radius:12px;
  background:color-mix(in srgb, var(--ink-page-surface, #fffaf0) 88%, transparent);
  box-shadow:var(--ink-page-shadow, 3px 4px 0 #c0b6a34a, 0 3px 8px #52442c0d);
}

.ac-tab{
  appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:1 1 0;
  min-width:0;
  min-height:34px;
  padding:0 10px;
  border:1px solid #363b2e !important; /* !important 反杀 Settings 懒加载的 button{border:0} */
  border-radius:9px;
  background:transparent;
  box-shadow:none;
  color:var(--ink-page-muted, #777060);
  font-size:12px;
  font-weight:600;
  line-height:1.2;
  white-space:nowrap;
  cursor:pointer;
  transition:background .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease;
}
.ac-tab:hover:not(.is-active){
  border-color:#363b2e !important;
  background:#f6eddf;
  color:var(--ink-page-text, #383c30);
}
.ac-tab:focus-visible{outline:2px solid var(--ink-page-accent, #6f7651);outline-offset:2px}
.ac-tab.is-active{
  border-color:#363b2e !important;
  /* 选中态 = 概览页金豆豆卡背景 */
  background:linear-gradient(110deg,#fce4bc,#fae9cc);
  color:#363b2e;
  box-shadow:2px 3px 0 #beb5aa65;
}

/* 内容面板 */
.ac-panes{margin-top:14px}
.ac-pane{display:none}
.ac-pane.is-active{display:block}
.ac-pane-desc{margin:0 0 12px;color:#777060;font-size:15px;line-height:1.6}

.ac-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 18px}
.ac-controls label{min-width:0;cursor:pointer}

.ac-extras{display:grid;gap:12px;margin-top:14px}
.ac-extras:empty{display:none;margin-top:0}
.ac-extras>.rounded,.ac-extras>section,.ac-extras>p,.ac-extras>div{margin:0;max-width:100%}

/* 参数块（原 tailwind 紫/绿/琥珀/天蓝）统一成暖纸系：
   同一色相、只走明度，四块之间约 4% 的深浅差 —— 看得出层次，但不会抢眼。 */
.ac-hub .ac-extras>:not(p){
  border:1px solid #e0d4bf;
  border-radius:10px;
  background:#fcf5ea;
  box-shadow:none;
}
.ac-hub .ac-extras>.bg-sky-50{background:#faf1e1}
.ac-hub .ac-extras>.bg-green-50{background:#f6efdb}
.ac-hub .ac-extras>.bg-purple-50{background:#f7ebd8}
.ac-hub .ac-extras>.bg-amber-50{background:#f3e5cf}
.ac-hub .ac-extras>section[aria-label="自动出售延迟"]{background:#fcf5ea}
.dark .ac-hub .ac-extras>:not(p){border-color:#4a4b40;background:#2c2d26}
.dark .ac-hub .ac-extras>.bg-sky-50{background:#2b2d27}
.dark .ac-hub .ac-extras>.bg-green-50{background:#2a2d25}
.dark .ac-hub .ac-extras>.bg-purple-50{background:#2d2b27}
.dark .ac-hub .ac-extras>.bg-amber-50{background:#2e2b24}

/* 好友操作时段的 teleport 容器：不限制高度，避免内容被裁 */
.ac-teleport-body{max-height:none!important;overflow:visible!important;margin-top:12px}
.ac-teleport-body:empty{display:none}
.automation-friend-schedule{margin-top:0;cursor:default}
.automation-friend-schedule input[type=time]{max-width:100%;box-sizing:border-box}
.automation-friend-schedule button{cursor:pointer}

/* 开关：与大卡片同风格（墨线描边 + 暖纸底 + 硬偏移） */
.ac-hub .base-switch{border:1.5px solid #363b2e;background:#f7eedd;box-shadow:inset 0 0 0 2px #fffcf2}
.ac-hub .base-switch::after{background:#fffdf8;border:1px solid #363b2e}
.nc-console-panel .ac-hub input:checked+.base-switch{
  background:linear-gradient(125deg,#8b9467,#6f7651);
  box-shadow:inset 0 0 0 2px #eef2e2;
}
.ac-hub input:checked+.base-switch::after{background:#fffdf8;border-color:#363b2e}
.ac-hub .automation-feature-proxy-control{min-width:0;cursor:pointer}
.ac-hub .automation-feature-proxy-control.is-disabled{cursor:not-allowed;opacity:.6}

/* 面板内的普通按钮（保存好友操作时段等），排除切换按钮 */
.ac-hub button:not(.ac-tab){
  border:1.5px solid #363b2e;
  border-radius:10px;
  background:linear-gradient(125deg,#fdf3e2,#fdf8ec 60%,#f8f1e4);
  box-shadow:2px 2px 0 #c0b6a34a;
  color:#383c30;
  font-weight:600;
}
.ac-hub button:not(.ac-tab):hover{background:linear-gradient(125deg,#fbefd9,#fdf7e9 60%,#f6efe0)}

/* 账号昵称行（云端快照并入） */
.automation-account-header{width:100%;gap:12px}
.automation-account-header>h3{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}
.automation-account-header>.cloud-automation-snapshot{flex:0 0 auto;margin:0!important}

@media(max-width:640px){
  .ac-hub{padding:14px 14px 16px;border-radius:12px}
  .ac-hub-title{font-size:19px}
  .ac-hub-hint{font-size:12px}
  .ac-tabs{gap:3px;padding:5px}
  /* 窄屏也不换行：等分 + 缩字号缩内边距，四个按钮仍在一排 */
  .ac-tab{min-height:32px;padding:0 6px;font-size:11px}
  .ac-controls{grid-template-columns:minmax(0,1fr);gap:10px}
  .ac-pane-desc{font-size:14px}
}
