/* =================================================================
 * 来图 v0.2 · UI v2（小红书底色 + Apple 质感）
 * 设计原则：
 *   - 大圆角 / 软阴影 / 渐变点缀
 *   - 字号节奏清晰，按钮系统收敛
 *   - 全局微动效（按下回弹、卡片浮起、弹窗滑入）
 *   - 不改 HTML 架构，不改业务 JS
 * ================================================================= */

/* ---------- 1. Design Tokens ---------- */
:root {
  /* 主色：粉红（小红书红基础上往粉偏 ~8°） */
  --color-primary: #ff4577;
  --color-primary-dark: #e63468;
  --color-primary-light: #ff80a0;
  --color-primary-tint: #fff2f6;
  --color-primary-tint-2: #ffe4ec;

  /* 强调色：金色（点数/奖励） */
  --color-accent: #ffb800;
  --color-accent-tint: #fff8e1;

  /* 状态色 */
  --color-success: #20bd6e;
  --color-success-tint: #e6f9ef;
  --color-warning: #ff8a3d;
  --color-warning-tint: #fff1e6;
  --color-danger: #ff4577;
  --color-danger-tint: #fff2f6;
  --color-info: #3d7fff;

  /* 中性色 */
  --color-text-strong: #1d1d1f;
  --color-text: #353539;
  --color-text-muted: #86868b;
  --color-text-faint: #b4b4b8;
  --color-text-on-primary: #ffffff;

  --color-bg: #f5f5f7;
  --color-bg-elevated: #ffffff;
  --color-bg-alt: #fafafa;
  --color-border: #e7e7ea;
  --color-border-faint: #f0f0f2;
  --color-divider: #ebebed;

  /* 渐变（用于 banner、品牌点缀） */
  --gradient-primary: linear-gradient(135deg, #ff5b8a 0%, #ffaccc 100%);
  --gradient-primary-soft: linear-gradient(135deg, #ffe4ec 0%, #fff5e6 100%);
  --gradient-gold: linear-gradient(135deg, #ffd54f 0%, #ffb800 100%);
  --gradient-bg-top: linear-gradient(180deg, #fff2f6 0%, #f5f5f7 220px);

  /* 间距尺度 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;

  /* 圆角 */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(20, 20, 30, 0.04);
  --shadow-sm: 0 2px 8px rgba(20, 20, 30, 0.05);
  --shadow-md: 0 4px 16px rgba(20, 20, 30, 0.07);
  --shadow-lg: 0 8px 28px rgba(20, 20, 30, 0.10);
  --shadow-xl: 0 16px 48px rgba(20, 20, 30, 0.14);
  --shadow-primary: 0 6px 20px rgba(255, 69, 119, 0.30);
  --shadow-gold: 0 4px 14px rgba(255, 184, 0, 0.30);

  /* 字号 */
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 28px;
  --text-4xl: 32px;

  /* 缓动 */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --transition-fast: 0.15s var(--ease-out);
  --transition-base: 0.22s var(--ease-out);
  --transition-slow: 0.4s var(--ease-out);

  --tabbar-height: 72px;
}

/* ---------- 2. Reset / Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

body {
  min-height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  color: var(--color-text-strong);
  line-height: 1.3;
}

h1 { font-size: var(--text-3xl); font-weight: 700; }
h2 { font-size: var(--text-2xl); font-weight: 700; }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-md); }

p {
  margin: 0;
  color: var(--color-text);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}
a:hover { opacity: 0.7; }
a:active { opacity: 0.55; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--transition-fast), background-color var(--transition-fast),
    color var(--transition-fast), box-shadow var(--transition-fast),
    opacity var(--transition-fast), border-color var(--transition-fast);
}
button:active:not(:disabled) {
  transform: scale(0.97);
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

input, textarea, select {
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  color: var(--color-text-strong);
  border-radius: var(--radius-md);
  padding: 0 14px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-tint);
}
input::placeholder { color: var(--color-text-faint); }

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

img { display: block; max-width: 100%; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--color-divider); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-faint); }

.hidden { display: none !important; }

/* ---------- 3. Layout ---------- */
.app-shell {
  width: min(100%, 420px);
  height: 100%;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  margin: 0 auto;
  background: var(--gradient-bg-top), var(--color-bg);
  background-blend-mode: normal;
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: var(--space-3);
  align-items: center;
  padding: 14px var(--space-4) 10px;
  background: transparent;
  position: relative;
  z-index: 10;
}

.logo-box {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.logo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-header p {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}
.app-header h1 {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text-strong);
  letter-spacing: -0.01em;
}

.app-header > div:nth-of-type(2) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}

.app-header > button {
  transform: none;
}

.points-entry {
  padding: 0 var(--space-3);
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--gradient-gold);
  color: #5b3a00;
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-gold);
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.02em;
}
.points-entry::before {
  content: "✦";
  margin-right: 4px;
  font-size: 12px;
}
.points-entry:hover { transform: translateY(-1px); }

/* Main scroll */
main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: var(--space-3) var(--space-4) var(--space-4);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.screen {
  display: none;
  animation: screen-fade-in 0.32s var(--ease-out);
}
.screen.active { display: block; }

@keyframes screen-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tabbar */
.tabbar {
  flex-shrink: 0;
  width: 100%;
  min-height: var(--tabbar-height);
  padding-bottom: env(safe-area-inset-bottom, 0);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--color-border-faint);
  z-index: 50;
}
.tabbar button {
  flex: 1;
  position: relative;
  padding-top: 14px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
}
.tabbar button::before {
  content: "";
  width: 22px;
  height: 22px;
  background: currentColor;
  -webkit-mask: var(--icon, none) center / contain no-repeat;
  mask: var(--icon, none) center / contain no-repeat;
  transition: transform var(--transition-base);
}
.tabbar button[data-tab="home"] {
  --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M3 11l9-7 9 7v9a2 2 0 0 1-2 2h-4a1 1 0 0 1-1-1v-5h-4v5a1 1 0 0 1-1 1H5a2 2 0 0 1-2-2z'/></svg>");
}
.tabbar button[data-tab="mine"] {
  --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='8' r='4'/><path d='M4 21a8 8 0 0 1 16 0'/></svg>");
}
.tabbar button.active {
  color: var(--color-primary);
  font-weight: 600;
}
.tabbar button.active::before {
  transform: scale(1.05);
}
.tabbar button.active::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
}

