/* ========== 全局布局 ========== */
.app-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  background: var(--bg-base);
}

/* ========== 左侧边栏 ========== */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

.sidebar-top {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-logo {
  padding: 4px 8px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-image {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #faf6ef;
}

.sidebar-logo .logo-text-group {
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}

.sidebar-logo .logo-text {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.sidebar-logo .logo-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.88rem;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}

.sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: var(--brand-dim);
  color: var(--brand);
  font-weight: 600;
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
}

.sidebar-group-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  padding: 4px 10px 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ========== 侧边栏底部 ========== */
.sidebar-bottom {
  padding: 12px 12px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-card:hover {
  background: var(--bg-hover);
}

.user-avatar-lg {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-warm);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}

.user-info-lg {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.user-name-lg {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-plan-lg {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  padding: 0 4px;
}

/* 当前套餐卡片 */
.current-plan-card {
  padding: 10px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 0 4px;
}

.plan-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 2px;
}

.plan-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 2px;
}

.plan-expire {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sidebar-action {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: all 0.15s ease;
}

.sidebar-action:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.sidebar-action.highlight {
  color: var(--brand);
  font-weight: 600;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-menu-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.82rem;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}

.sidebar-menu-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.badge {
  margin-left: 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.badge-delta {
  font-size: 0.7rem;
  color: var(--success);
  font-weight: 600;
}

/* ========== 主区域（居中布局） ========== */
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px 80px;
  overflow-y: auto;
}

.main-content {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* ========== Hero ========== */
.hero {
  text-align: center;
  margin-bottom: 24px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 400;
}

/* ========== 输入框 ========== */
.composer {
  margin-bottom: 24px;
}

.composer-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: visible;
  transition: all 0.25s ease;
}

.composer-box:focus-within {
  border-color: var(--brand);
  box-shadow: var(--shadow-lg), 0 0 0 4px var(--brand-dim);
}

.composer-input {
  width: 100%;
  padding: 20px 24px;
  background: transparent;
  border: none;
  resize: none;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-primary);
  outline: none;
  min-height: 140px;
}

.composer-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  gap: 8px;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.toolbar-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: var(--font-sans);
}

.toolbar-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.chip-icon {
  font-size: 0.85rem;
  opacity: 0.7;
}

/* ========== 工具栏下拉菜单 ========== */
.toolbar-dropdown {
  position: relative;
  display: inline-flex;
}

.toolbar-dropdown .chip-arrow {
  margin-left: 2px;
  font-size: 0.7rem;
  opacity: 0.5;
  transition: transform 0.2s ease;
}

.toolbar-dropdown.open .chip-arrow {
  transform: rotate(180deg);
  opacity: 1;
}

.toolbar-dropdown.open .toolbar-chip {
  border-color: var(--brand);
  color: var(--brand);
}

.chip-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  max-width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  display: none;
  overflow: hidden;
}

.chip-dropdown.open {
  display: block;
  animation: viewFadeIn 0.15s ease both;
}

.chip-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.chip-dropdown-item:last-child {
  border-bottom: none;
}

.chip-dropdown-item:hover {
  background: var(--bg-hover);
}

.chip-dropdown-item.selected {
  background: var(--brand-dim);
  color: var(--brand);
  font-weight: 600;
}

.chip-item-name {
  font-weight: 500;
  flex-shrink: 0;
}

.chip-item-desc {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-left: auto;
  white-space: nowrap;
}

/* 单纯文本的下拉项（无 name + desc 结构） */
.chip-dropdown-item > span:only-child {
  display: block;
  padding: 1px 0;
}

/* ========== 工具栏角色按钮 ========== */
.toolbar-roles {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.role-chip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.role-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s ease;
}

.role-chip-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.role-chip-btn.has-open {
  border-color: var(--brand);
  color: var(--brand);
}

.role-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.role-dot-1 { background: var(--brand); }
.role-dot-2 { background: var(--accent-2); }
.role-dot-3 { background: var(--accent-3); }

.role-chip-name {
  font-weight: 500;
  white-space: nowrap;
}

.role-chip-arrow {
  font-size: 0.7rem;
  opacity: 0.5;
}

