/* 订阅分组编辑台：仅前景组件卡进行一处低幅运动。 */
.rig-frame { position: relative; }
.rig { position: relative; width: 590px; height: 600px; margin: 0; }
.rig-plate { position: absolute; inset: 40px 0 12px; background: var(--bg-panel-2); color: var(--text); border-radius: var(--r-plate); }
.win { position: absolute; left: 32px; top: 76px; width: 372px; z-index: 2; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-window); overflow: hidden; }
.win-bar { height: 40px; display: flex; align-items: center; justify-content: space-between; padding-inline: 10px; border-bottom: 1px solid var(--border); }
.win-tools { display: flex; gap: 4px; }
.tool { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--r-tiny); background: var(--bg); color: var(--text); }
.tool svg { width: 14px; height: 14px; }
.win-title { font-size: 12px; font-weight: var(--weight-bold); color: var(--text-muted); letter-spacing: .01em; }
.band-wrap { padding: 14px 14px 0; }
.band { height: 68px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); border-radius: var(--r-control); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-ring); }
.band-ring { width: 38px; height: 38px; display: grid; place-items: center; border: 2px solid var(--on-accent); border-radius: var(--r-circle); color: var(--on-accent); }
.band-ring svg { width: 18px; height: 18px; }
.insert { width: 20px; height: 20px; margin: 8px auto 0; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--r-circle); background: var(--bg); color: var(--text-muted); }
.insert svg { width: 10px; height: 10px; }
.win-body { display: flex; flex-direction: column; gap: 12px; padding: 6px 20px 18px; }
.f-label { display: block; margin-bottom: 6px; font-size: 12px; line-height: 16px; font-weight: var(--weight-medium); color: var(--text-muted); }
.f-box { min-height: 32px; display: flex; align-items: center; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--r-control); background: var(--bg); color: var(--text); font-size: 13px; overflow-wrap: anywhere; }
.f-box.is-mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: -.01em; }
.f-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.switch-line { height: 32px; display: flex; align-items: center; gap: 10px; }
.switch { position: relative; display: inline-block; flex-shrink: 0; width: 34px; height: 20px; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); }
.switch::after { content: ""; position: absolute; top: 2px; left: 16px; width: 16px; height: 16px; border-radius: var(--r-circle); background: var(--on-accent); box-shadow: var(--shadow-hair); }
.state { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-muted); }
.dot { display: inline-block; width: 7px; height: 7px; flex-shrink: 0; border-radius: var(--r-circle); background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.rule-line { min-height: 30px; display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: var(--r-control); background: var(--bg-panel); color: var(--text); font-family: var(--font-mono); font-size: 12px; }
.rig .rule-line .k { color: var(--success); }
.rule-line .arrow { color: var(--text-muted); }
.drop { height: 66px; display: grid; place-items: center; border: 1.5px dashed var(--accent-ring); border-radius: var(--r-control); }
.ghost-btn { width: 112px; height: 30px; display: grid; place-items: center; border-radius: var(--r-control); background: var(--accent-ghost); color: var(--accent); font-size: 12px; font-weight: var(--weight-bold); }
.rig .ghost-btn { opacity: .6; }
.rail { position: absolute; left: 418px; top: 0; width: 140px; height: 600px; z-index: 1; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, var(--transparent) 0, var(--text) 80px, var(--text) calc(100% - 80px), var(--transparent) 100%); mask-image: linear-gradient(to bottom, var(--transparent) 0, var(--text) 80px, var(--text) calc(100% - 80px), var(--transparent) 100%); }
.comp { position: absolute; left: 0; width: 140px; height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-hair); }
.comp-ico { position: relative; width: 52px; height: 44px; display: grid; place-items: center; border-radius: var(--r-control); background: var(--bg-panel); color: var(--text); }
.comp-ico svg { width: 24px; height: 24px; }
.comp-ico .dot { position: absolute; top: -2px; right: -2px; }
.comp-label { font-size: 12.5px; font-weight: var(--weight-heavy); letter-spacing: .01em; }
.slot-1 { top: -21px; }
.slot-2 { top: 143px; }
.slot-3 { top: 307px; }
.slot-4 { top: 471px; }
.comp.is-ghost { background: var(--transparent); color: var(--text); border: 1.5px dashed var(--accent-ring); box-shadow: none; }
.comp.is-ghost .comp-ico, .comp.is-ghost .comp-label { opacity: .32; }
.comp.is-dragged { left: 296px; top: 360px; z-index: 4; border-color: var(--accent-ring); box-shadow: var(--shadow-lift); transform: rotate(-5deg); animation: card-hover 3.6s ease-in-out infinite alternate; }
.comp.is-dragged .comp-label { color: var(--accent); }
.grab { position: absolute; right: 22px; bottom: 30px; width: 18px; height: 18px; color: var(--text); }
.grab path { stroke: var(--bg); stroke-width: 1.2; stroke-linejoin: round; }
.wire { position: absolute; inset: 0; width: 590px; height: 600px; z-index: 3; pointer-events: none; overflow: visible; }
.wire-path { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 4; stroke-linecap: round; }
.wire-start { fill: var(--bg); stroke: var(--accent); stroke-width: 1.5; }
.wire-end { fill: var(--accent); }
@keyframes card-hover { from { transform: rotate(-5deg) translate3d(0, 0, 0); } to { transform: rotate(-5deg) translate3d(0, -6px, 0); } }