/* Page head */
.page-head {
  margin: var(--space-2) 0 var(--space-4);
  padding: 0 var(--space-1);
}
.page-head h2 {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text-strong);
}
.page-head p {
  margin-bottom: 4px;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ---------- 4. Card primitive ---------- */
.wire-card {
  margin-bottom: var(--space-3);
  padding: var(--space-4);
  background: var(--color-bg-elevated);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.wire-card h3 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-text-strong);
}
.wire-card p {
  font-size: var(--text-base);
  color: var(--color-text);
  margin: 0;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.section-title h3 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
}
.section-title > button {
  height: 30px;
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  background: transparent;
}
.section-title > button:hover {
  color: var(--color-primary);
  background: var(--color-primary-tint);
}

/* ---------- 5. Button System ---------- */
/* 默认按钮 = ghost/secondary */
.action-row button,
.modal button:not([data-close]):not(.primary-action):not(.ghost-share-btn):not(.logout-btn-v2):not(.points-log-tabs button):not(.points-log-close):not(.purchase-package-list button),
.wire-card > button {
  height: 44px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-primary);
}
.action-row button:hover:not(:disabled),
.modal button:not([data-close]):not(.primary-action):not(.ghost-share-btn):not(.logout-btn-v2):not(.points-log-tabs button):not(.points-log-close):not(.purchase-package-list button):hover:not(:disabled),
.wire-card > button:hover:not(:disabled) {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255, 69, 119, 0.36);
}