.role-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 2px;
  border: none;
  background: transparent;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.role-chip-remove:hover {
  background: var(--error-light);
  color: var(--error);
}

.role-chip-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.role-chip-add:hover {
  border-color: var(--brand);
  color: var(--brand);
  border-style: solid;
}

/* ========== 角色音下拉（嵌入工具栏） ========== */
.voice-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 280px;
  max-width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  display: none;
  max-height: 320px;
  overflow-y: auto;
}

.voice-dropdown.open {
  display: block;
  animation: viewFadeIn 0.15s ease both;
}

.voice-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.voice-dropdown-item:last-child {
  border-bottom: none;
}

.voice-dropdown-item:hover {
  background: var(--bg-hover);
}

.voice-dropdown-item.selected {
  background: var(--brand-dim);
}

.voice-dropdown-item .vd-info {
  flex: 1;
  min-width: 0;
}

.voice-dropdown-item .vd-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.voice-dropdown-item.selected .vd-name {
  color: var(--brand);
}

.voice-dropdown-item .vd-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.voice-dropdown-item .vd-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.voice-dropdown-item .vd-play:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-dim);
}

.toolbar-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-attach {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--brand-dim);
  border: 1px solid var(--brand);
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-attach svg {
  display: block;
  width: 13px;
  height: 13px;
}

.btn-attach:hover {
  background: var(--brand);
  color: #fff;
}

.toolbar-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, #8b5a2b 100%);
  color: #fff;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  font-family: var(--font-sans);
  box-shadow: 0 2px 8px rgba(184, 114, 63, 0.35), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(184, 114, 63, 0.5), 0 2px 4px rgba(0, 0, 0, 0.12);
}

.btn-send:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(184, 114, 63, 0.4);
}

.btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ========== 示例卡片（横排3个） ========== */
.examples-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 40px;
}

.example-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: left;
  font-family: var(--font-sans);
  text-decoration: none;
  color: inherit;
}

.example-card:hover {
  border-color: var(--brand);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.example-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.example-text {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.5;
}

/* ========== 示例声音区 ========== */
.voice-samples {
  margin-top: 24px;
  margin-bottom: 60px;
}

.voice-samples-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
  text-align: center;
  letter-spacing: -0.01em;
}

.voice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.voice-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
}

.voice-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.voice-cover {
  aspect-ratio: 5/2.4;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-elevated);
}

.voice-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.voice-card:hover .voice-cover img {
  transform: scale(1.05);
}

.voice-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  padding-left: 3px;
  z-index: 1;
}

.voice-play:hover {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.voice-meta {
  padding: 12px 14px;
}

.voice-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.voice-info {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.voice-info .dot {
  opacity: 0.5;
}

/* ========== 我的作品 ========== */
.works-section {
  margin-top: 8px;
}

.works-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.works-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  flex: 1;
}

.works-tab {
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.works-tab:hover {
  color: var(--text-primary);
}

.works-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
  font-weight: 600;
}

.works-more {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.works-more:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.works-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}

.search-icon {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.88rem;
  color: var(--text-primary);
  outline: none;
  font-family: var(--font-sans);
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.work-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
}

.work-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.work-cover {
  aspect-ratio: 4/3;
  position: relative;
  overflow: hidden;
}

.work-cover-draft {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-base) 0%, var(--bg-elevated) 100%);
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  position: relative;
}

/* 草稿卡无封面 fallback: 显示用户名 (居中 + 大字 + 衬线) */
.work-cover-draft-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f1ea 0%, #e8d8c4 100%);
  position: relative;
  overflow: hidden;
}
.work-cover-draft-empty::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(201, 138, 92, 0.08), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(184, 114, 63, 0.08), transparent 40%);
}
.work-cover-username {
  font-family: "DM Serif Display", "Noto Serif SC", Georgia, serif;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  text-align: center;
  padding: 0 24px;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}

