/* Annei Life Global — card.css
 * 电子贺卡（P1, 2026-08-28）：制作页表单/预览、贺卡页揭卡动效、模板皮肤、领取与分享面板。
 * 依赖 landing/style.css 的变量与基础样式；本文件只写贺卡专属样式。
 */

/* ---------- 六款模板皮肤（封面渐变 + 点缀色） ---------- */
.tpl-classic_green { --cg1: #1A5C3A; --cg2: #2E7D5B; --caccent: #E8C87A; --ctext: #FDF9F2; }
.tpl-cny           { --cg1: #A32B2B; --cg2: #C94A3A; --caccent: #F5D07A; --ctext: #FFF6E8; }
.tpl-mid_autumn    { --cg1: #1F3A5F; --cg2: #33557F; --caccent: #F0D9A0; --ctext: #F5F0E6; }
.tpl-birthday      { --cg1: #B96A75; --cg2: #D898A1; --caccent: #FBE3B8; --ctext: #FFF7F5; }
.tpl-thanks        { --cg1: #6E5A3E; --cg2: #96805C; --caccent: #EFD9A8; --ctext: #FBF6EC; }
.tpl-new_home      { --cg1: #2A5E5E; --cg2: #4C8378; --caccent: #F2DFAE; --ctext: #F4FAF7; }

/* ---------- 贺卡卡体（预览与贺卡页共用） ---------- */
.ecard {
  position: relative;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 3 / 4.3;
  border-radius: 20px;
  background: linear-gradient(160deg, var(--cg1) 0%, var(--cg2) 100%);
  color: var(--ctext);
  box-shadow: 0 14px 40px rgba(42,30,26,.22);
  overflow: hidden;
  margin: 0 auto;
  perspective: 1200px;
}
.ecard::before { /* 装饰圆 */
  content: '';
  position: absolute;
  width: 240px; height: 240px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.14);
  top: -90px; right: -70px;
}
.ecard::after {
  content: '';
  position: absolute;
  width: 130px; height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.10), transparent 70%);
  bottom: -30px; left: -40px;
}
.ecard-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 30px 26px;
  text-align: left;
}
.ecard-brand {
  font-size: 12px;
  letter-spacing: .14em;
  opacity: .8;
  margin-bottom: auto;
}
.ecard-to { font-size: 13px; opacity: .78; margin-bottom: 6px; }
.ecard-recipient {
  font-size: 27px;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-all;
  margin-bottom: 14px;
}
.ecard-message {
  font-size: 14.5px;
  line-height: 1.75;
  opacity: .95;
  min-height: 44px;
  white-space: pre-wrap;
  word-break: break-all;
  border-left: 2px solid var(--caccent);
  padding-left: 12px;
  margin-bottom: 18px;
}
.ecard-amount-row {
  margin-top: auto;
  border-top: 1px dashed rgba(255,255,255,.28);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.ecard-amount-label { font-size: 11.5px; opacity: .72; }
.ecard-amount { font-size: 30px; font-weight: 700; color: var(--caccent); line-height: 1.1; }
.ecard-amount small { font-size: 14px; font-weight: 600; margin-right: 3px; }
.ecard-from { font-size: 13px; opacity: .85; text-align: right; }

/* 封面态（未揭卡）：遮罩 + 轻触提示 */
.ecard-cover {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  background: linear-gradient(160deg, var(--cg1) 0%, var(--cg2) 100%);
  border-radius: 20px;
  transition: transform .9s cubic-bezier(.2,.8,.25,1), opacity .9s ease;
  transform-style: preserve-3d;
}
.ecard-cover .cover-seal {
  width: 74px; height: 74px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  color: var(--caccent);
  background: rgba(255,255,255,.06);
}
.ecard-cover .cover-tap { font-size: 14px; letter-spacing: .1em; opacity: .92; animation: tapPulse 2.2s ease-in-out infinite; }
.ecard-cover .cover-brand { position: absolute; top: 26px; font-size: 12px; letter-spacing: .14em; opacity: .8; }
@keyframes tapPulse { 0%,100% { opacity:.55 } 50% { opacity:1 } }
.ecard.opened .ecard-cover { transform: rotateY(178deg); opacity: 0; pointer-events: none; }

/* ---------- 制作页布局 ---------- */
.create-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 400px;
  gap: 48px;
  align-items: start;
}
.form-block { margin-bottom: 26px; }
.form-block label { display: block; font-size: 13.5px; font-weight: 600; color: var(--txt); margin-bottom: 8px; }
.form-block .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.f-input, .f-textarea, .f-select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--txt);
  font-size: 15px;
  padding: 11px 14px;
  font-family: inherit;
}
.f-input:focus, .f-textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(26,92,58,.1); }
.f-textarea { min-height: 84px; resize: vertical; }
.amount-wrap { position: relative; }
.amount-wrap .cur { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; }
.amount-wrap .f-input { padding-left: 38px; }