.action-row {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-4);
}
.action-row button { flex: 1; }

/* Primary action (CTA) */
.primary-action {
  height: 48px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  color: var(--color-text-on-primary);
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-primary);
  position: relative;
  overflow: hidden;
}
.primary-action::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.25) 50%, transparent 100%);
  transform: translateX(-110%);
  transition: transform 0.7s var(--ease-out);
}
.primary-action:hover::after { transform: translateX(110%); }
.primary-action:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(255, 69, 119, 0.40);
}

/* Close button in section-title */
.section-title [data-close],
.section-title #generatingClose,
.section-title #payingMinimize {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-full);
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  font-size: 0;
}
.section-title [data-close]::before,
.section-title #generatingClose::before,
.section-title #payingMinimize::before {
  content: "✕";
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
}
.section-title [data-close]:hover {
  background: var(--color-divider);
  color: var(--color-text-strong);
}
.section-title #generatingClose,
.section-title #payingMinimize {
  width: auto;
  padding: 0 var(--space-3);
  height: 30px;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}
.section-title #generatingClose::before,
.section-title #payingMinimize::before {
  content: "";
}

/* ---------- 6. Home · Hero Banner ---------- */
.hero-wire {
  margin-bottom: var(--space-4);
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #fff;
  position: relative;
  overflow: visible;
  display: block;
  box-shadow: none;
  cursor: pointer;
  transition: transform var(--transition-base);
}

.hero-banner-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 750 / 300;
  min-height: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--gradient-primary);
  box-shadow: 0 8px 28px rgba(255, 91, 138, 0.32);
}

.hero-banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
}

.hero-wire:hover .hero-banner-frame {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(255, 91, 138, 0.40);
}

.hero-wire::before,
.hero-wire::after {
  content: none;
}

.hero-wire:not(.banner-image-mode) .hero-banner-frame::before {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  filter: blur(40px);
  top: -40px;
  right: -30px;
  pointer-events: none;
  z-index: 1;
}

.hero-wire:not(.banner-image-mode) .hero-banner-frame::after {
  content: "";
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 213, 79, 0.30);
  filter: blur(30px);
  bottom: -20px;
  left: -10px;
  pointer-events: none;
  z-index: 1;
}

.hero-wire:not(.banner-image-mode) .hero-banner-frame {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-5);
}

.hero-wire.banner-image-mode .hero-copy,
.hero-wire.banner-image-mode .hero-example {
  display: none !important;
}

.hero-copy {
  position: relative;
  z-index: 2;
}
.hero-wire h2 {
  margin: 0 0 6px;
  font-size: var(--text-xl);
  line-height: 1.25;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.hero-kicker {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  font-weight: 500;
}
.hero-wire p {
  margin: 0 0 var(--space-3);
  color: rgba(255, 255, 255, 0.88);
  font-size: var(--text-sm);
}
.hero-cta {
  height: 32px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-full);
  background: #fff;
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
}
.hero-cta::after {
  content: " →";
  font-weight: 400;
}
.hero-cta:hover { background: var(--color-primary-tint); }

.hero-example {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
  z-index: 2;
}
.hero-card {
  flex: 1;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.20);
  border: 1px solid rgba(255, 255, 255, 0.30);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 500;
  backdrop-filter: blur(4px);
}
.hero-flow {
  flex: 0 0 16px;
  text-align: center;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.80);
}

.hero-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  z-index: 3;
}
.hero-dots button {
  width: 6px;
  height: 6px;
  padding: 0;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.45);
  transition: width var(--transition-base), background-color var(--transition-base);
}
.hero-dots button.active {
  width: 18px;
  background: #fff;
}

/* ---------- 7. Home · Filter Card + Template List ---------- */
.filter-card {
  padding: var(--space-4) var(--space-4) var(--space-3);
}
.filter-card .section-title {
  margin-bottom: var(--space-3);
}

