/* 首屏输入框下方的示例目标卡片：轻一点的毛玻璃小卡片，跟着首屏主题（旅行 / 面试 / 会议 / 考试）换内容和颜色。
   点卡片 = 把这句学习目标填进输入框（见 plan-cards.js）。 */
/* 暂时隐藏：index.html 里这一块带了 hidden，去掉就会显示回来 */
.plan-cards[hidden] { display: none !important; }

.plan-cards {
  --plan-tint: #bee4ff;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: calc(10 * var(--u));
  width: 100%;
  margin-top: calc(20 * var(--u));
}
/* 主题色和首屏标题里的彩色关键词一致 */
.plan-cards[data-scene="interview"] { --plan-tint: #efd8ff; }
.plan-cards[data-scene="meeting"] { --plan-tint: #c2f6e9; }
.plan-cards[data-scene="exam"] { --plan-tint: #ffe3b7; }

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: max(68px, calc(78 * var(--u)));
  margin: 0;
  padding: calc(12 * var(--u)) calc(46 * var(--u)) calc(12 * var(--u)) calc(16 * var(--u));
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: calc(18 * var(--u));
  background: rgb(255 255 255 / 8%);
  background: linear-gradient(150deg, color-mix(in srgb, var(--plan-tint) 16%, transparent), rgb(255 255 255 / 5%) 75%);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  color: rgb(255 255 255 / 92%);
  font: 400 max(13px, calc(15.5 * var(--u))) / 1.35 var(--brand-font);
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  /* 往下滑时由 hero-shrink.js 写入 --hero-fade：每张卡片自己淡出（外层不能有 opacity，否则毛玻璃会失效） */
  opacity: calc(1 - var(--hero-fade, 0));
  filter: blur(calc(var(--hero-fade, 0) * 8px));
  transition: background .3s ease, border-color .3s ease, translate .35s cubic-bezier(.2, .7, .2, 1);
}

.plan-card-sub {
  display: block;
  color: var(--plan-tint);
  font-size: max(11px, calc(12.5 * var(--u)));
  line-height: 1.3;
  opacity: .9;
}
/* 换主题时只有文字轻轻淡出淡入（plan-cards.js 加 .is-swapping），卡片不动 */
.plan-card-sub,
.plan-card-title { transition: opacity .16s ease; }
.plan-cards.is-swapping :is(.plan-card-sub, .plan-card-title) { opacity: 0; }

.plan-card-title {
  display: block;
  margin-top: calc(3 * var(--u));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-card-go {
  position: absolute;
  right: calc(12 * var(--u));
  top: 50%;
  display: grid;
  place-items: center;
  width: max(24px, calc(28 * var(--u)));
  height: max(24px, calc(28 * var(--u)));
  border-radius: 50%;
  background: rgb(255 255 255 / 14%);
  color: rgb(255 255 255 / 90%);
  translate: 0 -50%;
  transition: background .25s ease, color .25s ease;
}
.plan-card-go svg { width: 44%; height: auto; }

@media (hover: hover) {
  .plan-card:hover {
    border-color: rgb(255 255 255 / 30%);
    background: linear-gradient(150deg, color-mix(in srgb, var(--plan-tint) 26%, transparent), rgb(255 255 255 / 9%) 75%);
    translate: 0 -2px;
  }
  .plan-card:hover .plan-card-go { background: #fff; color: #111; }
}
.plan-card[aria-pressed="true"] {
  border-color: rgb(255 255 255 / 55%);
  background: linear-gradient(150deg, color-mix(in srgb, var(--plan-tint) 30%, transparent), rgb(255 255 255 / 12%) 75%);
}
.plan-card[aria-pressed="true"] .plan-card-go { background: #fff; color: #111; }
.plan-card:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* 出场：和输入框一样从下往上浮现，晚一点点 */
@media (prefers-reduced-motion: no-preference) {
  .copy > .plan-cards {
    animation: hero-copy-in .6s cubic-bezier(.2, .68, .22, 1) .24s backwards;
  }
}
html.midoo-intro .hero .plan-cards { opacity: 0; }
html.midoo-intro:not(.is-hero-in) .hero .plan-cards { visibility: hidden; }
html.midoo-intro.is-hero-in .hero .plan-cards { animation: intro-soft .9s ease .8s both; }
html.midoo-intro-done .copy > .plan-cards { animation: none !important; }

/* 手机：一排横向滑动，卡片贴着屏幕边缘露出下一张 */
@media (max-width: 700px) {
  .plan-cards {
    display: flex;
    gap: 8px;
    width: calc(100% + 32px);
    margin: 14px -16px 0;
    padding: 2px 16px 8px;
    /* 横向滑动的一排卡片不能把整块文字撑宽：宽度只跟着外层走 */
    contain: inline-size;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 16px;
    scrollbar-width: none;
  }
  .plan-cards::-webkit-scrollbar { display: none; }
  .plan-card {
    flex: 0 0 156px;
    min-height: 62px;
    padding: 10px 40px 10px 14px;
    border-radius: 16px;
    scroll-snap-align: start;
  }
  .plan-card-go { right: 10px; }
}

@media (forced-colors: active) {
  .plan-card { border: 1px solid CanvasText; }
}
