/* ═══════════ v2 計劃 tab（我／牌組／課表／設定） ═══════════ */
body.v2[data-v2] #panelPlan {
  background: none; border: 0; box-shadow: none; padding: 0; color: var(--v2-ink); font-family: var(--v2-font);
  display: flex; flex-direction: column; gap: 16px;
}
body.v2[data-v2] #panelPlan[hidden] { display: none; }
#panelPlan .v2-plan-page { display: flex; flex-direction: column; gap: 16px; animation: fcUp .4s cubic-bezier(.2, 1.3, .4, 1) both; }
#panelPlan .v2-plan-page[hidden] { display: none; }
.v2-plan-lbl { display: block; font-weight: 700; }

.v2-plan-head { display: flex; flex-direction: column; margin: 0 4px; }
.v2-plan-head .v2-mono { font-weight: 700; }
.v2-plan-head__title { margin: 0; font: 900 34px/1.1 var(--v2-font); }
.v2-plan-head__title span { background: var(--v2-moon); padding: 0 6px; }

/* 分頁掣 */
.v2-seg {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden;
  background: var(--v2-card); border: 2.5px solid var(--v2-ink); border-radius: 999px; box-shadow: 3px 3px 0 var(--v2-ink);
}
.v2-seg button {
  height: 42px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 900 14px/1 var(--v2-font); color: var(--v2-ink); -webkit-tap-highlight-color: transparent;
}
.v2-seg button + button { border-left: 2.5px solid var(--v2-ink); }
.v2-seg button[aria-selected="true"] { background: var(--v2-ink); color: var(--v2-card); }
.v2-seg button:focus-visible { outline: 3px solid var(--v2-ember); outline-offset: -5px; }

