:root {
  --bg: #f7f9ff;
  --bg-raised: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --surface-strong: #eef2ff;
  --ink: #151c32;
  --muted: #8b95ad;
  --muted-strong: #535d76;
  --line: rgba(103, 116, 156, 0.16);
  --line-strong: rgba(103, 116, 156, 0.26);
  --primary: #7657ff;
  --primary-strong: #556dff;
  --primary-ink: #ffffff;
  --accent: #ffc66d;
  --blue: #4d7cff;
  --danger: #ff6b64;
  --success: #19b993;
  --shadow: 0 20px 54px rgba(42, 50, 84, 0.12);
  --ring: 0 0 0 3px rgba(118, 87, 255, 0.2);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  background: radial-gradient(circle at 7% -8%, rgba(105, 149, 255, 0.18), transparent 28%),
    radial-gradient(circle at 92% 0%, rgba(168, 138, 255, 0.18), transparent 28%),
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

button:hover,
.button:hover {
  background: var(--primary-strong);
  box-shadow: 0 10px 26px rgba(56, 210, 166, 0.22);
  transform: translateY(-1px);
}

button:disabled,
button.is-disabled,
.primary-action.is-disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

select {
  height: 40px;
  padding: 0 11px;
}

textarea {
  min-height: 120px;
  padding: 11px;
  line-height: 1.6;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: relative;
  top: 0;
  z-index: 20;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 26px 10px;
  background: transparent;
  border-bottom: 0;
  backdrop-filter: none;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.brand:hover {
  background: transparent;
  box-shadow: none;
  transform: none;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: block;
  flex: 0 0 58px;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.brand h1 {
  margin: 0;
  color: #111831;
  font-size: 25px;
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: 0;
}

.brand p {
  margin: 2px 0 0;
  color: #7d879d;
  font-size: 14px;
  font-weight: 600;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.topbar-meta span,
.topbar-meta strong {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.topbar-meta strong {
  color: var(--primary-strong);
}

.tab-bar {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  pointer-events: auto;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0;
  background: transparent;
  border-bottom: 0;
  backdrop-filter: none;
}

.tab-pill {
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid rgba(130, 141, 174, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 34px rgba(61, 75, 118, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(22px);
  pointer-events: auto;
}

.tab-btn {
  min-width: 142px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #566176;
  font-weight: 800;
  gap: 10px;
  white-space: nowrap;
  letter-spacing: 0;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  box-shadow: none;
}

.tab-btn.is-active {
  border-color: rgba(110, 87, 255, 0.1);
  background: linear-gradient(180deg, rgba(239, 240, 255, 0.98), rgba(231, 234, 255, 0.9));
  color: #6655ff;
  box-shadow: 0 10px 24px rgba(103, 92, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.app-shell.is-i2v .tab-btn.is-active {
  border-color: rgba(255, 128, 54, 0.18);
  background: linear-gradient(180deg, rgba(255, 244, 233, 0.98), rgba(255, 232, 214, 0.92));
  color: #ff6b2c;
  box-shadow: 0 10px 24px rgba(255, 116, 54, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.app-shell.is-edit .tab-btn.is-active {
  border-color: rgba(30, 125, 255, 0.16);
  background: linear-gradient(180deg, rgba(232, 244, 255, 0.98), rgba(219, 235, 255, 0.94));
  color: #1672ff;
  box-shadow: 0 10px 24px rgba(18, 116, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.app-shell.is-edit {
  --primary: #1672ff;
  --primary-strong: #075be0;
  --accent: #1672ff;
  --blue: #1672ff;
  --surface-strong: #eaf3ff;
  --ring: 0 0 0 3px rgba(22, 114, 255, 0.18);
}


.tab-btn > span:not(.tab-icon) {
  color: currentColor;
  font-size: 16px;
  line-height: 1;
}

.tab-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
  color: currentColor;
}

.tab-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 320px minmax(420px, 1fr) 370px;
  gap: 14px;
  padding: 14px;
}

.workspace-edit {
  grid-template-columns: 360px minmax(420px, 1fr) 340px;
}

.workspace-pagemaker {
  position: relative;
  min-height: calc(100vh - 126px);
  padding: 0;
  background: #ffffff;
  overflow: hidden;
}

.pagemaker-portfolio-bar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 18px;
  border-bottom: 1px solid rgba(123, 136, 177, 0.14);
  background: #f8faff;
  color: #5c6680;
  font-size: 14px;
  font-weight: 700;
}

.image-workspace {
  min-height: calc(100vh - 104px);
  display: grid;
  grid-template-columns: 360px minmax(320px, min(440px, calc((100vh - 210px) / 2))) minmax(560px, 1fr);
  align-items: start;
  gap: 22px;
  padding: 22px 26px 30px;
}

.image-settings-inline {
  display: grid;
  grid-template-columns: 220px minmax(320px, 1fr) minmax(260px, 340px);
  align-items: end;
  gap: 16px;
}

.image-prompt-inline {
  display: grid;
  gap: 8px;
}

.image-prompt-inline span {
  color: #374056;
  font-size: 13px;
  font-weight: 800;
}

.image-prompt-inline textarea {
  min-height: 62px;
  border: 1px solid rgba(123, 136, 177, 0.18);
  background: #ffffff;
  color: #172039;
  resize: vertical;
}

.image-inline-actions {
  display: grid;
  gap: 10px;
}

.image-body-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(620px, 1fr);
  align-items: start;
  gap: 16px;
}

.image-material-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.video-workspace {
  min-height: calc(100vh - 104px);
  display: flex;
  flex-direction: column;
  padding: 22px 26px 30px;
  overflow-anchor: none;
}

.edit-workspace-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: 400px minmax(440px, 560px) minmax(620px, 1fr);
  gap: 28px;
  align-items: stretch;
}

.video-main-card {
  min-width: 0;
  min-height: 560px;
  padding: 26px 28px;
  border: 1px solid rgba(123, 136, 177, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 22px 56px rgba(45, 56, 92, 0.11);
}

.video-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.video-material-card {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
}

.video-material-card h3 {
  margin: 0;
  color: #172039;
  font-size: 18px;
  font-weight: 900;
}

.video-upload-hero,
.video-material-media {
  width: 100%;
  height: 420px;
  border-radius: 18px;
}

.video-generate-btn {
  margin-top: 20px;
}

.video-upload-hero {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 1px dashed rgba(118, 87, 255, 0.32);
  background: #fbfaff;
  text-align: center;
  cursor: pointer;
}

.video-upload-hero-ref {
  border-color: rgba(25, 185, 147, 0.32);
  background: #f6fffd;
}

.video-upload-hero input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.video-upload-hero strong {
  color: #172039;
  font-size: 20px;
  font-weight: 900;
}

.video-upload-hero small {
  color: #8b95ad;
  font-size: 14px;
  line-height: 1.6;
}

.video-material-media {
  object-fit: contain;
  border: 1px solid rgba(123, 136, 177, 0.16);
  background: #fbfaff;
}

.video-empty-result span {
  font-size: 82px;
}

.app-shell.is-edit .video-upload-hero {
  border-color: rgba(22, 114, 255, 0.32);
  background: #f3f8ff;
}

.app-shell.is-edit .video-upload-hero-ref {
  border-color: rgba(38, 151, 255, 0.3);
  background: #f4faff;
}

.app-shell.is-edit .video-main-card,
.app-shell.is-edit .image-settings-card,
.app-shell.is-edit .image-result-card {
  border-color: rgba(22, 114, 255, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(245, 249, 255, 0.92));
  box-shadow: 0 22px 56px rgba(18, 92, 210, 0.11);
}

.app-shell.is-edit .image-section-title span,
.app-shell.is-edit .video-material-card h3,
.app-shell.is-edit .edit-preview-block h3 {
  color: #145fdc;
}

.app-shell.is-edit .image-mini-upload,
.app-shell.is-edit .image-settings-section {
  border-color: rgba(22, 114, 255, 0.16);
  background: #f7fbff;
}

.app-shell.is-edit .image-mini-upload label,
.app-shell.is-edit .image-replace-file {
  border-color: rgba(22, 114, 255, 0.34);
  background: #f3f8ff;
  color: #145fdc;
}

.app-shell.is-edit .image-prompt-field textarea:focus,
.app-shell.is-edit .image-prompt-inline textarea:focus,
.app-shell.is-edit .image-source-select:focus {
  border-color: rgba(22, 114, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(22, 114, 255, 0.12);
}

.app-shell.is-edit .video-material-media {
  background: #f3f8ff;
}

.app-shell.is-edit #editGenerateBtn {
  background: linear-gradient(135deg, #42b8ff, #096dff);
  box-shadow: 0 16px 34px rgba(18, 116, 255, 0.24);
}


.i2v-workspace {
  min-height: calc(100vh - 104px);
  display: grid;
  grid-template-columns: 400px minmax(360px, 440px) minmax(620px, 1fr);
  gap: 28px;
  padding: 22px 26px 30px;
}

.i2v-settings-card {
  min-width: 0;
}

.i2v-model-pill {
  background: linear-gradient(90deg, rgba(255, 246, 238, 0.95), rgba(246, 240, 255, 0.92));
}

.i2v-model-pill strong,
.i2v-settings-card .sparkle,
.i2v-sparkle {
  color: #ff7a2d;
}

.i2v-duration-block {
  display: grid;
  gap: 10px;
}

.i2v-range-line {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
}

.i2v-range-line input {
  width: 100%;
  accent-color: #ff8a3d;
}

.i2v-range-line strong {
  min-width: 44px;
  color: #6e55ff;
  font-size: 16px;
  font-weight: 900;
  text-align: right;
}

.i2v-mini-upload .ghost-upload-btn,
.i2v-upload-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px dashed rgba(118, 87, 255, 0.38);
  border-radius: 10px;
  background: #fff;
  color: #59637b;
  font-weight: 800;
  cursor: pointer;
}

.i2v-mini-upload .ghost-upload-btn:hover,
.i2v-upload-btn:hover {
  background: #fff;
  color: #59637b;
  border-color: rgba(118, 87, 255, 0.38);
  box-shadow: none;
  transform: none;
}

.ghost-upload-btn input[type="file"],
.i2v-upload-btn input[type="file"] {
  display: none;
}

.i2v-primary-action {
  background: linear-gradient(135deg, #ffbd4a, #ff5d45);
  box-shadow: 0 16px 34px rgba(255, 104, 60, 0.24);
}

.i2v-tip {
  border-color: rgba(255, 174, 58, 0.32);
  background: #fff9ee;
  color: #936224;
}

.i2v-tip span {
  color: #ff9f1a;
}

.i2v-main-card {
  min-width: 0;
  min-height: 520px;
  padding: 26px 28px;
  border: 1px solid rgba(123, 136, 177, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 22px 56px rgba(45, 56, 92, 0.11);
}

.i2v-hero-stage {
  position: relative;
  width: 100%;
  height: 430px;
  margin-top: 22px;
  overflow: hidden;
  border: 1px dashed rgba(255, 141, 63, 0.38);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 132, 38, 0.08), transparent 22%),
    #fffaf6;
}

.i2v-upload-hero {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
  cursor: pointer;
}

.i2v-upload-hero input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.i2v-upload-orb {
  position: relative;
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 25%, #ffd589, #ff842f 72%);
  color: #ffffff;
  box-shadow: 0 18px 42px rgba(255, 116, 54, 0.28), 0 0 0 16px rgba(255, 184, 93, 0.16);
}

.i2v-upload-orb .image-upload-icon {
  font-size: 48px;
  line-height: 1;
}

.i2v-upload-orb svg {
  width: 62px;
  height: 62px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.i2v-upload-orb .upload-badge {
  position: absolute;
  right: 18px;
  bottom: 20px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ffffff;
  color: #ff7a2d;
  font-size: 18px;
  font-weight: 900;
}

.i2v-upload-hero strong {
  color: #172039;
  font-size: 23px;
  font-weight: 900;
}

.i2v-upload-hero small {
  color: #8b95ad;
  font-size: 15px;
}

.i2v-preview-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #fffaf6;
}

.i2v-result-shell {
  border-color: rgba(118, 87, 255, 0.28);
}

.i2v-empty-result {
  min-height: 520px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: #8b95ad;
  text-align: center;
}

.i2v-empty-result strong {
  color: #172039;
  font-size: 18px;
  font-weight: 900;
}

.i2v-result-illustration {
  background: linear-gradient(180deg, rgba(255, 245, 236, 0.98), rgba(245, 241, 255, 0.96));
}

.i2v-result-illustration .video-window-icon {
  color: #ff8a3d;
}

.image-settings-card,
.image-stage-card,
.image-result-card {
  border: 1px solid rgba(123, 136, 177, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 22px 56px rgba(45, 56, 92, 0.11);
}

.image-settings-card,
.image-result-card {
  align-self: stretch;
  padding: 22px 24px;
}

.image-main-column {
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 24px;
}

.image-stage-card {
  min-height: 0;
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  padding: 16px;
}

.image-section-title,
.image-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.image-section-title span,
.image-card-head h2 {
  color: #172039;
  font-size: 20px;
  font-weight: 900;
}

.image-section-title small {
  color: #a58cff;
  font-size: 18px;
}

.image-section-title.compact span {
  font-size: 16px;
}

.image-card-head {
  margin-bottom: 0;
}

.image-card-head h2 {
  margin: 0;
}

.image-card-head h2 {
  font-size: 18px;
}

.image-card-head p,
.image-muted,
.image-upload-hero small,
.image-mini-upload p,
.image-task-empty small,
.image-job-status {
  color: #8b95ad;
  font-size: 13px;
  line-height: 1.55;
}

.image-card-head p,
.image-mini-upload p {
  margin: 4px 0 0;
}

.image-settings-section {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
}

.model-pill {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(118, 87, 255, 0.13);
  border-radius: 10px;
  background: #f7f4ff;
  color: #6c55e8;
  font-size: 14px;
}

.model-pill strong {
  font-size: 14px;
}

.image-field {
  display: grid;
  gap: 8px;
}

.image-field span {
  color: #374056;
  font-size: 13px;
  font-weight: 800;
}

.image-field select,
.image-source-select,
.image-library-select,
.image-settings-section textarea {
  border: 1px solid rgba(123, 136, 177, 0.18);
  background: #ffffff;
  color: #172039;
}

.image-source-select,
.image-library-select {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border-radius: 10px;
  outline: none;
}

.image-library-select:disabled {
  background: #f5f7fb;
  color: #98a2b7;
}

.image-prompt-field {
  position: relative;
  display: grid;
  gap: 8px;
}

.image-prompt-field > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #172039;
  font-size: 15px;
  font-weight: 900;
}

.image-prompt-field > div small,
.prompt-count {
  color: #98a2b7;
  font-size: 12px;
  font-weight: 700;
}

.image-prompt-field textarea {
  min-height: 150px;
  border: 1px solid rgba(123, 136, 177, 0.22);
  border-radius: 12px;
  background: #ffffff;
  color: #4d586f;
  line-height: 1.6;
}

.image-prompt-field textarea::placeholder {
  color: #a8b0c1;
}

.image-prompt-field textarea:focus {
  border-color: rgba(255, 132, 45, 0.42);
  box-shadow: 0 0 0 4px rgba(255, 132, 45, 0.12);
}

.prompt-count {
  justify-self: end;
  margin-top: -4px;
}

.image-upload-list {
  display: grid;
  gap: 12px;
}

.image-mini-upload {
  min-height: 102px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid rgba(123, 136, 177, 0.18);
  border-radius: 12px;
  background: #ffffff;
}

.image-mini-upload strong {
  color: #202944;
  font-size: 14px;
}

.image-mini-upload label,
.image-upload-hero {
  position: relative;
  cursor: pointer;
}

.image-mini-upload label {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(118, 87, 255, 0.38);
  border-radius: 10px;
  color: #684cff;
  font-weight: 800;
}

.image-mini-upload label:hover,
.image-upload-hero:hover {
  background: inherit;
  color: inherit;
  border-color: rgba(118, 87, 255, 0.38);
  box-shadow: none;
  transform: none;
}

.image-mini-upload input,
.image-upload-hero input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.image-generate-btn {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #8759ff, #4e6eff);
  color: #ffffff;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(98, 88, 255, 0.24);
}

.image-tip {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(245, 171, 61, 0.22);
  border-radius: 12px;
  background: #fff9ef;
  color: #a76d12;
  font-size: 12px;
  line-height: 1.6;
}

.image-tip.error {
  border-color: rgba(255, 107, 100, 0.25);
  background: #fff3f2;
  color: #c23b34;
}

.image-clear-btn {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(123, 136, 177, 0.18);
  border-radius: 12px;
  background: #ffffff;
  color: #596276;
  font-size: 14px;
  font-weight: 800;
}

.image-stage-body {
  min-height: 0;
  height: auto;
  display: grid;
  overflow: hidden;
}

.image-upload-hero {
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed rgba(118, 87, 255, 0.3);
  border-radius: 16px;
  background: #fbfaff;
  color: #172039;
  text-align: center;
}

.image-upload-hero-product {
  border-color: rgba(25, 185, 147, 0.3);
  background: #f6fffd;
}

.upload-orb {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #b9aaff 0%, #7b5cff 48%, #563df0 100%);
  color: #ffffff;
  font-size: 44px;
  box-shadow: 0 18px 30px rgba(118, 87, 255, 0.24);
}

.upload-orb svg {
  width: 54px;
  height: 54px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-orb.product {
  background: linear-gradient(145deg, #75e7dc 0%, #24c8b7 48%, #0ca892 100%);
  box-shadow: 0 18px 30px rgba(36, 200, 183, 0.22);
}

.app-shell.is-edit .upload-orb,
.app-shell.is-edit .upload-orb.product {
  background: linear-gradient(145deg, #4cc2ff 0%, #1672ff 48%, #075be0 100%);
  box-shadow: 0 18px 34px rgba(18, 116, 255, 0.28), 0 0 0 12px rgba(22, 114, 255, 0.08);
}

.image-product-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 1px solid rgba(25, 185, 147, 0.18);
  border-radius: 16px;
  background: #f6fffd;
}

.image-result-card {
  min-height: 0;
}

.image-result-wide {
  width: min(100%, calc(100vh - 188px));
  aspect-ratio: 1 / 1;
  justify-self: center;
  padding: 22px 24px;
}

.image-result-wide .result-section {
  height: 100%;
  margin-bottom: 0;
  position: static;
  grid-template-rows: auto auto 1fr;
}

.image-result-wide #imageJobPanel,
.image-result-wide .job-card,
.image-compare-job {
  min-height: 0;
  height: 100%;
}

.image-replace-file {
  position: relative;
  min-height: 38px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(118, 87, 255, 0.3);
  border-radius: 10px;
  background: #fbfaff;
  color: #684cff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.image-replace-file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.image-job-status {
  display: block;
  margin-top: -8px;
}

.image-empty-result {
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  margin-top: 20px;
  border: 1px dashed rgba(118, 87, 255, 0.3);
  border-radius: 18px;
  background: #fbfaff;
  text-align: center;
}

.image-empty-result span {
  color: #b5a7ff;
  font-size: 74px;
}

.image-empty-result strong {
  color: #2b3450;
  line-height: 1.55;
}

.image-task-empty {
  min-height: 84px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
  padding: 16px 18px;
  border: 1px solid rgba(123, 136, 177, 0.14);
  border-radius: 14px;
  background: #ffffff;
}

.image-task-empty b {
  color: #8b95ad;
  font-size: 30px;
}

.image-compare-job {
  grid-template-rows: auto 1fr auto;
}

.image-compare-shell {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(123, 136, 177, 0.16);
  border-radius: 14px;
  background: #eef2ff;
  user-select: none;
  touch-action: none;
  cursor: ew-resize;
}

.image-compare-before,
.image-compare-after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f8faff;
}

.image-compare-after-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: inset(0 calc(100% - var(--compare)) 0 0);
}

.image-compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--compare);
  width: 0;
  transform: translateX(-50%);
  border-left: 2px dashed rgba(255, 255, 255, 0.98);
  filter: drop-shadow(0 0 1px rgba(71, 87, 130, 0.55)) drop-shadow(0 0 14px rgba(71, 87, 130, 0.24));
  pointer-events: none;
}

.image-compare-divider span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  display: block;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #4e6eff;
  box-shadow: 0 8px 18px rgba(42, 62, 130, 0.24);
  transform: translate(-50%, -50%);
}

.image-compare-divider span::before,
.image-compare-divider span::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
}

.image-compare-divider span::before {
  left: 9px;
  transform: translateY(-50%) rotate(-45deg);
}

.image-compare-divider span::after {
  right: 9px;
  transform: translateY(-50%) rotate(135deg);
}

.image-compare-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}

.image-compare-tag {
  position: absolute;
  top: 12px;
  z-index: 2;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(17, 24, 44, 0.72);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.image-compare-tag.generated {
  left: 12px;
}

.image-compare-tag.original {
  right: 12px;
}

.pagemaker-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 180px);
  border: 0;
  background: #ffffff;
}

.pagemaker-portfolio-layer {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  justify-content: flex-end;
}

.pagemaker-portfolio-backdrop {
  position: absolute;
  inset: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(21, 28, 50, 0.22);
}

.pagemaker-portfolio-backdrop:hover {
  background: rgba(21, 28, 50, 0.28);
  box-shadow: none;
  transform: none;
}

.pagemaker-portfolio-drawer {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  border-left: 1px solid rgba(123, 136, 177, 0.18);
  background: #ffffff;
  box-shadow: -20px 0 50px rgba(34, 45, 78, 0.16);
}

.pagemaker-portfolio-drawer header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid rgba(123, 136, 177, 0.14);
}

.pagemaker-portfolio-drawer header strong {
  display: block;
  color: #11182c;
  font-size: 18px;
  font-weight: 900;
}

.pagemaker-portfolio-drawer header span {
  display: block;
  margin-top: 4px;
  color: #7c879f;
  font-size: 13px;
  font-weight: 800;
}

.pagemaker-portfolio-drawer header > div:last-child {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pagemaker-portfolio-body {
  min-height: 0;
  padding: 14px;
  overflow: auto;
  background: #f8faff;
}

.pagemaker-portfolio-page-list {
  display: grid;
  gap: 10px;
}

.pagemaker-portfolio-page-list .portfolio-page-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(21, 25, 34, 0.88);
  box-shadow: var(--shadow);
}

.control-panel,
.storyboard-panel {
  align-self: start;
  display: grid;
  gap: 14px;
  padding: 14px;
}

.panel-section {
  display: grid;
  gap: 12px;
}

.section-title,
.canvas-head,
.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title span,
.canvas-head h2 {
  color: var(--ink);
  font-weight: 800;
}

.section-title small,
.canvas-head p {
  color: var(--muted);
  font-size: 12px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--muted-strong);
  font-size: 13px;
}

.warning,
.helper-text,
.error-text {
  margin: 0;
  line-height: 1.55;
  font-size: 12px;
}

.warning {
  padding: 10px;
  border: 1px solid rgba(255, 207, 112, 0.22);
  border-radius: 7px;
  background: rgba(255, 207, 112, 0.08);
  color: #ffd98c;
}

.helper-text {
  color: var(--muted);
}

.error-text {
  color: var(--danger);
}

.edit-upload-grid {
  display: grid;
  gap: 10px;
}

.edit-upload-card,
.job-card,
.empty-result {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.edit-upload-card {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.edit-upload-card strong {
  font-size: 14px;
}

.edit-upload-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
  word-break: break-word;
}

.file-button {
  position: relative;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted-strong);
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.file-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted-strong);
  box-shadow: none;
  transform: none;
}

