/* Auth, Pricing, Workspace pages */

.page-main { padding-top: var(--header-h); min-height: 100vh; }

/* ---- Auth ---- */
.auth-page {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - var(--header-h));
  padding: 40px 20px;
}
.auth-card {
  width: min(420px, 100%);
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  padding: 40px 36px;
  box-shadow: var(--shadow-md);
}
.auth-card h1 {
  font-family: var(--font-serif);
  font-size: 28px; font-weight: 600;
  text-align: center; margin-bottom: 8px;
}
.auth-subtitle {
  text-align: center; font-size: 14px;
  color: var(--text-secondary); margin-bottom: 28px;
}
.auth-tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--bg-cream); border-radius: 999px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1; height: 36px; border-radius: 999px;
  font-size: 14px; color: var(--text-secondary);
  transition: all 0.2s;
}
.auth-tab.active {
  background: var(--white); color: var(--text-primary);
  font-weight: 500; box-shadow: var(--shadow-sm);
}
.auth-error {
  display: none; padding: 10px 14px; margin-bottom: 16px;
  background: #fef2f2; color: #b91c1c;
  border-radius: var(--radius-sm); font-size: 13px;
}
.auth-error.show { display: block; }
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 500;
  margin-bottom: 6px; color: var(--text-primary);
}
.form-input {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; background: var(--white);
  transition: border-color 0.2s;
}
.form-input:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-light);
}
.form-row { display: flex; gap: 10px; }
.form-row .form-input { flex: 1; }
.btn-code {
  flex-shrink: 0; height: 44px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; background: var(--bg-cream);
  white-space: nowrap; transition: all 0.2s;
}
.btn-code:hover:not(:disabled) { border-color: var(--green); color: var(--green); }
.btn-code:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block {
  width: 100%; height: 44px; margin-top: 8px;
  font-size: 15px; font-weight: 500;
}
.auth-wechat {
  display: none; text-align: center; padding: 20px 0;
}
.auth-wechat.active { display: block; }
.auth-form-panel { display: none; }
.auth-form-panel.active { display: block; }
.qr-box {
  width: 180px; height: 180px; margin: 0 auto 16px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-cream);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text-muted);
}
.auth-footer {
  text-align: center; margin-top: 24px;
  font-size: 14px; color: var(--text-secondary);
}
.auth-footer a { color: var(--green); font-weight: 500; }
.auth-bonus {
  text-align: center; margin-top: 16px; padding: 10px;
  background: var(--green-light); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--green);
}
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; font-size: 12px; color: var(--text-muted);
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ---- Pricing ---- */
.pricing-page { padding: 48px 0 80px; }
.pricing-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--text-secondary);
  margin-bottom: 32px; transition: color 0.2s;
}
.pricing-back:hover { color: var(--green); }
.pricing-hero { text-align: center; margin-bottom: 48px; }
.pricing-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 600; letter-spacing: -0.03em;
}
.pricing-hero p {
  margin-top: 12px; font-size: 16px; color: var(--text-secondary);
}
.pricing-controls {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: center; gap: 16px; margin-bottom: 40px;
}
.billing-toggle {
  display: inline-flex; padding: 4px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: 999px;
}
.billing-toggle button {
  height: 36px; padding: 0 20px; border-radius: 999px;
  font-size: 14px; color: var(--text-secondary); transition: all 0.2s;
}
.billing-toggle button.active {
  background: var(--green); color: #fff; font-weight: 500;
}
.billing-save {
  font-size: 12px; color: var(--green);
  background: var(--green-light); padding: 4px 10px;
  border-radius: 999px;
}
.pricing-tabs {
  display: flex; justify-content: center; gap: 24px;
  margin-bottom: 40px; border-bottom: 1px solid var(--border);
}
.pricing-tab {
  padding: 12px 4px; font-size: 15px; color: var(--text-secondary);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all 0.2s;
}
.pricing-tab.active { color: var(--green); border-bottom-color: var(--green); font-weight: 500; }
.pricing-tab-panel { display: none; }
.pricing-tab-panel.active { display: block; }

.plans-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; align-items: stretch;
}
.plan-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px 24px;
  display: flex; flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}
.plan-card:hover { box-shadow: var(--shadow-md); }
.plan-card.featured {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green), var(--shadow-md);
  position: relative;
}
.plan-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--green); color: #fff;
  font-size: 12px; font-weight: 500;
  padding: 4px 14px; border-radius: 999px; white-space: nowrap;
}
.plan-name { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.plan-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; min-height: 40px; }
.plan-price { margin-bottom: 20px; }
.plan-price .amount {
  font-family: var(--font-serif);
  font-size: 36px; font-weight: 600; color: var(--text-primary);
}
.plan-price .period { font-size: 14px; color: var(--text-muted); }
.plan-price .annual-note {
  display: block; font-size: 12px; color: var(--green); margin-top: 4px;
}
.plan-credits {
  font-size: 14px; font-weight: 500; color: var(--green);
  padding: 8px 12px; background: var(--green-light);
  border-radius: var(--radius-sm); margin-bottom: 20px;
}
.plan-features { flex: 1; margin-bottom: 24px; }
.plan-features li {
  font-size: 13px; color: var(--text-secondary);
  padding: 6px 0; padding-left: 20px; position: relative; line-height: 1.5;
}
.plan-features li::before {
  content: '✓'; position: absolute; left: 0;
  color: var(--green); font-weight: 600;
}
.plan-features li.disabled { opacity: 0.45; }
.plan-features li.disabled::before { content: '—'; color: var(--text-muted); }
.plan-card .btn-primary, .plan-card .btn-outline { width: 100%; height: 40px; }