/* 草稿扁平卡: 无封面区, 只有标题+meta+按钮, 紧凑简洁 */
.work-card-flat {
  display: flex;
  flex-direction: column;
}
.work-card-flat .work-body {
  padding: 20px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.work-card-flat .work-title {
  margin-top: 0;
}

/* 草稿封面: 心跳波形 + 居中 '草稿' 标签 (与 work-edit 封面统一) */
.work-cover.work-cover-empty {
  position: relative;
  overflow: hidden;
}

.work-cover.work-cover-empty .clone-waveform {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 60%;
  margin: 0;
  position: absolute;
  inset: 0;
}

.work-cover.work-cover-empty .heartbeat-waves {
  position: relative;
  width: 90%;
  max-width: 360px;
  height: 100%;
  animation: heartbeatScale 1.8s ease-in-out infinite;
}

.work-cover.work-cover-empty .hb-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.work-cover.work-cover-empty .hb-base {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.2;
}

.work-cover.work-cover-empty .hb-base-1 { stroke: #b8723f; }
.work-cover.work-cover-empty .hb-base-2 { stroke: #e0b078; }
.work-cover.work-cover-empty .hb-base-3 { stroke: #c98a5c; }

.work-cover.work-cover-empty .hb-pulse {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 8 32;
  animation: hbPulseFlow 2.8s linear infinite;
}

.work-cover.work-cover-empty .hb-pulse-1 {
  stroke: #b8723f;
  filter: drop-shadow(0 0 6px rgba(184, 114, 63, 0.7));
  animation-duration: 2.5s;
}
.work-cover.work-cover-empty .hb-pulse-2 {
  stroke: #e0b078;
  filter: drop-shadow(0 0 5px rgba(224, 176, 120, 0.6));
  animation-duration: 3.2s;
  animation-direction: reverse;
  stroke-dasharray: 6 26;
}
.work-cover.work-cover-empty .hb-pulse-3 {
  stroke: #c98a5c;
  filter: drop-shadow(0 0 5px rgba(201, 138, 92, 0.5));
  animation-duration: 2.2s;
  stroke-dasharray: 7 29;
}

.work-cover-draft-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 2px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--text-secondary);
  z-index: 1;
}

.work-cover-art {
  width: 100%;
  height: 100%;
  position: relative;
}

.cover-shapes {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(20px);
  opacity: 0.6;
}

.cover-shape.s1 {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.4);
  top: 20%;
  left: 25%;
}

.cover-shape.s2 {
  width: 100px;
  height: 100px;
  background: rgba(255, 200, 150, 0.5);
  bottom: 20%;
  right: 20%;
}

.cover-shape.s3 {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.3);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.work-info {
  padding: 12px 14px;
}

.work-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.work-meta .dot {
  opacity: 0.5;
}

/* ========== 通用按钮 ========== */
.sidebar-general {
  background: transparent;
  border: none;
  text-align: left;
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-general:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--text-secondary);
}

.menu-icon svg {
  display: block;
}

/* ========== 设置弹窗 ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 760px;
  max-width: 90vw;
  height: 480px;
  max-height: 80vh;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

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

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  font-family: var(--font-serif);
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 1.2rem;
  line-height: 1;
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* 弹窗左侧分类 */
.modal-sidebar {
  width: 180px;
  padding: 16px 12px;
  border-right: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  font-family: var(--font-sans);
}

.modal-nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-nav-item.active {
  background: var(--brand-dim);
  color: var(--brand);
  font-weight: 600;
}

.modal-nav-icon {
  font-size: 0.95rem;
  width: 18px;
  text-align: center;
}

/* 弹窗右侧内容 */
.modal-content {
  flex: 1;
  padding: 24px 28px;
  overflow-y: auto;
}

.modal-pane {
  display: none;
}

.modal-pane.active {
  display: block;
}

.modal-pane[hidden] {
  display: none;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--brand);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--brand-dim);
}

.form-input[readonly] {
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: not-allowed;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-primary);
}

.form-row:last-child {
  border-bottom: none;
}

/* Switch 开关 */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
}

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

.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--border-strong);
  border-radius: 20px;
  transition: all 0.2s ease;
}

.switch-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: white;
  border-radius: 50%;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .switch-slider {
  background: var(--brand);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(16px);
}

/* 头像上传 */
.avatar-uploader {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar-preview {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-warm);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
}