.chip-row,
.filter-row {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  margin: 0 calc(var(--space-4) * -1) 0;
  padding: 0 var(--space-4) 4px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar,
.filter-row::-webkit-scrollbar { display: none; }

.chip-row button,
.filter-row button {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-full);
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1px solid transparent;
}
.chip-row button.active,
.filter-row button.active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(255, 69, 119, 0.32);
}
.chip-row button:hover:not(.active),
.filter-row button:hover:not(.active) {
  background: var(--color-primary-tint);
  color: var(--color-primary);
}

/* Template list — 小红书式两列瀑布流 */
.template-list {
  column-count: 2;
  column-gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.template-list .wire-card {
  break-inside: avoid;
  display: inline-flex;
  flex-direction: column;
  width: 100%;
  margin: 0 0 var(--space-3);
  padding: 10px;
  cursor: default;
  overflow: hidden;
  background: var(--color-bg-elevated);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.template-list .wire-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.template-list .wire-card.hidden {
  display: none;
}
.template-list .wire-card h3 {
  margin: var(--space-2) 0 4px;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text-strong);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.template-list .wire-card p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-3);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.template-list .wire-card button {
  width: 100%;
  height: 36px;
  padding: 0;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  background: var(--color-primary-tint);
  color: var(--color-primary);
  font-weight: 600;
  box-shadow: none;
  margin-top: auto;
}
.template-list .wire-card button:hover {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.template-cover {
  width: 100%;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background-color: var(--color-bg-alt);
  overflow: hidden;
  line-height: 0;
}
.template-cover img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: top;
}
.template-cover:not(:has(img)) {
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-faint);
  font-size: var(--text-sm);
  line-height: normal;
}

.template-cost {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 0;
  padding: 2px 8px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-accent-tint);
  color: #8a5e00;
  font-size: var(--text-xs);
  font-weight: 600;
  align-self: flex-start;
}
.template-cost::before {
  content: "✦";
  color: var(--color-accent);
}

.image-placeholder,
.result-placeholder,
.upload-box {
  min-height: 110px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  color: var(--color-text-faint);
  font-size: var(--text-sm);
}

/* ---------- 8. Mine · Profile Card v2 ---------- */
.profile-card-v2 {
  margin: 0 0 var(--space-3);
  padding: var(--space-5);
  border-radius: var(--radius-xl);
  background: var(--color-bg-elevated);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.profile-card-v2::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--gradient-primary);
  opacity: 0.08;
  pointer-events: none;
}

.profile-head-v2 {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  position: relative;
  z-index: 1;
}

.avatar-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: var(--text-xl);
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: var(--shadow-primary);
  letter-spacing: 0;
}

.profile-summary-v2 {
  flex: 1;
  min-width: 0;
}
.profile-summary-v2 h3 {
  margin: 0 0 4px;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.points-text {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.points-text strong {
  color: var(--color-primary);
  font-size: var(--text-lg);
  font-weight: 700;
  margin: 0 2px;
  letter-spacing: -0.01em;
}

.profile-info-list {
  position: relative;
  z-index: 1;
}
.profile-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border-faint);
  font-size: var(--text-base);
}
.profile-info-row:last-of-type { border-bottom: none; }
.profile-info-row[data-mine-action] {
  cursor: pointer;
  margin: 0 calc(var(--space-2) * -1);
  padding-left: var(--space-2);
  padding-right: var(--space-2);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}
.profile-info-row[data-mine-action]:hover {
  background: var(--color-bg-alt);
}
.profile-info-row[data-mine-action]:active {
  background: var(--color-divider);
}
.info-label {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  font-weight: 500;
}
.info-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-strong);
  font-weight: 500;
}
.info-icon {
  color: var(--color-primary);
  font-size: 13px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-primary-tint);
}

.invite-banner {
  margin: var(--space-3) 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--color-primary);
  background: linear-gradient(90deg, var(--color-primary-tint) 0%, transparent 100%);
  color: var(--color-primary-dark);
  font-size: var(--text-sm);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  line-height: 1.55;
}
.invite-banner strong {
  color: var(--color-primary);
  font-weight: 700;
}