.booster-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.booster-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; text-align: center;
  transition: box-shadow 0.2s;
}
.booster-card:hover { box-shadow: var(--shadow-md); }
.booster-card.best { border-color: var(--green); }
.booster-credits {
  font-family: var(--font-serif);
  font-size: 28px; font-weight: 600; color: var(--green);
}
.booster-price { font-size: 20px; font-weight: 600; margin: 8px 0 16px; }
.booster-label { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }

.enterprise-box {
  max-width: 720px; margin: 0 auto; text-align: center;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 48px 40px;
}
.enterprise-box h2 {
  font-family: var(--font-serif);
  font-size: 28px; margin-bottom: 12px;
}
.enterprise-box p {
  font-size: 15px; color: var(--text-secondary);
  line-height: 1.7; margin-bottom: 28px;
}
.enterprise-features {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-bottom: 32px; text-align: left;
}
.enterprise-feat {
  padding: 16px; background: var(--bg-cream);
  border-radius: var(--radius-md); font-size: 13px;
}
.enterprise-feat strong { display: block; margin-bottom: 4px; font-size: 14px; }

.pricing-faq { max-width: 800px; margin: 64px auto 0; }

/* ---- Workspace ---- */
body.workspace-body { background: #EDEAE0; }
.workspace-layout {
  display: flex; min-height: 100vh; padding-top: 0;
}
.ws-sidebar {
  width: 260px; flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
}
.ws-sidebar-logo {
  height: var(--header-h); padding: 0 20px;
  display: flex; align-items: center;
  border-bottom: 1px solid var(--border);
}
.ws-sidebar-logo img { height: 22px; }
.ws-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.ws-nav-section { margin-bottom: 24px; }
.ws-nav-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted);
  padding: 0 10px; margin-bottom: 8px;
}
.ws-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text-secondary);
  transition: all 0.15s; margin-bottom: 2px;
}
.ws-nav a:hover { background: var(--bg-cream); color: var(--text-primary); }
.ws-nav a.active {
  background: var(--green-light); color: var(--green); font-weight: 500;
}
.ws-nav a svg { flex-shrink: 0; opacity: 0.7; }
.ws-nav a.active svg { opacity: 1; }
.ws-sidebar-bottom {
  padding: 16px; border-top: 1px solid var(--border);
}
.credits-widget {
  padding: 14px; background: var(--bg-cream);
  border-radius: var(--radius-md); margin-bottom: 12px;
}
.credits-widget .label { font-size: 12px; color: var(--text-muted); }
.credits-widget .value {
  font-size: 22px; font-weight: 600; color: var(--green);
  margin: 4px 0 10px;
}
.credits-widget .bar {
  height: 4px; background: rgba(46,103,84,0.12);
  border-radius: 999px; overflow: hidden;
}
.credits-widget .bar-fill {
  height: 100%; background: var(--green); border-radius: 999px;
  transition: width 0.3s;
}

.ws-main {
  flex: 1; margin-left: 260px;
  display: flex; flex-direction: column; min-height: 100vh;
}
.ws-topbar {
  height: var(--header-h); padding: 0 28px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 40;
}
.ws-topbar h1 { font-size: 18px; font-weight: 600; }
.ws-topbar-actions { display: flex; align-items: center; gap: 12px; }
.ws-user {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-secondary);
}
.ws-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.ws-content { flex: 1; padding: 28px; }
.ws-view { display: none; }
.ws-view.active { display: block; }

.ws-create-wrap {
  max-width: 960px; margin: 0 auto;
}
.ws-create-wrap .workbench {
  width: 100%; margin-top: 0;
  outline-width: 4px;
}
.ws-create-hint {
  text-align: center; margin-bottom: 28px;
}
.ws-create-hint h2 {
  font-family: var(--font-serif);
  font-size: 24px; font-weight: 600; margin-bottom: 8px;
}
.ws-create-hint p { font-size: 14px; color: var(--text-secondary); }

