/* 灵感成图 H5：梦幻紫蓝渐变移动版 */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --primary: #6f4df7;
  --blue: #4a7dff;
  --gradient: linear-gradient(120deg, #7b4cf0 0%, #4a7dff 100%);
  --ink: #2c2545;
  --muted: #8b879c;
  --bg: #f7f4ff;
}
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.6; }
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
img { display: block; max-width: 100%; }

/* 顶部品牌栏 */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: 58px; padding: 0 16px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(14px);
  box-shadow: 0 2px 14px rgba(93,66,168,.06);
}
.brand { width: 118px; }
.login-btn { border: none; background: var(--gradient); color: #fff; font-size: 12px; font-weight: 600; padding: 8px 16px; border-radius: 999px; box-shadow: 0 5px 14px rgba(111,77,247,.28); cursor: pointer; }

/* 视图切换 */
.view { display: none; padding: 16px; }
.view.active { display: block; }

/* 搜索 */
.search-bar { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 999px; padding: 10px 16px; box-shadow: 0 5px 18px rgba(93,66,168,.08); }
.search-icon { font-size: 20px; color: #b4aec6; }
.search-bar input { flex: 1; border: none; outline: none; font-size: 13px; color: var(--ink); background: transparent; }
.search-bar input::placeholder { color: #b4aec6; }

/* 活动横幅 */
.banner { position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 16px; border-radius: 18px; background: var(--gradient); box-shadow: 0 10px 24px rgba(111,77,247,.24); cursor: pointer; }
.banner::before { content: ''; position: absolute; width: 130px; height: 130px; border-radius: 50%; top: -75px; left: -30px; background: rgba(255,255,255,.17); }
.banner-star { position: relative; font-size: 26px; color: #fff; }
.banner-copy { position: relative; flex: 1; min-width: 0; }
.banner-title { font-size: 13px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner-sub { font-size: 11px; color: rgba(255,255,255,.82); }
.banner-btn { position: relative; background: #fff; color: var(--primary); font-size: 11px; font-weight: 700; padding: 6px 13px; border-radius: 999px; white-space: nowrap; }

/* 分类标签 */
.tag-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 16px 0 4px; scrollbar-width: none; }
.tag-scroll::-webkit-scrollbar { display: none; }
.filter-tag { flex: 0 0 auto; padding: 7px 16px; border-radius: 999px; background: #fff; border: 1px solid #e8e2f8; color: #6b6580; font-size: 12px; cursor: pointer; white-space: nowrap; }
.filter-tag.active { background: var(--gradient); color: #fff; border-color: transparent; box-shadow: 0 5px 14px rgba(111,77,247,.22); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 0 12px; }
.section-head h2 { font-size: 19px; font-weight: 800; }
.section-head span { font-size: 11px; color: #a5a0b5; }

/* 双列瀑布流 */
.waterfall { columns: 2; column-gap: 12px; }
.idea-card { break-inside: avoid; background: #fff; border-radius: 16px; overflow: hidden; margin-bottom: 12px; box-shadow: 0 6px 20px rgba(93,66,168,.09); cursor: pointer; }
.idea-image-wrap { position: relative; }
.idea-image { width: 100%; display: block; background: #efeaff; }
.idea-image-tag { position: absolute; left: 8px; top: 8px; background: rgba(28,20,56,.52); color: #fff; font-size: 10px; padding: 4px 9px; border-radius: 999px; }
.idea-body { padding: 10px 11px 12px; }
.idea-content { font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
.idea-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; }
.idea-status { font-size: 10px; padding: 3px 8px; border-radius: 999px; }
.status-pending { background: #fff6e6; color: #d48806; }
.status-generating { background: #e9f0ff; color: #4a7dff; }
.status-generated { background: #e9f9f0; color: #14a85c; }
.status-failed { background: #fff0f2; color: #f54b76; }
.idea-time { font-size: 10px; color: #a5a0b5; }

.empty-state { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-emoji { font-size: 54px; margin-bottom: 12px; }
.empty-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.empty-desc { font-size: 12px; color: #a5a0b5; margin-top: 6px; }

/* 创作页 */
.card { background: #fff; border-radius: 18px; padding: 18px; margin-bottom: 14px; box-shadow: 0 6px 20px rgba(93,66,168,.08); }
.field-label { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
#ideaContent { width: 100%; min-height: 150px; border: none; outline: none; resize: vertical; background: #f7f4ff; border-radius: 14px; padding: 14px; font-size: 14px; color: var(--ink); font-family: inherit; }
#ideaTags { width: 100%; border: none; outline: none; background: #f7f4ff; border-radius: 14px; padding: 12px 14px; font-size: 13px; }
.char-count { text-align: right; font-size: 11px; color: #b4aec6; margin-top: 6px; }
.primary-btn { width: 100%; border: none; border-radius: 999px; padding: 14px; background: var(--gradient); color: #fff; font-size: 15px; font-weight: 700; box-shadow: 0 10px 22px rgba(111,77,247,.26); cursor: pointer; }
.primary-btn.small { width: auto; padding: 10px 20px; font-size: 13px; }
.primary-btn:disabled { background: #ddd8ea; box-shadow: none; }
.create-tip { text-align: center; font-size: 11px; color: #a5a0b5; margin-top: 14px; }
.create-tip-top { text-align: left; margin: 0 2px 12px; padding: 12px 16px; background: #f1edff; border-radius: 14px; color: #6f6a85; font-size: 12px; line-height: 1.6; }

/* 我的 */
.profile-card { display: flex; align-items: center; gap: 14px; padding: 22px; border-radius: 20px; background: var(--gradient); color: #fff; box-shadow: 0 12px 26px rgba(111,77,247,.24); }
.avatar { width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.22); border: 2px solid rgba(255,255,255,.45); display: flex; align-items: center; justify-content: center; font-size: 26px; }
.nickname { font-size: 18px; font-weight: 700; }
.user-id { font-size: 10px; color: rgba(255,255,255,.76); word-break: break-all; }
.stats-card { display: flex; text-align: center; }
.stat { flex: 1; }
.stat strong { display: block; font-size: 22px; color: var(--primary); }
.stat span { font-size: 11px; color: var(--muted); }
.menu-card { padding: 0; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid #f2eefc; font-size: 14px; cursor: pointer; }
.menu-item:last-child { border-bottom: none; }
.menu-item em { margin-left: auto; font-style: normal; color: #c9c3d8; }
.brand-area { display: flex; justify-content: center; padding-top: 16px; }
.brand-area img { width: 180px; opacity: .9; }
.footer-text { text-align: center; font-size: 11px; color: #b4aec6; padding: 12px 0 20px; }

/* 底部导航 */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto; height: calc(62px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: flex; align-items: center; justify-content: space-around; background: rgba(255,255,255,.97); box-shadow: 0 -5px 22px rgba(93,66,168,.10); z-index: 60; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #9a9aa8; cursor: pointer; }
.tab span { font-size: 20px; filter: grayscale(1); opacity: .6; }
.tab small { font-size: 10px; }
.tab.active span { filter: none; opacity: 1; }
.tab.active small { color: var(--primary); font-weight: 700; }
.tab.create { flex: 0 0 76px; }
.tab.create span { width: 50px; height: 50px; margin-top: -20px; border-radius: 50%; background: linear-gradient(135deg, #7b4cf0 0%, #f06bb0 100%); color: #fff; font-size: 24px; display: flex; align-items: center; justify-content: center; filter: none; opacity: 1; border: 4px solid #fff; box-shadow: 0 7px 18px rgba(111,77,247,.38); }

/* 详情弹窗 */
.modal { display: none; position: fixed; inset: 0; z-index: 100; }
.modal.show { display: block; }
.modal-mask { position: absolute; inset: 0; background: rgba(28,20,56,.5); }
.modal-body { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 480px; background: #fff; border-radius: 22px 22px 0 0; padding: 20px; max-height: 82vh; overflow-y: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-head h3 { font-size: 17px; }
.modal-head span { font-size: 18px; color: #a5a0b5; cursor: pointer; }
.modal-status { margin-bottom: 10px; }
.modal-content { font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.modal-image { width: 100%; border-radius: 14px; margin-top: 14px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.ghost-btn { border: 1px solid #e8e2f8; background: #fff; color: #a5a0b5; border-radius: 999px; cursor: pointer; }
.ghost-btn.small { padding: 10px 20px; font-size: 13px; }

.toast { position: fixed; top: 72px; left: 50%; transform: translateX(-50%) translateY(-12px); background: rgba(28,20,56,.9); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 200; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
