/* ==========================================================================
   LRIC Maker — 屏幕样式
   ========================================================================== */

:root {
  --ink: #000;
  --ink-soft: #46413a;
  --muted: #8b8478;
  --line: #e3ddd2;
  --line-soft: #efeae1;
  --paper: #fdfcf8;
  --bg: #ece7de;
  --panel: #faf8f3;
  --accent: #8c6f52;
  --accent-soft: rgba(140, 111, 82, .1);
  --accent-line: rgba(140, 111, 82, .35);
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", "Sitka Text", serif;
  --sans: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", -apple-system, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; }

/* ------------------------------------------------------------------ 布局 */

.app {
  display: grid;
  grid-template-columns: 392px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ------------------------------------------------------------ 左侧面板 */

.panel {
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-height: 0;
  padding: 20px 20px 16px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}

.brand-text h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .16em;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 10.5px;
  letter-spacing: .18em;
  color: var(--muted);
  text-transform: uppercase;
}

/* 搜索框 */

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  transition: border-color .16s, box-shadow .16s;
}

.search:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-icon {
  width: 15px;
  height: 15px;
  flex: none;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.search input {
  flex: 1;
  min-width: 0;
  padding: 4px 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13.5px;
  color: var(--ink);
}

.search input::placeholder { color: #b3aa9c; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.search button {
  flex: none;
  padding: 7px 13px;
  border: 0;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-size: 12.5px;
  letter-spacing: .06em;
  cursor: pointer;
  transition: opacity .15s, background .15s;
}

.search button:hover { background: #352f27; }
.search button:disabled { opacity: .45; cursor: default; }

.hint {
  margin: -4px 0 0;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .02em;
}

/* 结果列表 */

.results-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.results-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 2px 7px;
  font-size: 10.5px;
  letter-spacing: .16em;
  color: var(--muted);
  text-transform: uppercase;
}

.results {
  margin: 0;
  padding: 0 2px 0 0;
  list-style: none;
  overflow-y: auto;
  flex: 1;
  min-height: 60px;
  scrollbar-width: thin;
}

.results::-webkit-scrollbar { width: 7px; }
.results::-webkit-scrollbar-thumb { background: #d8d1c4; border-radius: 4px; }

.result {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  padding: 9px 11px 9px 11px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .13s;
}

.result:hover { background: #f1ecE2; }

.result.on {
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.result.on::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.result-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-sub {
  grid-column: 1 / -1;
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-tag {
  grid-row: 1;
  grid-column: 2;
  align-self: center;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 9.5px;
  letter-spacing: .06em;
  color: var(--muted);
  white-space: nowrap;
}

.result-tag.sync {
  border-color: var(--accent-line);
  color: var(--accent);
}

.result-empty,
.results-loading {
  padding: 16px 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.skeleton {
  height: 44px;
  margin-bottom: 6px;
  border-radius: 9px;
  background: linear-gradient(90deg, #f0ebe2 25%, #f7f3ec 50%, #f0ebe2 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* 选项 */

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.opt-label {
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
}

.segmented {
  display: inline-flex;
  padding: 2px;
  background: #f1ece2;
  border-radius: 8px;
}

.segmented button {
  padding: 5px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 11.5px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .14s, color .14s;
}

.segmented button.on {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(60, 50, 35, .1);
}

.select {
  appearance: none;
  min-width: 86px;
  padding: 5px 24px 5px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b8478' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 9px 6px;
  font-family: inherit;
  font-size: 11.5px;
  color: var(--ink-soft);
  cursor: pointer;
}

.select:hover { border-color: #d5cdbe; }

.select:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.opt-row {
  display: flex;
  gap: 18px;
  align-items: center;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .track {
  position: relative;
  width: 28px;
  height: 16px;
  border-radius: 9px;
  background: #ded7ca;
  transition: background .16s;
  flex: none;
}

.switch .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
  transition: transform .16s;
}

.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(12px); }
.switch-text { font-size: 11.5px; color: var(--ink-soft); }

/* 动作按钮 */

.actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  letter-spacing: .06em;
  cursor: pointer;
  transition: transform .12s, background .15s, box-shadow .15s, opacity .15s;
}

.btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.btn.primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .08);
}

.btn.primary:hover:not(:disabled) { background: #332d25; }
.btn.primary:active:not(:disabled) { transform: translateY(1px); }

.btn.ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink-soft);
}

.btn.ghost:hover:not(:disabled) { border-color: var(--accent-line); color: var(--ink); }

.btn:disabled { opacity: .42; cursor: not-allowed; }

.kbd {
  margin-left: 4px;
  padding: 1px 5px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .04em;
  opacity: .8;
}

.printer-note {
  margin: -3px 0 0;
  font-size: 10.5px;
  line-height: 1.55;
  letter-spacing: .02em;
  color: var(--muted);
}

.printer-note:empty { display: none; }

.printer-note.warn {
  color: #a8512f;
}

/* ------------------------------------------------------------------- 舞台 */

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background:
    radial-gradient(1200px 600px at 50% -10%, #f6f2ea 0%, transparent 60%),
    var(--bg);
}

.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 20px;
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--muted);
  border-bottom: 1px solid rgba(0, 0, 0, .05);
}

.stage-info { letter-spacing: .08em; }

.zoom {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 7px;
  padding: 2px;
}

.zoom button {
  min-width: 26px;
  height: 24px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
}

.zoom button:hover { background: #fff; }
.zoom .fit { font-size: 10.5px; padding: 0 7px; letter-spacing: .06em; }
.zoom span {
  min-width: 44px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.stage-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 26px 26px 40px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.sheet-wrap {
  zoom: var(--zoom, 1);
  flex: none;
}

/* ------------------------------------------------------------------- 纸面 */

.sheet {
  position: relative;
  width: 210mm;
  height: 297mm;
  background: var(--paper);
  color: var(--ink);
  box-shadow:
    0 1px 2px rgba(45, 38, 26, .12),
    0 18px 46px -12px rgba(45, 38, 26, .28);
  overflow: hidden;
}

.sheet-wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 100% 0%, var(--wash, rgba(140, 111, 82, .05)) 0%, transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, .55), transparent 30%);
}

.sheet-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 14mm 16mm 10mm;
}

