:root {
  --bg: #060b1d;
  --bg2: #0c1428;
  --card: #111827;
  --primary: #3b82f6;
  --cyan: #67e8f9;
  --yellow: #fde047;
  --text: #f8fafc;
  --muted: #94a3b8;
  --rail-w: 56px;
  --safe-b: env(safe-area-inset-bottom, 0);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #000; color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif; overflow: hidden; }

.app-shell { display: flex; height: 100vh; max-width: 480px; margin: 0 auto; background: var(--bg); position: relative; }

.main-area { flex: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: calc(16px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
.screen { display: none; padding: 12px 10px 20px; animation: fade .2s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.side-rail { width: var(--rail-w); background: #000; display: flex; flex-direction: column; align-items: center; padding: 16px 0; flex-shrink: 0; border-left: 1px solid rgba(255,255,255,.06); }
.rail-btn { background: none; border: none; color: var(--muted); font-size: 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px; cursor: pointer; width: 100%; }
.rail-btn.active { color: var(--yellow); }
.rail-icon { width: 24px; height: 24px; border-radius: 6px; }
.ri-home { background: linear-gradient(135deg, #fbbf24, #f59e0b); mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E") center/18px no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E") center/18px no-repeat; background-color: var(--yellow); }
.rail-btn:not(.active) .ri-home { background-color: #64748b; }
.ri-mine { background: #64748b; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2z'/%3E%3C/svg%3E") center/18px no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2z'/%3E%3C/svg%3E") center/18px no-repeat; }
.rail-btn.active .ri-mine { background-color: #fff; }

.brand-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.brand-logo { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #ec4899, #f59e0b); flex-shrink: 0; }
.brand-slogan { font-size: 12px; line-height: 1.4; color: #e2e8f0; }
.brand-slogan em { color: var(--yellow); font-style: normal; font-weight: 700; }

.hero-carousel { position: relative; border-radius: 14px; overflow: hidden; min-height: 148px; margin-bottom: 4px; }
.hero-slide { display: none; padding: 16px 14px 14px; background: var(--slide-bg, linear-gradient(135deg,#1e3a8a,#7c3aed)); min-height: 148px; position: relative; }
.hero-slide.active { display: block; }
.hero-slide-pro { min-height: 168px; padding-bottom: 52px; }
.hero-tag { display: inline-block; font-size: 10px; padding: 3px 10px; background: rgba(0,0,0,.4); border-radius: 6px; margin-bottom: 10px; }
.hero-slide h1 { font-size: 17px; font-weight: 800; margin-bottom: 4px; line-height: 1.3; }
.hero-title-line { font-size: 17px; font-weight: 800; line-height: 1.35; max-width: 72%; }
.hero-title-line .hero-highlight { font-style: normal; color: var(--yellow); font-size: 17px; display: inline; }
.hero-highlight { font-size: 18px; color: var(--yellow); font-weight: 800; }
.hero-sub { font-size: 11px; color: rgba(255,255,255,.8); margin-top: 6px; max-width: 70%; }
.hero-tags { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; }
.hero-tags span { font-size: 10px; padding: 4px 10px; border-radius: 12px; background: rgba(255,255,255,.15); backdrop-filter: blur(4px); }
.hero-play {
  position: absolute; right: 14px; top: 42%;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.95);
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.hero-play::after {
  content: '';
  position: absolute; left: 17px; top: 13px;
  border: 9px solid transparent; border-left: 14px solid #1d4ed8; border-right: 0;
}
.hero-cta { margin-top: 12px; padding: 8px 24px; background: #fff; color: #1e3a8a; border: none; border-radius: 20px; font-weight: 700; font-size: 13px; cursor: pointer; }
.hero-cta-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  width: 100%; margin: 0; padding: 12px 0;
  border-radius: 0 0 14px 14px;
  font-size: 15px; color: #1e40af;
}

.carousel-dots { display: flex; justify-content: center; gap: 6px; margin: 8px 0 12px; }
.carousel-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.25); cursor: pointer; }
.carousel-dots span.on { background: var(--cyan); width: 16px; border-radius: 3px; }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 16px; }
.stat-card { background: var(--bg2); border: 1px solid rgba(255,255,255,.06); border-radius: 10px; padding: 10px 6px; text-align: center; }
.stat-icon { width: 36px; height: 36px; margin: 0 auto 6px; border-radius: 8px; }
.si-cube { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.si-mascot { background: linear-gradient(135deg, #f472b6, #fb923c); border-radius: 50%; }
.si-ai { background: linear-gradient(135deg, #22c55e, #14b8a6); }
.stat-card b { display: block; font-size: 15px; color: var(--cyan); }
.stat-card span { font-size: 10px; color: var(--muted); }

.feature-section { margin-bottom: 20px; }
.sec-desc em { color: var(--yellow); font-style: normal; font-weight: 600; }

.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.feat-card {
  background: #0f172a;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 188px;
}
.fc-card-title, .feat-card h4.fc-card-title {
  font-size: 13px;
  padding: 8px 10px 0;
  font-weight: 800;
  color: var(--yellow);
  line-height: 1.25;
  position: relative;
  z-index: 2;
}
.fc-tags { display: flex; gap: 4px; padding: 8px 10px 0; flex-wrap: wrap; position: relative; z-index: 2; }
.fc-tags span {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.12);
  font-size: 10px; display: flex; align-items: center; justify-content: center;
  color: #cbd5e1; flex-shrink: 0;
}
.fc-visual {
  flex: 1;
  min-height: 100px;
  margin: 6px 8px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
}
.fc-visual.has-img { min-height: 110px; }
.fc-visual::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.35)); pointer-events: none; }
.fv-person { background: linear-gradient(160deg, #1e1b4b 40%, #6366f1); }
.fv-product { background: linear-gradient(160deg, #134e4a 40%, #06b6d4); }
.fv-douyin { background: linear-gradient(160deg, #000 30%, #fe2c55); }
.fv-xhs { background: linear-gradient(160deg, #450a0a 30%, #ef4444); }
.fv-link { background: linear-gradient(160deg, #581c87 30%, #a855f7); }
.fv-outfit { background: linear-gradient(160deg, #831843 30%, #ec4899); }
.fv-love { background: linear-gradient(160deg, #be185d, #fda4af); }
.fv-chase { background: linear-gradient(160deg, #1e3a8a, #60a5fa); }
.fv-ceo { background: linear-gradient(160deg, #292524, #78716c); }
.fv-palace { background: linear-gradient(160deg, #713f12, #fbbf24); }
.fv-koubo { background: linear-gradient(160deg, #312e81, #818cf8); }
.fv-hook { background: linear-gradient(160deg, #831843, #f472b6); }
.fv-slogan { background: linear-gradient(160deg, #1e3a8a, #38bdf8); }
.fv-shop { background: linear-gradient(160deg, #14532d, #4ade80); }
.fv-sell { background: linear-gradient(160deg, #0c4a6e, #22d3ee); }
.fv-free { background: linear-gradient(160deg, #1e1b4b, #6366f1); }

.fc-btn { display: block; width: calc(100% - 16px); margin: 0 8px 8px; padding: 6px 0; border: none; border-radius: 16px; background: linear-gradient(90deg, #a5f3fc, #93c5fd); color: #0c4a6e; font-size: 11px; font-weight: 700; cursor: pointer; }

.sec-title { font-size: 15px; font-weight: 800; color: #f8fafc; }
.sec-desc { font-size: 12px; color: #94a3b8; margin-bottom: 12px; line-height: 1.5; }

.tutorial-btn { width: 100%; padding: 12px; border: none; border-radius: 24px; background: linear-gradient(90deg, #2563eb, #3b82f6); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; margin-top: 8px; }

/* 我的 */
.mine-top { display: flex; align-items: center; gap: 12px; padding: 20px 8px; }
.mine-avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6); background-size: cover; border: 2px solid rgba(255,255,255,.15); flex-shrink: 0; }
.mine-meta { flex: 1; }
.mine-meta h2 { font-size: 16px; }
.mine-meta p { font-size: 12px; color: var(--cyan); margin-top: 2px; }
.btn-wechat-login { padding: 8px 14px; background: #07c160; color: #fff; border: none; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; }
.btn-wechat-login.hidden { display: none; }

.mine-list { padding: 0 4px; }
.mine-item { display: flex; align-items: center; gap: 12px; padding: 14px 10px; background: var(--card); border-radius: 12px; margin-bottom: 8px; cursor: pointer; border: 1px solid rgba(255,255,255,.05); }
.mine-item span { font-size: 22px; }
.mine-item b { display: block; font-size: 14px; }
.mine-item small { font-size: 11px; color: var(--muted); }
.mine-item i { margin-left: auto; color: var(--muted); font-style: normal; font-size: 18px; }

.sub-header { display: flex; align-items: center; gap: 8px; padding: 8px 4px 12px; }
.sub-header h1 { font-size: 16px; flex: 1; text-align: center; margin-right: 32px; }
.back-btn { background: none; border: none; color: var(--text); font-size: 28px; width: 32px; cursor: pointer; line-height: 1; }

.works-list { padding: 0 4px; }
.work-card { background: var(--card); border-radius: 10px; padding: 10px; margin-bottom: 8px; border: 1px solid rgba(255,255,255,.05); }
.work-card .st { font-size: 10px; padding: 2px 8px; border-radius: 8px; background: rgba(34,211,238,.15); color: var(--cyan); }
.work-card .st.fail { background: rgba(239,68,68,.15); color: #f87171; }
.work-card .st.ok { background: rgba(34,197,94,.15); color: #4ade80; }
.work-card p { font-size: 11px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-card video { width: 100%; border-radius: 8px; margin-top: 6px; }

/* Overlays */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 200; align-items: flex-end; justify-content: center; }
.overlay.show { display: flex; }
.overlay-panel { background: var(--bg2); width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 12px 14px calc(20px + var(--safe-b)); animation: slideUp .25s ease; }
.overlay-panel.sm { padding: 20px; border-radius: 16px; margin: auto 16px; max-height: none; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }

.create-form { padding: 0 2px; }
.engine-bar { font-size: 12px; color: var(--cyan); margin-bottom: 10px; font-weight: 600; }
.upload-zone { margin-bottom: 10px; }
.upload-placeholder { border: 2px dashed rgba(59,130,246,.4); border-radius: 10px; padding: 24px; text-align: center; color: var(--muted); font-size: 12px; cursor: pointer; }
.img-preview { width: 100%; max-height: 160px; object-fit: cover; border-radius: 10px; }
.story-previews { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.story-previews img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }

textarea, .text-input { width: 100%; background: var(--card); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 12px; color: var(--text); font-size: 13px; margin-bottom: 10px; resize: none; outline: none; }
.text-input { margin-bottom: 10px; }
.opt-row { margin-bottom: 10px; }
.opt-row label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 6px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { padding: 6px 14px; border-radius: 16px; border: 1px solid rgba(255,255,255,.1); background: var(--card); color: var(--muted); font-size: 12px; cursor: pointer; }
.pill.on { border-color: var(--primary); color: #93c5fd; background: rgba(59,130,246,.15); }
.cost-line, .hint-line { font-size: 12px; color: var(--cyan); text-align: center; margin: 8px 0; }
.submit-btn { width: 100%; padding: 13px; border: none; border-radius: 12px; background: linear-gradient(90deg, #2563eb, #6366f1); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; margin-bottom: 8px; }
.submit-btn.secondary { background: var(--card); border: 1px solid var(--primary); color: #93c5fd; }

.amt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.amt-grid button { padding: 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.1); background: var(--card); color: var(--text); cursor: pointer; }
.amt-grid button.on { border-color: var(--primary); background: rgba(59,130,246,.2); }
.amt-grid small { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.pay-row { display: flex; gap: 8px; margin-bottom: 8px; }
.pay-wx, .pay-ali { flex: 1; padding: 11px; border: none; border-radius: 10px; font-weight: 700; cursor: pointer; color: #fff; }
.pay-wx { background: #07c160; }
.pay-ali { background: #1677ff; }
.link-btn { width: 100%; background: none; border: none; color: var(--muted); padding: 10px; cursor: pointer; }

.loading-box { text-align: center; padding: 32px; margin: auto; }
.loader { width: 44px; height: 44px; border: 3px solid rgba(255,255,255,.1); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); background: rgba(0,0,0,.88); color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 13px; z-index: 300; display: none; max-width: 80%; text-align: center; }
.toast.show { display: block; }

@media (min-width: 481px) {
  .app-shell { box-shadow: 0 0 40px rgba(0,0,0,.5); }
}