.profile-actions-row {
  margin-top: var(--space-3);
  display: flex;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
}
.ghost-share-btn {
  height: 32px;
  padding: 0 var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-tint);
  border-radius: var(--radius-full);
  border: none;
}
.ghost-share-btn:hover {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

/* Login prompt card */
.login-prompt {
  text-align: center;
  padding: var(--space-6) var(--space-5);
}
.login-prompt h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
}
.login-prompt p {
  margin: 0 0 var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ---------- 9. Point Packages ----------
 * 渲染结构（app.js）：
 *   <article class="point-package">
 *     <div class="package-art">10点</div>            <- 大号点数
 *     <div>
 *       <h4>10点=40元</h4>                            <- 隐藏
 *       <p>4元1张</p>                                  <- 单价（小字）
 *       <strong>日常套餐</strong>                       <- 价格主标（醒目）
 *     </div>
 *     <button>去购买</button>
 *   </article>
 * 注意：app.js 中 strong 文本是「日常套餐」这种名称，不是金额，所以这里把 h4 提取出金额展示
 */
.point-packages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}
.point-package {
  background: var(--color-bg-alt);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-2);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
}
.point-package:hover {
  border-color: var(--color-primary-light);
  background: var(--color-primary-tint);
  transform: translateY(-2px);
}
/* 大号「N点」字样 */
.point-package .package-art {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text-strong);
  letter-spacing: -0.02em;
  line-height: 1.1;
  background: none;
  width: auto;
  height: auto;
  padding: 0;
  border: none;
  display: block;
}
.point-package .package-art::after {
  content: "";
}
.point-package > div:not(.package-art) {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
/* h4 包含「N点=M元」，提取金额展示 */
.point-package h4 {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--color-primary);
}
/* 把 h4 文本通过 CSS 替换处理：实际上 h4 的「10点=40元」我们整体显示 */
.point-package p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 0;
}
.point-package strong {
  display: none;
}
.point-package button {
  width: 100%;
  height: 30px;
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  margin-top: 6px;
  box-shadow: none;
}
.point-package button:hover { background: var(--color-primary-dark); }
/* 中间一个高亮为「热门」 */
.point-package:nth-child(2) {
  border-color: var(--color-primary);
  background: var(--color-bg-elevated);
  box-shadow: var(--shadow-primary);
}
.point-package:nth-child(2)::before {
  content: "热门";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: var(--gradient-gold);
  color: #5b3a00;
  font-size: var(--text-xs);
  font-weight: 700;
  box-shadow: var(--shadow-gold);
  white-space: nowrap;
}

/* ---------- 10. Records ---------- */
.record-hint {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-3);
  padding: 8px 12px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
}
.record-hint strong { color: var(--color-primary); font-weight: 600; }

.record-list { display: flex; flex-direction: column; gap: var(--space-3); }

.empty-record-v2 {
  padding: var(--space-7) var(--space-3);
  text-align: center;
  color: var(--color-text-muted);
}
.empty-icon-box {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-3);
  border-radius: var(--radius-md);
  background: var(--gradient-primary-soft);
  display: grid;
  place-items: center;
  font-size: 0;
  position: relative;
}
.empty-icon-box::before {
  content: "";
  width: 32px;
  height: 32px;
  background: var(--color-primary);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='6' width='18' height='14' rx='2'/><circle cx='12' cy='13' r='3'/><path d='M9 6l1.5-2h3L15 6'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='6' width='18' height='14' rx='2'/><circle cx='12' cy='13' r='3'/><path d='M9 6l1.5-2h3L15 6'/></svg>") center / contain no-repeat;
  opacity: 0.6;
}
.empty-title {
  margin: 0 0 4px;
  color: var(--color-text);
  font-size: var(--text-base);
  font-weight: 500;
}
.empty-hint {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-faint);
}

