:root {
  --ink: #19151b;
  --muted: #7c727c;
  --paper: #f7f4f5;
  --paper-strong: #ffffff;
  --line: #e7dfe3;
  --accent: #e50057;
  --accent-deep: #b90046;
  --accent-soft: #ffe4ef;
  --night: #0d0c11;
  --night-soft: #17151d;
  --night-line: #2c2834;
  --success: #16a66a;
  --shadow: 0 18px 60px rgba(41, 23, 34, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: #ebe5e8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 12% 0%, rgba(229, 0, 87, 0.09), transparent 26rem),
    #ebe5e8;
}

body {
  min-height: 100vh;
  overscroll-behavior-y: none;
}

.license-gate {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 39, 117, 0.23), transparent 30rem),
    linear-gradient(145deg, #100b11, #28101c 58%, #71002d);
}

.license-gate[hidden] {
  display: none;
}

.license-card {
  width: min(100%, 430px);
  padding: 34px 28px 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  color: white;
  background: rgba(21, 15, 20, 0.9);
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px);
}

.license-mark {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 24px;
  place-items: center;
  border-radius: 18px;
  color: white;
  background: linear-gradient(135deg, #ff367e, #c6004c);
  box-shadow: 0 14px 34px rgba(229, 0, 87, 0.35);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 1px;
}

.license-card h1 {
  margin: 8px 0 10px;
  font-size: 30px;
}

.license-card > p {
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  line-height: 1.7;
}

.license-input-wrap {
  display: grid;
  gap: 8px;
}

.license-input-wrap span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 800;
}

.license-input-wrap input {
  width: 100%;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  color: white;
  background: rgba(255, 255, 255, 0.07);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.license-input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.license-activate {
  margin-top: 14px;
}

.license-message {
  min-height: 18px;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  text-align: center;
}

.license-message.error {
  color: #ff91b8;
}

.license-device {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.28);
  font-size: 9px;
  text-align: center;
}

.license-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 15px;
  padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.055);
}

.license-contact span {
  display: grid;
  gap: 4px;
}

.license-contact small {
  color: rgba(255, 255, 255, 0.45);
  font-size: 9px;
}

.license-contact strong {
  color: #ff77aa;
  font-size: 14px;
  letter-spacing: 0.4px;
}

.license-contact button {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid rgba(255, 91, 151, 0.32);
  border-radius: 9px;
  color: #ff91b8;
  background: rgba(229, 0, 87, 0.1);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(229, 0, 87, 0.28);
  outline-offset: 2px;
}

.app-shell {
  position: relative;
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.view {
  display: none;
  min-height: 100vh;
  padding-bottom: 92px;
}

.view.active {
  display: block;
}

.home-view,
.materials-view {
  padding-inline: 18px;
}

.home-header,
.materials-header,
.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home-header {
  padding: 28px 4px 18px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.license-status {
  display: grid;
  gap: 2px;
  min-width: 76px;
  padding: 8px 11px;
  border: 1px solid #eadfe5;
  border-radius: 14px;
  color: var(--ink);
  background: white;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 8px 24px rgba(54, 31, 44, 0.08);
}

.license-status span {
  font-size: 9px;
  font-weight: 800;
}

.license-status small {
  color: var(--success);
  font-size: 9px;
}

.home-header h1,
.materials-header h1 {
  margin: 4px 0 0;
  font-size: 30px;
  letter-spacing: -1px;
}

.home-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.eyebrow,
.section-kicker,
.modal-kicker {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(22, 166, 106, 0.12);
}

.icon-button,
.editor-icon,
.modal-close {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.icon-button {
  width: 42px;
  height: 42px;
  color: var(--accent);
  background: white;
  box-shadow: 0 8px 24px rgba(54, 31, 44, 0.1);
  font-size: 23px;
}

.hero-card {
  position: relative;
  min-height: 224px;
  overflow: hidden;
  padding: 28px 24px 22px;
  border-radius: var(--radius-xl);
  color: white;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.13), transparent 42%),
    linear-gradient(140deg, #2a1522 0%, #d30051 72%, #ff3f82 100%);
  box-shadow: 0 20px 40px rgba(177, 0, 65, 0.24);
}

.hero-card::after {
  content: "创";
  position: absolute;
  right: -5px;
  bottom: -38px;
  color: rgba(255, 255, 255, 0.1);
  font: 900 160px/1 serif;
  transform: rotate(-8deg);
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 320px;
}

.hero-badge {
  display: inline-flex;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.7px;
}

.hero-copy h2 {
  max-width: 290px;
  margin: 16px 0 9px;
  font-size: 24px;
  line-height: 1.25;
}

.hero-copy p {
  max-width: 330px;
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  line-height: 1.65;
}

.hero-button {
  position: relative;
  z-index: 2;
  margin-top: 18px;
  color: var(--accent-deep) !important;
  background: white !important;
  box-shadow: none !important;
}

.hero-orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
}

.orbit-one {
  right: -70px;
  top: -110px;
  width: 250px;
  height: 250px;
}

.orbit-two {
  right: 22px;
  top: 18px;
  width: 78px;
  height: 78px;
}

.primary-button,
.secondary-button,
.text-button,
.export-button {
  border: 0;
  cursor: pointer;
  font-weight: 750;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, #f40964, #c9004b);
  box-shadow: 0 10px 24px rgba(219, 0, 81, 0.22);
}

.primary-button.compact {
  min-height: 38px;
  padding-inline: 14px;
  font-size: 12px;
}

.secondary-button {
  color: var(--accent);
  background: var(--accent-soft);
}

.full-width {
  width: 100%;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0 18px;
}

.stats-row article {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
}

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

.stats-row strong {
  margin-top: 4px;
  font-size: 19px;
}

.batch-toolbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 4px 0 25px;
}

