/* ============================================
   PictureAI - 主样式
   ============================================ */
:root {
  --bg: #03030a;
  --surface: #0c0c18;
  --surface2: #141428;
  --border: #1e1e3a;
  --text: #eeeef8;
  --text2: #8888bb;
  --accent: #6366f1;
  --accent2: #818cf8;
  --pink: #ec4899;
  --green: #10b981;
  --orange: #f59e0b;
  --radius: 20px;
  --rs: 12px;
  --font: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

*,
*::before,
*::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  background: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, .06) 0%, transparent 60%), var(--bg);
}

::selection { background: var(--accent); color: #fff; }

/* ========== Nav ========== */
nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; max-width: 1200px; margin: 0 auto;
  position: sticky; top: 0; z-index: 100;
  background: rgba(3, 3, 10, .8);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav-scrolled { border-bottom-color: var(--border); }

.logo { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.logo .hl { background: linear-gradient(135deg, var(--accent), var(--pink)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a { color: var(--text2); text-decoration: none; font-size: 13px; transition: color .2s; cursor: pointer; }
.nav-links a:hover { color: var(--text); }

/* ========== Buttons ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 24px; border: none; border-radius: var(--rs);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .25s; text-decoration: none;
}
.btn:active { transform: scale(.96); }

.btn-p {
  background: linear-gradient(135deg, var(--accent), var(--pink));
  color: #fff; box-shadow: 0 4px 20px rgba(99, 102, 241, .3);
}
.btn-p:hover { box-shadow: 0 6px 30px rgba(99, 102, 241, .45); transform: translateY(-1px); }

.btn-o { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-o:hover { border-color: var(--accent); color: var(--accent2); }

.btn-g { background: var(--green); color: #fff; }
.btn-sm { padding: 8px 18px; font-size: 12px; }
.btn-lg { padding: 14px 36px; font-size: 16px; }

/* ========== Hero ========== */
.hero {
  text-align: center; padding: 70px 20px 50px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -40%; left: 50%;
  transform: translateX(-50%); width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(99, 102, 241, .08) 0%, transparent 60%);
  pointer-events: none;
}
.hero h1 { font-size: clamp(28px, 5vw, 52px); font-weight: 800; line-height: 1.15; margin-bottom: 14px; letter-spacing: -1px; }
.hero .hl {
  background: linear-gradient(135deg, var(--accent), var(--accent2), var(--pink), var(--orange));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-size: 200% 200%; animation: gradient 4s ease infinite;
}
@keyframes gradient { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.hero p { font-size: 16px; color: var(--text2); max-width: 560px; margin: 0 auto 24px; line-height: 1.7; }
.hero .btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; justify-content: center; gap: 40px; margin-top: 36px; flex-wrap: wrap; }
.hero-stats .stat { text-align: center; }
.hero-stats .stat .num { font-size: 26px; font-weight: 800; background: linear-gradient(135deg, var(--accent2), var(--pink)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-stats .stat .label { font-size: 12px; color: var(--text2); margin-top: 2px; }

/* ========== Sections ========== */
.section { padding: 60px 20px; max-width: 1200px; margin: 0 auto; }
.section-title { text-align: center; font-size: clamp(20px, 3vw, 32px); font-weight: 800; margin-bottom: 6px; }
.section-subtitle { text-align: center; font-size: 14px; color: var(--text2); margin-bottom: 36px; max-width: 500px; margin-left: auto; margin-right: auto; line-height: 1.6; }

/* ========== Free Tools ========== */
.free-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.free-tool {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; text-align: center; transition: all .3s; position: relative; overflow: hidden; cursor: pointer;
}
.free-tool::before { content: '🆓'; position: absolute; top: 10px; right: 12px; font-size: 16px; }
.free-tool:hover { border-color: var(--green); transform: translateY(-3px); }
.free-tool .icon { font-size: 36px; margin-bottom: 8px; display: block; }
.free-tool h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.free-tool p { font-size: 12px; color: var(--text2); line-height: 1.5; }
.tag-free { display: inline-block; font-size: 10px; background: rgba(16, 185, 129, .15); color: var(--green); padding: 2px 10px; border-radius: 10px; margin-top: 8px; font-weight: 600; }

/* ========== Features ========== */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.feature-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; transition: all .4s; cursor: pointer;
}
.feature-card:hover { border-color: rgba(99, 102, 241, .3); transform: translateY(-4px); }
.feature-card .icon { font-size: 30px; margin-bottom: 10px; display: block; }
.feature-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.feature-card p { font-size: 13px; color: var(--text2); line-height: 1.5; }

/* ========== Train Model ========== */
.train-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px; text-align: center;
  margin-bottom: 20px;
}
.train-section h3 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.train-section p { font-size: 14px; color: var(--text2); margin-bottom: 16px; max-width: 500px; margin-left: auto; margin-right: auto; }
.train-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 400px; margin: 0 auto 16px; }
.train-slot {
  aspect-ratio: 1; border: 2px dashed var(--border); border-radius: var(--rs);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; cursor: pointer; transition: all .3s;
  position: relative; overflow: hidden; background: var(--surface2);
}
.train-slot:hover { border-color: var(--accent); }
.train-slot.has-img { border-color: var(--green); border-style: solid; }
.train-slot img { width: 100%; height: 100%; object-fit: cover; }
.train-slot .remove {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--red); color: #fff; font-size: 10px;
  border: none; cursor: pointer; display: none;
}
.train-slot.has-img .remove { display: flex; align-items: center; justify-content: center; }

/* ========== Showcase ========== */
.showcase { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.showcase-item {
  position: relative; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 1; background: var(--surface2); cursor: pointer; transition: all .4s;
}
.showcase-item:hover { transform: scale(1.02); }
.showcase-item .before, .showcase-item .after {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 56px; transition: opacity .5s;
}
.showcase-item .before { background: var(--surface2); }
.showcase-item .after {
  background: linear-gradient(135deg, rgba(99, 102, 241, .15), rgba(236, 72, 153, .1));
  opacity: 0;
}
.showcase-item:hover .after { opacity: 1; }
.showcase-item .label {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .8));
  font-size: 12px; font-weight: 600;
}

