/*
 * 사이 产品主页的开通会员框（static/js/sai-plans.js）：照搬 사이 权益对比框的静态卡片
 * （cn2kr apps/web/src/components/plans/plans.css 的「静态卡片」部分），类名、尺寸、配色与之一致。
 * 颜色取 사이 默认皮肤「韩纸」的亮、暗两套种子，只在 .pl-root 里生效，不影响米羊页面其余部分；
 * 사이 那边改了配色，这里跟着改。
 */

.pl-root {
  --sf: 255 252 246; --sf3: 255 253 249;
  --fg: 70 50 25; --tx: 31 27 22; --cin-rgb: 196 78 52; --cel-rgb: 30 138 118; --gold-rgb: 160 108 34;
  --gold-a: #ecc98a; --gold-b: #f8e6c2; --on-gold: #2a1d08; --shade: 90 65 30;
  --line: rgb(var(--fg) / 0.075);
  --line-2: rgb(var(--fg) / 0.14);
  --text: rgb(var(--tx));
  --text-2: rgb(var(--tx) / 0.68);
  --text-3: rgb(var(--tx) / 0.42);
  --gold: rgb(var(--gold-rgb));
  --gold-grad: linear-gradient(120deg, var(--gold-a), var(--gold-b));
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --expo: cubic-bezier(0.16, 1, 0.3, 1);
  --spring-snap: linear(0, 0.0155, 0.0557, 0.1122, 0.1789, 0.2508, 0.3244, 0.397, 0.4668, 0.5325, 0.5934, 0.649, 0.6991, 0.7439, 0.7835, 0.8183, 0.8486, 0.8747, 0.8972, 0.9162, 0.9324, 0.946, 0.9573, 0.9666, 0.9743, 0.9806, 0.9856, 0.9897, 0.9929, 0.9954, 0.9973, 0.9988, 0.9999, 1.0007, 1.0012, 1.0015, 1);
  --sans: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Noto Sans SC', 'Microsoft YaHei', 'Malgun Gothic', system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme='dark'] .pl-root {
  --sf: 16 18 28; --sf3: 30 33 50;
  --fg: 255 245 230; --tx: 241 236 227; --cin-rgb: 239 106 79; --cel-rgb: 127 209 191; --gold-rgb: 243 217 164;
  --gold-a: #f3d9a4; --gold-b: #fff2d6; --on-gold: #15110a; --shade: 0 0 0;
  color-scheme: dark;
}

.pl-root {
  position: fixed;
  inset: 0;
  z-index: 1200;
  isolation: isolate;
  overflow: hidden;
  color: var(--text);
  font-family: var(--sans);
  background: rgb(var(--sf) / 0.55);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  user-select: none;
  -webkit-user-select: none;
  outline: none;
  animation: pl-in 0.5s var(--ease) both;
}
.pl-root.closing { animation: pl-out 0.42s var(--ease) both; pointer-events: none; }
.pl-root *, .pl-root *::before, .pl-root *::after { box-sizing: border-box; }
@keyframes pl-in { from { opacity: 0; } }
@keyframes pl-out { to { opacity: 0; } }
body.pl-open { overflow: hidden; }

/* ------------------------------------------------------------------ 标题与工具 */

.pl-head {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: max(clamp(18px, 4.2vh, 44px), env(safe-area-inset-top)) 72px 0;
  text-align: center;
  pointer-events: none;
}
.pl-eyebrow {
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--text-3);
  animation: pl-rise 0.9s var(--expo) 0.1s both;
}
.pl-title {
  margin: 10px 0 8px;
  font-size: clamp(22px, 3.1vw, 34px);
  font-weight: 720;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text);
  text-wrap: balance;
  animation: pl-rise 0.9s var(--expo) 0.18s both;
}
.pl-sub {
  max-width: 600px;
  margin: 0 auto;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
  text-wrap: pretty;
  animation: pl-rise 0.9s var(--expo) 0.26s both;
}
@keyframes pl-rise { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } }

.pl-tools {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  z-index: 3;
  display: flex;
  gap: 8px;
}
.pl-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgb(var(--sf) / 0.6);
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.25s var(--spring-snap);
}
.pl-icon:hover { color: var(--text); background: rgb(var(--sf) / 0.85); }
.pl-icon:active { transform: scale(0.92); }
.pl-icon:disabled { opacity: 0.45; cursor: default; }
.pl-icon:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ------------------------------------------------------------------ 底部 */