/* 设置面板对照 */
.settings-tabs { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.6fr); gap: var(--space-10); align-items: start; }
.tab-list { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0; margin: 0 0 var(--space-6); }
.tab-list [role="tab"] { min-height: 44px; padding: 10px 18px; border: 1px solid var(--border); border-radius: var(--r-control); background: var(--bg); color: var(--text-muted); font-weight: var(--weight-bold); text-align: left; }
.tab-list [role="tab"]:hover { border-color: var(--border-strong); color: var(--text); }
.tab-list [role="tab"][aria-selected="true"] { background: var(--bg-panel-2); color: var(--accent-dark); border-color: var(--accent-ring); }
.settings-tabs .tab-list { flex-direction: column; gap: 0; margin: 0; }
.settings-tabs [role="tab"] { position: relative; display: flex; align-items: flex-start; gap: var(--space-4); width: 100%; min-height: 92px; border: 0; border-radius: 0; padding: var(--space-5); background: var(--bg); color: var(--text); }
.settings-tabs [role="tab"]::before { content: ""; position: absolute; inset: 12px auto 12px 0; width: 3px; background: var(--transparent); }
.settings-tabs [role="tab"][aria-selected="true"] { background: var(--bg-panel); color: var(--text); }
.settings-tabs [role="tab"][aria-selected="true"]::before { background: var(--accent); }
.tab-icon { width: 24px; height: 24px; flex-shrink: 0; color: var(--text); }
.tab-title { display: block; font-weight: var(--weight-heavy); }
.tab-description { display: block; margin-top: 4px; color: var(--text-muted); font-size: var(--size-small); font-weight: var(--weight-normal); }
.tab-panel { min-width: 0; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); color: var(--text); }
.tab-panel-copy { padding: var(--space-8); }
.tab-panel-copy p { color: var(--text-muted); }
.setting-slice { padding: var(--space-8); border-bottom: 1px solid var(--border); background: var(--bg-panel); color: var(--text); border-radius: var(--r-card) var(--r-card) 0 0; }
.setting-window { max-width: 480px; margin-inline: auto; padding: var(--space-6); border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); color: var(--text); box-shadow: var(--shadow-hair); }
.setting-window .f-box { margin-bottom: var(--space-4); }
.setting-heading { margin-bottom: var(--space-5); padding-bottom: var(--space-3); border-bottom: 1px solid var(--border); font-size: 14px; font-weight: var(--weight-bold); }
.setting-options { display: flex; gap: var(--space-4); flex-wrap: wrap; font-size: 14px; }
.setting-options label { display: inline-flex; align-items: center; gap: var(--space-2); }
.setting-options input { accent-color: var(--accent); }