.record-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
}
.record-thumb {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-divider);
  display: grid;
  place-items: center;
  color: var(--color-text-faint);
  font-size: var(--text-xs);
}
.record-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.record-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}
.record-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}
.record-title-row strong {
  font-size: var(--text-base);
  color: var(--color-text-strong);
  font-weight: 600;
}
.record-status {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.record-success .record-status { background: var(--color-success-tint); color: var(--color-success); }
.record-generating .record-status { background: var(--color-warning-tint); color: var(--color-warning); }
.record-failed .record-status,
.record-refunded .record-status { background: var(--color-danger-tint); color: var(--color-danger); }

.record-meta {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}
.record-hint-inline {
  margin: 4px 0 0;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.record-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--color-success-tint);
  color: var(--color-success);
  font-size: 10px;
  font-weight: 600;
}
.record-actions {
  display: flex;
  gap: 6px;
  margin-top: var(--space-2);
}
.record-actions button {
  height: 28px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: var(--text-xs);
  font-weight: 500;
}
.record-actions button:not(:disabled):hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-tint);
}

/* ---------- 11. Compliance / Legal / Footer ---------- */
.compliance-card .compliance-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: 4px;
}
.compliance-list li {
  font-size: var(--text-sm);
  color: var(--color-text);
  padding-left: var(--space-4);
  position: relative;
  line-height: 1.6;
}
.compliance-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-success);
  font-weight: 700;
}
.compliance-list a { color: var(--color-primary); }

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin: var(--space-4) 0 var(--space-3);
  padding: 0 var(--space-2);
  justify-content: center;
}
.legal-links a {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.legal-links a:hover { color: var(--color-primary); }

.logout-area {
  margin: var(--space-2) 0 var(--space-4);
  display: flex;
  justify-content: center;
}
.logout-btn-v2 {
  min-width: 140px;
  height: 40px;
  padding: 0 var(--space-5);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
}
.logout-btn-v2:hover {
  color: var(--color-danger);
  border-color: var(--color-danger);
  background: var(--color-danger-tint);
}

.site-foot {
  margin-top: var(--space-3);
  padding: var(--space-3) 0;
  text-align: center;
  color: var(--color-text-faint);
}
.site-foot p {
  margin: 2px 0;
  font-size: 10px;
  color: var(--color-text-faint);
}

/* ---------- 12. Modals ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  background: rgba(20, 20, 30, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: flex-end;
  justify-content: center;
  animation: modal-fade 0.22s var(--ease-out);
}
.modal.active { display: flex; }

@keyframes modal-fade {
  from { background-color: rgba(20, 20, 30, 0); backdrop-filter: blur(0); }
  to { background-color: rgba(20, 20, 30, 0.45); backdrop-filter: blur(6px); }
}

.modal-panel {
  width: 100%;
  max-width: 420px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--color-bg-elevated);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  padding: var(--space-5) var(--space-5) calc(var(--space-5) + env(safe-area-inset-bottom, 0));
  box-shadow: 0 -8px 32px rgba(20, 20, 30, 0.12);
  animation: modal-slide-up 0.32s var(--ease-spring);
  position: relative;
}

@keyframes modal-slide-up {
  from { transform: translateY(40%); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-panel::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-divider);
}
.modal-panel .section-title {
  margin-top: var(--space-2);
  margin-bottom: var(--space-4);
}
.modal-panel .section-title h3 {
  font-size: var(--text-lg);
  font-weight: 700;
}
.modal-panel > p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

/* Modal field */
.modal-field {
  display: block;
  margin-bottom: var(--space-3);
}
.modal-field > input {
  width: 100%;
  height: 44px;
  margin-top: 6px;
}
.modal-field .field-hint {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

/* Code row (sms code + send button) */
.code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2);
  margin-top: 6px;
}
.code-row input { height: 44px; }
.code-row button {
  height: 44px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-primary-tint);
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  box-shadow: none;
}
.code-row button:hover:not(:disabled) {
  background: var(--color-primary);
  color: #fff;
}