/* 头部 */

.sheet-head {
  display: grid;
  grid-template-columns: 50mm minmax(0, 1fr);
  gap: 8mm;
  align-items: center;
}

.cover {
  position: relative;
  width: 50mm;
  height: 50mm;
  margin: 0;
  background: #e9e4d9;
  overflow: hidden;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .14), 0 6px 16px -8px rgba(0, 0, 0, .3);
}

.cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(150deg, var(--accent) 0%, #2c261f 100%);
  color: rgba(255, 255, 255, .9);
}

.cover-fallback span {
  font-family: var(--serif);
  font-size: 40mm;
  line-height: 1;
  opacity: .55;
}

.cover-edit {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 4px 8px;
  border: 0;
  border-radius: 5px;
  background: rgba(20, 18, 15, .62);
  color: #fff;
  font-size: 10px;
  letter-spacing: .06em;
  opacity: 0;
  cursor: pointer;
  transition: opacity .15s;
  backdrop-filter: blur(3px);
}

.cover:hover .cover-edit,
.cover-edit:focus-visible { opacity: 1; }

.head-meta { min-width: 0; }

.kicker {
  margin: 0 0 3mm;
  font-size: 7.5pt;
  letter-spacing: .34em;
  color: var(--accent);
  text-transform: uppercase;
}

.title {
  margin: 0;
  font-family: var(--font-title, var(--font-body, var(--serif)));
  font-size: 25pt;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: .01em;
  word-break: break-word;
}

