:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #182033;
  --muted: #7b8496;
  --line: #e7ebf2;
  --blue: #171717;
  --blue-soft: #eeeeeb;
  --green: #1aa36f;
  --shadow: 0 16px 42px rgba(24, 32, 51, .10);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: #efefec;
}

button, input, textarea { font: inherit; }
button { border: 0; cursor: pointer; }

.phone-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.phone {
  width: min(430px, 100vw);
  height: min(900px, calc(100vh - 32px));
  background: var(--bg);
  border: 12px solid #111827;
  border-radius: 42px;
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
}

.statusbar {
  height: 22px;
  background: #fff;
}

#app {
  height: calc(100% - 86px);
  overflow: auto;
  padding: 14px 16px 84px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.brand h1, .page-title h1 {
  font-size: 24px;
  line-height: 1.1;
  margin: 0 0 5px;
  letter-spacing: 0;
}

.brand p, .page-title p {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 12px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.card h2 {
  font-size: 16px;
  margin: 0;
}

.hint { color: var(--muted); font-size: 12px; }

.image-drop {
  height: 190px;
  border-radius: 16px;
  overflow: hidden;
  background: #eef2f8;
  position: relative;
  margin-bottom: 12px;
}

.image-drop img, .asset-img, .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.image-drop.fit img, .asset-img.fit { object-fit: contain; background: #f8fafc; }

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

.soft-btn {
  min-height: 38px;
  border-radius: 12px;
  background: #f0f4fa;
  color: #273247;
  font-weight: 700;
}

.primary {
  width: 100%;
  min-height: 50px;
  border-radius: 16px;
  background: #171717;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .16);
}

.seg {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 5px;
  background: #edf1f7;
  border-radius: 14px;
  margin-bottom: 12px;
}

.seg button {
  min-height: 34px;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.seg button.active {
  color: var(--blue);
  background: #fff;
  box-shadow: 0 4px 12px rgba(32, 45, 70, .08);
}

textarea {
  width: 100%;
  min-height: 74px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  outline: none;
  color: var(--text);
  background: #fbfcfe;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  border-radius: 999px;
  padding: 7px 10px;
  background: #f2f5fa;
  color: #4d596d;
  font-size: 12px;
  font-weight: 700;
}

.asset-grid, .history-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.asset-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.asset-img { height: 138px; }
.asset-meta { padding: 10px; }
.asset-meta strong { display: block; font-size: 13px; margin-bottom: 6px; }
.asset-meta span { color: var(--muted); font-size: 12px; }

.filters {
  display: flex;
  overflow: auto;
  gap: 8px;
  margin: 12px 0;
  padding-bottom: 2px;
}

.filters button {
  flex: 0 0 auto;
  border-radius: 999px;
  min-height: 34px;
  padding: 0 13px;
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line);
}

.filters button.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.steps {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue-soft);
  border: 5px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}

.step.done { color: var(--text); font-weight: 700; }
.step.done .dot { background: var(--green); }

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mini-preview {
  height: 176px;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.result-main {
  height: 430px;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 12px;
}

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

.thumb {
  height: 82px;
  border-radius: 13px;
  overflow: hidden;
  background: #fff;
}

.video-card {
  width: 100%;
  height: 240px;
  border-radius: 16px;
  overflow: hidden;
  background: #101827;
  display: block;
  margin-bottom: 12px;
}

.image-video-preview {
  position: relative;
  color: #fff;
}

.image-video-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .82;
  display: block;
}

.image-video-preview span {
  position: absolute;
  left: 14px;
  bottom: 14px;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, .48);
  font-size: 12px;
  font-weight: 800;
}

.image-video-preview.animated img {
  animation: fabricmind-pan 6s ease-in-out infinite alternate;
}

@keyframes fabricmind-pan {
  from { transform: scale(1.02) translateY(4px); }
  to { transform: scale(1.12) translateY(-8px); }
}

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

.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}

.stat strong { display: block; font-size: 20px; }
.stat span { color: var(--muted); font-size: 12px; }

.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line);
}

.tabbar button {
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tabbar button.active { color: var(--blue); }

@media (max-width: 460px) {
  .phone-shell { padding: 0; }
  .phone {
    width: 100vw;
    height: 100vh;
    border: 0;
    border-radius: 0;
  }
}