.batch-toolbar button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: #5f5660;
  background: white;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.batch-toolbar button.accent {
  border-color: transparent;
  color: white;
  background: var(--ink);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-heading h3 {
  margin: 3px 0 0;
  font-size: 20px;
}

.text-button {
  padding: 8px;
  color: var(--accent);
  background: transparent;
  font-size: 12px;
}

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

.project-card {
  position: relative;
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 13px;
  align-items: center;
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
  box-shadow: 0 9px 28px rgba(56, 32, 45, 0.06);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease;
}

.project-card:hover {
  transform: translateY(-2px);
}

.project-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229, 0, 87, 0.08);
}

.project-thumb {
  position: relative;
  width: 88px;
  height: 88px;
  overflow: hidden;
  border-radius: 15px;
  background: #18141b;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-thumb span {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 3px 6px;
  border-radius: 7px;
  color: white;
  background: rgba(13, 12, 17, 0.72);
  font-size: 9px;
}

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

.project-info h4 {
  overflow: hidden;
  margin: 0 0 7px;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-info p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.project-tags span,
.local-chip {
  padding: 4px 7px;
  border-radius: 8px;
  color: #665c65;
  background: #f3eff1;
  font-size: 9px;
  font-style: normal;
}

.project-tags .exported {
  color: var(--success);
  background: #e7f8f1;
}

.project-select {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid #d8cfd4;
  border-radius: 50%;
  color: transparent;
  background: white;
  font-size: 12px;
}

.project-card.selected .project-select {
  border-color: var(--accent);
  color: white;
  background: var(--accent);
}

.empty-state {
  padding: 44px 28px;
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-illustration {
  display: grid;
  width: 86px;
  height: 86px;
  margin: 0 auto 18px;
  place-items: center;
  border-radius: 28px;
  color: white;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.35), transparent 30%),
    linear-gradient(145deg, #f3377a, #b80045);
  box-shadow: 0 18px 34px rgba(196, 0, 71, 0.22);
  transform: rotate(-5deg);
}

.empty-illustration span {
  font-size: 24px;
  transform: rotate(5deg);
}

.empty-state h3 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0 auto 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  bottom: 0;
  left: 50%;
  display: grid;
  width: min(100%, 520px);
  height: 72px;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid rgba(224, 214, 220, 0.8);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.bottom-nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  color: #8b8189;
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.bottom-nav button span {
  font-size: 18px;
}

.bottom-nav button.active {
  color: var(--accent);
  font-weight: 800;
}

.materials-header {
  padding: 31px 2px 18px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
}

.search-box span {
  color: var(--accent);
  font-size: 22px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}

.filter-chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 12px 0 14px;
  scrollbar-width: none;
}

.filter-chips button {
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
  background: white;
  font-size: 11px;
  cursor: pointer;
}

.filter-chips button.active {
  border-color: var(--ink);
  color: white;
  background: var(--ink);
}