/* 共用細掣 */
.v2-btn--paper { background: var(--v2-card); }
.v2-btn--danger { background: var(--v2-card); color: #c2290f; border-color: #c2290f; box-shadow: 3px 3px 0 #c2290f; }
.v2-plan-chip {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; cursor: pointer; white-space: nowrap;
  font: 700 13px/1.1 var(--v2-font); color: var(--v2-ink); background: var(--v2-card);
  border: 2px solid var(--v2-ink); border-radius: 999px; box-shadow: 2px 2px 0 var(--v2-ink);
}
.v2-plan-chip--on, .v2-plan-chip.deck-series__btn--active { background: var(--v2-ink); color: var(--v2-card); }
.v2-plan-chip:active { transform: translate(2px, 2px); box-shadow: none; }

/* ── 我 ── */
body.v2[data-v2] #panelPlan .streak-wrap { display: flex; flex-direction: column; gap: 16px; }
.v2-me { padding: 14px; display: flex; gap: 12px; align-items: center; }
.v2-me__av {
  position: relative; width: 58px; height: 58px; flex-shrink: 0; overflow: hidden;
  border: 2.5px solid var(--v2-ink); border-radius: 50%; background: var(--v2-flame);
}
.v2-me__fire {
  position: absolute; left: 50%; top: -18px; width: 52px; height: 82px; margin-left: -26px;
  background: url(./images/v2/mascot-idle.png) 0 0 / 800% 100% no-repeat; image-rendering: pixelated; animation: v2m8 1.2s steps(8) infinite;
}
.v2-me__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.v2-me__name { font-size: 19px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-me__txt .v2-mono { color: var(--v2-muted); }
body.v2 .v2-tiles.streak-card { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0; background: none; border: 0; box-shadow: none; }
.v2-tile { padding: 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.v2-tile--flame { background: var(--v2-flame); }
.v2-tile--moon { background: var(--v2-moon); }
.v2-tile__lbl { font-weight: 700; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2-tile__val { font-size: 28px; font-weight: 700; line-height: 1.05; }
.v2-tile__unit { font-size: 10px; white-space: nowrap; }

body.v2[data-v2] #panelPlan .motivation { padding: 14px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
body.v2[data-v2] #panelPlan .motivation__label { font-weight: 700; color: var(--v2-ink); display: block; }
body.v2[data-v2] #panelPlan .motivation__input {
  height: 46px; padding: 0 12px; font: 700 15px var(--v2-font); color: var(--v2-ink);
  background: var(--v2-paper); border: 2.5px solid var(--v2-ink); border-radius: 10px; box-shadow: none;
}
body.v2[data-v2] #panelPlan .motivation__input::placeholder { color: var(--v2-muted); font-weight: 400; }
body.v2[data-v2] #panelPlan .motivation__input:focus { outline: 3px solid var(--v2-ember); outline-offset: 1px; }

/* 日曆 */
body.v2[data-v2] #panelPlan .cal {
  padding: 14px; margin: 0; color: var(--v2-ink);
  background: var(--v2-card); border: 2.5px solid var(--v2-ink); border-radius: 12px; box-shadow: 5px 5px 0 var(--v2-ink);
}
body.v2[data-v2] #panelPlan .cal__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
body.v2[data-v2] #panelPlan .cal__title { margin: 0; font: 700 15px/1.2 var(--v2-font); color: var(--v2-ink); display: flex; align-items: center; gap: 6px; }
body.v2[data-v2] #panelPlan .cal__title svg { display: none; }
body.v2[data-v2] #panelPlan .cal__head .btn {
  width: 36px; height: 36px; min-height: 0; padding: 0; display: grid; place-items: center; color: var(--v2-ink);
  background: var(--v2-card); border: 2px solid var(--v2-ink); border-radius: 8px; box-shadow: 2px 2px 0 var(--v2-ink);
}
body.v2[data-v2] #panelPlan .cal__week, body.v2[data-v2] #panelPlan .cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
body.v2[data-v2] #panelPlan .cal__week { margin-bottom: 5px; }
body.v2[data-v2] #panelPlan .cal__week span { font: 700 10px/1 var(--v2-mono); text-align: center; color: var(--v2-ink); }
body.v2[data-v2] #panelPlan .cal__day {
  position: relative; aspect-ratio: 1; min-height: 0; padding: 0; display: flex; align-items: flex-start; justify-content: flex-start;
  background: var(--v2-card); border: 2px solid var(--v2-ink); border-radius: 5px; box-shadow: none; color: var(--v2-ink);
}
body.v2[data-v2] #panelPlan .cal__num { position: static; margin: 2px 0 0 3px; font: 700 10px/1 var(--v2-num); color: inherit; opacity: 1; }
body.v2[data-v2] #panelPlan .cal__marks { display: none; }
body.v2[data-v2] #panelPlan .cal__day--both { background: var(--v2-ember); }
body.v2[data-v2] #panelPlan .cal__day--half { background-color: var(--v2-ember); background-image: repeating-conic-gradient(var(--v2-ink) 0 25%, transparent 0 50%); background-size: 4px 4px; }
body.v2[data-v2] #panelPlan .cal__day--half .cal__num { background: var(--v2-card); padding: 1px 2px; margin: 1px 0 0 1px; border-radius: 2px; }
body.v2[data-v2] #panelPlan .cal__day--today { box-shadow: 0 0 0 2px var(--v2-flame), 0 0 0 4.5px var(--v2-ink); z-index: 1; }
body.v2[data-v2] #panelPlan .cal__pad { visibility: hidden; }
body.v2[data-v2] #panelPlan .cal__legend { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0 0; font: 400 11px/1.2 var(--v2-mono); color: var(--v2-ink); }
body.v2[data-v2] #panelPlan .cal__legend span:nth-child(1)::before,
body.v2[data-v2] #panelPlan .cal__legend span:nth-child(2)::before,
body.v2[data-v2] #panelPlan .cal__legend span:nth-child(3)::before {
  content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 4px; vertical-align: -1px; border: 2px solid var(--v2-ink); border-radius: 3px;
  background-color: var(--v2-ember); background-image: repeating-conic-gradient(var(--v2-ink) 0 25%, transparent 0 50%); background-size: 4px 4px;
}
body.v2[data-v2] #panelPlan .cal__legend span:nth-child(3)::before { background-image: none; }

