/* 视图层样式：剧本库 / 编辑器 / 排练台 / 统计 */

/* ---------- 剧本库 ---------- */
.lib-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.lib-head h2 { font-size: 22px; font-family: var(--font-ui); letter-spacing: -0.03em; }
.lib-head .hint { color: var(--text-dim); font-size: 12px; margin-top: 6px; }
.lib-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin-left: 6px; padding: 0 6px; border-radius: 7px; background: #26292d; color: var(--text-2); font: 12px var(--font-mono); vertical-align: middle; }
.lib-head h2 .accent { color: var(--neon-green); text-shadow: var(--glow-green); }

.hero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(57, 255, 20, 0.045), rgba(255, 255, 255, 0.01));
  overflow: hidden;
}
.hero__item {
  position: relative;
  padding: 18px 22px;
  animation: cardIn 0.4s var(--ease) backwards;
}
.hero__item + .hero__item { border-left: 1px solid var(--line); }
.hero__item::before {
  content: "";
  position: absolute;
  left: 0; top: 22%; bottom: 22%;
  width: 2px;
  background: var(--neon-green);
  opacity: 0.5;
}
.hero__item:nth-child(1)::before { background: var(--neon-green); }
.hero__item:nth-child(2)::before { background: var(--neon-cyan); opacity: 0.4; }
.hero__item:nth-child(3)::before { background: var(--neon-pink); opacity: 0.4; }
.hero__item:nth-child(2) { animation-delay: 60ms; }
.hero__item:nth-child(3) { animation-delay: 120ms; }
.hero__num {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  color: var(--neon-green);
  text-shadow: var(--glow-green);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.hero__label {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.16em;
  font-family: var(--font-mono);
  margin-top: 4px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: var(--gap);
}
.script-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  padding: 0 20px 18px;
  overflow: hidden;
  min-width: 0;
}
.script-card__cover { position: relative; height: 112px; margin: 0 -20px 4px; overflow: hidden; background: linear-gradient(125deg, #293329, #1e2529); border-bottom: 1px solid var(--line); }
.script-card__cover::before { content: ""; position: absolute; width: 160px; height: 160px; border: 1px solid #566647; border-radius: 50%; top: -92px; right: 10px; box-shadow: 0 0 0 24px #ccff7307, 0 0 0 48px #ccff7305; }
.script-card__number { position: absolute; left: 22px; top: 14px; font: 42px var(--font-mono); letter-spacing: -0.05em; color: #c6d8b9; }
.script-card__cover-label { position: absolute; left: 24px; bottom: 17px; font: 8px var(--font-mono); letter-spacing: 0.18em; color: #9fae98; }
.script-card__cover-mark { position: absolute; right: 23px; bottom: 8px; font-size: 52px; font-weight: 800; color: #ccff732b; }
.script-card:nth-child(3n+2) .script-card__cover { background: linear-gradient(125deg, #2c283b, #23232b); }
.script-card:nth-child(3n+3) .script-card__cover { background: linear-gradient(125deg, #332a27, #282323); }
.script-card__head { display: flex; flex-direction: column; gap: 6px; }
.script-card__title {
  font-size: 19px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.script-card__logline {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.script-card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.script-card__progress { margin-top: auto; }
.script-card__last {
  margin-top: 9px;
  font-size: 11.5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.script-card__foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.script-card__foot-spacer { flex: 1; }
.icon-btn--danger:hover { color: var(--neon-pink); background: rgba(255, 46, 151, 0.1); }

/* 剧本库工具栏：搜索 + 排序 */
.lib-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.lib-tools__search { flex: 1; min-width: 220px; }
.lib-tools__search .input { padding: 9px 14px; }
.lib-tools__sort { display: inline-flex; align-items: center; gap: 8px; }
.lib-tools__sort .select { width: auto; padding: 8px 32px 8px 12px; }
.lib-tools { justify-content: space-between; padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.lib-tools__search { flex: 0 1 340px; min-width: 0; }
.lib-tools__search .input { background: transparent; }
.create-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 350px; border: 1px dashed #383d42; border-radius: var(--radius); background: #15171a; color: var(--text-dim); cursor: pointer; text-align: center; padding: 28px; transition: border-color 0.2s, background 0.2s; }
.create-card:hover { border-color: #71834f; background: #1b2018; }
.create-card__plus { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid #353a3f; border-radius: 50%; color: #aeb5bd; font-size: 26px; margin-bottom: 7px; }
.create-card strong { color: var(--text-2); font-size: 15px; font-weight: 500; }
.create-card > span:not(.create-card__plus) { font-size: 12px; }
.create-card__link { color: var(--neon-green); margin-top: 16px; }

/* 工作室首页 */
.workspace-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 30px; }
.workspace-head__path { font-size: 11px; color: var(--text-dim); margin-bottom: 20px; }
.workspace-head__path span { margin: 0 10px; color: #525860; }
.workspace-head h1 { font-size: 27px; letter-spacing: -0.04em; font-weight: 600; }
.workspace-head p { font-size: 12px; color: var(--text-dim); margin-top: 8px; }
.workspace-status { display: flex; align-items: center; gap: 7px; flex-shrink: 0; font-size: 10px; color: var(--text-dim); }
.workspace-status span { width: 5px; height: 5px; background: var(--neon-green); border-radius: 50%; }
.studio-hero { position: relative; display: grid; grid-template-columns: 1.2fr 1fr; min-height: 350px; background: linear-gradient(115deg, #202620, #1c231d 55%, #252c20); border: 1px solid #3a4431; border-radius: 22px; overflow: hidden; }
.studio-hero__content { position: relative; z-index: 1; padding: 38px 40px; }
.studio-hero__eyebrow { display: flex; align-items: center; gap: 8px; font: 9px var(--font-mono); letter-spacing: 0.18em; color: #adbc9d; margin-bottom: 18px; }
.studio-hero__eyebrow > span { width: 5px; height: 5px; border-radius: 50%; background: var(--neon-green); }
.studio-hero h2 { font-size: clamp(32px, 3.3vw, 48px); font-weight: 700; line-height: 1.4; letter-spacing: -0.04em; }
.studio-hero h2 span { color: var(--neon-green); }
.studio-hero p { color: #a7b09f; font-size: 12px; line-height: 1.9; margin-top: 16px; }
.studio-hero__actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 24px; }
.studio-hero__actions .btn { padding: 12px 22px; font-size: 13px; }
.studio-hero__script { font-size: 10px; color: #909e87; }
.studio-hero__script strong { display: block; font-size: 12px; color: #cad3c2; font-weight: 400; margin-top: 4px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-hero__art { position: relative; display: grid; place-items: center; min-width: 0; }
.studio-hero__orbit { position: absolute; width: 380px; height: 380px; border-radius: 50%; border: 1px solid #ccff7317; box-shadow: 0 0 0 32px #ccff7305, 0 0 0 64px #ccff7304; }
.studio-hero__disc { position: relative; width: 252px; height: 252px; border-radius: 50%; background: #ccff73; color: #25301b; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; transform: rotate(-12deg); box-shadow: 16px 22px 0 #0e120c30; }
.studio-hero__disc::after { content: ""; position: absolute; inset: 12px; border: 1px solid #25301b35; border-radius: 50%; }
.studio-hero__disc > span { font: 8px var(--font-mono); letter-spacing: 0.2em; }
.studio-hero__disc strong { font: 700 45px/0.95 Arial, sans-serif; text-align: center; letter-spacing: -0.06em; }
.studio-hero__disc i { font-style: normal; font-size: 80px; }
.studio-hero__live { position: absolute; right: 20px; top: 24px; font: 8px var(--font-mono); letter-spacing: 0.14em; color: #a5b592; }
.studio-hero__wave { position: absolute; bottom: 25px; right: 32px; display: flex; align-items: center; gap: 4px; height: 64px; }
.studio-hero__wave span { width: 3px; height: var(--h); background: #ccff7366; border-radius: 3px; }
.workspace-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 22px 0 36px; }
.workspace-metrics > div { display: flex; gap: 14px; align-items: center; padding: 18px 20px; background: #191b1e; border: 1px solid var(--line); border-radius: 14px; }
.metric-icon { display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; color: #a8b58f; background: #252a22; border-radius: 10px; font-size: 23px; }
.workspace-metrics > div > span:last-child { font-size: 10px; color: var(--text-dim); }
.workspace-metrics strong { display: block; color: var(--text); font: 24px var(--font-mono); margin-top: 4px; }
.workspace-metrics small { font: 10px var(--font-ui); color: var(--text-dim); margin-left: 6px; }

/* 卡片入场（仅首屏，避免搜索/重渲染时反复闪现） */
.card-grid--enter > * {
  animation: cardIn 0.42s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 编辑器 ---------- */
.editor-grid {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.tree {
  position: sticky;
  top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px;
  max-height: calc(100vh - var(--topbar-h) - 40px);
  overflow-y: auto;
}
.tree__ep { margin-bottom: 12px; }
.tree__ep-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 7px;
  background: #25282d;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
}
.tree__scene {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 8px 7px 14px;
  margin-top: 3px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  border-left: 2px solid transparent;
}
.tree__scene:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.tree__scene.is-active {
  background: rgba(204, 255, 115, 0.07);
  border-left-color: var(--neon-green);
  color: var(--text);
}
.tree__count { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-dim); }
.tree__ops { display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s; }
.tree__scene:hover .tree__ops, .tree__ep-head:hover .tree__ops { opacity: 1; }
.icon-btn {
  border: none;
  background: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1.4;
}
.icon-btn:hover { color: var(--neon-pink); background: rgba(255, 46, 151, 0.1); }

.line-row {
  display: grid;
  grid-template-columns: 26px 116px 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease);
}
.line-row:hover {
  background: rgba(255, 255, 255, 0.025);
  border-color: var(--line);
  border-left-color: rgba(204, 255, 115, 0.35);
}
.line-row__idx {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  text-align: right;
  padding-top: 11px;
  opacity: 0.6;
  user-select: none;
}
.line-row__role { position: relative; }
.line-row__role .select {
  padding: 8px 26px 8px 10px;
  font-size: 12.5px;
  background-position: right 9px center;
  background-size: 9px 5px;
}
.line-row .textarea {
  min-height: 38px;
  padding: 8px 11px;
  font-family: var(--font-ui);
  font-size: 13.5px;
  line-height: 1.65;
  resize: none;
  overflow: hidden;
}
.line-row__ops { display: flex; gap: 1px; opacity: 0; transition: opacity 0.15s; padding-top: 3px; }
.line-row:hover .line-row__ops,
.line-row:focus-within .line-row__ops { opacity: 1; }
.role-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11.5px;
  font-family: var(--font-mono);
}
.role-tag--mine { color: #04120a; background: var(--neon-green); }
.role-tag--other { color: #02131a; background: var(--neon-cyan); }
.role-tag--narr { color: var(--text-dim); border: 1px solid var(--line); }

/* ---------- 排练台 ---------- */
.rehearse-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: none;
  margin-bottom: 16px;
}
.rehearse-bar__scene { line-height: 1.35; min-width: 0; }
.rehearse-bar__scene span {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 3px;
}
.rehearse-bar__scene strong { font-size: 15px; font-weight: 600; }
.divider-v { width: 1px; align-self: stretch; min-height: 26px; background: var(--line); }

.stage {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: radial-gradient(ellipse at 50% 0, #303a25, transparent 65%), #1a1d1b;
  padding: 48px 38px;
  margin-bottom: 16px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  text-align: center;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 50px rgba(0, 0, 0, 0.35);
}
/* 四角取景框 */
.stage::before,
.stage::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 1px solid rgba(204, 255, 115, 0.3);
  pointer-events: none;
}
.stage::before { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.stage::after { bottom: 12px; right: 12px; border-left: none; border-top: none; }

.stage__ghost {
  font-size: 13.5px;
  color: var(--text-dim);
  opacity: 0.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.stage__current {
  font-size: clamp(23px, 3.6vw, 36px);
  line-height: 1.42;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-wrap: pretty;
  animation: lineIn 0.28s var(--ease);
}
.stage > .row { justify-content: center; }
.stage__current.is-mine { color: var(--neon-green); text-shadow: none; }
.stage__current.is-other { color: var(--text); text-shadow: none; }
.stage__current.is-narr {
  color: var(--text-2);
  font-style: italic;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.7;
  text-shadow: none;
}
@keyframes lineIn {
  from { opacity: 0; transform: translateY(10px); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: none; }
}
.stage__who {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.stage__masked { letter-spacing: 0.18em; }
.stage__masked .mask-dot { color: var(--neon-pink); opacity: 0.75; }

.transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.transport__round {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  cursor: pointer;
  font-size: 17px;
  transition: all 0.18s var(--ease);
}
.transport__round:hover {
  border-color: var(--neon-green);
  color: var(--neon-green);
  background: rgba(204, 255, 115, 0.08);
}
.transport__play {
  width: 62px; height: 62px;
  background: var(--neon-green);
  border-color: var(--neon-green);
  color: #04120a;
  font-size: 21px;
  box-shadow: var(--glow-green);
  margin: 0 4px;
}
.transport__play:hover { color: #04120a; background: var(--neon-green); filter: brightness(1.1); }
.transport__play.is-playing { animation: playPulse 1.5s ease-in-out infinite; }
@keyframes playPulse {
  50% { box-shadow: 0 0 0 7px rgba(204, 255, 115, 0.06); }
}

/* 快捷键提示条 */
.hints {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px 18px;
  margin: -8px 0 14px;
  font-size: 11.5px;
  color: var(--text-dim);
}
.hints span { display: inline-flex; align-items: center; gap: 5px; }
kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-2);
}

.script-scroll {
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 8px;
}
.script-line {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  padding: 8px 12px;
  border-radius: 7px;
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.script-line:hover { background: rgba(255, 255, 255, 0.035); }
.script-line__role {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  padding-top: 3px;
  letter-spacing: 0.06em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.script-line__text { font-size: 14px; color: var(--text-2); line-height: 1.65; }
.script-line.is-mine .script-line__role { color: var(--neon-green); }
.script-line.is-other .script-line__role { color: var(--neon-cyan); }
.script-line.is-active {
  background: rgba(204, 255, 115, 0.06);
  border-left-color: var(--neon-green);
}
.script-line.is-active .script-line__text { color: var(--text); font-weight: 600; }
.script-line.is-done { opacity: 0.38; }

.session-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  margin-top: 22px;
}

.rec-panel {
  margin-top: 20px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}
.rec-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--neon-pink);
  box-shadow: var(--glow-pink);
  animation: pulse 1s infinite;
  display: inline-block;
}
@keyframes pulse { 50% { opacity: 0.3; } }
.rec-time { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-dim); }
.rec-time.is-live { color: var(--neon-pink); }

/* ---------- 统计 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--gap);
  margin-bottom: 26px;
}
.stat-card {
  position: relative;
  padding: 18px;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  right: -30px; top: -30px;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(204, 255, 115, 0.05), transparent 70%);
  pointer-events: none;
}
.stat-card__num {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
  letter-spacing: -0.01em;
}
.stat-card__num.is-green { color: var(--neon-green); text-shadow: var(--glow-green); }
.stat-card__num.is-pink { color: var(--neon-pink); text-shadow: var(--glow-pink); }
.stat-card__label {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  font-family: var(--font-mono);
  margin-top: 4px;
}

.bars { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 10px; }
.bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; }
.bars__track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.bars__fill {
  width: 100%;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--neon-green), #6a8450);
  box-shadow: none;
  min-height: 3px;
  transition: height 0.4s var(--ease);
}
.bars__label { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-dim); }

.rank-row {
  display: grid;
  grid-template-columns: 1fr 150px 64px;
  gap: 14px;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.rank-row:last-child { border-bottom: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .workspace-head { align-items: flex-start; }
  .workspace-status { display: none; }
  .studio-hero__content { padding: 30px 28px; }
  .studio-hero__disc { width: 195px; height: 195px; }
  .studio-hero__disc strong { font-size: 35px; }
  .studio-hero__disc i { font-size: 65px; }
  .studio-hero__disc > span { font-size: 6px; }
  .studio-hero__orbit { width: 290px; height: 290px; }
  .workspace-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: repeat(3, 1fr); }
  .hero__item { padding: 12px 12px; }
  .hero__num { font-size: 21px; }
  .hero__item:nth-child(2),
  .hero__item:nth-child(3) { animation-delay: 0ms; }
  .editor-grid { grid-template-columns: 1fr; }
  .tree { position: static; max-height: 260px; }
  .session-summary { grid-template-columns: repeat(2, 1fr); }
  .line-row { grid-template-columns: 22px 1fr auto; }
  .line-row__idx { padding-top: 9px; }
  .line-row .textarea { grid-column: 1 / -1; }
  .script-line { grid-template-columns: 92px 1fr; }
  .lib-tools__search { flex: 1; min-width: 0; }
  .rank-row { grid-template-columns: 1fr 90px 52px; }
}

@media (max-width: 640px) {
  .workspace-head { margin-bottom: 22px; }
  .workspace-head__path { margin-bottom: 14px; }
  .workspace-head h1 { font-size: 24px; }
  .workspace-head p { font-size: 11px; line-height: 1.8; }
  .studio-hero { min-height: 330px; grid-template-columns: 1fr; }
  .studio-hero__content { padding: 30px 24px; }
  .studio-hero h2 { font-size: 34px; }
  .studio-hero__art { position: absolute; top: 18px; right: -74px; width: 230px; height: 230px; opacity: 0.18; pointer-events: none; }
  .studio-hero__actions { gap: 14px; }
  .studio-hero__wave, .studio-hero__live { display: none; }
  .workspace-metrics { gap: 10px; margin: 16px 0 28px; }
  .workspace-metrics > div { padding: 14px 12px; gap: 10px; }
  .workspace-metrics strong { font-size: 21px; }
  .metric-icon { width: 30px; height: 30px; font-size: 20px; }
  .lib-head .row { width: 100%; }
  .lib-head .btn { flex: 1; padding: 10px 12px; font-size: 12px; }
  .lib-tools { flex-wrap: nowrap; gap: 10px; }
  .lib-tools__sort > span { display: none; }
  .lib-tools__search { min-width: 0; }
  .lib-tools__search .input { font-size: 12px; padding: 10px; }
  .lib-tools__sort .select { max-width: 116px; font-size: 12px; }
  .create-card { min-height: 220px; }
  .hero__label { font-size: 10px; letter-spacing: 0.02em; }
  .lib-head { gap: 14px; }
  .lib-head .hint { color: var(--text-2); font-size: 13px; }
  .script-card { min-width: 0; }
  .script-card__foot { flex-wrap: wrap; }
  .rehearse-bar { gap: 10px; padding: 14px; }
  .rehearse-bar__scene { flex-basis: 100%; overflow-wrap: anywhere; }
  .rehearse-bar .divider-v { display: none; }
  .stage { padding: 32px 20px; min-height: 240px; }
  .stage__current { overflow-wrap: anywhere; }
  .script-line { grid-template-columns: 64px minmax(0, 1fr); gap: 8px; }
  .script-line__text { overflow-wrap: anywhere; }
  .rec-panel { padding: 14px; }
  .rec-panel audio { max-width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { padding: 14px; }
  .stat-card__num { font-size: 26px; }
  .rank-row { grid-template-columns: minmax(0, 1fr) 60px 36px; gap: 8px; }
}

@media (hover: none) {
  .tree__ops, .line-row__ops { opacity: 1; }
  .icon-btn { min-width: 32px; min-height: 32px; }
}