.ranking-banner {
  position: relative;
  display: flex;
  overflow: hidden;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 20px;
  border-radius: 21px;
  color: white;
  background: linear-gradient(120deg, #16121a, #482133 60%, #a60043);
}

.ranking-banner small {
  color: #f7abc9;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.4px;
}

.ranking-banner strong {
  display: block;
  margin: 5px 0;
  font-size: 19px;
}

.ranking-banner p {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
}

.ranking-number {
  position: relative;
  z-index: 2;
  color: #ff6b9f;
  font: 900 52px/1 Georgia, serif;
}

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

.material-card {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.material-thumb {
  position: relative;
  width: 74px;
  height: 96px;
  overflow: hidden;
  border-radius: 13px;
  background: linear-gradient(150deg, #442536, #f42370);
}

.material-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.material-rank {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 3px 5px;
  border-radius: 6px;
  color: white;
  background: rgba(0, 0, 0, 0.62);
  font-size: 8px;
}

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

.material-info h4 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.material-info p,
.material-info small {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.material-info .metrics {
  display: flex;
  gap: 9px;
  margin-top: 7px;
  color: #a16d80;
  font-size: 9px;
}

.remix-button {
  padding: 9px 12px;
  border: 0;
  border-radius: 12px;
  color: white;
  background: linear-gradient(140deg, #f12972, #bd0047);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

/* Editor */
.editor-view {
  min-height: 100vh;
  padding-bottom: 0;
  color: white;
  background:
    radial-gradient(circle at 50% 20%, rgba(229, 0, 87, 0.13), transparent 18rem),
    var(--night);
}

.editor-header {
  position: sticky;
  z-index: 15;
  top: 0;
  height: 64px;
  padding: 0 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(13, 12, 17, 0.9);
  backdrop-filter: blur(16px);
}

.editor-icon {
  width: 34px;
  height: 34px;
  color: white;
  background: #211e27;
  font-size: 22px;
}

.editor-title-wrap {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
}

.editor-title-wrap input {
  width: 190px;
  overflow: hidden;
  border: 0;
  color: white;
  outline: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
}

.editor-title-wrap span {
  margin-top: 2px;
  color: #77717f;
  font-size: 8px;
}

.export-button {
  min-width: 56px;
  height: 34px;
  border-radius: 11px;
  color: white;
  background: var(--accent);
  font-size: 11px;
}

.preview-area {
  padding: 12px 18px 6px;
}

.stage-shell {
  position: relative;
  width: min(100%, 310px);
  max-height: 46vh;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #302b36;
  border-radius: 18px;
  background: #050507;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
  touch-action: none;
}

.stage-shell video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: black;
}

.watermark-region,
.new-watermark-preview,
.text-layer-preview {
  position: absolute;
  z-index: 3;
  user-select: none;
  touch-action: none;
}

.watermark-region {
  left: 72%;
  top: 10%;
  width: 23%;
  height: 10%;
  min-width: 38px;
  min-height: 24px;
  border: 1.5px solid #ff317c;
  background: repeating-linear-gradient(135deg, rgba(229, 0, 87, 0.18) 0 6px, rgba(255, 255, 255, 0.08) 6px 12px);
  backdrop-filter: blur(4px);
  cursor: grab;
}

.watermark-region:active,
.new-watermark-preview:active,
.text-layer-preview:active {
  cursor: grabbing;
}

.region-label {
  position: absolute;
  top: -18px;
  left: -1px;
  padding: 2px 5px;
  border-radius: 4px 4px 0 0;
  color: white;
  background: var(--accent);
  font-size: 7px;
  white-space: nowrap;
}

.resize-handle {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 11px;
  height: 11px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--accent);
}

.new-watermark-preview {
  left: 83.5%;
  top: 15%;
  color: white;
  font-size: 10px;
  font-weight: 700;
  text-shadow: 0 1px 3px black;
  transform: translate(-50%, -50%);
  pointer-events: none;
  white-space: nowrap;
}

.text-layer-preview {
  left: 50%;
  top: 14%;
  display: none;
  padding: 4px 8px;
  border: 1px dashed rgba(255, 255, 255, 0.65);
  border-radius: 6px;
  color: white;
  background: rgba(9, 8, 12, 0.55);
  font-size: 13px;
  font-weight: 800;
  text-shadow: 0 1px 3px black;
  transform: translate(-50%, -50%);
  cursor: grab;
  white-space: nowrap;
}

.stage-play {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  color: white;
  background: rgba(13, 12, 17, 0.62);
  backdrop-filter: blur(8px);
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.stage-play.playing {
  opacity: 0;
  pointer-events: none;
}

.transport-row {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  gap: 8px;
  align-items: center;
  max-width: 380px;
  margin: 9px auto 0;
  color: #77717f;
  font-size: 9px;
}

input[type="range"] {
  accent-color: var(--accent);
}

.transport-row input {
  width: 100%;
}

.timeline-strip {
  position: relative;
  height: 38px;
  max-width: 380px;
  margin: 5px auto 0;
  overflow: hidden;
  border-radius: 8px;
  background: #201d25;
}

.timeline-thumbs {
  position: absolute;
  inset: 0;
  opacity: 0.74;
  background-position: center;
  background-size: auto 100%;
}

.timeline-strip::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent);
  border-radius: inherit;
  pointer-events: none;
}

.timeline-playhead {
  position: absolute;
  z-index: 2;
  top: -2px;
  bottom: -2px;
  left: 0;
  width: 2px;
  background: white;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.editor-tabs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin-top: 6px;
  border-top: 1px solid var(--night-line);
  border-bottom: 1px solid var(--night-line);
  background: #121017;
}

.editor-tabs button {
  position: relative;
  display: flex;
  min-height: 58px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  color: #77717e;
  background: transparent;
  font-size: 9px;
  cursor: pointer;
}

.editor-tabs button span {
  font-size: 17px;
}

.editor-tabs button.active {
  color: #ff2c77;
}

.editor-tabs button.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 28px;
  height: 2px;
  background: var(--accent);
}

.control-drawer {
  min-height: 380px;
  padding: 18px 18px 48px;
  background: var(--night-soft);
}

.control-panel {
  display: none;
}

.control-panel.active {
  display: block;
  animation: panel-in 180ms ease;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

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

.panel-heading small {
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.7px;
}

.panel-heading h3 {
  margin: 3px 0 0;
  font-size: 17px;
}

.panel-description,
.inline-tip {
  color: #817a87;
  font-size: 10px;
  line-height: 1.65;
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

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

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: #393440;
  cursor: pointer;
  transition: 160ms ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  transition: 160ms ease;
}

.switch input:checked + span {
  background: var(--accent);
}

.switch input:checked + span::after {
  transform: translateX(18px);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}

.field > span,
.control-label,
.slider-row > span {
  color: #a39ca8;
  font-size: 10px;
}

.field i {
  color: #5f5965;
  font-size: 8px;
  font-style: normal;
}

.field input[type="text"] {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  border: 1px solid #322e39;
  border-radius: 11px;
  color: white;
  outline: 0;
  background: #111016;
  font-size: 12px;
}

.field input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229, 0, 87, 0.11);
}

.control-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 3px 0 7px;
}