/* Modal labels (legacy form) */
.modal label {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Upload modal */
.preview-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-2);
}
.preview-note strong {
  color: var(--color-text-strong);
  font-weight: 600;
}

.upload-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  cursor: pointer;
  margin: var(--space-2) 0;
  transition: all var(--transition-base);
}
.upload-drop input { display: none; }
.upload-drop:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-tint);
  color: var(--color-primary);
}

.confirm-line {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.55;
  margin: var(--space-3) 0;
  cursor: pointer;
}
.confirm-line input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  padding: 0;
  border-radius: var(--radius-xs);
  accent-color: var(--color-primary);
}
.upload-auth-line {
  padding: 12px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
}

/* Generating modal */
.generating-panel { text-align: center; }
.generating-illu {
  padding: var(--space-5) 0 var(--space-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}
.generating-spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--color-primary), var(--color-primary-light), var(--color-primary));
  -webkit-mask: radial-gradient(circle, transparent 55%, black 56%);
  mask: radial-gradient(circle, transparent 55%, black 56%);
  animation: spinner-rotate 0.9s linear infinite;
}
@keyframes spinner-rotate {
  to { transform: rotate(360deg); }
}
.generating-illu p {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text-strong);
}

.progress-track {
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-divider);
  overflow: hidden;
  margin: var(--space-3) 0 var(--space-2);
}
.progress-fill {
  width: 0%;
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 0.4s var(--ease-out);
}

.generating-hint {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.55;
}
.generating-error {
  font-size: var(--text-sm);
  color: var(--color-danger);
  margin: var(--space-2) 0 0;
  padding: 10px 12px;
  background: var(--color-danger-tint);
  border-radius: var(--radius-sm);
}

/* Result modal */
.result-placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  min-height: 0;
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  color: var(--color-text-faint);
}
.result-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.result-placeholder.has-image #resultTemplateName {
  display: none;
}
.result-placeholder.image-error #resultTemplateName {
  display: block;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  padding: var(--space-4);
  text-align: center;
}
.ai-watermark {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  backdrop-filter: blur(4px);
  z-index: 2;
}

.share-card {
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--gradient-primary-soft);
}
.share-card h4 {
  margin: 0 0 4px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-strong);
}
.share-card h4 strong { color: var(--color-primary); }
.share-tip {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 0;
}

/* Purchase modal */
.purchase-hero {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--gradient-primary-soft);
  margin-bottom: var(--space-3);
  text-align: center;
}
.purchase-hero #purchaseContext {
  margin: 0 0 var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}
.purchase-hero #purchaseSummary {
  display: block;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text-strong);
  margin-bottom: var(--space-1);
}
.purchase-unit-price {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.purchase-benefits {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  flex-wrap: wrap;
}
.purchase-benefits span {
  font-size: var(--text-xs);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.6);
  color: var(--color-text);
}

.purchase-package-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.purchase-package-list button {
  width: 100%;
  min-height: 56px;
  height: auto;
  padding: 12px var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  border: 2px solid transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-base);
  color: var(--color-text);
  box-shadow: none;
  transform: none;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.purchase-package-list button:hover {
  background: #fff;
  border-color: rgba(255, 91, 138, 0.28);
  transform: none;
  box-shadow: none;
}
.purchase-package-list button strong {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--color-text-strong);
  text-align: left;
  white-space: nowrap;
}
.purchase-package-list button span {
  flex: 0 0 auto;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: right;
  white-space: nowrap;
}
.purchase-package-list button.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-primary);
}
.purchase-package-list button.active strong,
.purchase-package-list button.active span {
  color: #fff;
}
.purchase-package-list button.active:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.notice-card {
  margin: var(--space-2) 0;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.notice-card summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--color-text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notice-card summary::after {
  content: "›";
  transform: rotate(90deg);
  transition: transform var(--transition-base);
  font-size: var(--text-lg);
  color: var(--color-text-muted);
}
.notice-card[open] summary::after { transform: rotate(-90deg); }
.notice-card[open] summary { margin-bottom: var(--space-2); }
.notice-card p { margin: 0; line-height: 1.6; }

.payment-status {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: var(--space-3) 0;
  text-align: center;
}

/* Preview modal */
.large-preview {
  width: 100%;
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  overflow: hidden;
}
.large-preview img {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  display: block;
  border-radius: var(--radius-md);
}
.large-preview img[src=""] {
  display: none;
}
#previewPlaceholder {
  color: var(--color-text-faint);
  font-size: var(--text-sm);
}