.file-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.primary-action {
  min-height: 48px;
  font-weight: 800;
}

.secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-strong);
  border-color: var(--line);
  font-weight: 650;
}

.secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  box-shadow: none;
}

.range-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  color: var(--muted-strong);
  font-size: 13px;
}

.range-line input {
  width: 100%;
  accent-color: var(--primary);
}

.range-line input:disabled {
  opacity: 0.45;
}

.range-line strong {
  min-width: 40px;
  color: var(--primary-strong);
  font-size: 12px;
  text-align: right;
}

.edit-preview-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  min-height: calc(100vh - 132px);
}

.edit-preview-panel {
  grid-template-rows: auto 1fr;
}

.canvas-head h2 {
  margin: 0;
  font-size: 17px;
}

.canvas-head p {
  margin: 3px 0 0;
}

.edit-preview-video,
.edit-preview-image,
.empty-canvas {
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    #07090d;
  background-size: 22px 22px;
}

.empty-canvas {
  min-height: 240px;
  display: grid;
  place-items: center;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.job-scenes span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(130, 170, 255, 0.12);
  color: var(--blue);
  font-size: 12px;
  white-space: nowrap;
}

.result-section {
  position: sticky;
  top: 126px;
}

.empty-result {
  min-height: 150px;
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.job-card {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.progress-row span {
  color: var(--muted);
  font-size: 13px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--blue));
}