/* 目录的直接父级须覆盖全部章节，不能只包目录自身。 */
.toc { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: var(--space-2); overflow-x: auto; max-width: 100%; padding: var(--space-3); margin-bottom: var(--space-8); border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); color: var(--text); overscroll-behavior-inline: contain; }
.toc a { flex-shrink: 0; min-height: 44px; display: inline-flex; align-items: center; padding: 8px 14px; font-size: 14px; border-radius: var(--r-control); }
.toc a:hover, .toc a[aria-current="location"] { background: var(--bg-panel-2); color: var(--accent-dark); }
.toc.is-static { position: static; }
.faq-item { border-bottom: 1px solid var(--border); background: var(--bg); color: var(--text); }
.faq-item summary { position: relative; padding: var(--space-6) 40px var(--space-6) 0; font-weight: var(--weight-bold); cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; top: 24px; right: 8px; color: var(--accent); font-family: var(--font-mono); }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding-right: var(--space-8); padding-bottom: var(--space-6); color: var(--text-muted); }
.faq-answer p:last-child { margin-bottom: 0; }
.term-card { padding: var(--space-6); border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); color: var(--text); min-width: 0; }
.term-card dt { margin-bottom: var(--space-3); font-family: var(--font-mono); font-size: 20px; font-weight: var(--weight-heavy); overflow-wrap: anywhere; }
.term-card dd { margin: 0; color: var(--text-muted); }
.badge, .tag { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; min-height: 26px; padding: 3px 9px; border: 1px solid var(--border); border-radius: var(--r-control); background: var(--bg-panel); color: var(--text-muted); font-size: 12px; font-weight: var(--weight-bold); line-height: 1.5; overflow-wrap: anywhere; }
.badge-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.badge-recommended { background: var(--bg-panel-2); color: var(--accent-dark); border-color: var(--accent-ring); }
.badge-retired { background: var(--bg-panel); color: var(--text-muted); border-color: var(--border-strong); }
.badge-retired::before { content: ""; width: 6px; height: 6px; flex-shrink: 0; border-radius: var(--r-circle); background: var(--warn); }
.tag { font-weight: var(--weight-medium); }
.download-card { padding: var(--space-8); min-width: 0; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); color: var(--text); }
.download-card.is-featured { border-color: var(--accent-ring); }
.download-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-bottom: var(--space-5); }
.download-card-head h3 { margin: 0; }
.download-meta { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-block: var(--space-5); font-size: var(--size-small); color: var(--text-muted); }
.download-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
.download-note { margin-top: var(--space-4); color: var(--text-muted); font-size: var(--size-small); }
.article-card { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); min-width: 0; padding: var(--space-8); border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); color: var(--text); }
.article-card h3 { font-size: 21px; margin: 0; }
.article-card h3 a:hover { color: var(--accent); }
.article-card p { margin: 0; color: var(--text-muted); }
.article-card time { margin-top: auto; color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; }
.callout { margin: var(--space-6) 0; padding: var(--space-6); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--r-control); background: var(--bg-panel); color: var(--text); }
.callout p:last-child { margin-bottom: 0; }
.callout-title { display: block; margin-bottom: var(--space-2); font-weight: var(--weight-heavy); }
.callout-warn { border-left-color: var(--warn); }
.callout-error { border-left-color: var(--error); }
.table-scroll { overflow-x: auto; max-width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: var(--r-card); -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; background: var(--bg); color: var(--text); }
.data-table :is(th, td), .prose table :is(th, td), .document-body table :is(th, td) { min-width: 7em; padding: 14px 18px; vertical-align: top; border-bottom: 1px solid var(--border); overflow-wrap: normal; word-break: normal; }
.data-table th, .prose th, .document-body th { background: var(--bg-panel); color: var(--text); font-weight: var(--weight-bold); }
.data-table tr:last-child td { border-bottom: 0; }
.prose table, .document-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; min-width: 0; border-collapse: collapse; text-align: left; background: var(--bg); color: var(--text); }
.prose table code, .document-body table code, .data-table code { overflow-wrap: anywhere; }
.dl-fab { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 30; display: flex; align-items: center; gap: var(--space-3); max-width: calc(100% - 40px); min-height: 54px; padding: 12px 18px; border: 1px solid var(--accent); border-radius: var(--r-control); background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-window); font-size: 14px; font-weight: var(--weight-bold); }
.dl-fab svg { width: 22px; height: 22px; flex-shrink: 0; }
.dl-fab:hover { background: var(--accent-dark); color: var(--on-accent); }
.article-download { margin-top: var(--space-12); padding: var(--space-8); border: 1px solid var(--accent-ring); border-radius: var(--r-card); background: var(--bg-panel-2); color: var(--text); }
.article-download h2 { margin-top: 0; font-size: 26px; }
.article-download p { color: var(--text-muted); }
.article-has-fab { padding-bottom: 96px; }