.control-label em {
  color: #5e5863;
  font-size: 8px;
  font-style: normal;
}

.segmented,
.position-toggle {
  display: grid;
  gap: 5px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 12px;
  background: #100f14;
}

.segmented {
  grid-template-columns: repeat(3, 1fr);
}

#coverStyle {
  grid-template-columns: 1fr;
}

.watermark-simple {
  padding: 14px;
  border: 1px solid rgba(229, 0, 87, 0.25);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(229, 0, 87, 0.1), rgba(255, 255, 255, 0.018));
}

.simple-intro {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 13px;
}

.simple-intro strong {
  font-size: 14px;
}

.simple-intro span,
.one-click-hint {
  color: #8d8490;
  font-size: 9px;
  line-height: 1.55;
}

.watermark-goals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.watermark-goal {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 9px;
  align-items: center;
  min-height: 68px;
  padding: 10px;
  border: 1px solid #37313b;
  border-radius: 13px;
  background: #111016;
  cursor: pointer;
}

.watermark-goal.active {
  border-color: #ff2c77;
  background: rgba(229, 0, 87, 0.12);
  box-shadow: inset 0 0 0 1px rgba(229, 0, 87, 0.12);
}

.watermark-goal input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.goal-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #ff5b96;
  background: rgba(229, 0, 87, 0.14);
  font-size: 13px;
  font-weight: 900;
}

.watermark-goal > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.watermark-goal strong {
  font-size: 10px;
}

.watermark-goal small {
  margin-top: 4px;
  color: #776f7b;
  font-size: 8px;
  line-height: 1.4;
}

.watermark-name-field {
  margin: 12px 0 0;
}