.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 9px; padding: 9px 18px; font-size: 14px; cursor: pointer; font-family: inherit;
}
.seg button.on { border-color: var(--gold); color: var(--gold); background: rgba(26,92,58,.08); font-weight: 600; }

.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tpl-item { cursor: pointer; border: 2px solid transparent; border-radius: 14px; overflow: hidden; padding: 0; background: none; position: relative; font-family: inherit; }
.tpl-item .mini {
  aspect-ratio: 3 / 3.6;
  border-radius: 12px;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 12px 11px;
  color: var(--ctext);
  font-size: 11px;
  text-align: left;
  background: linear-gradient(160deg, var(--cg1) 0%, var(--cg2) 100%);
}
.tpl-item .mini .m-dot { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(255,255,255,.5); margin: 0 auto; background: rgba(255,255,255,.22); }
.tpl-item .mini .m-name { font-weight: 700; font-size: 12.5px; }
.tpl-item.on { border-color: var(--gold); }
.tpl-item .tpl-name {
  display: block; font-size: 12px; color: var(--muted); margin-top: 7px; text-align: center;
}
.tpl-item.on .tpl-name { color: var(--gold); font-weight: 600; }

.btn-primary {
  display: inline-block;
  border: none; cursor: pointer; font-family: inherit;
  background: linear-gradient(135deg, var(--gold) 0%, #2E7D5B 100%);
  color: #fff; font-size: 16px; font-weight: 600;
  border-radius: 12px; padding: 14px 30px;
  box-shadow: 0 6px 18px rgba(26,92,58,.28);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary:active { transform: translateY(1px); }
.btn-primary[disabled] { opacity: .6; cursor: not-allowed; }
.form-err { color: #C0392B; font-size: 13px; margin-top: 10px; min-height: 18px; }

.preview-col { position: sticky; top: 90px; }
.preview-col .pv-title { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 16px; letter-spacing: .06em; }
.beta-strip {
  margin-top: 18px; text-align: center;
  background: var(--rose-bg); border-radius: 10px; padding: 10px 14px;
  font-size: 12.5px; color: var(--muted);
}
.gold-note {
  margin-top: 10px; text-align: left; line-height: 1.6;
  background: rgba(26,92,58,.05); border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0; padding: 8px 12px;
  font-size: 12px; color: var(--muted);
}

/* ---------- 贺卡页 ---------- */
.cardview { max-width: 480px; margin: 0 auto; padding: 40px 20px 80px; text-align: center; }
.cardview .sender-line { margin: 22px 0 6px; font-size: 17px; color: var(--txt); }
.cardview .sender-line b { color: var(--gold); }
.cardview .meta-line { font-size: 13px; color: var(--muted); margin-bottom: 26px; }

.detail-rows { text-align: left; margin: 26px auto 0; max-width: 360px; }
.detail-rows .dr { display: flex; justify-content: space-between; gap: 14px; padding: 11px 2px; border-bottom: 1px dashed var(--line); font-size: 14px; }
.detail-rows .dr .k { color: var(--muted); white-space: nowrap; }
.detail-rows .dr .v { color: var(--txt); font-weight: 600; text-align: right; word-break: break-all; }

/* 领取面板 */
.claim-panel {
  margin: 34px auto 0; max-width: 400px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px;
  box-shadow: 0 4px 18px rgba(58,46,42,.06);
}
.claim-panel h3 { font-size: 17px; color: var(--txt); margin-bottom: 4px; }
.claim-panel .cp-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.mode-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.mode-picker button {
  border: 1px solid var(--line); background: none; border-radius: 10px;
  padding: 10px 8px; font-size: 12.5px; color: var(--muted); cursor: pointer; font-family: inherit; line-height: 1.5;
}
.mode-picker button.on { border-color: var(--gold); color: var(--gold); background: rgba(26,92,58,.07); font-weight: 600; }

/* RC 码结果 */
.rc-panel {
  margin: 34px auto 0; max-width: 400px;
  background: #10241B; border-radius: 16px; padding: 26px; color: #F2EBDD;
  box-shadow: 0 10px 30px rgba(16,36,27,.35);
}
.rc-panel .rc-title { font-size: 14px; letter-spacing: .08em; color: #E8C87A; margin-bottom: 12px; }
.rc-panel .rc-code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 20px; font-weight: 700; letter-spacing: .04em;
  background: rgba(232,200,122,.12); border: 1px dashed rgba(232,200,122,.5);
  border-radius: 10px; padding: 14px 12px; word-break: break-all; user-select: all;
}
.rc-panel .rc-rows { margin: 16px 0 4px; }
.rc-panel .rc-rows .dr { display: flex; justify-content: space-between; font-size: 13px; padding: 7px 0; border-bottom: 1px dashed rgba(242,235,221,.15); }
.rc-panel .rc-rows .dr .k { color: rgba(242,235,221,.6); }
.rc-panel .rc-desc { font-size: 12.5px; line-height: 1.7; color: rgba(242,235,221,.75); margin-top: 12px; }
.rc-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.btn-ghost {
  border: 1px solid rgba(232,200,122,.5); background: none; color: #E8C87A;
  border-radius: 9px; padding: 9px 16px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.btn-ghost:hover { background: rgba(232,200,122,.1); }

/* 本地入账结果 */
.local-panel {
  margin: 34px auto 0; max-width: 400px;
  background: rgba(26,92,58,.07); border: 1px solid rgba(26,92,58,.22);
  border-radius: 16px; padding: 26px; text-align: center;
}
.local-panel h3 { color: var(--gold); font-size: 17px; margin-bottom: 8px; }
.local-panel p { font-size: 13.5px; color: var(--muted); line-height: 1.7; }
.local-panel a.go-mall { display: inline-block; margin-top: 14px; color: var(--gold); font-weight: 600; text-decoration: none; font-size: 14.5px; }

/* 分享面板 */
.share-panel {
  margin: 30px auto 0; max-width: 400px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px;
}
.share-panel .sp-title { text-align: center; font-size: 14px; color: var(--muted); margin-bottom: 16px; letter-spacing: .05em; }
.share-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.share-actions button {
  border: 1px solid var(--line); background: none; border-radius: 12px;
  padding: 13px 4px 10px; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--muted); font-size: 12px;
}
.share-actions button:hover { border-color: var(--gold); color: var(--gold); }
.share-actions .ic { font-size: 21px; line-height: 1; }
.share-tip { font-size: 12px; color: var(--muted); text-align: center; margin-top: 12px; line-height: 1.6; min-height: 32px; }

/* 状态页（已领/过期/不存在） */
.state-box {
  margin: 40px auto 0; max-width: 400px; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 34px 24px;
}
.state-box .big { font-size: 40px; margin-bottom: 12px; }
.state-box p { color: var(--muted); font-size: 14.5px; }

/* toast */
#card-toast {
  position: fixed; left: 50%; bottom: 46px; transform: translateX(-50%) translateY(20px);
  background: rgba(58,46,42,.92); color: #fff; font-size: 13.5px;
  border-radius: 10px; padding: 11px 20px; opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease; z-index: 99; max-width: 82vw; text-align: center;
}
#card-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 响应式 ---------- */
@media (max-width: 880px) {
  .create-layout { grid-template-columns: 1fr; gap: 34px; }
  .preview-col { position: static; }
  .tpl-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .ecard { max-width: 300px; }
  .ecard-inner { padding: 24px 20px; }
  .ecard-recipient { font-size: 23px; }
  .mode-picker { grid-template-columns: 1fr; }
}