/* ── 牌組 ── */
body.v2[data-v2] #panelPlan .deck-series-wrap { display: flex; flex-direction: column; gap: 16px; padding: 0; margin: 0; background: none; border: 0; box-shadow: none; }
.v2-series { overflow: hidden; }
.v2-series__head { padding: 14px; background: var(--v2-ember); border-bottom: 2.5px solid var(--v2-ink); display: flex; flex-direction: column; gap: 4px; text-align: left; }
.v2-series__head .v2-mono { font-weight: 700; }
.v2-series__title { margin: 0; font: 900 26px/1.15 var(--v2-font); color: var(--v2-ink); }
.v2-series__sub { margin: 0; font-size: 13px; line-height: 1.5; color: var(--v2-ink); }
.v2-series__body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.v2-series__body:empty { display: none; }
body.v2 .v2-series .deck-series__traits { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
body.v2 .v2-series .deck-series__trait {
  padding: 3px 10px; font: 700 12px/1.3 var(--v2-font); color: var(--v2-ink); background: var(--v2-card);
  border: 2px solid var(--v2-ink); border-radius: 999px; box-shadow: none;
}
.v2-series__line { margin: 0; line-height: 1.6; color: var(--v2-ink); font-size: 13px; }
.v2-series__limited { font-weight: 700; background: var(--v2-flame); align-self: flex-start; padding: 2px 8px; border: 2px solid var(--v2-ink); border-radius: 6px; }
body.v2 .v2-series .deck-series__signature-btn {
  padding: 0; border: 0; background: none; font: 900 13px var(--v2-font); color: var(--v2-ink); text-decoration: underline; cursor: pointer;
}

.v2-plan-block { display: flex; flex-direction: column; gap: 8px; }
.v2-plan-block > .v2-plan-lbl { margin: 0 4px; }
.v2-plan-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 2px 4px 8px; margin: 0 -4px; scrollbar-width: none; }
.v2-plan-scroll::-webkit-scrollbar { display: none; }
body.v2 .deck-series__btn .deck-series__limited {
  padding: 1px 6px; font-size: 10px; font-weight: 900; color: var(--v2-ink); background: var(--v2-flame); border: 1.5px solid var(--v2-ink); border-radius: 999px;
}
.v2-today { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.v2-today__cell {
  display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; min-width: 0;
  border: 2.5px solid var(--v2-ink); border-radius: 10px; box-shadow: 3px 3px 0 var(--v2-ink); background: var(--v2-flame);
}
.v2-today__cell--moon { background: var(--v2-moon); }
.v2-today__cell .v2-mono { font-weight: 700; font-size: 10px; }
.v2-today__cell b { font-size: 14px; font-weight: 900; line-height: 1.3; }
.v2-plan-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 0; }
.v2-plan-actions .v2-btn { flex: 1 1 auto; }