.job-scenes {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.job-scenes span {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.job-scenes .running {
  background: rgba(255, 207, 112, 0.12);
  color: var(--accent);
}

.job-scenes .completed {
  background: rgba(88, 223, 155, 0.12);
  color: var(--success);
}

.result-video {
  width: min(100%, 260px);
  aspect-ratio: 9 / 16;
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #000000;
}

.result-image {
  width: 100%;
  max-height: 560px;
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: #07090d;
}

.result-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.settings-workspace {
  min-height: calc(100vh - 126px);
  display: grid;
  align-items: start;
  justify-items: center;
  padding: 24px 28px 34px;
}

.settings-panel {
  width: min(760px, 100%);
  padding: 24px;
  border: 1px solid rgba(123, 136, 177, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 42px rgba(45, 56, 92, 0.08);
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.settings-head h2 {
  margin: 0 0 6px;
  color: #11182c;
  font-size: 24px;
  font-weight: 900;
}

.settings-seat-button {
  min-height: 42px;
  padding: 0 16px;
}

.settings-head p,
.settings-avatar-row p {
  margin: 0;
  color: #7c879f;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

.settings-form {
  display: grid;
  gap: 18px;
}

.settings-avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(114, 128, 164, 0.12);
  border-radius: 8px;
  background: #f8faff;
}

.settings-avatar-picker {
  width: 86px;
  height: 86px;
  flex: 0 0 86px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(61, 109, 255, 0.2);
  border-radius: 999px;
  background: linear-gradient(135deg, #eef4ff, #f3fff9);
  color: #2367ff;
  font-size: 32px;
  font-weight: 900;
  cursor: pointer;
}

.settings-avatar-picker:hover {
  border-color: rgba(61, 109, 255, 0.42);
  box-shadow: 0 12px 24px rgba(61, 109, 255, 0.12);
}

.settings-avatar-picker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings-avatar-row strong {
  display: block;
  margin-bottom: 6px;
  color: #11182c;
  font-size: 18px;
  font-weight: 900;
}

.settings-form label {
  display: grid;
  gap: 8px;
}

.settings-form label > span {
  color: #35415b;
  font-size: 13px;
  font-weight: 900;
}

.settings-form input[type="text"],
.settings-form input[type="tel"],
.settings-form input[type="email"],
.settings-form input[type="password"] {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(114, 128, 164, 0.18);
  border-radius: 8px;
  background: #ffffff;
  color: #11182c;
  font: inherit;
  font-weight: 700;
  outline: none;
}

.settings-form input[readonly] {
  background: #f5f7fb;
  color: #69758d;
}

.settings-form input:focus {
  border-color: rgba(61, 109, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(61, 109, 255, 0.1);
}

.settings-seat-summary {
  display: grid;
  grid-template-columns: minmax(88px, auto) 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(61, 109, 255, 0.16);
  border-radius: 8px;
  background: #f7f9ff;
}

.settings-seat-summary span {
  color: #35415b;
  font-size: 13px;
  font-weight: 900;
}

.settings-seat-summary strong {
  color: #11182c;
  font-size: 16px;
  font-weight: 900;
}

.settings-seat-summary small {
  color: #69758d;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.settings-password-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.settings-save {
  width: 132px;
  min-width: 132px;
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-logout {
  width: 132px;
  min-width: 132px;
  min-height: 48px;
  border-color: rgba(235, 80, 80, 0.18);
  background: #fff4f4;
  color: #cf3333;
}

.settings-logout:hover {
  border-color: rgba(235, 80, 80, 0.28);
  background: #ffe8e8;
  color: #bd2424;
  box-shadow: none;
}

.settings-seat-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.46);
}

.settings-seat-modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(123, 136, 177, 0.18);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.settings-seat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.settings-seat-head h3 {
  margin: 0 0 6px;
  color: #11182c;
  font-size: 21px;
  font-weight: 900;
}

.settings-seat-head p {
  margin: 0;
  color: #7c879f;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

.settings-seat-close,
.settings-seat-cancel {
  min-height: 38px;
  padding: 0 14px;
}

.settings-seat-form {
  display: grid;
  gap: 16px;
}

.settings-seat-form label {
  display: grid;
  gap: 8px;
}

.settings-seat-form label > span,
.settings-seat-password span {
  color: #35415b;
  font-size: 13px;
  font-weight: 900;
}

.settings-seat-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(114, 128, 164, 0.18);
  border-radius: 8px;
  background: #ffffff;
  color: #11182c;
  font: inherit;
  font-weight: 700;
  outline: none;
}

.settings-seat-form input[readonly] {
  background: #f5f7fb;
  color: #69758d;
}

.settings-seat-form input:focus {
  border-color: rgba(61, 109, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(61, 109, 255, 0.1);
}

.settings-seat-password {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 13px;
  border: 1px dashed rgba(61, 109, 255, 0.28);
  border-radius: 8px;
  background: #f7f9ff;
}

.settings-seat-password strong {
  color: #1f4fd8;
  font-size: 15px;
}

.settings-seat-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 2px;
}

.settings-seat-save {
  min-width: 112px;
}

.portfolio-workspace {
  min-height: calc(100vh - 126px);
  display: grid;
  gap: 14px;
  padding: 24px 28px 34px;
}

.portfolio-panel {
  border: 1px solid rgba(123, 136, 177, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 42px rgba(45, 56, 92, 0.08);
}

.portfolio-panel-head h3 {
  margin: 0;
  color: #11182c;
  font-weight: 900;
}

.portfolio-panel {
  padding: 20px;
}

.portfolio-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(114, 128, 164, 0.14);
  border-radius: 8px;
  background: #f5f7fb;
}

.portfolio-tabs button {
  min-height: 38px;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #69758d;
  font-weight: 900;
}

.portfolio-tabs button:hover,
.portfolio-tabs button.is-active {
  background: #ffffff;
  color: #2367ff;
  box-shadow: 0 8px 20px rgba(47, 78, 138, 0.08);
  transform: none;
}

.portfolio-tabs span {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #eef3ff;
  color: #3f6ff4;
  font-size: 12px;
}

.product-style-tabs {
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.product-style-tabs button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.portfolio-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0;
}

.portfolio-toolbar > div:first-child {
  display: grid;
  gap: 4px;
}

.portfolio-toolbar strong {
  color: #11182c;
  font-size: 20px;
  font-weight: 900;
}

.portfolio-toolbar span {
  color: #7c879f;
  font-size: 13px;
  font-weight: 700;
}

.portfolio-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.portfolio-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(130px, 1fr)) auto auto;
  gap: 10px;
  align-items: center;
  margin: 12px 0 18px;
  padding: 12px;
  border: 1px solid rgba(122, 137, 174, 0.14);
  border-radius: 10px;
  background: #f8faff;
}

.portfolio-filters input,
.portfolio-filters select {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(122, 137, 174, 0.2);
  border-radius: 8px;
  background: #fff;
  color: #172039;
  padding: 0 10px;
  outline: none;
}

.portfolio-filter-check {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(122, 137, 174, 0.16);
  border-radius: 8px;
  background: #fff;
  color: #59637b;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.portfolio-mark {
  display: inline-flex;
  align-items: center;
  height: 18px;
  margin-right: 6px;
  padding: 0 6px;
  border-radius: 5px;
  background: #edf3ff;
  color: #365fff;
  font-size: 11px;
  font-weight: 900;
  vertical-align: middle;
}

.portfolio-mark.favorite {
  background: #fff4df;
  color: #a86300;
}

.portfolio-mark.draft {
  background: #eef7f1;
  color: #1f7a47;
}

.button.is-disabled,
.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

.portfolio-param-box {
  padding: 12px;
  border: 1px solid rgba(122, 137, 174, 0.16);
  border-radius: 10px;
  background: #f8faff;
}

.portfolio-param-box dl {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px 12px;
  margin: 0;
}

.portfolio-param-box dt {
  color: #7b8499;
  font-size: 13px;
  font-weight: 800;
}

.portfolio-param-box dd {
  margin: 0;
  color: #172039;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.danger {
  border-color: rgba(235, 80, 80, 0.2);
  background: #fff4f4;
  color: #cf3333;
}

.danger:hover {
  border-color: rgba(235, 80, 80, 0.32);
  background: #ffe8e8;
  color: #bd2424;
  box-shadow: none;
}

.portfolio-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.portfolio-panel-head span {
  color: #7c879f;
  font-size: 13px;
  font-weight: 800;
}

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

.portfolio-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(114, 128, 164, 0.13);
  border-radius: 8px;
  background: #ffffff;
}

.portfolio-card-check {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
}

.portfolio-card-check input,
.portfolio-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.portfolio-card-check span,
.portfolio-check span {
  width: 22px;
  height: 22px;
  display: block;
  border: 2px solid rgba(82, 103, 150, 0.32);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px rgba(27, 38, 74, 0.12);
}

.portfolio-card-check input:checked + span,
.portfolio-check input:checked + span {
  border-color: #2f70ff;
  background: #2f70ff;
}

.portfolio-card-check input:checked + span::after,
.portfolio-check input:checked + span::after {
  content: "";
  width: 10px;
  height: 6px;
  display: block;
  margin: 5px auto 0;
  border: solid #ffffff;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}

.portfolio-preview {
  position: relative;
  height: 150px;
  display: block;
  background: #f5f7ff;
}

.portfolio-preview img,
.portfolio-preview video,
.portfolio-preview iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  object-fit: contain;
}

.portfolio-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.94);
  background: linear-gradient(180deg, transparent, rgba(18, 26, 51, 0.2));
  pointer-events: none;
}