.artist {
  margin: 2.6mm 0 0;
  font-size: 12.5pt;
  font-weight: 400;
  letter-spacing: .08em;
  color: var(--ink-soft);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(24mm, auto));
  gap: 1.6mm 7mm;
  margin: 5mm 0 0;
  justify-content: start;
}

.facts > div { min-width: 0; }

.facts dt {
  font-size: 7pt;
  letter-spacing: .2em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 1mm;
}

.facts dd {
  margin: 0;
  font-size: 9pt;
  color: var(--ink-soft);
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.divider {
  display: flex;
  align-items: center;
  margin: 6mm 0 5mm;
  height: 1px;
  background: var(--line);
}

.divider i {
  display: block;
  width: 14mm;
  height: 1px;
  background: var(--accent);
}

/* 歌词 */

.lyrics-viewport {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.lyrics-body {
  margin: auto 0;
  font-family: var(--font-body, var(--serif));
  font-size: var(--lyric-size, 10.4pt);
  line-height: var(--lyric-lh, 1.95);
  color: #000;
  letter-spacing: .012em;
  text-align: left;
}

.lyrics-body .line {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
}

.lyrics-body .gap { display: block; height: .62em; }

.lyrics-body .ts {
  display: inline-block;
  min-width: 12mm;
  margin-right: 2mm;
  font-family: var(--mono);
  font-size: .68em;
  letter-spacing: .02em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  vertical-align: .04em;
}

.lyrics-body .placeholder-line {
  color: var(--muted);
  font-style: italic;
}

/* 双栏 */

.sheet[data-layout="column"] .lyrics-body {
  column-count: 2;
  column-gap: 11mm;
  column-rule: 1px solid var(--line-soft);
  font-size: var(--lyric-size, 9.6pt);
  line-height: var(--lyric-lh, 1.85);
}

/* 海报 */

.sheet[data-layout="poster"] .sheet-head {
  display: block;
}

.sheet[data-layout="poster"] .cover {
  width: 100%;
  height: 88mm;
}

.sheet[data-layout="poster"] .cover-fallback span { font-size: 60mm; }

.sheet[data-layout="poster"] .head-meta {
  margin-top: 7mm;
  text-align: center;
}

.sheet[data-layout="poster"] .kicker { margin-bottom: 2.5mm; }

.sheet[data-layout="poster"] .title {
  font-size: 28pt;
  letter-spacing: .04em;
}

.sheet[data-layout="poster"] .artist {
  margin-top: 1.6mm;
  font-size: 11.5pt;
}

.sheet[data-layout="poster"] .facts {
  justify-content: center;
  margin-top: 3.5mm;
}

.sheet[data-layout="poster"] .divider { margin: 5mm 0 5mm; }

.sheet[data-layout="poster"] .divider i { margin: 0 auto; }

.sheet[data-layout="poster"] .lyrics-body {
  text-align: center;
  font-size: var(--lyric-size, 10pt);
  padding: 0 6mm;
}

.sheet[data-layout="poster"] .lyrics-body .ts {
  min-width: 11mm;
  margin-right: 1.5mm;
}

/* 页脚 */

.sheet-foot {
  display: flex;
  justify-content: space-between;
  gap: 8mm;
  margin-top: 5mm;
  padding-top: 3mm;
  border-top: 1px solid var(--line-soft);
  font-size: 7pt;
  letter-spacing: .12em;
  color: var(--muted);
  text-transform: uppercase;
}

/* 跨页模式 */

.sheet.flow {
  height: auto;
  min-height: 297mm;
}

.sheet.flow .lyrics-viewport { overflow: visible; }

/* 编辑态 */

.lyrics-body[contenteditable="true"] {
  outline: 1px dashed var(--accent-line);
  outline-offset: 6mm;
  cursor: text;
}

/* ------------------------------------------------------------------- 弹层 */

.modal[hidden] { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(28, 24, 18, .45);
  backdrop-filter: blur(2px);
}

.modal-card {
  width: min(560px, calc(100vw - 40px));
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 14px;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .5);
  overflow: hidden;
}

.modal-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .1em;
}