.current-plan {
  display: inline-block;
  padding: 6px 14px;
  background: var(--brand-dim);
  color: var(--brand);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.btn {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--gradient-warm);
  color: white;
  box-shadow: 0 2px 6px rgba(184, 114, 63, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 4px 10px rgba(184, 114, 63, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
  .sidebar {
    width: 64px;
  }
  .sidebar-item-text,
  .sidebar-group-title,
  .user-info-lg,
  .sidebar-action:not(.highlight),
  .current-plan-card,
  .plan-tabs {
    display: none;
  }
  .sidebar-actions {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  .app-main {
    padding: 24px 16px 60px;
  }
  .hero-title {
    font-size: 1.6rem;
  }
  .examples-row {
    grid-template-columns: 1fr;
  }
  .voice-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .voice-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== 音色下拉：男女声切换 + 置顶 (2026-06-30, sync from work-edit.css) ========== */

.voice-tabs {
  display: flex;
  gap: 6px;
  padding: 4px 6px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.voice-tab {
  flex: 1;
  padding: 7px 12px;
  border: 1px solid var(--border);
  background: var(--bg-base);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.voice-tab:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.voice-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.voice-section-title {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 8px 4px;
}

.voice-pinned-section {
  border-bottom: 1px dashed var(--border);
  margin-bottom: 4px;
  padding-bottom: 2px;
}

.voice-pin-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-base);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1;
  transition: all 0.15s ease;
}

.voice-pin-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-dim);
}

.voice-pin-btn.pinned {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.voice-pin-btn.pinned:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

/* 音色下拉项（toolbar-roles 内的 .voice-dropdown） */
.toolbar-roles .voice-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease;
}

.toolbar-roles .voice-dropdown .dropdown-item:hover {
  background: var(--bg-hover);
}

.toolbar-roles .voice-dropdown .dropdown-item.selected {
  background: var(--brand-dim);
}

.toolbar-roles .voice-dropdown .voice-info {
  flex: 1;
  min-width: 0;
}

.toolbar-roles .voice-dropdown .voice-name {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.toolbar-roles .voice-dropdown .voice-play-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--brand);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  padding-left: 2px;
  transition: all 0.15s ease;
}

.toolbar-roles .voice-dropdown .voice-play-btn:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.toolbar-roles .voice-dropdown {
  max-width: 320px;
  max-height: 380px;
  overflow-y: auto;
}

/* ========== 生成脚本进度弹窗 (2026-06-30) ========== */

.progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: progressFadeIn 0.2s ease both;
}

.progress-overlay[hidden] {
  display: none;
}

@keyframes progressFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.progress-modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg, 16px);
  padding: 28px 32px 24px;
  min-width: 360px;
  max-width: 420px;
  box-shadow: var(--shadow-xl, 0 16px 48px rgba(0, 0, 0, 0.25));
  animation: progressSlideUp 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes progressSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.progress-header {
  text-align: center;
  margin-bottom: 20px;
}

.progress-title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.progress-sub {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.progress-elapsed {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 6px 0 0;
  font-weight: 500;
}

.progress-elapsed[hidden] {
  display: none;
}

.progress-bar-fill.indeterminate {
  width: 30% !important;
  animation: progressShimmer 1.4s ease-in-out infinite;
}

@keyframes progressShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

.progress-bar-track {
  height: 6px;
  background: var(--bg-base);
  border-radius: var(--radius-pill, 9999px);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-hover) 100%);
  border-radius: var(--radius-pill, 9999px);
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.progress-percent {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: right;
  margin-bottom: 18px;
}

.progress-stages {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-stages .stage {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.progress-stages .stage-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-base);
  color: var(--text-muted);
  flex-shrink: 0;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.progress-stages .stage.active {
  color: var(--text-primary);
}

.progress-stages .stage.active .stage-icon {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  animation: stagePulse 1.4s ease-in-out infinite;
}

.progress-stages .stage.done {
  color: var(--text-secondary);
}

.progress-stages .stage.done .stage-icon {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

@keyframes stagePulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--brand-dim); }
  50% { box-shadow: 0 0 0 6px transparent; }
}