.portfolio-play svg {
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 999px;
  background: rgba(18, 26, 51, 0.46);
  fill: currentColor;
  stroke: currentColor;
}

.portfolio-info {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.portfolio-info span {
  color: #4b7cff;
  font-size: 12px;
  font-weight: 900;
}

.portfolio-info h4 {
  margin: 0;
  color: #202943;
  font-size: 16px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portfolio-info p,
.portfolio-page-row p {
  margin: 0;
  color: #7c879f;
  font-size: 13px;
}

.portfolio-empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(123, 136, 177, 0.24);
  border-radius: 8px;
  color: #7c879f;
  background: #fbfcff;
}

.portfolio-page-list {
  display: grid;
  gap: 10px;
}

.portfolio-page-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid rgba(114, 128, 164, 0.13);
  border-radius: 8px;
  background: #ffffff;
}

.portfolio-page-row strong {
  color: #202943;
}

.portfolio-row-actions,
.portfolio-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.portfolio-card-actions .button,
.portfolio-row-actions .button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.edit-preview-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.edit-preview-grid-single {
  grid-template-columns: 1fr;
}

.edit-preview-block {
  min-width: 0;
  min-height: 240px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
}

.edit-preview-block h3 {
  margin: 0;
  color: var(--muted-strong);
  font-size: 14px;
}