.modal-x {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.modal-x:hover { background: #f0ebe2; }

.modal-body {
  padding: 16px 18px 18px;
  overflow-y: auto;
}

.cover-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.cover-grid figure {
  margin: 0;
  cursor: pointer;
}

.cover-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  background: #eee9e0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .06);
  transition: box-shadow .15s;
}

.cover-grid figure:hover img { box-shadow: 0 0 0 2px var(--accent); }

.cover-grid figcaption {
  margin-top: 4px;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cover-upload {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.upload-btn,
.ghost-btn {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
}

.upload-btn:hover,
.ghost-btn:hover { border-color: var(--accent-line); color: var(--ink); }

/* ------------------------------------------------------------------- 提示 */

.toast {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 12px);
  padding: 9px 16px;
  border-radius: 9px;
  background: rgba(25, 23, 19, .92);
  color: #fff;
  font-size: 12px;
  letter-spacing: .04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 忙碌态 */

.sheet.busy { opacity: .55; transition: opacity .2s; }

/* 平板连接 */

.actions.pad-row { grid-template-columns: 1fr; padding-top: 0; border-top: 0; }

.printer-note.pad-note { margin-top: -6px; }

.lan-row {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.lan-row:last-child { border-bottom: 0; }

.lan-qr {
  flex: none;
  width: 132px;
  height: 132px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
  overflow: hidden;
}

.lan-qr img { display: block; width: 100%; height: 100%; }

.lan-info { min-width: 0; }

.lan-label {
  margin: 0;
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
}

.lan-url {
  margin: 6px 0 10px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--ink);
  word-break: break-all;
}

.lan-copy {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}

.lan-copy:hover { border-color: var(--accent-line); }

/* ============================================================ 账号与我的 */

.app.blurred { filter: blur(3px) saturate(.9); pointer-events: none; user-select: none; }

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(38, 32, 24, .38);
  backdrop-filter: blur(3px);
}

.auth-card {
  width: min(420px, 100%);
  padding: 30px 30px 24px;
  background: var(--paper);
  border-radius: 18px;
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .5);
}

.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand h1 { margin: 0; font-family: var(--serif); font-size: 22px; letter-spacing: .12em; font-weight: 600; }
.auth-sub { margin: 12px 0 20px; font-size: 13px; line-height: 1.6; color: var(--muted); }

.auth-field { display: block; margin-bottom: 12px; }
.auth-field span { display: block; font-size: 11.5px; letter-spacing: .1em; color: var(--muted); margin-bottom: 6px; }
.auth-field input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 15px;
  color: var(--ink);
}
.auth-field input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }

.auth-error { min-height: 18px; margin: 4px 0 10px; font-size: 12.5px; color: #a8512f; }

.auth-submit {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  letter-spacing: .08em;
  cursor: pointer;
}
.auth-submit:disabled { opacity: .5; }

.auth-switch { margin: 14px 0 0; text-align: center; }
.auth-switch button { border: 0; background: none; color: var(--accent); font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.auth-note { margin: 8px 0 0; text-align: center; font-size: 12px; color: var(--muted); }

/* 用户胶囊 */
.user-chip { margin-left: auto; }
.user-name {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  cursor: pointer;
  max-width: 150px;
}
.user-name:hover { border-color: var(--accent-line); }
.user-name .avatar {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent);
}
#userLabel { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 面板标签 */
.panel-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: #f0ebe1;
  border-radius: 10px;
}
.panel-tabs button {
  flex: 1;
  position: relative;
  padding: 7px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.panel-tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(60, 50, 35, .12); }
.panel-tabs .badge {
  display: inline-block;
  min-width: 16px;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  vertical-align: 1px;
}

