style: 优化剧本生成器移动端布局(方案 A)

主要变更:
- 参数区域改为并排两列 grid 布局,匹配原型图
- 全面调小字体尺寸(input: 22rpx→18rpx, label: 16rpx→17rpx)
- 优化间距(主容器 padding: 32rpx→24rpx, NPC 容器:24rpx→16rpx)
- 添加超小屏幕(≤320px)适配媒体查询
- 圆角调整接近原型图(主容器:56rpx)
- 输入框高度降低(72rpx→64rpx),视觉更紧凑

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 19:31:12 +08:00
parent d36574440b
commit 97a74d5969
+146 -112
View File
@@ -30,7 +30,7 @@
<view class="section-card glass-card-main"> <view class="section-card glass-card-main">
<view class="input-group"> <view class="input-group">
<text class="label">剧本主题</text> <text class="label">1. 剧本主题</text>
<input <input
class="glass-input theme-input" class="glass-input theme-input"
placeholder="如:巅峰重现、治愈之旅、赛博觉醒..." placeholder="如:巅峰重现、治愈之旅、赛博觉醒..."
@@ -40,7 +40,7 @@
<view class="input-group"> <view class="input-group">
<view class="npc-header"> <view class="npc-header">
<text class="label">关键配角/新的人设</text> <text class="label">2. 关键配角/新的人设</text>
<button class="add-btn" @click="addNpc">+ 添加</button> <button class="add-btn" @click="addNpc">+ 添加</button>
</view> </view>
@@ -80,35 +80,35 @@
</view> </view>
<view class="params-section"> <view class="params-section">
<view class="param-row"> <text class="param-section-label">3. 核心参数</text>
<text class="param-label">叙事风格</text> <view class="params-container">
<view class="param-options"> <view class="param-group">
<text <text class="param-sublabel">叙事风格</text>
v-for="style in scriptStyles" <view class="param-options">
:key="style" <text
class="param-option" v-for="style in scriptStyles"
:class="{ active: scriptConfig.style === style }" :key="style"
@click="scriptConfig.style = style" class="param-option"
> :class="{ active: scriptConfig.style === style }"
{{ style }} @click="scriptConfig.style = style"
</text> >
{{ style }}
</text>
</view>
</view> </view>
</view> <view class="param-group">
</view> <text class="param-sublabel">故事篇幅</text>
<view class="param-options">
<view class="params-section"> <text
<view class="param-row"> v-for="length in scriptLengths"
<text class="param-label">故事篇幅</text> :key="length"
<view class="param-options"> class="param-option"
<text :class="{ active: scriptConfig.length === length }"
v-for="length in scriptLengths" @click="scriptConfig.length = length"
:key="length" >
class="param-option" {{ length }}
:class="{ active: scriptConfig.length === length }" </text>
@click="scriptConfig.length = length" </view>
>
{{ length }}
</text>
</view> </view>
</view> </view>
</view> </view>
@@ -275,7 +275,7 @@ onMounted(async () => {
.script-view { .script-view {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 24rpx; gap: 20rpx;
min-height: 100%; min-height: 100%;
} }
@@ -287,24 +287,24 @@ onMounted(async () => {
} }
.section-card { .section-card {
padding: 24rpx; padding: 20rpx;
border-radius: 32rpx; border-radius: 28rpx;
} }
.glass-card-main { .glass-card-main {
padding: 32rpx; padding: 24rpx;
border-radius: 48rpx; border-radius: 56rpx;
} }
.section-header { .section-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-bottom: 20rpx; margin-bottom: 16rpx;
} }
.section-title { .section-title {
font-size: 18rpx; font-size: 17rpx;
color: rgba(192, 132, 252, 0.6); color: rgba(192, 132, 252, 0.6);
font-weight: 600; font-weight: 600;
letter-spacing: 3rpx; letter-spacing: 3rpx;
@@ -312,7 +312,7 @@ onMounted(async () => {
} }
.section-hint { .section-hint {
font-size: 14rpx; font-size: 13rpx;
color: rgba(255, 255, 255, 0.35); color: rgba(255, 255, 255, 0.35);
font-style: italic; font-style: italic;
} }
@@ -320,18 +320,18 @@ onMounted(async () => {
.profile-grid { .profile-grid {
display: grid; display: grid;
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr 1fr;
gap: 12rpx; gap: 10rpx;
} }
.glass-input, .glass-picker { .glass-input, .glass-picker {
width: 100%; width: 100%;
height: 72rpx; height: 64rpx;
background: rgba(255, 255, 255, 0.05); background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 24rpx; border-radius: 20rpx;
padding: 0 20rpx; padding: 0 16rpx;
color: rgba(255, 255, 255, 0.9); color: rgba(255, 255, 255, 0.9);
font-size: 22rpx; font-size: 18rpx;
box-sizing: border-box; box-sizing: border-box;
} }
@@ -340,136 +340,154 @@ onMounted(async () => {
} }
.theme-input { .theme-input {
height: 80rpx; height: 72rpx;
font-size: 24rpx; font-size: 19rpx;
} }
.picker-value { .picker-value {
line-height: 72rpx; line-height: 64rpx;
color: rgba(255, 255, 255, 0.9); color: rgba(255, 255, 255, 0.9);
} }
.input-group { .input-group {
margin-bottom: 28rpx; margin-bottom: 24rpx;
} }
.label { .label {
display: block; display: block;
font-size: 16rpx; font-size: 17rpx;
color: rgba(255, 255, 255, 0.35); color: rgba(192, 132, 252, 0.6);
font-weight: 600; font-weight: 600;
letter-spacing: 3rpx; letter-spacing: 3rpx;
text-transform: uppercase; text-transform: uppercase;
margin-bottom: 12rpx; margin-bottom: 10rpx;
} }
.npc-header { .npc-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-bottom: 12rpx; margin-bottom: 10rpx;
} }
.add-btn { .add-btn {
font-size: 18rpx; font-size: 16rpx;
color: #C084FC; color: #C084FC;
border: 1px solid rgba(192, 132, 252, 0.3); border: 1px solid rgba(192, 132, 252, 0.3);
padding: 6rpx 12rpx; padding: 5rpx 10rpx;
border-radius: 12rpx; border-radius: 10rpx;
background: transparent; background: transparent;
} }
.npc-container { .npc-container {
background: rgba(255, 255, 255, 0.05); background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 32rpx; border-radius: 24rpx;
padding: 24rpx; padding: 16rpx;
margin-bottom: 16rpx; margin-bottom: 14rpx;
} }
.npc-form { .npc-form {
display: grid; display: grid;
grid-template-columns: 1fr 1fr 1fr; grid-template-columns: 1fr 1fr 1fr;
gap: 12rpx; gap: 10rpx;
margin-bottom: 16rpx; margin-bottom: 14rpx;
} }
.npc-input, .npc-picker { .npc-input, .npc-picker {
height: 64rpx; height: 60rpx;
padding: 0 16rpx; padding: 0 14rpx;
font-size: 20rpx; font-size: 17rpx;
} }
.npc-picker .picker-value { .npc-picker .picker-value {
line-height: 64rpx; line-height: 60rpx;
font-size: 20rpx; font-size: 17rpx;
} }
.glass-textarea { .glass-textarea {
width: 100%; width: 100%;
height: 100rpx; height: 88rpx;
background: rgba(255, 255, 255, 0.05); background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 24rpx; border-radius: 20rpx;
padding: 16rpx; padding: 14rpx;
color: rgba(255, 255, 255, 0.9); color: rgba(255, 255, 255, 0.9);
font-size: 20rpx; font-size: 17rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.npc-list { .npc-list {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 12rpx; gap: 10rpx;
} }
.npc-tag { .npc-tag {
background: rgba(168, 85, 247, 0.1); background: rgba(168, 85, 247, 0.1);
border: 1px solid rgba(168, 85, 247, 0.3); border: 1px solid rgba(168, 85, 247, 0.3);
border-radius: 24rpx; border-radius: 20rpx;
padding: 8rpx 20rpx; padding: 6rpx 16rpx;
font-size: 20rpx; font-size: 18rpx;
color: rgba(243, 232, 255, 0.8); color: rgba(243, 232, 255, 0.8);
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8rpx; gap: 6rpx;
} }
.delete-btn { .delete-btn {
color: rgba(255, 255, 255, 0.4); color: rgba(255, 255, 255, 0.4);
font-size: 24rpx; font-size: 20rpx;
padding: 0 4rpx; padding: 0 2rpx;
} }
.params-section { .params-section {
margin-bottom: 24rpx; margin-bottom: 24rpx;
} }
.param-row { .param-section-label {
display: flex; display: block;
flex-direction: column; font-size: 17rpx;
gap: 12rpx; color: rgba(192, 132, 252, 0.6);
font-weight: 600;
letter-spacing: 3rpx;
text-transform: uppercase;
margin-bottom: 12rpx;
} }
.param-label { .params-container {
font-size: 16rpx; display: grid;
color: rgba(255, 255, 255, 0.35); grid-template-columns: 1fr 1fr;
gap: 16rpx;
}
.param-group {
display: flex;
flex-direction: column;
gap: 8rpx;
min-width: 0;
}
.param-sublabel {
font-size: 15rpx;
color: rgba(255, 255, 255, 0.4);
margin-left: 4rpx; margin-left: 4rpx;
} }
.param-options { .param-options {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 8rpx; gap: 6rpx;
} }
.param-option { .param-option {
padding: 8rpx 16rpx; padding: 6rpx 12rpx;
background: rgba(255, 255, 255, 0.05); background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 20rpx; border-radius: 18rpx;
font-size: 18rpx; font-size: 17rpx;
color: rgba(255, 255, 255, 0.5); color: rgba(255, 255, 255, 0.4);
white-space: nowrap;
} }
.param-option.active { .param-option.active {
@@ -480,21 +498,22 @@ onMounted(async () => {
.generate-btn { .generate-btn {
width: 100%; width: 100%;
height: 88rpx; height: 80rpx;
border-radius: 32rpx; border-radius: 28rpx;
box-shadow: 0 8rpx 32rpx rgba(168, 85, 247, 0.3); box-shadow: 0 8rpx 32rpx rgba(168, 85, 247, 0.3);
margin-top: 8rpx;
} }
.scripts-list { .scripts-list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 20rpx; gap: 16rpx;
} }
.script-card { .script-card {
padding: 24rpx; padding: 20rpx;
border-left: 4rpx solid transparent; border-left: 3rpx solid transparent;
border-radius: 32rpx; border-radius: 28rpx;
} }
.script-card.selected { .script-card.selected {
@@ -505,30 +524,30 @@ onMounted(async () => {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-bottom: 12rpx; margin-bottom: 10rpx;
} }
.script-title { .script-title {
font-size: 28rpx; font-size: 26rpx;
font-weight: 500; font-weight: 500;
color: rgba(255, 255, 255, 0.9); color: rgba(255, 255, 255, 0.9);
} }
.script-persona { .script-persona {
font-size: 16rpx; font-size: 15rpx;
color: rgba(168, 85, 247, 0.6); color: rgba(168, 85, 247, 0.6);
background: rgba(168, 85, 247, 0.1); background: rgba(168, 85, 247, 0.1);
padding: 6rpx 12rpx; padding: 5rpx 10rpx;
border-radius: 12rpx; border-radius: 10rpx;
border: 1px solid rgba(168, 85, 247, 0.2); border: 1px solid rgba(168, 85, 247, 0.2);
} }
.script-summary { .script-summary {
display: block; display: block;
font-size: 22rpx; font-size: 20rpx;
color: rgba(255, 255, 255, 0.5); color: rgba(255, 255, 255, 0.5);
line-height: 1.6; line-height: 1.5;
margin-bottom: 16rpx; margin-bottom: 14rpx;
} }
.script-footer { .script-footer {
@@ -538,12 +557,12 @@ onMounted(async () => {
} }
.script-style { .script-style {
font-size: 18rpx; font-size: 16rpx;
color: #C084FC; color: #C084FC;
} }
.select-btn { .select-btn {
font-size: 20rpx; font-size: 18rpx;
color: #C084FC; color: #C084FC;
font-weight: 600; font-weight: 600;
background: transparent; background: transparent;
@@ -552,37 +571,37 @@ onMounted(async () => {
} }
.empty-state { .empty-state {
padding: 64rpx 40rpx; padding: 56rpx 36rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
gap: 20rpx; gap: 16rpx;
opacity: 0.5; opacity: 0.5;
border-radius: 48rpx; border-radius: 48rpx;
} }
.empty-icon { .empty-icon {
font-size: 56rpx; font-size: 48rpx;
} }
.empty-text { .empty-text {
font-size: 22rpx; font-size: 20rpx;
color: rgba(255, 255, 255, 0.5); color: rgba(255, 255, 255, 0.5);
text-align: center; text-align: center;
} }
.generating-state { .generating-state {
padding: 64rpx 40rpx; padding: 56rpx 36rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
gap: 24rpx; gap: 20rpx;
border-radius: 48rpx; border-radius: 48rpx;
} }
.spinner { .spinner {
width: 56rpx; width: 48rpx;
height: 56rpx; height: 48rpx;
border: 3rpx solid #A855F7; border: 3rpx solid #A855F7;
border-top-color: transparent; border-top-color: transparent;
border-radius: 50%; border-radius: 50%;
@@ -595,9 +614,24 @@ onMounted(async () => {
} }
.generating-text { .generating-text {
font-size: 24rpx; font-size: 20rpx;
color: rgba(192, 132, 252, 0.6); color: rgba(192, 132, 252, 0.6);
font-style: italic; font-style: italic;
letter-spacing: 2rpx; letter-spacing: 2rpx;
} }
/* 超小屏幕适配 */
@media (max-width: 320px) {
.params-container {
grid-template-columns: 1fr;
}
.npc-form {
grid-template-columns: 1fr 1fr;
}
.profile-grid {
grid-template-columns: 1fr;
}
}
</style> </style>