/* Luna Agent Store — 功能组件样式（注册/登录/验证码/应用网格/客服浮窗/账户菜单）
   Claude Design 导出没有设计这些组件（纯视觉壳，零真实功能），配色/圆角/间距延续
   assets/luna-site.css 已建立的视觉语言手写补齐，交互机制（[hidden] 覆盖、disabled 态、
   pending 动画）照搬自 assets/styles.css 的既有实现，只换色板，不改行为。 */

/* ── 账户导航（登录态） ─────────────────────────────────────── */
.account-nav { position: relative; }
.account-nav[hidden] { display: none !important; }
.account-nav__trigger {
  background: none; border: none; padding: 0; margin: 0; font: inherit;
  color: #cacaca; font-size: 14px; cursor: pointer; transition: color .3s ease;
}
.account-nav__trigger:hover { color: #fafafa; }
.account-menu {
  position: absolute; top: calc(100% + 14px); right: 0;
  width: min(280px, calc(100vw - 24px)); padding: 8px;
  border: 1px solid #262626; border-radius: 16px; background: #0d0d0d;
  box-shadow: 0 24px 60px rgba(0,0,0,.55); z-index: 200;
}
.account-menu[hidden] { display: none !important; }
.account-menu__identity {
  display: grid; gap: 4px; padding: 12px 12px 10px;
  border-bottom: 1px solid #222; margin-bottom: 6px;
}
.account-menu__identity strong { font-size: 15px; color: #fafafa; }
.account-menu__identity span { color: #8f8f8f; font-size: 13px; }
.account-menu > button {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 0; border-radius: 10px;
  color: #eaeaea; background: transparent; text-align: left; font: inherit; cursor: pointer;
}
.account-menu > button:hover, .account-menu > button:focus-visible { background: #161616; outline: none; }
.account-menu > button:disabled { cursor: wait; opacity: .6; }
.account-menu > .account-menu__logout { color: #ff6b57; }
.account-menu__error { margin: 6px 10px 4px; color: #ff6b57; font-size: 12px; line-height: 1.45; }

/* ── 通用按钮（弹窗/网格内复用） ────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 600; min-height: 44px; padding: 12px 22px;
  border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  text-align: center; text-decoration: none; white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn[hidden] { display: none !important; }
.btn--accent, .btn--primary { color: #080808; background: #fafafa; }
.btn--accent:hover, .btn--primary:hover { background: #e6e6e6; }
.btn--ghost { color: #fafafa; background: transparent; border-color: #333; }
.btn--ghost:hover { border-color: #555; background: rgba(255,255,255,.04); }
.btn--lg { font-size: 15px; min-height: 48px; padding: 14px 26px; }

/* ── 状态条（登录后展示） ───────────────────────────────────── */
.store-status-bar {
  margin: 24px 0 0; padding: 12px 20px; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 14px; color: #cacaca;
}
.store-status-bar[hidden] { display: none !important; }
.store-status-bar .status-icon { font-size: 20px; }
.store-status-bar .status-text { flex: 1; text-align: left; }
.store-status-bar .status-action {
  background: none; border: none; cursor: pointer; color: #fafafa;
  font-size: 13px; text-decoration: underline; padding: 0;
}
.store-status-bar .status-action--button {
  border: 1px solid rgba(255,255,255,.24); border-radius: 999px; padding: 6px 12px; text-decoration: none;
}
.store-status-bar.is-pending { background: rgba(255,159,10,.08); border-color: rgba(255,159,10,.28); }
.store-status-bar.is-pending .status-icon::after { content: '⏳'; }
.store-status-bar.is-approved { background: rgba(48,209,88,.08); border-color: rgba(48,209,88,.28); }
.store-status-bar.is-approved .status-icon::after { content: '✓'; }

/* ── 筛选 Tab（沿用 .store-tab，视觉对齐 .filtab） ──────────── */
.store-tabs { display: flex; gap: 10px; padding: 32px 0 24px; flex-wrap: wrap; }
.store-tab {
  padding: 9px 20px; border-radius: 999px; border: 1px solid #262626;
  background: rgba(255,255,255,.01); color: #9a9a9a; font-size: 14px; font-family: inherit;
  cursor: pointer; transition: border-color .3s ease, color .3s ease, background .3s ease;
}
.store-tab:hover { border-color: #444; color: #fafafa; }
.store-tab.is-active { border-color: #fafafa; background: #fafafa; color: #080808; font-weight: 600; }

/* ── 应用网格 ────────────────────────────────────────────────── */
.store-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
  padding-bottom: 64px; align-items: stretch;
  /* ponytail: reserve height so async app-card render doesn't shift footer (CLS). 60vh holds loading state + typical 3-row grid; raise if card count grows. */
  min-height: 60vh;
}
.store-loading, .store-empty { grid-column: 1 / -1; padding: 60px 20px; text-align: center; color: #9a9a9a; font-size: 15px; } /* F14 折中：用户可读状态文案提至 AA */
@media (max-width: 1020px) { .store-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .store-grid { grid-template-columns: 1fr; } }

.app-card {
  background: #0b0b0b; border: 1px solid #202020; border-radius: 16px; padding: 24px;
  display: flex; flex-direction: column; gap: 14px; min-height: 260px;
  transition: border-color .4s ease, background .4s ease;
}
.app-card:hover { border-color: #333; background: #101010; }
.app-card__head { display: flex; align-items: flex-start; gap: 14px; }
.app-card__icon {
  width: 46px; height: 46px; border-radius: 12px; border: 1px solid #262626;
  background: rgba(255,255,255,.02); display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.app-card__meta { flex: 1; min-width: 0; }
.app-card__name { font-size: 16px; font-weight: 600; color: #fafafa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-card__version { font-family: "Space Grotesk", monospace; font-size: 12px; color: #6a6a6a; margin-top: 3px; }
.app-card__desc { font-size: 12.5px; line-height: 1.7; color: #8f8f8f; flex: 1; margin: 0; }
.app-card__stats { display: flex; flex-wrap: wrap; gap: 14px; font-family: "Space Grotesk", monospace; font-size: 12px; color: #6a6a6a; }
.app-card__stats span { display: flex; align-items: center; gap: 4px; }
.app-card__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.app-card__actions--single { grid-template-columns: 1fr; }
.app-card__actions .btn { font-size: 13px; padding: 9px 12px; }
.app-card__actions .btn--dl { background: #fafafa; color: #080808; border-color: #fafafa; }
.app-card__actions .btn--dl:hover { opacity: .88; }
.app-card__actions .btn--dl:disabled, .app-card__actions .btn--dl.is-locked {
  background: transparent; color: #6a6a6a; border-color: #262626; cursor: default; opacity: 1;
}
.app-card__download-message { margin: 2px 0 0; font-size: 12px; line-height: 1.45; color: #8f8f8f; overflow-wrap: anywhere; }
.app-card__download-message[data-kind="success"] { color: #30d158; }
.app-card__download-message[data-kind="error"] { color: #ff6b57; }
.btn--dl-single { width: 100%; grid-column: 1 / -1; }

.tier-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .03em; flex-shrink: 0;
  border: 1px solid #262626; background: rgba(255,255,255,.02); color: #a9a9a9;
}
.tier-badge--standard { color: #9a9a9a; }
.tier-badge--member { color: #8a93ff; border-color: rgba(138,147,255,.35); background: rgba(138,147,255,.08); }
.tier-badge--flagship { color: #fafafa; border-color: #333; background: rgba(255,255,255,.08); }

/* ── 弹窗（注册 / 登录） ────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9000; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.modal-overlay[hidden] { display: none; }
.modal {
  position: relative; background: #0d0d0d; border: 1px solid #262626; border-radius: 20px;
  padding: 32px; width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,.6); color: #eaeaea;
}
.modal--register { max-width: 560px; }
.modal__close {
  position: absolute; top: 16px; right: 16px; width: 30px; height: 30px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.06); color: #9a9a9a; font-size: 18px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.modal__close:hover { background: rgba(255,255,255,.12); color: #fafafa; }
.modal__head { margin-bottom: 24px; }
.modal__title { font-size: 20px; font-weight: 700; margin-bottom: 6px; color: #fafafa; }
.modal__sub { font-size: 13px; color: #8f8f8f; }
.modal__hint { margin: 12px 0 0; font-size: 13px; color: #8f8f8f; text-align: center; }
.modal__hint a { color: #cacaca; text-decoration: underline; text-underline-offset: 2px; }
.modal__hint a:hover { color: #fafafa; }
.modal__form { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field[hidden] { display: none !important; }
.field > span { font-size: 13px; font-weight: 500; color: #bdbdbd; }
.field > span em { color: #fafafa; font-style: normal; margin-left: 2px; }
.field input, .field select, .field textarea {
  padding: 11px 14px; border-radius: 10px; border: 1px solid #262626; background: #0e0e0e;
  color: #eaeaea; font-size: 15px; font-family: inherit; outline: none; transition: border-color .3s ease;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: #4a4a4a; background: #111; }
.field textarea { min-height: 78px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #5a5a5a; }

.interest-field { border: 0; display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; }
.interest-field legend { color: #bdbdbd; font-size: 13px; font-weight: 500; padding: 0; }
.interest-field legend em { color: #fafafa; font-style: normal; margin-left: 2px; }
.interest-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.interest-chip { display: inline-flex; min-width: 0; }
.interest-chip input { position: absolute; opacity: 0; pointer-events: none; }
.interest-chip span {
  align-items: center; background: #0e0e0e; border: 1px solid #262626; border-radius: 999px;
  color: #cacaca; cursor: pointer; display: inline-flex; font-size: 13px; line-height: 1.3;
  min-height: 34px; padding: 7px 12px; user-select: none;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.interest-chip input:checked + span { background: rgba(255,255,255,.1); border-color: #4a4a4a; color: #fafafa; }
.interest-chip input:focus-visible + span { outline: 2px solid #8a93ff; outline-offset: 2px; }

.modal__switch { color: #8f8f8f; font-size: 13px; margin: 10px 0 0; text-align: center; }
.modal__switch-btn { background: none; border: none; color: #fafafa; cursor: pointer; font-size: 13px; padding: 0; text-decoration: underline; }
.modal__tip { font-size: 13px; margin: 0; padding: 8px 12px; border-radius: 8px; background: rgba(255,107,87,.1); }
.modal__tip--error { color: #ff8a75; }
.modal__submit { margin-top: 8px; width: 100%; }

.modal__success { text-align: center; padding: 8px 0; }
.modal__success-icon {
  width: 56px; height: 56px; border-radius: 50%; background: rgba(48,209,88,.15); color: #30d158;
  font-size: 26px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.modal__success h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: #fafafa; }
.modal__success p { font-size: 14px; color: #8f8f8f; margin: 0 0 8px; }
.modal__success-note { color: #8f8f8f; font-size: 13px; margin-top: 16px; }

.captcha-row { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; }
.captcha-canvas { border: 1px solid #262626; border-radius: 8px; cursor: pointer; flex-shrink: 0; background: #0e0e0e; }
.captcha-refresh { appearance: none; padding: 0; border: 0; border-radius: 8px; background: transparent; line-height: 0; cursor: pointer; }
.captcha-refresh:focus-visible { outline: 3px solid #8a93ff; outline-offset: 3px; }
.captcha-mode-toggle {
  flex-basis: 100%; min-height: 40px; padding: 0 12px; border: 1px solid #262626; border-radius: 8px;
  background: #0e0e0e; color: #eaeaea; cursor: pointer; font-family: inherit;
}
.captcha-mode-toggle:focus-visible { outline: 3px solid #8a93ff; outline-offset: 3px; }
.captcha-prompt {
  flex: 1 1 110px; min-height: 40px; margin: 0; padding: 10px 12px; border: 1px solid #262626;
  border-radius: 8px; background: #0e0e0e; color: #eaeaea; line-height: 1.4;
}
.captcha-status { display: block; min-height: 1.4em; color: #8f8f8f; font-size: 12px; }
.captcha-input { flex: 1; font-family: ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; }
.captcha-hint { color: #6a6a6a; font-size: 11px; margin-top: 2px; }