.tab-body { display: flex; flex-direction: column; min-height: 0; flex: 1; gap: 10px; }
.tab-tip { margin: 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.tab-empty { padding: 18px 6px; font-size: 12.5px; line-height: 1.8; color: var(--muted); list-style: none; }

/* 歌词单 / 点词记录 / 用户列表通用行 */
.songs, .words, .users { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 80px; }
.song-row, .user-row, .word-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line-soft);
}
.song-main, .user-main, .word-main { flex: 1; min-width: 0; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.song-main { cursor: pointer; }
.song-main:hover .result-title { color: var(--accent); }
.row-x, .mark-btn {
  width: 26px;
  height: 26px;
  flex: none;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.row-x:hover { background: #f2e7de; color: #a8512f; }
.mark-btn:hover { background: var(--accent-soft); }
.mark-btn.on { color: #2f7a4f; border-color: rgba(47, 122, 79, .35); }

.word-row.marked .word-name { text-decoration: line-through; text-decoration-color: rgba(47, 122, 79, .5); }
.word-line1 { display: flex; align-items: baseline; gap: 6px; }
.word-name { font-family: var(--serif); font-size: 15px; cursor: pointer; }
.word-name:hover { color: var(--accent); }
.word-count { font-size: 11px; color: var(--muted); }
.word-short { font-size: 11.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.word-side { display: flex; align-items: center; gap: 6px; flex: none; }
.word-when { font-size: 10.5px; color: var(--muted); }
.word-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.segmented.small button { padding: 4px 10px; font-size: 11.5px; }
.word-stat { font-size: 11px; color: var(--muted); }

/* 管理 */
.admin-form { display: flex; gap: 6px; }
.admin-form input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12.5px;
}
.admin-form button {
  flex: none;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}
.user-actions { display: flex; flex-direction: column; gap: 4px; flex: none; }
.mini-btn {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 10.5px;
  color: var(--ink-soft);
  cursor: pointer;
}
.mini-btn.danger:hover { border-color: #c9795a; color: #a8512f; }
.admin-tag { font-style: normal; font-size: 10px; padding: 1px 5px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); }

/* 单词详情弹层 */
.word-detail h4 { margin: 0 0 10px; font-family: var(--serif); font-size: 24px; }
.def-phon { font-family: var(--sans); font-size: 14px; color: var(--muted); margin-left: 8px; }
.def-row { display: flex; gap: 8px; padding: 6px 0; font-size: 15px; line-height: 1.5; border-top: 1px solid #f0ebe1; }
.def-row .pos { flex: none; min-width: 34px; color: var(--accent); font-size: 12px; padding-top: 3px; }
.def-en { font-size: 13px; color: #55504a; padding: 2px 0; }
.def-en b { color: var(--accent); margin-right: 6px; }
.def-ex { margin-top: 10px; padding: 10px 12px; background: #f7f3ea; border-radius: 10px; font-size: 13.5px; line-height: 1.55; }
.def-zh { color: var(--muted); margin-top: 2px; }
.word-detail .ghost-btn { margin-top: 12px; }

/* 收藏按钮 */
.btn.ghost.owned { border-color: rgba(47, 122, 79, .45); color: #2f7a4f; }

/* 账号设置弹层 */
.account-row { margin: 0 0 8px; font-size: 13px; color: var(--ink-soft); }
.account-form { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.account-form input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}
.account-form button {
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}
.account-actions { margin-top: 14px; display: flex; justify-content: flex-end; }

/* 舞台栏 */
.stage-actions { display: flex; align-items: center; gap: 12px; }
.stage-link { font-size: 11.5px; color: var(--accent); text-decoration: none; letter-spacing: .04em; }
.stage-link:hover { text-decoration: underline; }

@media (max-width: 1100px) {
  .app { grid-template-columns: 340px minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .panel { max-height: 52vh; }
}
