/* ============================================================
   components.css — UI 组件：卡片、按钮、输入框、首页、角色广场、详情、设置
============================================================ */

/* ── 通用卡片 ──────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.section-title {
  margin: 22px 2px 12px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.section-title .hint { color: var(--muted); font-size: 12px; font-weight: 400; }

/* ── 按钮 ──────────────────────────────────────────────────── */
.btn {
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .15s cubic-bezier(0.22, 1, 0.36, 1), box-shadow .2s;
  touch-action: manipulation;
  -webkit-touch-callout: none;
}
.btn:active:not(:disabled) { opacity: .85; transform: scale(0.96); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  box-shadow: 0 10px 24px var(--accent-glow);
}
.btn-ghost {
  color: var(--text);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}
.btn.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: none;
}
.btn.btn-danger:hover { opacity: .88; }

/* ── 输入框 ────────────────────────────────────────────────── */
.input-field {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  margin-bottom: 12px;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.input-field::placeholder { color: var(--muted); }
.input-field:focus {
  border-color: rgba(167,139,250,.4);
  box-shadow: 0 0 0 3px rgba(167,139,250,.08);
}

/* ============================================================
   PAGE: 首页（极简神秘风）
============================================================ */
#page-home .home-topbar-hidden { display: none; }

.home-minimal-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-h) - var(--safe-bottom) - 32px);
  padding: 40px 24px;
  position: relative;
  text-align: center;
}

.home-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
}
.home-glow-1 {
  width: 200px;
  height: 200px;
  background: rgba(129,140,248,.08);
  top: 10%;
  left: 10%;
  animation: glow-drift 8s ease-in-out infinite alternate;
}
.home-glow-2 {
  width: 160px;
  height: 160px;
  background: rgba(167,139,250,.06);
  bottom: 15%;
  right: 10%;
  animation: glow-drift 10s ease-in-out infinite alternate-reverse;
}

.home-logo {
  margin-bottom: 32px;
  animation: home-fadein 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.home-logo-text {
  font-size: 48px;
  font-weight: 200;
  letter-spacing: 12px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #e0e7ff 0%, #c4b5fd 50%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-tagline {
  font-size: 16px;
  line-height: 1.8;
  color: rgba(232,236,248,.6);
  margin: 0 0 48px;
  letter-spacing: 2px;
  animation: home-fadein 1s cubic-bezier(0.22, 1, 0.36, 1) .15s both;
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 240px;
  animation: home-fadein 1s cubic-bezier(0.22, 1, 0.36, 1) .3s both;
}
.home-btn {
  width: 100%;
  padding: 14px 0;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all .25s cubic-bezier(0.22, 1, 0.36, 1);
  letter-spacing: 2px;
  text-align: center;
  border: none;
  font-family: inherit;
}
.home-btn:active { transform: scale(0.96); }
.home-btn-outline {
  color: var(--pink);
  background: transparent;
  border: 1.5px solid rgba(167,139,250,.35);
  backdrop-filter: blur(4px);
}
.home-btn-outline:hover {
  border-color: rgba(167,139,250,.6);
  background: rgba(167,139,250,.08);
  box-shadow: 0 0 24px rgba(167,139,250,.15);
}
.home-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  box-shadow: 0 8px 28px var(--accent-glow);
}
.home-btn-primary:hover {
  box-shadow: 0 12px 36px rgba(129,140,248,.4);
  transform: translateY(-1px);
}

