/**
 * css/style.css - v2.0 (Apple Liquid Glass, Hero Capsule, Transparent Mode)
 */

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  background-color: #090b10;
  color: #ffffff;
  padding: calc(14px + var(--safe-top)) 16px calc(36px + var(--safe-bottom)) 16px;
  line-height: 1.4;
  user-select: none;
}

/* ================= 1. Glassmorphism Utilities ================= */
.glass-panel {
  background: rgba(14, 18, 30, 0.65);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  transition: all 0.25s ease;
}

.glass-btn {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  color: #ffffff;
  font-weight: 700;
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.glass-btn:active {
  transform: scale(0.97);
}

.glass-btn-primary {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.12) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), inset 0 1px 1px #ffffff;
}

/* ================= 2. Preview Frame ================= */
.preview-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.card-scale-box {
  width: 100%;
  max-width: 480px;
  position: relative;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  transition: height 0.15s ease-out;
}

.card-node {
  width: 1080px;
  min-height: 675px;
  height: auto;
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  border-radius: 40px;
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  overflow: hidden;
}

/* ================= 3. Apple-Grade Liquid Glass Presets ================= */
/* Preset 0: Apple Frosted Glass (通透温润，低饱和纯正磨砂) */
.mesh-frost {
  background: #11141c;
}
.ambient-frost-layer {
  position: absolute;
  top: -30%;
  left: -30%;
  width: 160%;
  height: 160%;
  object-fit: cover;
  filter: blur(85px) saturate(1.2) brightness(0.65);
  opacity: 0.85;
  z-index: 1;
  pointer-events: none;
}

/* Preset 1: Apple Liquid Prism (高折射棱镜流体玻璃) */
.mesh-liquid-prism {
  background: radial-gradient(at 10% 10%, rgba(255, 255, 255, 0.15) 0px, transparent 40%),
              radial-gradient(at 90% 90%, rgba(0, 162, 255, 0.2) 0px, transparent 50%),
              #0c0f17;
}
.ambient-prism-layer {
  position: absolute;
  top: -30%;
  left: -30%;
  width: 160%;
  height: 160%;
  object-fit: cover;
  filter: blur(65px) saturate(1.6) brightness(0.8);
  opacity: 0.7;
  z-index: 1;
  pointer-events: none;
}

