:root {
  --bg: #0b0b14;
  --bg-soft: #14141f;
  --panel: #1a1a28;
  --panel-2: #21212f;
  --border: #2c2c3c;
  --text: #e8e8f0;
  --text-dim: #9a9ab0;
  --text-mute: #6b6b80;
  --primary: #7c3aed;
  --primary-2: #2563eb;
  --accent: #06b6d4;
  --pink: #ec4899;
  --grad: linear-gradient(135deg, #7c3aed 0%, #2563eb 50%, #06b6d4 100%);
  --grad-soft: linear-gradient(135deg, rgba(124,58,237,.18), rgba(37,99,235,.12));
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(0,0,0,.45);
  font-synthesis: none;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(124,58,237,.18), transparent 60%),
              radial-gradient(900px 500px at -10% 10%, rgba(37,99,235,.15), transparent 55%),
              var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

.loading { padding: 80px; text-align: center; color: var(--text-dim); }

/* ---------- 布局 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 20px;
  padding: 14px 28px;
  background: rgba(11,11,20,.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: .5px; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); display: grid; place-items: center; font-size: 16px; }
.brand .grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 6px; margin-left: 8px; }
.nav-links a { padding: 8px 14px; border-radius: 10px; color: var(--text-dim); font-weight: 600; font-size: 14px; transition: .15s; }
.nav-links a:hover { color: var(--text); background: var(--panel); }
.nav-links a.active { color: #fff; background: var(--grad-soft); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.credits-pill { background: var(--panel); border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--amber); }
.credits-pill b { color: var(--amber); }

.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-weight: 700; color: #fff; cursor: pointer; position: relative; }
.user-menu { position: absolute; right: 0; top: 42px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 6px; min-width: 180px; box-shadow: var(--shadow); display: none; }
.user-menu.show { display: block; }
.user-menu a, .user-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: none; background: none; color: var(--text); border-radius: 8px; font-size: 14px; }
.user-menu a:hover, .user-menu button:hover { background: var(--panel-2); }

.container { max-width: 1200px; margin: 0 auto; padding: 28px; }
.container-wide { max-width: 1320px; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel); color: var(--text); font-weight: 700; font-size: 14px; transition: .15s; }
.btn:hover { border-color: var(--primary); }
.btn-primary { background: var(--grad); border: none; color: #fff; box-shadow: 0 6px 20px rgba(124,58,237,.35); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn-danger { color: var(--red); border-color: rgba(239,68,68,.4); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 7px; font-weight: 600; }
.input, .textarea, .select {
  width: 100%; padding: 12px 14px; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: 11px; color: var(--text); font-size: 14px; outline: none; transition: .15s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,.18); }
.textarea { resize: vertical; min-height: 90px; }
.row { display: flex; gap: 14px; }
.row > * { flex: 1; }

/* ---------- 卡片/面板 ---------- */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: .18s; }
.card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow); }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px){ .grid-3,.grid-4 { grid-template-columns: repeat(2,1fr);} .grid-2{grid-template-columns:1fr;} }
@media (max-width: 560px){ .grid-3,.grid-4,.grid-2 { grid-template-columns: 1fr; } .nav-links{display:none;} }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 30px 0 16px; }
.section-title h2 { font-size: 22px; font-weight: 800; }
.muted { color: var(--text-dim); }
.mute { color: var(--text-mute); }
.center { text-align: center; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--grad-soft); color: #c9b6ff; border: 1px solid rgba(124,58,237,.3); }

/* ---------- Hero / Landing ---------- */
.hero { text-align: center; padding: 70px 20px 40px; }
.hero h1 { font-size: clamp(34px, 6vw, 60px); font-weight: 900; line-height: 1.15; letter-spacing: -1px; }
.hero h1 .grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { max-width: 640px; margin: 20px auto 30px; color: var(--text-dim); font-size: 17px; }
.hero .cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 50px; }
.feature { padding: 24px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); }
.feature .ico { width: 46px; height: 46px; border-radius: 12px; background: var(--grad-soft); display: grid; place-items: center; font-size: 22px; margin-bottom: 14px; }
.feature h3 { font-size: 16px; margin-bottom: 6px; }
.feature p { font-size: 13.5px; color: var(--text-dim); }
.steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-top: 30px; }
@media (max-width: 700px){ .steps{grid-template-columns:1fr;} }
.step { text-align: center; padding: 22px; border: 1px dashed var(--border); border-radius: var(--radius); }
.step .num { width: 38px; height: 38px; margin: 0 auto 12px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-weight: 800; }