.pl-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 0 24px max(18px, env(safe-area-inset-bottom));
  text-align: center;
  pointer-events: none;
  animation: pl-rise 0.9s var(--expo) 0.5s both;
}
.pl-foot > * { pointer-events: auto; }
.pl-pack {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgb(var(--sf) / 0.6);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 620;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.25s var(--spring-snap);
}
.pl-pack:hover { background: rgb(var(--sf) / 0.9); border-color: rgb(var(--cin-rgb) / 0.5); }
.pl-pack:active { transform: scale(0.97); }
.pl-pack:disabled { opacity: 0.5; cursor: default; }
.pl-pack:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.pl-note {
  margin: 8px auto 0;
  max-width: 560px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-3);
}

/* ------------------------------------------------------------------ 卡面 */

.pc-face {
  width: 300px;
  height: 468px;
  border-radius: 22px;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  --band-ink: var(--on-gold);
}
.pc-face[data-kind='1'] { --band-ink: color-mix(in srgb, rgb(var(--cel-rgb)) 22%, var(--on-gold)); }
.pc-face[data-kind='3'] { --band-ink: color-mix(in srgb, rgb(var(--cin-rgb)) 30%, var(--on-gold)); }
.pc-in { position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; }

.pc-band {
  position: relative;
  flex: none;
  height: 158px;
  padding: 20px 22px 0;
  color: var(--band-ink);
}
.pc-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
  font-size: 13px;
  font-weight: 680;
  letter-spacing: 0.08em;
}
.pc-chip, .pc-badge {
  flex: none;
  max-width: 62%;
  overflow: hidden;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.pc-chip {
  border: 1px solid color-mix(in srgb, var(--band-ink) 30%, transparent);
  background: color-mix(in srgb, var(--band-ink) 8%, transparent);
}
.pc-badge {
  background: var(--band-ink);
  color: var(--gold-b);
}
.pc-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 16px;
}
.pc-price b {
  font-size: 42px;
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.pc-price b.pc-small-b { font-size: 28px; letter-spacing: -0.01em; }
.pc-price small { font-size: 13px; font-weight: 560; opacity: 0.78; }
.pc-sub {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0.84;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pc-body { flex: 1; min-height: 0; padding: 14px 22px 0; }
.pc-rows { margin: 0; padding: 0; list-style: none; }
.pc-rows li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.pc-rows li:last-child { border-bottom: 0; }
.pc-rows span { min-width: 0; font-size: 13px; color: var(--text-2); }
.pc-rows b { flex: none; max-width: 58%; font-size: 14px; font-weight: 650; text-align: right; }
.pc-rows b.pc-yes { display: inline-flex; align-self: center; color: var(--gold); }
.pc-face[data-kind='1'] .pc-rows b.pc-yes { color: rgb(var(--cel-rgb)); }
.pc-rows b.pc-yes svg { stroke-width: 2.4; }
/* 增量包卡：字数包、语音包上下两项，各自一个付款按钮 */
.pc-addon {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.pc-addon:last-child { border-bottom: 0; }
.pc-addon-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pc-addon-main b { font-size: 15px; font-weight: 680; overflow-wrap: anywhere; }
.pc-addon-main span { font-size: 12px; line-height: 1.4; color: var(--text-2); overflow-wrap: anywhere; }
.pc-addon .pc-btns { flex: none; }
.pc-addon .pc-btn { flex: none; height: 40px; padding: 0 14px; font-size: 14px; }
.pc-fine { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--text-3); }
.pc-msg { margin: 6px 0 0; font-size: 14px; line-height: 1.6; color: var(--text-2); }

.pc-done { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 18px; }
.pc-done p { margin: 14px 0 0; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.pc-wait { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; color: var(--gold); background: rgb(var(--gold-rgb) / 0.08); }
.pc-wait .ic { animation: pl-spin 0.9s linear infinite; }
.pc-qr { display: grid; place-items: center; min-width: 140px; min-height: 140px; color: var(--gold); }
.pc-qr img { display: block; width: 140px; height: 140px; border-radius: 12px; box-shadow: 0 6px 18px rgb(0 0 0 / 0.12); }
.pc-qr > .ic { animation: pl-spin 0.9s linear infinite; }
.pc-qr + p { margin-top: 10px; }
.pc-seal { width: 72px; height: 72px; fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pc-seal circle { stroke-dasharray: 170; stroke-dashoffset: 170; animation: pc-draw 0.9s var(--expo) 0.25s forwards; opacity: 0.55; }
.pc-seal path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: pc-draw 0.5s var(--expo) 0.75s forwards; stroke-width: 4; }
@keyframes pc-draw { to { stroke-dashoffset: 0; } }

.pc-foot {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pc-note {
  min-height: 17px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-3);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.pc-btns { display: flex; gap: 8px; }
/* 两个按钮并排时，次按钮按文字宽度，主按钮占满剩下的 */
.pc-btns .pc-btn:not(.primary):not(:only-child) { flex: none; padding: 0 16px; }
.pc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pc-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: rgb(var(--sf) / 0.55);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 660;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.25s, transform 0.25s var(--spring-snap), filter 0.2s;
}
.pc-btn:hover { background: rgb(var(--sf) / 0.85); }
.pc-btn:active { transform: scale(0.97); }
.pc-btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.pc-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.pc-btn .ic { flex: none; }
.pc-btn:disabled .ic { animation: pl-spin 0.9s linear infinite; }
.pc-btn:not(:disabled) .ic { animation: none; }
@keyframes pl-spin { to { transform: rotate(360deg); } }

.pc-face[data-kind='0'] .pc-btn.primary,
.pc-face[data-kind='1'] .pc-btn.primary {
  border-color: color-mix(in srgb, rgb(var(--cel-rgb)) 40%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, rgb(var(--cel-rgb)) 38%, var(--gold-b)), color-mix(in srgb, rgb(var(--cel-rgb)) 55%, var(--gold-b)));
  color: color-mix(in srgb, rgb(var(--cel-rgb)) 22%, var(--on-gold));
}
.pc-face[data-kind='3'] .pc-btn.primary {
  border-color: color-mix(in srgb, rgb(var(--cin-rgb)) 40%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, rgb(var(--cin-rgb)) 30%, var(--gold-b)), color-mix(in srgb, rgb(var(--cin-rgb)) 46%, var(--gold-b)));
  color: color-mix(in srgb, rgb(var(--cin-rgb)) 30%, var(--on-gold));
}
.pc-face[data-kind='2'] .pc-btn.primary {
  border-color: transparent;
  background: var(--gold-grad);
  color: var(--on-gold);
  box-shadow: 0 10px 28px -12px rgb(var(--gold-rgb) / 0.8);
}
.pc-btn.primary:hover:not(:disabled) { filter: brightness(1.05) saturate(1.05); box-shadow: 0 14px 34px -12px rgb(var(--gold-rgb) / 0.75); }

.pl-root .ic { flex: none; width: 18px; height: 18px; }

/* ------------------------------------------------------------------ 静态卡片 */

.pl-static {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: var(--pl-top, 150px) 24px 130px;
  overflow: auto hidden;
  touch-action: pan-x;
}
.pc-face.static {
  flex: none;
  border: 1px solid var(--line);
  background: rgb(var(--sf3));
  box-shadow: 0 30px 60px -28px rgb(var(--shade) / 0.45), 0 0 0 1px rgb(var(--fg) / 0.03);
}
.pc-face.static[data-kind='0'] .pc-band { background: var(--gold-b); }
.pc-face.static[data-kind='1'] .pc-band { background: linear-gradient(160deg, color-mix(in srgb, rgb(var(--cel-rgb)) 35%, var(--gold-b)), color-mix(in srgb, rgb(var(--cel-rgb)) 52%, var(--gold-b))); }
.pc-face.static[data-kind='2'] .pc-band { background: linear-gradient(135deg, var(--gold-a), var(--gold-b) 55%, var(--gold-a)); }
.pc-face.static[data-kind='2'] { border-color: rgb(var(--gold-rgb) / 0.55); }
.pc-face.static[data-kind='3'] .pc-band {
  background:
    radial-gradient(circle at 22% 30%, rgb(var(--gold-rgb) / 0.55) 0 1.5px, transparent 2.5px) 0 0 / 23px 19px,
    radial-gradient(circle at 70% 65%, rgb(var(--gold-rgb) / 0.4) 0 1px, transparent 2px) 0 0 / 17px 21px,
    linear-gradient(160deg, color-mix(in srgb, rgb(var(--cin-rgb)) 30%, var(--gold-b)), color-mix(in srgb, rgb(var(--cin-rgb)) 44%, var(--gold-b)));
}

@media (max-width: 760px) {
  .pl-head { padding-left: 56px; padding-right: 56px; }
  .pl-title { font-size: 21px; }
  .pl-sub { font-size: 13px; }
  .pl-static { justify-content: flex-start; scroll-snap-type: x mandatory; padding-left: 9vw; padding-right: 9vw; gap: 16px; }
  .pc-face.static { scroll-snap-align: center; }
}
@media (max-height: 640px) {
  .pl-sub { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pl-root, .pl-root * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