/* ========== Pricing ========== */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; max-width: 900px; margin: 0 auto; }
.plan {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; position: relative; transition: all .4s;
}
.plan:hover { border-color: var(--accent); transform: translateY(-4px); }
.plan.popular { border-color: var(--accent); box-shadow: 0 0 30px rgba(99, 102, 241, .12); }
.popular-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), var(--pink));
  color: #fff; font-size: 11px; font-weight: 700; padding: 4px 20px; border-radius: 20px; white-space: nowrap;
}
.plan .name { font-size: 18px; font-weight: 700; }
.plan .desc { font-size: 13px; color: var(--text2); margin: 4px 0 14px; }
.plan .price { font-size: 38px; font-weight: 800; }
.plan .price .cur { font-size: 18px; vertical-align: super; }
.plan .price .period { font-size: 13px; font-weight: 400; color: var(--text2); margin-left: 4px; }
.plan .perks { list-style: none; margin: 16px 0; padding: 0; }
.plan .perks li { padding: 7px 0; font-size: 13px; color: var(--text2); display: flex; align-items: center; gap: 8px; border-bottom: 1px solid rgba(255, 255, 255, .03); }
.plan .perks li:last-child { border-bottom: none; }
.plan .perks li::before { content: '✓'; color: var(--green); font-weight: 700; }
.plan .btn { width: 100%; text-align: center; margin-top: 6px; }

/* ========== Dashboard ========== */
.dashboard { display: none; max-width: 1200px; margin: 0 auto; padding: 20px; }
.dashboard.show { display: block; animation: fadeUp .4s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.dash-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.dash-header h2 { font-size: 18px; font-weight: 700; }
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.photo-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--rs); overflow: hidden; cursor: pointer; transition: all .3s; }
.photo-card:hover { border-color: var(--accent); }
.photo-card .thumb { width: 100%; aspect-ratio: 1; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 32px; overflow: hidden; }
.photo-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-card .meta { padding: 8px 10px; }
.photo-card .meta .fn { font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--text2); }
.empty-state .icon { font-size: 48px; margin-bottom: 10px; }
.empty-state .t { font-size: 15px; }
.empty-state .d { font-size: 13px; margin-top: 4px; margin-bottom: 14px; }
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 40px 20px; text-align: center; cursor: pointer;
  transition: all .3s; margin-bottom: 20px;
}
.upload-zone.dragover { border-color: var(--accent); background: rgba(99, 102, 241, .06); }
.upload-zone .icon { font-size: 42px; margin-bottom: 6px; }
.upload-zone .t { font-size: 15px; font-weight: 600; }
.upload-zone .d { font-size: 12px; color: var(--text2); margin-top: 3px; }
.upload-zone input { display: none; }

/* ========== Testimonials ========== */
.testimonials { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.testimonial { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.testimonial .stars { color: var(--orange); font-size: 13px; margin-bottom: 6px; }

/* ========== FAQ ========== */
.faq { max-width: 600px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); padding: 14px 0; cursor: pointer; }
.faq-item .q { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 600; }
.faq-item .q .arrow { transition: transform .3s; font-size: 11px; color: var(--text2); }
.faq-item.open .q .arrow { transform: rotate(180deg); }
.faq-item .a { font-size: 13px; color: var(--text2); line-height: 1.6; margin-top: 10px; display: none; }
.faq-item.open .a { display: block; }

/* ========== Modal ========== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0, 0, 0, .7); z-index: 1000;
  padding: 20px; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.show { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; max-width: 400px; width: 100%; }
.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.modal .sub { font-size: 13px; color: var(--text2); margin-bottom: 16px; }

/* ========== Toast ========== */
.toast {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(.9);
  background: rgba(0, 0, 0, .92); backdrop-filter: blur(12px);
  color: #fff; padding: 14px 24px; border-radius: var(--rs);
  font-size: 13px; z-index: 9999; opacity: 0;
  transition: all .3s; pointer-events: none;
  text-align: center; max-width: 80vw;
  border: 1px solid rgba(255, 255, 255, .06);
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ========== Footer ========== */
footer { text-align: center; padding: 30px 20px; font-size: 12px; color: var(--text2); border-top: 1px solid var(--border); margin-top: 30px; }
footer .links { display: flex; gap: 16px; justify-content: center; margin-bottom: 10px; flex-wrap: wrap; }
footer .links a { color: var(--text2); text-decoration: none; font-size: 12px; cursor: pointer; }
footer .links a:hover { color: var(--text); }

/* ========== Responsive ========== */
@media (max-width: 600px) {
  .hero { padding: 50px 16px 40px; }
  .hero h1 { font-size: 24px; }
  .nav-links a:not(.btn) { display: none; }
  .train-grid { grid-template-columns: repeat(2, 1fr); }
  .free-tools { grid-template-columns: 1fr 1fr; }
  .pricing-grid,
  .features-grid { grid-template-columns: 1fr; }
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