.edit-preview-video,
.edit-preview-image {
  width: 100%;
  max-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
}

.image-mask-wrap {
  min-height: 0;
  display: grid;
  place-items: start stretch;
}

.image-mask-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfaff;
  touch-action: none;
  cursor: crosshair;
  user-select: none;
}

.image-mask-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.image-mask-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.image-mask-box {
  position: absolute;
  border: 2px solid #7657ff;
  background: rgba(118, 87, 255, 0.16);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.75);
}

.image-mask-box span {
  position: absolute;
  top: -1px;
  left: -1px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: #7657ff;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid rgba(103, 116, 156, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 48px rgba(42, 50, 84, 0.18);
  color: var(--ink);
  line-height: 1.5;
  font-weight: 800;
  backdrop-filter: blur(12px);
}

.toast.error {
  border-color: rgba(255, 107, 100, 0.4);
  background: #fff4f3;
  color: #b8322c;
}

.toast.success {
  border-color: rgba(88, 223, 155, 0.4);
  background: #f0fff9;
  color: #08795f;
}

.toast.info {
  border-color: rgba(77, 124, 255, 0.28);
  background: #f4f7ff;
  color: #24458f;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 18% 14%, rgba(73, 124, 255, 0.16), transparent 28%),
    radial-gradient(circle at 82% 10%, rgba(143, 97, 255, 0.14), transparent 26%),
    #f6f8fd;
}

.login-card {
  width: min(430px, 100%);
  display: grid;
  gap: 24px;
  padding: 34px;
  border: 1px solid rgba(111, 124, 160, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 60px rgba(48, 63, 100, 0.12);
}

.login-loading-card {
  justify-items: center;
  text-align: center;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #121a33;
  font-size: 26px;
  font-weight: 900;
}

.login-brand img {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: contain;
}

.login-brand strong {
  font: inherit;
}

.login-head h1 {
  margin: 0;
  color: #11182c;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 900;
}

.login-head p,
.login-tip,
.login-loading-card p {
  margin: 8px 0 0;
  color: #6e7891;
  font-size: 14px;
  line-height: 1.7;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 8px;
}

.login-form .login-remember {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: fit-content;
  cursor: pointer;
}

.login-form .login-remember input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.login-form label span {
  color: #2f3951;
  font-size: 14px;
  font-weight: 800;
}

.login-form input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(123, 136, 177, 0.2);
  border-radius: 8px;
  background: #ffffff;
  color: #172039;
  outline: none;
}

.login-form input:focus {
  border-color: rgba(63, 124, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(63, 124, 255, 0.12);
}

.login-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #4f82ff, #7657ff);
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
}

.topbar-logout,
.home-logout-btn {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(122, 137, 174, 0.18);
  border-radius: 8px;
  background: #ffffff;
  color: #65708a;
  font-size: 13px;
  font-weight: 800;
}

.topbar-logout:hover,
.home-logout-btn:hover {
  background: #f5f7ff;
  color: #365fff;
}

.home-shell {
  min-height: 100vh;
  grid-template-rows: 78px 1fr;
  background: #f6f8fd;
}

.home-shell button {
  box-shadow: none;
  transform: none;
}

.home-shell button:hover {
  box-shadow: none;
  transform: none;
}