.watermark-name-field[hidden] {
  display: none;
}

.quick-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 10px;
  color: #8b838e;
  font-size: 8px;
}

.quick-flow span {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.quick-flow b {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: #4a3a43;
  font-size: 8px;
}

.quick-flow i {
  color: #574f59;
  font-style: normal;
}

.one-click-watermark {
  display: grid;
  width: 100%;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  color: white;
  background: linear-gradient(110deg, #ff075d, #c80048);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(229, 0, 87, 0.25);
}

.one-click-watermark:disabled {
  cursor: wait;
  opacity: 0.68;
}

.quick-action-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 17px;
}

.one-click-watermark > span:nth-child(2) {
  display: flex;
  flex-direction: column;
}

.one-click-watermark strong {
  font-size: 11px;
}

.one-click-watermark small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 8px;
}

.one-click-watermark em {
  padding: 6px 9px;
  border-radius: 8px;
  color: white;
  background: rgba(255, 255, 255, 0.16);
  font-size: 9px;
  font-style: normal;
}

.one-click-hint {
  display: block;
  margin-top: 9px;
  text-align: center;
}

.advanced-watermark {
  margin-top: 14px;
  border: 1px solid #302c36;
  border-radius: 14px;
  background: #111016;
}

.advanced-watermark summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px;
  cursor: pointer;
  list-style: none;
}

.advanced-watermark summary::-webkit-details-marker {
  display: none;
}

.advanced-watermark summary span {
  font-size: 10px;
  font-weight: 700;
}

.advanced-watermark summary small {
  color: #6f6873;
  font-size: 8px;
}

.advanced-watermark[open] summary {
  border-bottom: 1px solid #302c36;
}

.advanced-watermark-body {
  padding: 13px;
}

.watermark-simple.remove-mode + .advanced-watermark .replace-style-settings {
  display: none;
}

.tool-section,
.tool-details {
  margin-bottom: 12px;
  padding: 13px;
  border: 1px solid #302c36;
  border-radius: 14px;
  background: #111016;
}

.tool-section-title,
.tool-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-section-title strong,
.tool-details summary span {
  font-size: 11px;
}

.tool-section-title small,
.tool-details summary small {
  color: #6e6873;
  font-size: 8px;
}

.tool-details {
  padding: 0;
}

.tool-details summary {
  padding: 13px;
  cursor: pointer;
  list-style: none;
}

.tool-details summary::-webkit-details-marker {
  display: none;
}

.tool-details[open] summary {
  border-bottom: 1px solid #302c36;
}

.tool-details-body {
  padding: 13px;
}

.trim-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.trim-actions button,
.reset-look {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #3b343e;
  border-radius: 10px;
  color: #aaa2ad;
  background: #18151c;
  font-size: 9px;
  cursor: pointer;
}

#speedMode.six-segment {
  grid-template-columns: repeat(6, 1fr);
}

#aspectMode.five-segment {
  grid-template-columns: repeat(5, 1fr);
}

#rotationMode.four-segment {
  grid-template-columns: repeat(4, 1fr);
}

#fitMode {
  grid-template-columns: repeat(2, 1fr);
}

