/* 珠宝AI 首页 - 对齐 zbai.art v7 */
:root {
  --header-h: 56px;
  --sidebar-w: 72px;
  --primary-blue: #4a69dd;
  --btn-gradient: linear-gradient(96deg, #36d9fd 4.57%, #5685ff 47.33%, #eb6dff 94.97%);
  --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
  --page-max: 1440px;
}

[data-theme="light"] {
  --bg: #f7f8fa;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #888;
  --border: rgba(0,0,0,0.06);
  --header-bg: #fff;
  --sidebar-bg: #131316;
  --sidebar-text: rgba(255,255,255,0.55);
  --sidebar-active-bg: rgba(255,255,255,0.12);
}

[data-theme="dark"] {
  --bg: #0f0f12;
  --bg-card: #1a1a1e;
  --text: #edf4ff;
  --text-muted: #999;
  --border: rgba(255,255,255,0.08);
  --header-bg: #131418;
  --sidebar-bg: #0a0a0c;
  --sidebar-text: rgba(255,255,255,0.5);
  --sidebar-active-bg: rgba(255,255,255,0.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body.app-body {
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* 侧边栏 - 全高 */
.site-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 12px 0 16px; z-index: 1001;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; }
.sidebar-item {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 6px; color: var(--sidebar-text); font-size: 0.5625rem;
  border-radius: 10px; margin: 0 6px;
  transition: color 0.2s, background 0.2s;
}
.sidebar-item:hover { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.06); }
.sidebar-item.active { color: #fff; }
.sidebar-item-start.active {
  background: var(--sidebar-active-bg);
  border: 1px solid rgba(255,255,255,0.15);
}
.sidebar-icon { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; }
.sidebar-icon svg { display: block; }
.sidebar-label { line-height: 1.2; text-align: center; max-width: 56px; }
.sidebar-footer { padding: 0 6px; }

/* 顶栏 - 内容区 */
.site-header {
  position: fixed; top: 0;
  left: var(--sidebar-w); right: 0;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}
.header-logo { display: flex; align-items: center; gap: 10px; }
.header-logo .img1 { height: 30px; }
.header-logo .logo-partner { height: 26px; opacity: 0.9; }
.logo-x { color: var(--text-muted); font-size: 0.875rem; font-weight: 300; }
.header-center { position: absolute; left: 50%; transform: translateX(-50%); }
.mode-switch {
  display: flex; background: #eceef2; border-radius: 22px; padding: 3px;
  min-width: 180px;
}
.mode-btn {
  flex: 1; text-align: center;
  padding: 7px 18px; border-radius: 20px;
  font-size: 0.8125rem; font-weight: 500; color: #666;
}
.mode-btn.active { background: #2d2a26; color: #fff; }
.beta-tag {
  font-size: 0.5625rem; vertical-align: super;
  background: rgba(255,255,255,0.25); padding: 1px 4px;
  border-radius: 4px; margin-left: 3px; font-weight: 600;
}
.header-right { display: flex; align-items: center; gap: 20px; }
.header-link { font-size: 0.875rem; color: var(--text-muted); }
.header-link:hover { color: var(--text); }
.header-cta {
  padding: 9px 22px; background: #2d2a26; color: #fff;
  border-radius: 10px; font-size: 0.875rem; font-weight: 500;
}
.header-cta:hover { opacity: 0.9; }
.header-user { font-size: 0.8125rem; color: var(--text-muted); }

/* 主内容 */
.site-main {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
  padding: 20px 28px 56px;
}
.home-zbai { max-width: var(--page-max); margin: 0 auto; }

/* Hero */
.hero-section { margin-bottom: 28px; }
.hero-track { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hero-banner {
  position: relative; border-radius: 14px; overflow: hidden;
  aspect-ratio: 2.2 / 1;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  transition: transform 0.25s, box-shadow 0.25s;
}
.hero-banner:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,0.1); }
.hero-banner img { width: 100%; height: 100%; object-fit: cover; }
.hero-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 20px 14px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  color: #fff;
}
.hero-caption strong { display: block; font-size: 0.875rem; font-weight: 600; line-height: 1.4; }
.hero-caption span { display: block; font-size: 0.6875rem; opacity: 0.85; margin-top: 2px; }

/* 基础工具 */
.tools-section { margin-bottom: 36px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 1rem; font-weight: 600; }
.section-more { font-size: 0.8125rem; color: var(--text-muted); }
.section-more:hover { color: var(--text); }
.basic-tools-layout {
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: 14px;
  align-items: stretch;
}
.basic-modules {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.basic-module-card {
  position: relative; border-radius: 14px; overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
  flex: 1;
  min-height: 128px;
}
.basic-module-card img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.basic-module-info {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 14px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.72)); color: #fff;
  z-index: 1;
}
.basic-module-info h3 { font-size: 0.9375rem; font-weight: 600; margin-bottom: 2px; }
.basic-module-info p { font-size: 0.6875rem; opacity: 0.88; }
.basic-tools-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-content: start; }
.basic-tool-item {
  display: flex; flex-direction: row; align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--bg-card); border-radius: 10px;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s, border-color 0.2s;
  min-height: 52px;
}
.basic-tool-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.07); border-color: rgba(0,0,0,0.1); }
.basic-tool-item img { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.basic-tool-item span { font-size: 0.75rem; line-height: 1.3; font-weight: 500; color: var(--text); }

/* 画廊 */
.gallery-section { margin-bottom: 48px; }
.gallery-tabs {
  display: flex; gap: 24px; overflow-x: auto;
  padding-bottom: 0; margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.gallery-tabs::-webkit-scrollbar { display: none; }
.gallery-tab {
  flex: 0 0 auto; padding: 8px 0 12px; font-size: 0.875rem;
  color: var(--text-muted); white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.2s;
}
.gallery-tab:hover { color: var(--text); }
.gallery-tab.active {
  color: var(--text); font-weight: 600;
  border-bottom-color: var(--text);
}
.gallery-section-title {
  font-size: 1.125rem; font-weight: 600;
  margin-bottom: 16px; padding-top: 4px;
}
.gallery-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.gallery-card {
  position: relative; border-radius: 12px; overflow: hidden;
  aspect-ratio: 3 / 4; background: var(--bg-card);
  box-shadow: 0 1px 10px rgba(0,0,0,0.06);
  transition: transform 0.22s;
}
.gallery-card:hover { transform: scale(1.015); }
.gallery-card img { width: 100%; height: 100%; object-fit: cover; }
.gallery-badge {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  background: #ff6b35; color: #fff; font-size: 0.5625rem;
  padding: 2px 7px; border-radius: 4px; font-weight: 600;
}

/* 登录页 */
.auth-page { min-height: 100vh; position: relative; overflow: hidden; }
.auth-bg { position: fixed; inset: 0; z-index: 0; filter: blur(8px); transform: scale(1.05); pointer-events: none; }
.auth-bg-inner { min-height: 100vh; padding: 100px 48px; background: linear-gradient(180deg, #f8f9fc, #eef1f8); }
.auth-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 100; width: calc(100% - 48px); max-width: 440px;
  background: #fff; border-radius: 20px; padding: 40px 36px 32px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.12);
}
.auth-close { position: absolute; top: 16px; right: 20px; font-size: 1.5rem; color: #999; cursor: pointer; background: none; border: none; }
.auth-title { text-align: center; font-size: 1.375rem; font-weight: 600; margin-bottom: 28px; }
.auth-tabs { display: flex; background: #f3f4f6; border-radius: 10px; padding: 4px; margin-bottom: 24px; }
.auth-tab { flex: 1; padding: 10px; border: none; background: transparent; border-radius: 8px; font-size: 0.9375rem; color: #666; cursor: pointer; }
.auth-tab.active { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.auth-panel.hidden { display: none; }
.phone-row { display: flex; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }
.country-code { padding: 14px 12px; border: none; border-right: 1px solid #e5e7eb; background: #fafafa; }
.auth-input { width: 100%; padding: 14px 16px; border: 1px solid #e5e7eb; border-radius: 10px; font-size: 0.9375rem; }
.phone-row .auth-input { flex: 1; border: none; border-radius: 0; }
.auth-submit { width: 100%; margin-top: 24px; padding: 14px; background: #2d2a26; color: #fff; border: none; border-radius: 10px; font-size: 1rem; cursor: pointer; }
.auth-terms { margin-top: 20px; text-align: center; font-size: 0.75rem; color: #999; }
.auth-terms a { color: #4a69dd; }

/* 创作工作台 */
.workspace { max-width: 1100px; margin: 0 auto; padding: 24px; }
.workspace-header { margin-bottom: 32px; }
.back-link { color: var(--text-muted); font-size: 0.875rem; }
.workspace-body { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.upload-zone { border: 2px dashed var(--border); border-radius: 16px; padding: 48px 24px; text-align: center; cursor: pointer; }
.upload-zone input { display: none; }
.upload-icon { font-size: 2.5rem; margin-bottom: 12px; }
.upload-title { font-weight: 500; margin-bottom: 8px; }
.upload-hint { font-size: 0.8125rem; color: var(--text-muted); }
.preview-box, .result-box {
  min-height: 200px; border-radius: 16px; background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; margin-bottom: 16px; border: 1px solid var(--border);
}
.preview-placeholder { color: var(--text-muted); font-size: 0.875rem; }
.btn-generate {
  width: 100%; padding: 14px; background: var(--btn-gradient); color: #fff;
  border: none; border-radius: 10px; font-size: 1rem; cursor: pointer; font-weight: 500;
}
.coin-badge { margin-left: 8px; font-size: 0.8125rem; opacity: 0.9; }
.workspace-result h3 { font-size: 1rem; margin-bottom: 16px; }
.workspace-header h1 { font-size: 1.75rem; margin: 12px 0 8px; }
.workspace-desc { color: var(--text-muted); font-size: 0.9375rem; }

@media (max-width: 1200px) {
  .gallery-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1024px) {
  .hero-track { grid-template-columns: 1fr; }
  .basic-tools-layout { grid-template-columns: 1fr; }
  .basic-modules { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
}
@media (max-width: 768px) {
  .site-sidebar { display: none; }
  .site-header { left: 0; padding: 0 16px; }
  .site-main { margin-left: 0; }
  .basic-tools-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