/* ---------- 创作台 ---------- */
.studio-layout { display: grid; grid-template-columns: 340px 1fr; gap: 22px; }
@media (max-width: 980px){ .studio-layout{ grid-template-columns:1fr; } }
.mode-tabs { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.mode-tab { padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); text-align: center; cursor: pointer; transition: .15s; }
.mode-tab .mt-ico { font-size: 22px; }
.mode-tab .mt-name { font-weight: 700; font-size: 14px; margin-top: 4px; }
.mode-tab .mt-sub { font-size: 11.5px; color: var(--text-mute); }
.mode-tab.active { border-color: transparent; background: var(--grad-soft); box-shadow: 0 0 0 2px var(--primary) inset; }

.style-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-soft); font-size: 13px; cursor: pointer; transition: .15s; }
.chip:hover { border-color: var(--primary); }
.chip.active { background: var(--grad); color: #fff; border: none; }

.result-area { min-height: 420px; border: 1px dashed var(--border); border-radius: var(--radius); display: grid; place-items: center; background: var(--bg-soft); position: relative; overflow: hidden; }
.result-area.has-result { display: block; border-style: solid; }
.result-grid { display: grid; gap: 12px; padding: 16px; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); }
.result-img { width: 100%; border-radius: 12px; background: #000; display: block; }
.result-img.video, .result-area video { width: 100%; border-radius: 12px; background: #000; display: block; }
.result-card { position: relative; }
.result-card .dl { position: absolute; right: 8px; bottom: 8px; }
.placeholder-tip { color: var(--text-mute); text-align: center; padding: 30px; }
.progress-bar { width: 70%; height: 10px; border-radius: 999px; background: var(--bg); overflow: hidden; margin: 14px auto; }
.progress-bar > i { display: block; height: 100%; background: var(--grad); transition: width .4s; }

.inspiration-list { max-height: 260px; overflow: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.insp { font-size: 12.5px; padding: 7px 11px; border-radius: 9px; background: var(--bg-soft); border: 1px solid var(--border); cursor: pointer; }
.insp:hover { border-color: var(--accent); }

/* ---------- 画廊 ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 18px; }
.g-item { border-radius: var(--radius); overflow: hidden; background: var(--panel); border: 1px solid var(--border); }
.g-item .thumb { aspect-ratio: 1/1; background: #000; display: grid; place-items: center; overflow: hidden; }
.g-item img, .g-item video { width: 100%; height: 100%; object-fit: cover; }
.g-item .meta { padding: 12px 14px; }
.g-item .meta h4 { font-size: 14px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-item .meta .sub { font-size: 12px; color: var(--text-mute); display: flex; justify-content: space-between; align-items: center; }
.like-btn { display: inline-flex; align-items: center; gap: 5px; background: none; border: none; color: var(--text-dim); font-weight: 700; font-size: 13px; }
.like-btn.liked { color: var(--pink); }

/* ---------- 弹窗 / Toast ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { width: 100%; max-width: 480px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 26px; box-shadow: var(--shadow); }
.modal h3 { margin-bottom: 16px; font-size: 18px; }
.modal .close { position: absolute; }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--panel-2); border: 1px solid var(--border); padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow); opacity: 0; transition: .25s; z-index: 200; font-size: 14px; font-weight: 600; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: rgba(34,197,94,.5); }
.toast.err { border-color: rgba(239,68,68,.5); }

/* ---------- 工具类 ---------- */
.flex { display: flex; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8{margin-top:8px}.mt-12{margin-top:12px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}.mb-12{margin-bottom:12px}.mb-16{margin-bottom:16px}
.ml-auto { margin-left: auto; }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.full { width: 100%; }
.hidden { display: none !important; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--text-dim); font-weight: 700; font-size: 12.5px; }
.table tr:hover td { background: var(--bg-soft); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 14px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.stat .v { font-size: 26px; font-weight: 800; }
.stat .l { color: var(--text-dim); font-size: 13px; margin-top: 2px; }
.code-box { font-family: ui-monospace, "SF Mono", Menlo, monospace; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px; font-size: 13px; white-space: pre-wrap; word-break: break-all; color: var(--accent); }
.dropzone { border: 2px dashed var(--border); border-radius: 12px; padding: 18px; text-align: center; color: var(--text-dim); cursor: pointer; transition: .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--primary); color: var(--text); }
.dropzone img { max-height: 140px; border-radius: 8px; margin-top: 8px; }
.empty { text-align: center; padding: 60px 20px; color: var(--text-mute); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs a { padding: 10px 16px; color: var(--text-dim); font-weight: 700; font-size: 14px; border-bottom: 2px solid transparent; cursor: pointer; }
.tabs a.active { color: #fff; border-bottom-color: var(--primary); }
.footer { text-align: center; padding: 40px 20px; color: var(--text-mute); font-size: 13px; border-top: 1px solid var(--border); margin-top: 50px; }