.filter-presets {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.filter-presets button {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 5px 2px 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #77717c;
  background: transparent;
  font-size: 8px;
  cursor: pointer;
}

.filter-presets button.active {
  border-color: rgba(229, 0, 87, 0.55);
  color: white;
  background: rgba(229, 0, 87, 0.09);
}

.filter-swatch {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #51414c, #b8a1ad);
}

.filter-swatch.vivid { background: linear-gradient(135deg, #ff3d67, #ffbb2e, #20b8c4); }
.filter-swatch.cinema { background: linear-gradient(135deg, #222b40, #d49b67); }
.filter-swatch.warm { background: linear-gradient(135deg, #8e3f28, #ffd07d); }
.filter-swatch.cool { background: linear-gradient(135deg, #203954, #81d6e6); }
.filter-swatch.mono { background: linear-gradient(135deg, #181818, #d7d7d7); }

.reset-look {
  min-height: 30px;
}

@media (max-width: 520px) {
  .watermark-goals {
    grid-template-columns: 1fr;
  }

  .quick-flow {
    gap: 3px;
    font-size: 7px;
  }

  #speedMode.six-segment,
  .filter-presets {
    grid-template-columns: repeat(3, 1fr);
  }
}

.position-toggle {
  grid-template-columns: repeat(2, 1fr);
}

.segmented button,
.position-toggle button {
  min-height: 32px;
  border: 0;
  border-radius: 9px;
  color: #77717c;
  background: transparent;
  font-size: 9px;
  cursor: pointer;
}

.segmented button.active,
.position-toggle button.active {
  color: white;
  background: #31222b;
  box-shadow: inset 0 0 0 1px rgba(229, 0, 87, 0.35);
}

.check-row,
.check-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #302c36;
  border-radius: 12px;
  background: #111016;
}

.check-row {
  min-height: 58px;
  margin-bottom: 12px;
  padding: 10px 12px;
}

.check-row span,
.check-card span {
  display: flex;
  flex-direction: column;
}

.check-row strong,
.check-card strong {
  font-size: 10px;
}

.check-row small,
.check-card small {
  margin-top: 3px;
  color: #6e6873;
  font-size: 8px;
}

.check-row input,
.check-card input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.tracking-button {
  display: grid;
  width: 100%;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 64px;
  margin: -2px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(229, 0, 87, 0.34);
  border-radius: 13px;
  color: white;
  background: linear-gradient(120deg, rgba(229, 0, 87, 0.13), rgba(229, 0, 87, 0.035));
  text-align: left;
  cursor: pointer;
}

.tracking-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.tracking-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  color: #ff4e8c;
  background: rgba(229, 0, 87, 0.16);
  font-size: 18px;
}

.tracking-button > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.tracking-button strong {
  font-size: 10px;
}

.tracking-button small {
  overflow: hidden;
  margin-top: 4px;
  color: #8e7b86;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tracking-button em {
  padding: 6px 9px;
  border-radius: 8px;
  color: #ff5a95;
  background: rgba(229, 0, 87, 0.12);
  font-size: 9px;
  font-style: normal;
}

.slider-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}

.slider-row > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slider-row output {
  color: #d6cfd7;
  font-size: 9px;
}

.slider-row input {
  width: 100%;
  height: 4px;
}

.compact-grid {
  align-items: stretch;
  margin-top: 16px;
}

.color-field input[type="color"] {
  width: 100%;
  height: 45px;
  padding: 5px;
  border: 1px solid #302c36;
  border-radius: 11px;
  background: #111016;
}

.check-card {
  align-self: end;
  min-height: 45px;
  margin-bottom: 14px;
  padding: 8px 10px;
  gap: 7px;
}

.check-card span {
  flex: 1;
}

.focus-picker {
  position: relative;
  height: 110px;
  overflow: hidden;
  margin: 18px 0;
  border: 1px solid #322e39;
  border-radius: 15px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    #100f14;
  background-size: 25% 25%;
  cursor: crosshair;
}

.focus-picker span {
  position: absolute;
  bottom: 8px;
  left: 10px;
  color: #5f5965;
  font-size: 8px;
}

.focus-picker i {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 18px;
  height: 18px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(229, 0, 87, 0.18);
  transform: translate(-50%, -50%);
}

.quality-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.quality-cards button {
  display: flex;
  min-height: 86px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 13px;
  border: 1px solid #302c36;
  border-radius: 15px;
  color: white;
  background: #111016;
  text-align: left;
  cursor: pointer;
}

.quality-cards button.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(229, 0, 87, 0.08);
}

.quality-cards strong {
  font-size: 13px;
}

.quality-cards span {
  margin-top: 5px;
  color: #716a77;
  font-size: 8px;
  line-height: 1.5;
}

.info-card {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding: 13px;
  border: 1px solid rgba(229, 0, 87, 0.18);
  border-radius: 13px;
  color: #b08798;
  background: rgba(229, 0, 87, 0.07);
}

.info-card p {
  margin: 0;
  font-size: 9px;
  line-height: 1.65;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  visibility: hidden;
  background: rgba(14, 10, 13, 0.56);
  opacity: 0;
  backdrop-filter: blur(8px);
  transition: 180ms ease;
}

.modal-backdrop.open {
  visibility: visible;
  opacity: 1;
}

.modal-card {
  position: relative;
  width: min(100%, 488px);
  padding: 28px 22px 22px;
  border-radius: 28px;
  background: white;
  box-shadow: 0 25px 80px rgba(24, 11, 18, 0.3);
  transform: translateY(24px);
  transition: 180ms ease;
}

.modal-backdrop.open .modal-card {
  transform: none;
}

.modal-card h2 {
  margin: 6px 0 8px;
  font-size: 23px;
}

.modal-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  background: #f3eef1;
  font-size: 20px;
}

.link-import-box {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #efd4df;
  border-radius: 20px;
  background: linear-gradient(145deg, #fff7fa, #fff);
}

.link-import-box textarea {
  width: 100%;
  min-height: 98px;
  padding: 13px 14px;
  resize: vertical;
  border: 1px solid #dccbd3;
  border-radius: 14px;
  color: var(--ink);
  outline: 0;
  background: white;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.65;
}

.link-import-box textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229, 0, 87, 0.09);
}

.link-import-button {
  width: 100%;
  min-height: 46px;
  justify-content: center;
}

.link-import-box small {
  color: #9a7e89;
  font-size: 9px;
  line-height: 1.55;
  text-align: center;
}

.import-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 2px 0;
  color: #a9969e;
  font-size: 9px;
}

.import-divider::before,
.import-divider::after {
  height: 1px;
  flex: 1;
  background: #eee4e8;
  content: "";
}

.drop-zone {
  display: flex;
  width: 100%;
  min-height: 112px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  border: 1.5px dashed #d9c7d0;
  border-radius: 21px;
  color: var(--ink);
  background:
    radial-gradient(circle at center, rgba(229, 0, 87, 0.07), transparent 58%),
    #fcfafb;
  cursor: pointer;
}

.upload-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 9px;
  place-items: center;
  border-radius: 17px;
  color: white;
  background: var(--accent);
  font-size: 20px;
  box-shadow: 0 10px 24px rgba(229, 0, 87, 0.22);
}

.drop-zone strong {
  font-size: 14px;
}

.drop-zone small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.export-options {
  display: grid;
  gap: 9px;
  margin: 18px 0;
}

.export-option {
  display: grid;
  grid-template-columns: auto 40px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 72px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
}

.export-option.selected {
  border-color: var(--accent);
  background: #fff6f9;
  box-shadow: inset 0 0 0 2px rgba(229, 0, 87, 0.06);
}

.export-option input {
  accent-color: var(--accent);
}

.option-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 800;
}

.export-option > span:last-child {
  display: flex;
  flex-direction: column;
}

.export-option strong {
  font-size: 12px;
}

.export-option small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.progress-card {
  text-align: center;
}

.progress-orb {
  display: grid;
  width: 96px;
  height: 96px;
  margin: -70px auto 18px;
  place-items: center;
  border: 8px solid #ffd5e5;
  border-radius: 50%;
  color: var(--accent);
  background: white;
  box-shadow: 0 18px 45px rgba(164, 0, 60, 0.22);
}

.progress-orb span {
  font-size: 20px;
  font-weight: 900;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  margin: 18px 0;
  border-radius: 20px;
  background: #f0e9ed;
}

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #bd0047, #ff347c);
  transition: width 260ms ease;
}

.progress-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
}

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