/* 预览专用家具，不改变公共组件的尺度。 */
.swatch-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.swatch { min-width: 0; margin: 0; border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
.swatch-color { display: block; height: 72px; }
.swatch figcaption { padding: var(--space-3); font-family: var(--font-mono); font-size: 12px; overflow-wrap: anywhere; }
.swatch-bg { background: var(--bg); }
.swatch-panel { background: var(--bg-panel); }
.swatch-panel-2 { background: var(--bg-panel-2); }
.swatch-border { background: var(--border); }
.swatch-border-strong { background: var(--border-strong); }
.swatch-accent { background: var(--accent); }
.swatch-accent-dark { background: var(--accent-dark); }
.swatch-accent-ring { background: var(--accent-ring); }
.swatch-accent-ghost { background: var(--accent-ghost); }
.swatch-text { background: var(--text); }
.swatch-muted { background: var(--text-muted); }
.swatch-faint { background: var(--text-faint); }
.swatch-on-accent { background: var(--on-accent); }
.swatch-success { background: var(--success); }
.swatch-success-soft { background: var(--success-soft); }
.swatch-warn { background: var(--warn); }
.swatch-error { background: var(--error); }
.swatch-veil { background: var(--veil); }
.swatch-transparent { background: var(--transparent); }
.type-sample { padding-block: var(--space-6); border-bottom: 1px solid var(--border); }
.type-display { font-family: var(--font-display); font-size: var(--size-h1); font-weight: var(--weight-display); line-height: 1.14; letter-spacing: var(--tracking-display); }
.type-section { font-family: var(--font-display); font-size: var(--size-h2); font-weight: var(--weight-display); line-height: 1.2; }
.preview-button-grid { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.preview-button-grid > div { display: grid; justify-items: start; gap: var(--space-2); }
@media (max-width: 768px) {
  .settings-tabs { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
  .settings-tabs .tab-list { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: var(--space-2); gap: var(--space-2); }
  .settings-tabs [role="tab"] { width: auto; min-height: 44px; flex-shrink: 0; padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--r-pill); align-items: center; }
  .settings-tabs [role="tab"]::before, .settings-tabs .tab-description { display: none; }
  .settings-tabs [role="tab"][aria-selected="true"] { background: var(--bg-panel-2); color: var(--accent-dark); border-color: var(--accent-ring); }
  .tab-panel-copy, .setting-slice { padding: var(--space-6); }
  .swatch-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .comp.is-dragged { animation: none; transform: none; }
  .download-card, .article-card, .article-download { padding: var(--space-6); }
  .swatch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dl-fab { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); max-width: calc(100% - 32px); }
}
@media (prefers-reduced-motion: reduce) {
  .comp.is-dragged { animation: none; }
}