/* ============================================================
   PAGE: 角色广场
============================================================ */
.char-grid { display: flex; flex-direction: column; gap: 0; }
.char-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform .25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow .25s, border-color .2s;
  will-change: transform;
}
.char-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 48px rgba(0,0,0,.4);
  border-color: rgba(167,139,250,.3);
}
.char-card:active { transform: scale(0.96) translateY(-2px); transition: transform .1s; }
.char-card:hover .char-cover::after {
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.42));
}
.char-cover {
  height: 156px;
  background-size: cover;
  background-position: center top;
  position: relative;
  overflow: hidden;
}
.char-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,.32));
  pointer-events: none;
}
.char-info .char-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}
.char-info .char-name small {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}
.char-bio {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  min-height: 34px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0;
}
.char-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 9px; }
.char-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.05);
  color: var(--text);
}
.char-tag.asset-tag {
  border-color: rgba(167,139,250,.18);
  background: rgba(167,139,250,.10);
  color: #d4c4fe;
}
.char-tag.warning-tag {
  border-color: rgba(196,181,253,.18);
  background: rgba(196,181,253,.10);
  color: var(--gold);
}
.free-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(110,231,183,.15);
  color: var(--green);
  border: 1px solid rgba(110,231,183,.20);
}
.char-online-hint {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--green);
  margin-top: 6px;
}
/* ============================================================
   PAGE: 我的
============================================================ */
.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(167,139,250,.10), rgba(129,140,248,.08));
  border: 1px solid rgba(255,255,255,.06);
  margin-bottom: 6px;
}
.profile-avatar {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  max-width: 56px;
  max-height: 56px;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.profile-name { font-size: 17px; font-weight: 700; }
.profile-sub  { font-size: 12px; color: var(--muted); margin-top: 3px; }

.setting-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 12px;
}
.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  cursor: pointer;
  transition: background .15s;
}
.setting-row:last-child { border-bottom: none; }
.setting-row:active { background: rgba(255,255,255,.04); }
.setting-row.static { cursor: default; }
.setting-row.static:active { background: transparent; }
.setting-row-icon { font-size: 18px; width: 26px; text-align: center; flex-shrink: 0; }
.setting-row-text { flex: 1; }
.setting-row-text .row-label { font-size: 14px; }
.setting-row-text .row-hint  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.setting-row-arrow { color: var(--muted); font-size: 13px; }

.auth-row { display: flex; gap: 10px; margin-bottom: 12px; }
.auth-row .btn { flex: 1; }

/* ── 登录/注册 Tab ─────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
}
.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 0;
  cursor: pointer;
  transition: all .25s ease;
  font-family: inherit;
  border-radius: 10px;
  letter-spacing: 0.5px;
}
.auth-tab:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}
.auth-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-start) 0%, var(--accent-end) 100%);
  box-shadow: 0 4px 15px rgba(129,140,248,0.35);
}
.forgot-password-link {
  font-size: 13px;
  color: var(--pink);
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.forgot-password-link:hover { opacity: 1; }

/* ============================================================
   角色详情弹窗
============================================================ */
.char-detail-cover {
  height: 300px;
  border-radius: var(--radius-lg);
  background-size: cover;
  background-position: center top;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.char-detail-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(0,0,0,.45) 60%, rgba(0,0,0,.88));
}
.char-detail-cover-inner { position: relative; z-index: 1; }
.char-detail-name { font-size: 26px; font-weight: 700; line-height: 1.2; }
.char-detail-sign { font-size: 13px; color: rgba(255,255,255,.75); margin-top: 4px; }
.char-detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.char-detail-tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(167,139,250,.10);
  border: 1px solid rgba(167,139,250,.18);
  color: var(--pink);
}
.char-detail-section { margin-bottom: 16px; }
.char-detail-section-title {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.char-detail-section p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
  margin: 0;
}
.char-detail-divider { height: 1px; background: var(--line); margin: 16px 0; }
.char-detail-actions { display: flex; gap: 10px; margin-top: 20px; }
.char-detail-actions .btn { flex: 1; padding: 15px; font-size: 15px; }

.detail-opening-preview {
  background: var(--bg-card-md);
  border: 1px solid rgba(167,139,250,.15);
  border-radius: 16px;
  border-top-left-radius: 4px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  position: relative;
}
.detail-opening-preview::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(167,139,250,.08), rgba(129,140,248,.06));
  pointer-events: none;
}

/* ============================================================
   剧情线选择弹窗
============================================================ */
.greeting-select-sheet {
  max-height: 88vh;
  overflow-y: auto;
  padding-bottom: 24px;
}
.greeting-select-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.greeting-select-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.greeting-select-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.greeting-list { padding: 10px 0 4px; }
.greeting-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background .15s;
}
.greeting-item:last-child { border-bottom: none; }
.greeting-item:active,
.greeting-item:hover { background: rgba(255,255,255,.04); }
.greeting-item-inner { flex: 1; min-width: 0; }
.greeting-item-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--pink);
  margin-bottom: 4px;
}
.greeting-item-preview {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.greeting-item-arrow { font-size: 20px; color: var(--muted); flex-shrink: 0; }