/* ---------- 13. Points Log ---------- */
.points-log-panel {
  padding-top: calc(var(--space-4) + env(safe-area-inset-top, 0));
  display: flex;
  flex-direction: column;
  height: min(70vh, calc(100vh - 120px));
  max-height: min(70vh, calc(100vh - 120px));
  overflow: hidden;
}

.points-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin: var(--space-2) 0 var(--space-4);
}

.points-log-head h3 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text-strong);
}

.points-log-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  font-size: 22px;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
}

.points-log-close:hover {
  background: var(--color-primary-tint);
  color: var(--color-primary);
  transform: none;
  box-shadow: none;
}

.points-log-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  margin-bottom: var(--space-4);
  border-radius: var(--radius-full);
  background: var(--color-bg-alt);
}

.points-log-tabs button {
  height: 34px;
  padding: 0 8px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
  box-shadow: none;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}

.points-log-tabs button:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.72);
  transform: none;
  box-shadow: none;
}

.points-log-tabs button.active {
  background: #fff;
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.points-log-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border-top: 1px solid var(--color-border);
  -webkit-overflow-scrolling: touch;
}

.points-log-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
}

.points-log-item:last-child {
  border-bottom: none;
}

.log-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.log-type-label {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text-strong);
}

.log-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.log-date {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.log-delta {
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1.2;
  padding-top: 2px;
}

.log-positive {
  color: #18a058;
}

.log-negative {
  color: #e5484d;
}

.log-empty {
  min-height: 220px;
  padding: var(--space-6) var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-text-faint);
  font-size: var(--text-sm);
}

/* ---------- 14. Toast ---------- */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 40px));
  z-index: 1000;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  background: rgba(20, 20, 30, 0.92);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  pointer-events: none;
  transition: transform 0.28s var(--ease-spring), opacity 0.28s ease;
  opacity: 0;
  white-space: nowrap;
  max-width: calc(100% - 48px);
  backdrop-filter: blur(8px);
  text-align: center;
}
.toast.active {
  transform: translate(-50%, -50%);
  opacity: 1;
}

/* ---------- 14. Misc legacy compat / cleanup ---------- */
/* Hide v1 leftovers that we don't want anymore */
.profile-title-row,
.icon-toggle,
.profile-detail,
.profile-card.login-card {
  /* legacy classes still referenced in some places — keep them off-screen if used */
}

.share-card p { color: var(--color-text-muted); }

/* package-art (legacy decorative box inside .point-package) — hide cleanly */
.point-package .package-art { display: none; }

/* Inputs inside .form-card and legacy profile-card */
.form-card input,
.profile-card input {
  min-height: 44px;
  border-radius: var(--radius-md);
  padding: 0 14px;
}

/* ---------- 15. Page background polish ---------- */
#home {
  /* slight gradient stripe behind hero */
}
#mine {
  padding-top: var(--space-1);
}

/* ---------- 16. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 17. Wider phones / iPad mini compat ---------- */
@media (min-width: 480px) {
  .app-shell {
    margin-top: 16px;
    margin-bottom: 16px;
    height: calc(100% - 32px);
    min-height: calc(100vh - 32px);
    min-height: calc(100svh - 32px);
    min-height: calc(100dvh - 32px);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
  }
}