.v2-album { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.v2-album__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.v2-album__title { font-size: 17px; font-weight: 900; }
.v2-album__head .v2-num { font-weight: 700; }
.v2-album__bar { height: 16px; overflow: hidden; background: var(--v2-card); border: 2.5px solid var(--v2-ink); border-radius: 6px; }
.v2-album__bar span { display: block; height: 100%; border-right: 2.5px solid var(--v2-ink); }
.v2-album__bar span[style="width:0%"] { border-right: 0; }
.v2-album__split { margin: 0; color: var(--v2-muted); }
.v2-album__filters { display: flex; gap: 6px; flex-wrap: wrap; }
.v2-album__filters .v2-plan-chip { padding: 5px 10px; font-size: 12px; }
body.v2 .v2-album__grid.deck-album { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.v2-album__empty { grid-column: 1 / -1; padding: 16px 0; text-align: center; font: 400 12px var(--v2-mono); color: var(--v2-muted); }

/* 附魔（摺埋） */
.v2-fold { padding: 0; overflow: hidden; }
.v2-fold__sum { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; }
.v2-fold__sum::-webkit-details-marker { display: none; }
.v2-fold__txt { display: flex; flex-direction: column; gap: 2px; }
.v2-fold__txt b { font-size: 16px; font-weight: 900; }
.v2-fold__txt span { font-size: 12px; color: var(--v2-muted); }
.v2-fold__count {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 12px; font: 900 13px var(--v2-num);
  background: var(--v2-moon); border: 2.5px solid var(--v2-ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--v2-ink);
}
.v2-fold__count::after { content: "▾"; font-size: 12px; transition: transform .2s; }
.v2-fold[open] .v2-fold__count::after { transform: rotate(180deg); }
body.v2[data-v2] #panelPlan .enchant-panel-wrap { padding: 0 14px 12px; margin: 0; background: none; border: 0; border-top: 2px dashed rgba(22, 19, 29, .25); box-shadow: none; }
body.v2[data-v2] #panelPlan .enchant-panel__title, body.v2[data-v2] #panelPlan .enchant-panel__hint { display: none; }
body.v2[data-v2] #panelPlan .enchant-panel__list { display: flex; flex-direction: column; gap: 0; }
body.v2[data-v2] #panelPlan .enchant-panel__row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 11px 0; margin: 0; cursor: pointer; text-align: left;
  background: none; border: 0; border-bottom: 2px dashed rgba(22, 19, 29, .2); border-radius: 0; box-shadow: none; color: var(--v2-ink);
}
body.v2[data-v2] #panelPlan .enchant-panel__row:last-child { border-bottom: 0; }
body.v2[data-v2] #panelPlan .enchant-panel__name { font: 700 14px/1.35 var(--v2-font); color: var(--v2-ink); }
body.v2[data-v2] #panelPlan .enchant-panel__val {
  flex-shrink: 0; padding: 3px 9px; font: 700 11px/1.2 var(--v2-mono); color: var(--v2-ink);
  background: var(--v2-flame); border: 2px solid var(--v2-ink); border-radius: 999px;
}
body.v2[data-v2] #panelPlan .enchant-panel__val--empty { background: var(--v2-card); color: var(--v2-muted); border-style: dashed; }

/* ── 課表 ── */
.v2-cyclebox { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
body.v2[data-v2] #panelPlan .cycle { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
body.v2[data-v2] #panelPlan .cycle__cell {
  display: flex; flex-direction: column; gap: 3px; padding: 10px 10px; min-width: 0; text-align: left;
  background: var(--v2-card); border: 2.5px dashed var(--v2-ink); border-radius: 10px; box-shadow: none; color: var(--v2-ink);
}
body.v2[data-v2] #panelPlan .cycle__cell--suggested { background: var(--v2-flame); border-style: solid; box-shadow: 3px 3px 0 var(--v2-ink); }
body.v2[data-v2] #panelPlan .cycle__label { font: 700 10px/1.2 var(--v2-mono); color: var(--v2-ink); text-transform: none; letter-spacing: .02em; }
body.v2[data-v2] #panelPlan .cycle__name { font: 900 14px/1.35 var(--v2-font); color: var(--v2-ink); }
body.v2[data-v2] #panelPlan .cycle__progress { font: 400 11px/1.2 var(--v2-mono); color: var(--v2-ink); }
.v2-anchor {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px;
  border-top: 2px dashed rgba(22, 19, 29, .25); font-size: 14px; font-weight: 700;
}
body.v2[data-v2] #panelPlan .v2-anchor .anchor__input {
  width: auto; min-width: 0; height: 36px; margin: 0; padding: 0 10px; font: 700 13px var(--v2-num); color: var(--v2-ink); color-scheme: light;
  background: var(--v2-card); border: 2px solid var(--v2-ink); border-radius: 999px; box-shadow: 2px 2px 0 var(--v2-ink);
}
body.v2[data-v2] #panelPlan .focus-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; margin: 0; }
body.v2[data-v2] #panelPlan .focus-card__body, body.v2[data-v2] #panelPlan .focus-card__body p { margin: 0; font-size: 14px; line-height: 1.65; color: var(--v2-ink); }
body.v2[data-v2] #panelPlan .focus-card__body p + p { margin-top: 8px !important; }
body.v2[data-v2] #panelPlan .summary { padding: 14px 14px 4px; margin: 0; }
body.v2[data-v2] #panelPlan .summary__list { margin: 4px 0 0; padding: 0; list-style: none; }
.v2-rule { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; border-bottom: 2px dashed rgba(22, 19, 29, .25); }
.v2-rule:last-child { border-bottom: 0; }
.v2-rule::before, .v2-rule::marker { content: none; }
.v2-rule__chip {
  flex-shrink: 0; max-width: 42%; padding: 3px 9px; font: 700 12px/1.3 var(--v2-font);
  background: var(--v2-flame); border: 2px solid var(--v2-ink); border-radius: 999px;
}
.v2-rule__txt { flex: 1; min-width: 0; font-size: 13px; line-height: 1.6; color: var(--v2-ink); }

