*]:min-w-0',
+
*]:min-w-0',
// 间距照旧站 .frow(gap: 8px 10px):列间 10px 是「标签在左」不贴到上一格控件的地板,
// 之前这里只在 tight 时给 gap,非 tight 档位间距为 0,窄屏上「镜号」几乎贴着上一格的输入框。
tight ? 'gap-[8px]' : 'gap-x-[10px] gap-y-[8px]',
cols === undefined && 'max-mid:grid-cols-2',
(cols === 3 || cols === 4) && 'max-mid:grid-cols-2',
(cols === 4 || cols === 6) && 'max-nav:grid-cols-2',
- stack && 'gap-y-[10px] [&>*]:flex-col [&>*]:items-stretch [&>*]:gap-[5px] [&>*]:flex-none [&>*]:w-auto [&>*:not(span)]:w-full',
+ stack && 'gap-y-[10px] [&>*]:flex-col [&>*]:items-stretch [&>*]:gap-[5px] [&>*]:w-auto [&>*:not(span)]:w-full',
className)}
style={{ gridTemplateColumns: tracks }}>
{children}
diff --git a/frontend/src/styles/base.css b/frontend/src/styles/base.css
index 4495585..0324c90 100644
--- a/frontend/src/styles/base.css
+++ b/frontend/src/styles/base.css
@@ -39,10 +39,35 @@
}
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=color]),
select { height: var(--ctl-h); padding-block: 0 }
- textarea { min-height: var(--ctl-h); resize: vertical; line-height: 1.65 }
+
+ /* 多行文本也归档位管:行数由 rows 决定,但「一行」必须正好等于 --ctl-h。
+ 默认 line-height 1.65 时 rows=2 的裸 textarea 量出来是 41.6px,
+ 比同一行里的 input(38px)高 3.6px,一排字段就参差不齐;
+ 把上下 padding 按 --ctl-h 倒推,rows=1 → 38px,之后每多一行正好多 1.5em。 */
+ textarea {
+ min-height: var(--ctl-h);
+ resize: vertical;
+ line-height: 1.5;
+ padding-block: calc((var(--ctl-h) - 1.5em - 2px) / 2);
+ }
input:focus, textarea:focus, select:focus { border-color: var(--c-accent-deep) }
input:disabled, textarea:disabled, select:disabled { @apply bg-sunken text-faint; opacity: .7 }
- select { appearance: none; -webkit-appearance: none }
+
+ /* 原生下拉:抹掉 UA 皮肤后必须自己补箭头,并给箭头腾出右侧空间 */
+ select {
+ appearance: none; -webkit-appearance: none;
+ background-image: var(--ctl-caret);
+ background-repeat: no-repeat;
+ background-position: right 8px center;
+ background-size: 15px 15px;
+ padding-right: 28px;
+ }
+
+ /* 数字框:UA 的 spinner 比控件本身还高(模型抽屉里那颗大箭头),
+ 尺寸和配色都不受控,统一去掉;步进动作交给旁边的按钮。 */
+ input[type=number] { appearance: textfield; -moz-appearance: textfield }
+ input[type=number]::-webkit-outer-spin-button,
+ input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0 }
/* 勾选类控件不参与定高,跟随系统强调色改成主色 */
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--c-accent-fill) }
diff --git a/frontend/src/styles/tokens.css b/frontend/src/styles/tokens.css
index 6c5a2c7..2bc72cc 100644
--- a/frontend/src/styles/tokens.css
+++ b/frontend/src/styles/tokens.css
@@ -164,6 +164,10 @@
--ctl-h-main: 38px;
--ctl-h-md: 31px;
--ctl-h: var(--ctl-h-main);
+ /* 裸