.progress-actions a {
  text-decoration: none;
}

.loading-overlay {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  color: white;
  background: rgba(13, 10, 13, 0.74);
  backdrop-filter: blur(10px);
}

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

.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ff3c80;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast {
  position: fixed;
  z-index: 300;
  left: 50%;
  bottom: 92px;
  max-width: min(88vw, 430px);
  padding: 11px 16px;
  border-radius: 13px;
  color: white;
  background: rgba(27, 21, 26, 0.93);
  font-size: 11px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: 180ms ease;
}

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

@media (min-width: 760px) {
  body {
    padding: 24px 0;
  }

  .app-shell {
    min-height: calc(100vh - 48px);
    border-radius: 32px;
  }

  .view {
    min-height: calc(100vh - 48px);
  }

  .bottom-nav {
    bottom: 24px;
    border-radius: 0 0 32px 32px;
  }

  .editor-view {
    min-height: calc(100vh - 48px);
  }

  .modal-backdrop {
    align-items: center;
  }

  .progress-orb {
    margin-top: -72px;
  }
}

@media (max-width: 390px) {
  .home-view,
  .materials-view {
    padding-inline: 14px;
  }

  .hero-copy h2 {
    font-size: 21px;
  }

  .project-card {
    grid-template-columns: 78px 1fr auto;
  }

  .project-thumb {
    width: 78px;
    height: 84px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .compact-grid {
    grid-template-columns: 1fr 1fr;
  }
}