/* ── 設定 ── */
body.v2[data-v2] #panelPlan .account-bar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 0; color: var(--v2-ink); }
body.v2[data-v2] #panelPlan .account-bar[hidden] { display: none; }
body.v2[data-v2] #panelPlan .account-bar__avatar { width: 44px; height: 44px; border-radius: 50%; border: 2.5px solid var(--v2-ink); }
body.v2[data-v2] #panelPlan .account-bar__avatar[hidden] { display: none; }
body.v2[data-v2] #panelPlan .account-bar__meta { flex: 1; min-width: 0; }
body.v2[data-v2] #panelPlan .account-bar__name { margin: 0; font: 900 16px/1.3 var(--v2-font); color: var(--v2-ink); }
body.v2[data-v2] #panelPlan .account-bar__email { margin: 0; font: 400 11px/1.3 var(--v2-mono); color: var(--v2-muted); overflow: hidden; text-overflow: ellipsis; }
.v2-data { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
body.v2[data-v2] #panelPlan .v2-data__row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.v2-data .v2-btn { width: 100%; min-height: 46px; font-size: 14px; }
body.v2[data-v2] #panelPlan .btn--file { cursor: pointer; }
body.v2[data-v2] #panelPlan .disclaimer, body.v2[data-v2] #panelPlan .credit { margin: 0 4px; line-height: 1.7; color: var(--v2-muted); font-size: 11px; }
body.v2[data-v2] #panelPlan .credit a { color: var(--v2-ink); }

@media (prefers-reduced-motion: reduce) {
  #panelPlan .v2-plan-page { animation: none; }
}

/* 修正：舊深色樣式蓋過 */
body.v2[data-v2] #panelPlan .account-bar, body.v2[data-v2] #panelPlan .v2-anchor { background: var(--v2-card); }
body.v2[data-v2] #panelPlan .account-bar { border: 2.5px solid var(--v2-ink); border-radius: 12px; box-shadow: 5px 5px 0 var(--v2-ink); }
body.v2[data-v2] #panelPlan .v2-anchor { border: 0; border-top: 2px dashed rgba(22, 19, 29, .25); border-radius: 0; box-shadow: none; padding: 10px 0 0; margin: 0; color: var(--v2-ink); }
body.v2[data-v2] #panelPlan .v2-today, body.v2[data-v2] #panelPlan .v2-today * { opacity: 1; color: var(--v2-ink); }
body.v2[data-v2] #panelPlan .cal__head .btn svg, body.v2[data-v2] #panelPlan .cal__head .btn i { display: none; }
body.v2[data-v2] #panelPlan .cal__head .btn::before { font: 900 18px/1 var(--v2-num); }
body.v2[data-v2] #panelPlan .cal__head [data-cal-nav="-1"]::before { content: "‹"; }
body.v2[data-v2] #panelPlan .cal__head [data-cal-nav="1"]::before { content: "›"; }