/* Other Diffuse Meshes */
.mesh-2 {
  background: radial-gradient(at 15% 15%, #00f2fe 0px, transparent 55%),
              radial-gradient(at 85% 20%, #4facfe 0px, transparent 50%),
              radial-gradient(at 50% 85%, #0044ff 0px, transparent 60%),
              #030712;
}
.mesh-3 {
  background: radial-gradient(at 20% 20%, #ff007f 0px, transparent 55%),
              radial-gradient(at 85% 30%, #ffaa00 0px, transparent 50%),
              radial-gradient(at 50% 80%, #7928ca 0px, transparent 60%),
              #0d021a;
}
.mesh-4 {
  background: radial-gradient(at 10% 20%, #00d2ff 0px, transparent 50%),
              radial-gradient(at 80% 80%, #1e3c72 0px, transparent 60%),
              radial-gradient(at 90% 20%, #2a5298 0px, transparent 50%),
              #040a17;
}
.mesh-5 {
  background: radial-gradient(at 25% 25%, #00ff87 0px, transparent 55%),
              radial-gradient(at 75% 75%, #60efff 0px, transparent 55%),
              radial-gradient(at 85% 15%, #0061ff 0px, transparent 50%),
              #01140b;
}
.mesh-6 {
  background: radial-gradient(at 20% 25%, #ff4b4b 0px, transparent 55%),
              radial-gradient(at 80% 25%, #f9d423 0px, transparent 50%),
              radial-gradient(at 50% 85%, #ff0844 0px, transparent 60%),
              #1c0408;
}
.mesh-7 {
  background: radial-gradient(at 20% 30%, #a18cd1 0px, transparent 55%),
              radial-gradient(at 80% 70%, #fbc2eb 0px, transparent 50%),
              radial-gradient(at 50% 20%, #8fd3f4 0px, transparent 55%),
              #0f0b17;
}

/* ================= 4. Card Content Layout ================= */
.card-content-top {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.card-left-pane {
  width: 530px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 500px;
}

.top-action-capsules {
  display: flex;
  align-items: center;
  gap: 22px;
}

/* 需求2: 超大醒目纯白胶囊，纯黑粗字，与姓名层级看齐 */
.capsule-badge-hero {
  padding: 10px 28px;
  border-radius: 100px;
  background: #ffffff !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.capsule-badge-hero span {
  font-size: 34px;
  font-weight: 900;
  color: #000000 !important;
  letter-spacing: -0.5px;
  line-height: 1;
}

.deco-dots-group {
  display: flex;
  gap: 8px;
}
.deco-dot-item {
  width: 13px;
  height: 13px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
}

/* 3-Row Dynamic Name Block */
.name-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 16px 0;
}

.name-first, .name-middle, .name-last {
  font-size: 52px;
  font-weight: 900;
  line-height: 1.05;
  color: #ffffff;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 个人信息双层胶囊 */
.metrics-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.metric-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 18px;
  border-radius: 18px;
  gap: 2px;
}

.pill-category {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.pill-value {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

/* 需求7: 高通透液态玻璃胶囊样式 (用户可选一键切换) */
.capsules-liquid-mode .metric-pill,
.capsules-liquid-mode .item-tag,
.capsules-liquid-mode .elastic-address-pill,
.capsules-liquid-mode .bottom-glass-box {
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(36px) saturate(220%) !important;
  -webkit-backdrop-filter: blur(36px) saturate(220%) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.42) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3), inset 0 1.5px 2px rgba(255, 255, 255, 0.6) !important;
}

.capsules-liquid-mode .pill-value,
.capsules-liquid-mode .item-tag,
.capsules-liquid-mode .elastic-address-pill span,
.capsules-liquid-mode .social-text {
  color: #ffffff !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85); /* 保证高亮通透时字迹锐利 */
}

/* 右侧相片包裹 */
.card-right-pane-wrapper {
  width: 440px;
  height: 500px;
  position: relative;
  flex-shrink: 0;
}

.portrait-photo-frame {
  width: 100%;
  height: 100%;
  border-radius: 32px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55);
}

.portrait-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.watermark-photo-inner {
  position: absolute;
  z-index: 5;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
}

.watermark-global-layer {
  position: absolute;
  z-index: 50;
  pointer-events: none;
}
.watermark-global-layer img {
  max-height: 56px;
  object-fit: contain;
}

/* ================= 5. Bottom Elastic Glass Section ================= */
.bottom-glass-box {
  position: relative;
  z-index: 2;
  margin-top: 24px;
  padding: 26px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Elastic Address */
.elastic-address-wrapper {
  display: flex;
}
.elastic-address-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  border-radius: 14px;
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  max-width: 100%;
}
.elastic-address-pill span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tag Cloud (Interests & Dislikes) */
.tags-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.section-subtitle {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.item-tag {
  padding: 6px 18px;
  border-radius: 100px;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

/* Social Grid */
.socials-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}
.socials-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 20px;
}
.social-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.social-item svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  fill: #ffffff;
}
.social-text {
  font-size: 20px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Creator Footer Group */
.creator-footer-group {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 4px;
}
.creator-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.creator-line svg {
  width: 18px;
  height: 18px;
  fill: #ffffff !important;
}
.bot-tag-line {
  font-size: 15px;
  font-weight: 600;
  color: #93c5fd;
}
.mandatory-disclaimer {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 10px;
}

/* ================= 6. Controls ================= */
.form-panel {
  padding: 22px;
}
.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  text-transform: uppercase;
}

.form-input, .form-select {
  height: 44px;
  line-height: 44px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  user-select: text !important;
}
.form-select option {
  background-color: #161b26;
  color: #ffffff;
}
.form-input:focus, .form-select:focus {
  border-color: rgba(255, 255, 255, 0.6);
}

/* 需求3: 社交账号独立标头项 */
.social-input-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.social-input-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 样式选择微缩色板 */
.style-selection-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px 8px 2px;
}

.style-thumb-btn {
  width: 58px;
  height: 54px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  overflow: hidden !important;
  isolation: isolate;
  outline: 1.5px solid rgba(255, 255, 255, 0.15);
  transition: all 0.2s ease;
}

.style-thumb-btn.active {
  outline: 2px solid #ffffff;
  box-shadow: inset 0 0 0 1.5px #ffffff;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 12px;
}

.admin-drawer-panel {
  width: 100%;
  max-width: 520px;
  max-height: 62vh;
  overflow-y: auto;
  padding: 20px;
  background: rgba(16, 21, 33, 0.92);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.7);
  border-radius: 24px;
}

.cropper-viewport {
  width: 264px;
  height: 300px;
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  background: #000;
}