.projects-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.projects-toolbar h2 { font-size: 18px; font-weight: 600; }
.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.project-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
  cursor: pointer; transition: box-shadow 0.2s, transform 0.2s;
}
.project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.project-thumb {
  aspect-ratio: 16/9; background: linear-gradient(135deg, #E8F0EC, #D4E4DC);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.project-thumb .status-badge {
  position: absolute; top: 10px; right: 10px;
  font-size: 11px; font-weight: 500; padding: 3px 10px;
  border-radius: 999px; background: rgba(255,255,255,0.9);
}
.status-badge.done { color: var(--green); }
.status-badge.processing { color: #D97706; }
.status-badge.draft { color: var(--text-muted); }
.project-body { padding: 14px 16px 16px; }
.project-body h3 {
  font-size: 14px; font-weight: 600; margin-bottom: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.project-meta { font-size: 12px; color: var(--text-muted); }

.generating-panel {
  display: none; margin-top: 24px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  text-align: center;
}
.generating-panel.active { display: block; }
.generating-panel h3 { font-size: 16px; margin-bottom: 8px; }
.generating-panel p { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }
.progress-track {
  height: 6px; background: var(--green-light);
  border-radius: 999px; overflow: hidden; max-width: 400px; margin: 0 auto;
}
.progress-fill {
  height: 100%; background: var(--green); border-radius: 999px;
  width: 0; transition: width 0.4s ease;
}
.gen-steps {
  display: flex; justify-content: center; gap: 24px;
  margin-top: 24px; flex-wrap: wrap;
}
.gen-step {
  font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}
.gen-step.active { color: var(--green); font-weight: 500; }
.gen-step.done { color: var(--green); }

.ws-mobile-toggle {
  display: none; position: fixed; bottom: 20px; right: 20px;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 20px;
  box-shadow: var(--shadow-md); z-index: 60;
}

@media (max-width: 1024px) {
  .plans-grid { grid-template-columns: repeat(2, 1fr); }
  .booster-grid { grid-template-columns: repeat(2, 1fr); }
  .enterprise-features { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .ws-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  .ws-sidebar.open { transform: translateX(0); }
  .ws-main { margin-left: 0; }
  .ws-mobile-toggle { display: flex; align-items: center; justify-content: center; }
}
@media (max-width: 640px) {
  .plans-grid, .booster-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 32px 24px; }
  .ws-content { padding: 16px; }
  .auth-split { grid-template-columns: 1fr; }
  .auth-benefits { display: none; }
  .project-layout { grid-template-columns: 1fr; }
}

/* ---- Register split layout ---- */
.auth-split-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - var(--header-h));
  padding: 40px 20px;
}
.auth-split {
  display: grid; grid-template-columns: 420px 380px;
  gap: 24px; width: min(860px, 100%); align-items: stretch;
}
.auth-split .auth-card { margin: 0; }
.auth-benefits {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 36px 32px;
  box-shadow: var(--shadow-md);
}
.auth-benefits h2 {
  font-family: var(--font-serif); font-size: 22px;
  margin-bottom: 20px;
}
.benefit-list { display: flex; flex-direction: column; gap: 16px; }
.benefit-item {
  display: flex; gap: 12px; font-size: 14px; line-height: 1.6;
}
.benefit-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 10px; background: var(--green-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.benefit-item strong { display: block; margin-bottom: 2px; }

/* ---- Project detail ---- */
.project-page { padding: 24px 0 64px; }
.project-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--text-secondary); margin-bottom: 24px;
}
.project-back:hover { color: var(--green); }
.project-layout {
  display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start;
}
.project-player {
  background: #000; border-radius: var(--radius-lg);
  overflow: hidden; border: 4px solid rgba(46,103,84,0.12);
  aspect-ratio: 16/9;
}
.project-player video { width: 100%; height: 100%; object-fit: contain; display: block; }
.project-player-placeholder {
  width: 100%; height: 100%; min-height: 280px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a2e27, #2e6754);
  color: rgba(255,255,255,0.7); font-size: 14px;
}
.project-head { margin-top: 20px; }
.project-head h1 {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 32px); font-weight: 600;
  line-height: 1.25; margin-bottom: 10px;
}
.project-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.project-tag {
  font-size: 12px; padding: 4px 12px; border-radius: 999px;
  background: var(--green-light); color: var(--green); font-weight: 500;
}
.project-tag.status-processing { background: #FEF3C7; color: #D97706; }
.project-tag.status-failed { background: #FEE2E2; color: #DC2626; }
.project-desc { font-size: 15px; color: var(--text-secondary); line-height: 1.7; }
.project-sidebar { display: flex; flex-direction: column; gap: 16px; }
.sidebar-panel {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
}
.sidebar-panel h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.meta-row {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--border);
}
.meta-row:last-child { border-bottom: none; }
.meta-row span:first-child { color: var(--text-muted); }
.script-list { display: flex; flex-direction: column; gap: 12px; }
.script-item {
  padding: 12px; background: var(--bg-cream); border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.6;
}
.script-item .scene-num {
  font-size: 11px; font-weight: 600; color: var(--green); margin-bottom: 4px;
}
.script-item .visual { color: var(--text-muted); font-size: 12px; margin-top: 6px; }
.project-actions { display: flex; flex-direction: column; gap: 8px; }
.project-actions .btn-primary, .project-actions .btn-outline { width: 100%; height: 40px; }
.loading-state {
  text-align: center; padding: 80px 20px; color: var(--text-muted);
}
.error-state {
  text-align: center; padding: 80px 20px;
}
.error-state p { color: #DC2626; margin-bottom: 16px; }