.home-topbar {
  position: relative;
  z-index: 120;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 48px;
  border-bottom: 1px solid rgba(111, 124, 160, 0.14);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.home-topbar button {
  box-shadow: none;
  transform: none;
}

.home-topbar button:hover {
  box-shadow: none;
  transform: none;
}

.home-brand {
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #121a33;
  font-size: 28px;
  font-weight: 900;
  gap: 12px;
}

.home-brand:hover {
  background: transparent;
  color: #121a33;
}

.home-brand img {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  object-fit: contain;
}

.home-brand strong {
  font: inherit;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-module-name {
  max-width: min(36vw, 360px);
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(118, 87, 255, 0.18);
  border-radius: 999px;
  background: rgba(246, 248, 255, 0.92);
  color: #59637b;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-user-actions {
  min-width: 0;
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.task-center-wrap {
  position: relative;
  z-index: 130;
}

.task-bell-btn {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(122, 137, 174, 0.2);
  border-radius: 999px;
  background: #fff;
  color: #59637b;
  font-size: 0;
}

.task-bell-btn span {
  width: 16px;
  height: 18px;
  display: block;
  border: 2px solid currentColor;
  border-radius: 9px 9px 6px 6px;
  border-bottom-width: 3px;
  position: relative;
}

.task-bell-btn span::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 4px;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
}

.task-bell-btn span::after {
  content: "";
  position: absolute;
  left: 4px;
  bottom: -8px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
}

.task-bell-btn.has-unread {
  color: #365fff;
  border-color: rgba(54, 95, 255, 0.25);
  background: #f6f8ff;
}

.task-bell-btn em {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ef3340;
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.task-center-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 1000;
  width: min(390px, calc(100vw - 28px));
  max-height: min(620px, calc(100vh - 96px));
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(122, 137, 174, 0.18);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 22px 56px rgba(35, 46, 78, 0.18);
}

.task-center-head,
.task-center-meta,
.task-center-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-center-head {
  margin-bottom: 12px;
}

.task-center-head strong {
  color: #172039;
  font-size: 15px;
}

.task-center-head span,
.task-center-item span,
.task-center-meta small {
  color: #7b8499;
  font-size: 12px;
}

.task-center-list {
  display: grid;
  gap: 10px;
}

.task-center-item {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(122, 137, 174, 0.16);
  border-radius: 10px;
  background: #fbfcff;
}

.task-center-item > div:first-child {
  display: grid;
  gap: 4px;
}

.task-center-item strong {
  color: #172039;
  font-size: 13px;
}

.task-center-item p {
  margin: 2px 0 0;
  color: #d9303e;
  font-size: 12px;
  line-height: 1.5;
}

.task-center-meta b {
  color: #365fff;
  font-size: 12px;
}

.task-center-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f8;
}

.task-center-progress span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f82ff, #7657ff);
}

.task-center-actions {
  justify-content: flex-start;
}

.task-center-actions button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.task-center-empty {
  padding: 22px 10px;
  color: #7b8499;
  text-align: center;
}

.home-member-btn,
.home-icon-btn,
.home-profile-btn,
.home-works-btn,
.home-recent-head button {
  border: 1px solid rgba(122, 137, 174, 0.16);
  background: #ffffff;
  color: #1f2a44;
}

.home-member-btn {
  min-height: 38px;
  padding: 0 18px;
  border-color: rgba(255, 151, 44, 0.28);
  border-radius: 12px;
  color: #d37a15;
  font-size: 14px;
  font-weight: 800;
}

.home-member-btn span {
  color: #f5a524;
}

.home-icon-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8390ab;
}

.home-icon-btn svg,
.home-profile-btn svg,
.home-works-btn svg,
.home-side-item svg,
.home-feature-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-profile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  gap: 12px;
  color: #202943;
  font-size: 15px;
  font-weight: 800;
  cursor: default;
}

.home-profile-btn > span:not(.home-avatar) {
  display: grid;
  justify-items: start;
  gap: 3px;
  min-width: 0;
}

.home-profile-btn strong {
  max-width: min(220px, 32vw);
  overflow: hidden;
  color: #202943;
  font-size: 14px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-profile-btn small {
  max-width: none;
  overflow: visible;
  color: #8a94aa;
  font-size: 12px;
  line-height: 1.1;
  text-overflow: clip;
  white-space: nowrap;
}

.home-avatar {
  width: 46px;
  min-width: 46px;
  max-width: 46px;
  height: 46px;
  min-height: 46px;
  max-height: 46px;
  flex: 0 0 46px;
  display: block;
  overflow: hidden;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 28%, #ffe0ca 0 15%, transparent 16%),
    radial-gradient(circle at 50% 38%, #38231e 0 23%, transparent 24%),
    radial-gradient(circle at 50% 70%, #f0b08e 0 30%, transparent 31%),
    linear-gradient(135deg, #ffe4cf, #6f8dff);
  box-shadow: 0 8px 18px rgba(40, 54, 94, 0.16);
}

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

.home-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 326px minmax(0, 1fr);
}

.app-side-layout {
  min-height: calc(100vh - 78px);
}

.app-side-main {
  min-width: 0;
}

.app-side-main > .portfolio-workspace,
.app-side-main > .settings-workspace {
  min-height: calc(100vh - 78px);
}

.home-sidebar {
  min-height: calc(100vh - 78px);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
  padding: 24px 28px 28px;
  border-right: 1px solid rgba(111, 124, 160, 0.14);
  background: rgba(255, 255, 255, 0.74);
}

.home-side-nav {
  display: grid;
  gap: 10px;
}

.home-side-item {
  width: 100%;
  min-height: 54px;
  justify-content: flex-start;
  gap: 20px;
  padding: 0 22px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #7e8aa4;
  font-size: 16px;
  font-weight: 800;
}

.home-side-item:hover {
  background: #f2f5ff;
  color: #426ff0;
}

.home-side-item.is-active {
  background: linear-gradient(90deg, #eef3ff, #f6f4ff);
  color: #326dff;
}

.home-side-item span {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
}

.home-side-item.is-active span {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #4e7dff;
  color: #ffffff;
}

.home-upgrade-card {
  align-self: end;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 18px 24px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f6f3ff, #ffffff);
  box-shadow: inset 0 0 0 1px rgba(117, 107, 190, 0.08);
  text-align: center;
}

.home-gem {
  width: 78px;
  height: 62px;
  background:
    linear-gradient(135deg, transparent 18%, rgba(255, 255, 255, 0.8) 19% 22%, transparent 23%),
    linear-gradient(145deg, #c7ccff 0%, #8b7cff 45%, #6b3df0 100%);
  clip-path: polygon(50% 0, 86% 24%, 72% 100%, 28% 100%, 14% 24%);
  filter: drop-shadow(0 18px 22px rgba(111, 83, 237, 0.24));
}

.home-upgrade-card strong {
  color: #121a33;
  font-size: 17px;
  font-weight: 900;
}

.home-upgrade-card p {
  margin: 0;
  color: #78849f;
  font-size: 14px;
  line-height: 1.7;
}

.home-upgrade-card button {
  width: 100%;
  min-height: 46px;
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #9c65ff, #6c4cf0);
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
}

.home-main {
  position: relative;
  min-width: 0;
  padding: 28px 52px 18px;
  overflow: hidden;
}

.home-hero {
  position: relative;
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 10px;
  z-index: 1;
}

.home-hero h1 {
  margin: 0;
  color: #11182c;
  font-size: 27px;
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: 0;
}

.home-hero h1 span {
  color: #7d8cff;
}

.home-hero p {
  margin: 8px 0 0;
  color: #6e7891;
  font-size: 16px;
  font-weight: 600;
}

.home-works-btn {
  min-width: 156px;
  min-height: 42px;
  border-radius: 999px;
  gap: 9px;
  font-size: 15px;
  font-weight: 900;
  z-index: 1;
}

.home-works-btn svg {
  width: 20px;
  height: 20px;
}

.home-section {
  position: relative;
  z-index: 1;
}

.home-section h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  color: #11182c;
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
}

.home-section h2 span {
  width: 5px;
  height: 24px;
  border-radius: 999px;
  background: #3f7cff;
}

.home-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px 16px;
}

.home-feature-card {
  position: relative;
  aspect-ratio: auto;
  height: clamp(188px, calc((100vh - 446px) / 2), 266px);
  min-height: 0;
  justify-content: flex-start;
  align-items: flex-start;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--feature-bg-a), var(--feature-bg-b));
  color: #11182c;
  text-align: left;
  box-shadow: 0 14px 32px rgba(45, 56, 92, 0.12);
}

.home-feature-card::before {
  content: "";
  position: absolute;
  inset: -28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    var(--cover-url) center / cover no-repeat;
  filter: blur(26px) saturate(1.32);
  opacity: 0.86;
  transform: scale(1.18);
}

.home-feature-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.home-feature-purple::after {
  background: linear-gradient(135deg, rgba(221, 207, 255, 0.34), rgba(117, 76, 232, 0.2));
}

.home-feature-orange::after {
  background: linear-gradient(135deg, rgba(255, 221, 188, 0.36), rgba(255, 120, 40, 0.2));
}

.home-feature-blue::after {
  background: linear-gradient(135deg, rgba(202, 235, 255, 0.38), rgba(46, 128, 255, 0.2));
}

.home-feature-green::after {
  background: linear-gradient(135deg, rgba(199, 250, 231, 0.4), rgba(31, 180, 132, 0.2));
}

.home-feature-teal::after {
  background: linear-gradient(135deg, rgba(196, 247, 236, 0.42), rgba(15, 155, 132, 0.22));
}

.home-feature-card:hover img {
  transform: scale(1.02);
}

.home-feature-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.home-feature-copy strong {
  color: #0f1729;
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
}

.home-feature-copy span {
  color: #5f6b83;
  font-size: 15px;
  font-weight: 700;
}

.home-feature-card img {
  position: absolute;
  inset: 12px;
  z-index: 2;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(27, 38, 74, 0.18);
  transition: transform 220ms ease;
}

.home-feature-icon {
  display: none;
}

.home-feature-purple {
  --feature-bg-a: #e5d9ff;
  --feature-bg-b: #c8bbff;
}

.home-feature-purple .home-feature-icon {
  background: linear-gradient(145deg, #b86fff, #7b45e9);
}

.home-feature-orange {
  --feature-bg-a: #ffe2c2;
  --feature-bg-b: #ffc88d;
}

.home-feature-orange .home-feature-icon {
  background: linear-gradient(145deg, #ffb24f, #ff752f);
}

.home-feature-blue {
  --feature-bg-a: #cfeaff;
  --feature-bg-b: #a8d5ff;
}

.home-feature-blue .home-feature-icon {
  background: linear-gradient(145deg, #67c8ff, #287dff);
}

.home-feature-green {
  --feature-bg-a: #c9f5e6;
  --feature-bg-b: #9ee7cf;
}

.home-feature-green .home-feature-icon {
  background: linear-gradient(145deg, #5ce0b9, #20b587);
}

.home-feature-teal {
  --feature-bg-a: #c7f3ea;
  --feature-bg-b: #93e4d4;
}

.home-feature-teal .home-feature-icon {
  background: linear-gradient(145deg, #44d4b6, #0f9b84);
}

.home-recent-panel {
  margin-top: 12px;
  padding: 12px 16px;
  border: 1px solid rgba(114, 128, 164, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 42px rgba(48, 63, 100, 0.08);
}

.home-recent-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 34px;
  margin-bottom: 10px;
}

.home-recent-head h2 {
  margin: 0;
  color: #11182c;
  font-size: 17px;
  font-weight: 900;
}

.home-recent-head button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #4b7cff;
  font-size: 13px;
  font-weight: 800;
}

.home-recent-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.home-recent-item {
  min-width: 0;
  min-height: 68px;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(114, 128, 164, 0.13);
  border-radius: 8px;
  background: #ffffff;
  color: #25304a;
  text-align: left;
}

.home-recent-item:hover {
  border-color: rgba(63, 124, 255, 0.3);
  background: #fbfcff;
}

.home-recent-item img,
.home-recent-item video,
.home-recent-fallback {
  width: 88px;
  height: 52px;
  flex: 0 0 88px;
  border-radius: 6px;
  object-fit: cover;
  background: #f5f7ff;
}

.home-recent-fallback {
  display: grid;
  place-items: center;
  color: #4d72f5;
}

.home-recent-fallback svg {
  width: 24px;
  height: 24px;
}

.home-recent-empty {
  min-height: 88px;
  display: grid;
  place-items: center;
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px dashed rgba(114, 128, 164, 0.22);
  border-radius: 8px;
  color: #7c879f;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  background: #f8faff;
}

.home-recent-item span {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.home-recent-item strong {
  overflow: hidden;
  color: #25304a;
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-recent-item small {
  color: #8a94aa;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 1220px) {
  .home-topbar {
    padding: 0 24px;
  }

  .home-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .home-main {
    padding: 34px 28px 24px;
  }

  .home-feature-card {
    height: auto;
    min-height: 0;
    padding: 0;
  }

  .home-recent-list {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .tab-bar {
    position: static;
    transform: none;
    padding: 0 18px 12px;
  }

  .tab-pill {
    width: 100%;
    justify-content: center;
    overflow-x: auto;
  }

  .image-workspace {
    grid-template-columns: 320px minmax(280px, 340px) minmax(420px, 1fr);
    gap: 14px;
  }

  .edit-workspace-grid {
    grid-template-columns: 360px minmax(520px, 1fr);
  }

  .i2v-workspace {
    grid-template-columns: 360px minmax(520px, 1fr);
  }

  .workspace,
  .workspace-edit {
    grid-template-columns: 310px minmax(380px, 1fr);
  }

  .storyboard-panel {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .workspace-edit .storyboard-panel {
    grid-template-columns: 1fr;
  }

  .result-section {
    position: static;
  }
}

@media (max-width: 860px) {
  .home-topbar {
    height: 64px;
    min-height: 64px;
    align-items: center;
    flex-direction: row;
    gap: 10px;
    padding: 0 12px;
  }

  .home-user-actions {
    width: auto;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .home-brand {
    flex: 1 1 auto;
    font-size: 22px;
    gap: 8px;
  }

  .home-module-name {
    max-width: 30vw;
    min-height: 24px;
    padding: 0 9px;
    font-size: 12px;
  }

  .home-brand img {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .home-profile-btn {
    flex: 0 1 auto;
    gap: 8px;
  }

  .home-avatar {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    flex-basis: 40px;
  }

  .home-profile-btn strong {
    max-width: 24vw;
    font-size: 13px;
  }

  .home-layout {
    grid-template-columns: 1fr;
  }

  .home-sidebar {
    min-height: auto;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid rgba(111, 124, 160, 0.14);
  }

  .home-side-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .home-side-item {
    min-height: 42px;
    justify-content: center;
    gap: 6px;
    padding: 0 6px;
    font-size: 13px;
  }

  .home-side-item span {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
  }

  .home-upgrade-card {
    display: none;
  }

  .home-main {
    padding: 16px 12px 18px;
  }

  .home-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-hero h1 {
    font-size: 24px;
  }

  .home-feature-grid {
    grid-template-columns: 1fr;
  }

  .home-feature-card {
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .tab-bar {
    overflow-x: auto;
  }

  .image-workspace {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .image-settings-inline,
  .image-body-grid {
    grid-template-columns: 1fr;
  }

  .image-result-wide {
    width: 100%;
  }

  .video-workspace {
    padding: 14px;
  }

  .edit-workspace-grid {
    grid-template-columns: 1fr;
  }

  .i2v-workspace {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .storyboard-test3-workspace,
  .storyboard-test3-workspace .image-settings-card,
  .storyboard-test3-workspace .i2v-main-card,
  .storyboard-test3-workspace .image-result-card,
  .storyboard-test3-workspace .image-result-shell,
  .storyboard-test3-workspace #storyboardTest3JobPanel {
    width: 100%;
    min-width: 0;
  }

  .storyboard-test3-plan-table {
    max-height: min(52vh, 460px);
  }

  .storyboard-test3-shot-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .video-preview-grid {
    grid-template-columns: 1fr;
  }

  .video-upload-hero,
  .video-material-media {
    height: 360px;
  }

  .i2v-hero-stage {
    height: 420px;
  }

  .image-main-column {
    grid-template-rows: auto;
  }

  .topbar-meta {
    flex-wrap: wrap;
  }

  .workspace,
  .workspace-edit,
  .settings-workspace,
  .storyboard-panel,
  .edit-preview-grid {
    grid-template-columns: 1fr;
  }

  .settings-workspace {
    padding: 14px;
  }

  .settings-password-grid {
    grid-template-columns: 1fr;
  }

  .settings-seat-summary {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .settings-seat-summary small {
    text-align: left;
  }

  .edit-preview-panel {
    min-height: auto;
  }
}

@media (max-width: 540px) {
  .home-brand {
    font-size: 18px;
  }

  .home-module-name {
    max-width: 34vw;
    padding: 0 8px;
  }

  .home-brand img {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .home-member-btn {
    display: none;
  }

  .home-profile-btn {
    margin-left: 0;
  }

  .home-logout-btn {
    min-width: 58px;
  }

  .home-side-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-side-item {
    min-height: 40px;
    font-size: 12px;
  }

  .home-feature-copy strong {
    font-size: 22px;
  }

  .home-feature-card {
    aspect-ratio: 16 / 9;
  }

  .home-recent-list {
    grid-template-columns: 1fr;
  }

  .topbar,
  .tab-bar {
    padding-left: 12px;
    padding-right: 12px;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
  }

  .brand h1 {
    font-size: 21px;
  }

  .tab-pill {
    gap: 6px;
    padding: 5px;
  }

  .tab-btn {
    padding: 0 10px;
    font-size: 13px;
    min-width: 112px;
  }

  .workspace,
  .workspace-edit {
    padding: 10px;
  }

  .settings-workspace {
    padding: 10px;
  }

  .settings-panel {
    padding: 14px;
  }

  .settings-avatar-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .control-panel,
  .storyboard-panel,
  .edit-preview-panel {
    padding: 12px;
  }

  .result-actions,
  .range-line {
    grid-template-columns: 1fr;
  }

  .range-line strong {
    text-align: left;
  }

  .i2v-hero-stage {
    height: 340px;
  }

  .storyboard-test3-workspace {
    padding: 10px;
    gap: 10px;
  }

  .storyboard-test3-workspace .image-settings-card,
  .storyboard-test3-workspace .i2v-main-card,
  .storyboard-test3-workspace .image-result-card {
    padding: 12px;
  }

  .storyboard-test3-workspace .i2v-hero-stage {
    height: clamp(240px, 68vw, 340px);
  }

  .storyboard-test3-plan {
    padding: 8px;
  }

  .storyboard-test3-plan-table {
    max-height: 58vh;
  }

  .storyboard-test3-plan-table table {
    min-width: 680px;
  }

  .storyboard-test3-plan-table th,
  .storyboard-test3-plan-table td {
    padding: 8px;
    font-size: 11px;
  }
}

/* 图生视频测试3 */
.storyboard-test3-extras {
  min-width: 0;
  display: grid;
  gap: 12px;
  margin: 12px 0;
}

.storyboard-test3-plan {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 12px;
}

.storyboard-test3-plan summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--text);
}

.storyboard-test3-plan-table {
  max-height: min(56vh, 520px);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin-top: 10px;
}

.storyboard-test3-plan-table table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid rgba(122, 137, 174, 0.16);
  border-radius: 8px;
  background: #ffffff;
}

.storyboard-test3-plan-table th,
.storyboard-test3-plan-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(122, 137, 174, 0.14);
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
  text-align: left;
  vertical-align: top;
}

.storyboard-test3-plan-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f9fd;
  color: var(--muted);
  font-weight: 800;
}

.storyboard-test3-plan-table tr:last-child td {
  border-bottom: 0;
}

.storyboard-test3-plan-table td:first-child,
.storyboard-test3-plan-table th:first-child {
  width: 58px;
  text-align: center;
}

.storyboard-test3-plan-table td:nth-child(4),
.storyboard-test3-plan-table th:nth-child(4) {
  width: 72px;
  white-space: nowrap;
}

.storyboard-test3-grid-preview {
  display: grid;
  gap: 8px;
}

.storyboard-test3-grid-preview strong {
  font-size: 13px;
}

.storyboard-test3-grid-preview img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.storyboard-test3-shot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.storyboard-test3-shot-grid article {
  position: relative;
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}

.storyboard-test3-shot-grid article:not(.is-selected) img {
  opacity: 0.46;
  filter: grayscale(0.3);
}

.storyboard-test3-select-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(118, 87, 255, 0.18);
  border-radius: 8px;
  background: rgba(246, 243, 255, 0.76);
  font-size: 12px;
}

.storyboard-test3-select-summary strong {
  color: var(--text);
}

.storyboard-test3-select-summary span {
  color: var(--muted);
}

.storyboard-test3-shot-check {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 14px rgba(24, 31, 54, 0.18);
  cursor: pointer;
}

.storyboard-test3-shot-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.storyboard-test3-shot-check span {
  width: 14px;
  height: 14px;
  border: 2px solid #8b95ad;
  border-radius: 4px;
  background: #fff;
}

.storyboard-test3-shot-check input:checked + span {
  border-color: #7657ff;
  background: #7657ff;
  box-shadow: inset 0 0 0 3px #fff;
}

.storyboard-test3-add-image {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 11px;
}

.storyboard-test3-shot-grid img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
}

/* ---- 视频生视频子Tab栏 ---- */
.edit-subtab-bar {
  flex: 0 0 auto;
  min-height: 43px;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 0 0 10px;
  background: transparent;
  border-bottom: 1px solid var(--line);
  margin: 0 0 28px;
}

.edit-subtab {
  flex: 0 0 112px;
  min-width: 112px;
  min-height: 32px;
  padding: 0 14px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  border-radius: 7px;
  box-shadow: none;
  cursor: pointer;
  transform: none;
  transition: background 0.2s ease, color 0.2s ease;
  line-height: 1.4;
}

.edit-subtab:hover {
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: none;
  transform: none;
}

.edit-subtab.is-active {
  background: var(--accent, #4f6ef7);
  color: #fff;
  box-shadow: none;
  transform: none;
}

.edit-subtab.is-active:hover,
.edit-subtab:focus-visible {
  box-shadow: none;
  transform: none;
}

/* ---- 素材库-背景音乐 ---- */
.portfolio-audio-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 14px 10px;
  background: var(--surface-soft);
  border-radius: 10px;
  gap: 8px;
}

.portfolio-audio-preview .audio-icon {
  font-size: 32px;
  line-height: 1;
}

.portfolio-audio-preview audio {
  width: 100%;
  height: 36px;
}

/* BGM 选择器通用样式 */
.bgm-select-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.bgm-select-row select {
  flex: 1;
}
.bgm-select-row .ghost-upload-btn {
  flex-shrink: 0;
}

/* 系统内置标记 */
.builtin-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  background: #8b95ad;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 6px;
}

@media (max-width: 860px) {
  .storyboard-test3-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .storyboard-test3-shot-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (max-width: 540px) {
  .storyboard-test3-shot-grid {
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 8px;
  }

  .storyboard-test3-select-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

/* ---- media picker modal ---- */
.media-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.media-picker-dialog {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 24px 72px rgba(0,0,0,0.28);
  width: min(860px, 94vw);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.media-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.media-picker-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
}
.media-picker-close {
  width: 34px; height: 34px;
  border: none;
  background: var(--surface-soft);
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--muted-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.media-picker-close:hover {
  background: var(--surface-strong);
}

.media-picker-search {
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
}
.media-picker-search input {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s;
}
.media-picker-search input:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}

.media-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
}

.media-picker-card {
  border: 2px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--surface);
}
.media-picker-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(118,87,255,0.14);
}
.media-picker-card.is-selected {
  border-color: var(--primary-strong);
  box-shadow: 0 0 0 2px rgba(85,109,255,0.25);
}

.media-picker-thumb {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
  background: var(--surface-soft);
}
.media-picker-thumb-icon {
  width: 100%;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  background: var(--surface-soft);
  color: var(--muted);
}

.media-picker-name {
  padding: 8px 10px;
  font-size: 0.82rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.media-picker-card-audio .media-picker-thumb-wrap {
  position: relative;
}
.media-picker-play-btn {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 32px; height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.12s;
  z-index: 2;
}
.media-picker-play-btn:hover {
  background: var(--primary);
  transform: none;
}
.media-picker-play-btn.is-playing {
  background: var(--danger);
}
.media-picker-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* picker trigger button */
.media-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: border-color 0.15s;
}
.media-picker-btn:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
  transform: none;
}
.media-picker-btn.is-empty {
  color: var(--muted);
}
.media-picker-btn .picker-arrow {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
}
