/* ============================================================
   椎名真昼 App Styles
   ============================================================ */
:root {
  --bg: #fff7f9;
  --bg-2: #ffffff;
  --card: #ffffff;
  --text: #2a2230;
  --text-2: #8a7f8c;
  --border: #f3e4ea;
  --primary: #ff9eb5;
  --primary-2: #ff7eb3;
  --nav-bg: rgba(255, 255, 255, 0.72);
  --shadow: 0 8px 28px rgba(255, 158, 181, 0.18);
  --radius: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Google Material Icons base (ligature font) - LOCAL font for offline use */
@font-face {
  font-family: 'Material Icons';
  font-style: normal;
  font-weight: 400;
  src: url('./fonts/MaterialIcons-Regular.ttf') format('truetype');
}
.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'liga';
}

[data-theme="sakura"] {
  --bg: #fff0f6;
  --bg-2: #ffe3ee;
  --card: #ffffff;
  --primary: #ff7eb3;
  --primary-2: #ff5e9e;
  --nav-bg: rgba(255, 240, 246, 0.78);
  --shadow: 0 8px 28px rgba(255, 126, 179, 0.22);
}
[data-theme="dusk"] {
  --bg: #fff6ed;
  --bg-2: #ffecd9;
  --card: #ffffff;
  --primary: #ff9f6b;
  --primary-2: #ff8147;
  --nav-bg: rgba(255, 246, 237, 0.78);
  --shadow: 0 8px 28px rgba(255, 159, 107, 0.22);
}
[data-theme="night"] {
  --bg: #0f1424;
  --bg-2: #161d33;
  --card: #1c2540;
  --text: #e8ecf7;
  --text-2: #9aa3c4;
  --border: #2a3558;
  --primary: #7aa2ff;
  --primary-2: #5a85f0;
  --nav-bg: rgba(22, 29, 51, 0.72);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}
[data-theme="forest"] {
  --bg: #f0faf5;
  --bg-2: #e0f5ea;
  --card: #ffffff;
  --primary: #5cc8a0;
  --primary-2: #3db087;
  --nav-bg: rgba(240, 250, 245, 0.78);
  --shadow: 0 8px 28px rgba(92, 200, 160, 0.22);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Hiragino Sans", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  font-size: 15px;
  line-height: 1.5;
  transition: background 0.3s, color 0.3s;
}

#app {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.status-bar-spacer { height: env(safe-area-inset-top, 0px); flex-shrink: 0; }

/* ---------- Views ---------- */
.view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 16px 110px;
  -webkit-overflow-scrolling: touch;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Headers ---------- */
.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 18px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--primary);
  box-shadow: 0 6px 16px var(--shadow);
  padding: 2px;
  background: var(--card);
}
.brand-text h1 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--text), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-text p { font-size: 12px; color: var(--text-2); margin-top: 2px; }

.sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 16px;
}
.sub-header h2 { font-size: 22px; font-weight: 700; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--card);
  color: var(--text);
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.2s;
}
.icon-btn:active { transform: scale(0.92); }

/* ---------- Scroll gallery (horizontal) ---------- */
.scroll-gallery {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  margin-bottom: 6px;
  scroll-behavior: smooth;
}
.scroll-gallery::-webkit-scrollbar { display: none; }
.gallery-card {
  flex: 0 0 80%;
  height: 190px;
  border-radius: 20px;
  background-size: cover;
  background-position: center;
  scroll-snap-align: center;
  position: relative;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  overflow: hidden;
  transition: transform 0.3s;
}
.gallery-card:active { transform: scale(0.98); }
.gallery-card::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.7));
}
.gallery-caption {
  position: absolute;
  left: 16px; bottom: 14px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  z-index: 2;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 18px;
}
.gallery-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s;
  cursor: pointer;
}
.gallery-dot.active {
  width: 18px;
  border-radius: 3px;
  background: var(--primary);
}

/* ---------- Announcement capsule ---------- */
.announcement {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--card), color-mix(in srgb, var(--primary) 8%, var(--card)));
  border-radius: 999px;
  padding: 11px 16px;
  margin-bottom: 22px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.05);
  border: 1px solid color-mix(in srgb, var(--primary) 15%, var(--border));
}
.announce-icon {
  color: var(--primary);
  font-size: 16px;
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; }
}
.announce-text {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-2);
}

/* ---------- Quick cards grid ---------- */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.quick-card {
  background: var(--card);
  border-radius: 18px;
  padding: 16px 4px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.05);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.quick-card:active { transform: translateY(3px) scale(0.97); box-shadow: 0 1px 6px rgba(0,0,0,0.06); }
.quick-icon {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 10px color-mix(in srgb, var(--primary) 30%, transparent);
}
.quick-card:nth-child(2) .quick-icon { background: linear-gradient(135deg, #a78bfa, #7c3aed); box-shadow: 0 4px 10px rgba(124,58,237,0.3); }
.quick-card:nth-child(3) .quick-icon { background: linear-gradient(135deg, #34d399, #059669); box-shadow: 0 4px 10px rgba(5,150,105,0.3); }
.quick-card:nth-child(4) .quick-icon { background: linear-gradient(135deg, #fb7185, #e11d48); box-shadow: 0 4px 10px rgba(225,29,72,0.3); }
.quick-label { font-size: 12px; color: var(--text); font-weight: 500; }

/* ---------- Floating capsules ---------- */
.floating-capsules {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.capsule {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.capsule:active { transform: scale(0.95); }
.capsule-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 35%, transparent);
  flex: 1;
  justify-content: center;
  min-height: 46px;
}
.capsule-ghost {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  flex: 1;
  justify-content: center;
  min-height: 46px;
}
.capsule i { font-size: 18px; }

/* ---------- Quotes ---------- */
.quotes-list { display: flex; flex-direction: column; gap: 12px; }
.quote-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  position: relative;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  border: 1px solid var(--border);
}
.quote-mark {
  position: absolute;
  top: 14px; left: 16px;
  font-size: 18px;
  color: var(--primary);
  opacity: 0.5;
}
.quote-text {
  font-size: 15px;
  line-height: 1.7;
  padding-left: 26px;
  margin-bottom: 12px;
  font-weight: 500;
}
.quote-meta {
  display: flex;
  justify-content: space-between;
  padding-left: 26px;
  font-size: 12px;
}
.quote-ep { color: var(--text-2); }
.quote-cat {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  padding: 2px 10px;
  border-radius: 999px;
}

/* ---------- Chat ---------- */
.token-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 16px 8px;
}
.gate-illust {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.token-gate h3 { font-size: 20px; margin-bottom: 6px; }
.gate-desc { font-size: 13px; color: var(--text-2); margin-bottom: 14px; max-width: 320px; }
.tutorial-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  margin-bottom: 16px;
}
.token-form { width: 100%; max-width: 340px; text-align: left; }
.form-label { font-size: 13px; color: var(--text-2); margin-bottom: 8px; display: block; font-weight: 500; }
.form-group { margin-bottom: 14px; }
.token-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.form-group .token-input-wrap { margin-bottom: 0; }
.token-input-wrap i { color: var(--text-2); font-size: 15px; }
.token-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  min-width: 0;
}
.toggle-pass { cursor: pointer; }

/* Model info (fixed DeepSeek) */
.model-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 8%, var(--card));
  border: 1.5px solid color-mix(in srgb, var(--primary) 20%, var(--border));
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.model-info .model-svg-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: var(--primary);
}

.model-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  margin: 4px 0 14px;
  padding: 0 2px;
}
.model-hint i { color: var(--primary); }

.btn-primary {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.btn-primary:active { transform: scale(0.98); }

/* Chat view: flex column so input bar sits above bottom nav */
.view-chat { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
.chat-area { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 4px 16px;
  -webkit-overflow-scrolling: touch;
}
.msg-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  align-items: flex-end;
}
.msg-row.user { flex-direction: row-reverse; }
.msg-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.msg-bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}
.msg-row.ai .msg-bubble {
  background: var(--card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.msg-row.user .msg-bubble {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-name { display: block; font-size: 11px; color: var(--primary); margin-bottom: 2px; font-weight: 600; }
.msg-row.user .msg-bubble .msg-name { display: none; }
.typing { display: flex; gap: 4px; padding: 14px; }
.typing .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-2);
  animation: bounce 1.2s infinite;
}
.typing .dot:nth-child(2) { animation-delay: 0.15s; }
.typing .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.chat-input-bar {
  display: flex;
  gap: 10px;
  padding: 10px 4px calc(66px + var(--safe-bottom));
  align-items: flex-end;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.input-shell {
  flex: 1;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  padding: 10px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  max-height: 140px;
  overflow: hidden;
}
.input-shell:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.chat-input-bar textarea {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  resize: none;
  font-family: inherit;
  max-height: 120px;
  padding: 0;
}
.chat-input-bar textarea::placeholder { color: var(--text-2); }
.send-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
  flex-shrink: 0;
  transition: transform 0.15s, opacity 0.2s;
}
.send-btn:not(:disabled):active { transform: scale(0.9); }
.send-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.send-btn.stop-btn {
  background: var(--card);
  color: var(--text);
  border: 1.5px solid var(--border);
  box-shadow: none;
}
.send-btn.stop-btn:active { transform: scale(0.9); }

/* ---------- Settings ---------- */
.section-title {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 600;
  margin: 18px 4px 10px;
  letter-spacing: 0.5px;
}
.avatar-group {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.avatar-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}
.avatar-item:last-child { border-bottom: none; }
.avatar-img {
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.avatar-info { flex: 1; }
.avatar-name { font-weight: 600; font-size: 15px; }
.avatar-sub { font-size: 12px; color: var(--text-2); }
.avatar-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--primary);
  cursor: pointer;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.theme-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.theme-preview {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  border: 2px solid transparent;
  transition: border-color 0.2s, transform 0.2s;
}
.theme-card.active .theme-preview {
  border-color: var(--p, var(--primary));
  transform: scale(1.04);
}
.theme-card span { font-size: 11px; color: var(--text-2); }
.theme-card.active span { color: var(--text); font-weight: 600; }

.seg-group {
  display: flex;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
}
.seg-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}
.seg-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
}

.cache-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.cache-info { display: flex; align-items: center; gap: 12px; }
.cache-info > i {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.cache-label { font-size: 13px; font-weight: 600; }
.cache-value { font-size: 12px; color: var(--text-2); }
.btn-ghost {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
}

/* ---------- About ---------- */
.about-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 0 24px;
}
.about-logo {
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.about-hero h3 { font-size: 22px; }
.about-ver { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* Feature list */
.feature-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.feature-card {
  display: flex;
  gap: 10px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  align-items: flex-start;
}
.feature-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.feature-body { flex: 1; min-width: 0; }
.feature-title { font-size: 13px; font-weight: 600; margin-bottom: 3px; color: var(--text); }
.feature-desc { font-size: 11px; line-height: 1.45; color: var(--text-2); }

.about-list {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.about-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.about-item:last-child { border-bottom: none; }
.about-item > i:first-child {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.about-item > div { flex: 1; }
.about-label { font-size: 14px; font-weight: 600; }
.about-val { font-size: 12px; color: var(--text-2); }
.about-item > i:last-child { color: var(--text-2); font-size: 16px; }
.heart-mini { font-size: 13px !important; vertical-align: middle; color: var(--primary); }
.pink { color: var(--primary); }

/* ---------- Bottom nav (frosted glass + line indicator) ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
  z-index: 100;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 0 8px;
  position: relative;
  cursor: pointer;
  color: var(--text-2);
  transition: color 0.25s;
}
.nav-item i { font-size: 18px; transition: transform 0.25s; }
.nav-item span { font-size: 11px; font-weight: 500; }
.nav-item.active { color: var(--primary); }
.nav-item.active i { transform: translateY(-1px); }
.nav-indicator {
  position: absolute;
  bottom: 2px;
  width: 22px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  animation: slideIn 0.28s ease;
}
@keyframes slideIn { from { width: 0; opacity: 0; } to { width: 22px; opacity: 1; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.82);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 999;
  animation: popIn 0.25s ease;
  max-width: 80%;
  text-align: center;
}
@keyframes popIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ============================================================
   Community
   ============================================================ */
.view-community { display: flex; flex-direction: column; }
.community-list { display: flex; flex-direction: column; flex: 1; }

/* Board tabs */
.board-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scroll-snap-type: x mandatory;
}
.board-tabs::-webkit-scrollbar { display: none; }
.board-tab {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.board-tab i { font-size: 16px; }
.board-tab.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
.board-tab:not(.active) i { color: var(--bc, var(--primary)); }

/* Sort bar */
.sort-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.sort-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
}
.sort-btn i { font-size: 16px; }
.sort-btn.active { color: var(--primary); font-weight: 700; }

/* Post list & cards */
.post-list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 24px; }
.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.post-card:active { transform: scale(0.99); }
.post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.post-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.post-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.post-author { font-size: 13px; font-weight: 600; color: var(--text); }
.post-time { font-size: 11px; color: var(--text-2); }
.post-board {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid;
  background: color-mix(in srgb, currentColor 10%, transparent);
}
.post-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.post-excerpt {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.55;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.post-actions {
  display: flex;
  gap: 18px;
  margin-top: 10px;
}
.post-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
}
.post-stat i { font-size: 16px; }
.post-stat.liked { color: var(--primary); }

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 60px 20px;
  color: var(--text-2);
}
.empty-state i { font-size: 48px; opacity: 0.5; }
.empty-state p { font-size: 14px; }

/* Floating action button */
.fab {
  position: fixed;
  bottom: calc(82px + var(--safe-bottom));
  right: 18px;
  width: 54px; height: 54px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.22);
  cursor: pointer;
  z-index: 90;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fab i { font-size: 26px; }
.fab:active { transform: scale(0.92); }

/* Post detail */
.post-detail { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.detail-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0 16px;
  -webkit-overflow-scrolling: touch;
}
.detail-card { cursor: default; }
.detail-title { -webkit-line-clamp: unset; }
.post-full {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.detail-actions { padding-top: 6px; border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }

/* Comments */
.comments-section { margin-top: 16px; }
.comments-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  padding: 0 4px 12px;
}
.comments-title i { font-size: 18px; color: var(--primary); }
.empty-comments {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 30px 20px;
  color: var(--text-2);
  font-size: 13px;
}
.empty-comments i { font-size: 32px; opacity: 0.5; }
.comment-item {
  display: flex;
  gap: 10px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }
.comment-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.comment-body { flex: 1; min-width: 0; }
.comment-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.comment-author { font-size: 13px; font-weight: 600; color: var(--text); }
.comment-time { font-size: 11px; color: var(--text-2); }
.comment-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
  word-break: break-word;
}
.comment-actions { margin-top: 6px; }
.comment-like {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.comment-like i { font-size: 14px; }
.comment-like.liked { color: var(--primary); }

/* Comment input bar (above bottom nav) */
.comment-input-bar {
  display: flex;
  gap: 10px;
  padding: 10px 4px calc(66px + var(--safe-bottom));
}
.comment-input-bar .input-shell {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 14px;
}
.input-icon { font-size: 18px; color: var(--text-2); }
.comment-input-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  padding: 10px 0;
  outline: none;
  color: var(--text);
}
.send-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s, opacity 0.2s;
}
.send-btn i { font-size: 20px; }
.send-btn:disabled { opacity: 0.4; }
.send-btn:active { transform: scale(0.92); }

/* Compose */
.compose-view { display: flex; flex-direction: column; flex: 1; }
.compose-form {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text); }
.board-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.board-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.board-chip i { font-size: 15px; color: var(--bc, var(--primary)); }
.board-chip.active {
  color: #fff;
  border-color: transparent;
  background: var(--bc, var(--primary));
}
.board-chip.active i { color: #fff; }
.compose-input, .compose-textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  font-family: inherit;
  resize: vertical;
}
.compose-input:focus, .compose-textarea:focus { border-color: var(--primary); }
.compose-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}
.publish-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
}

/* ---------- Home latest activity ---------- */
.latest-section {
  margin-top: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px 16px 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.latest-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.latest-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.latest-title i { font-size: 20px; color: var(--primary); }
.latest-more {
  display: flex;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.latest-more i { font-size: 16px; }

.latest-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 12px;
  color: var(--text-2);
}
.latest-empty > i { font-size: 44px; opacity: 0.4; }
.latest-empty p { font-size: 13px; text-align: center; margin: 0; }
.latest-empty .btn-primary {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.latest-empty .btn-primary i { font-size: 16px; }

.latest-list { display: flex; flex-direction: column; gap: 0; }
.latest-item {
  display: flex;
  gap: 12px;
  padding: 13px 10px;
  cursor: pointer;
  border-radius: 14px;
  transition: background 0.2s, transform 0.15s;
}
.latest-item + .latest-item { border-top: 1px solid var(--border); }
.latest-item:active { background: var(--bg-2); transform: scale(0.99); }
.latest-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
}
.latest-body { flex: 1; min-width: 0; }
.latest-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.latest-author { font-size: 13px; font-weight: 600; color: var(--text); }
.latest-time { font-size: 11px; color: var(--text-2); }
.latest-board {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid;
  flex-shrink: 0;
  background: color-mix(in srgb, currentColor 8%, transparent);
}
.latest-post-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 5px;
}
.latest-stats { display: flex; gap: 16px; }
.latest-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-2);
}
.latest-stat i { font-size: 14px; }

/* ---------- Entrance Exam (强制入站考试) ---------- */
.exam-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: linear-gradient(160deg, #fff1f5 0%, #ffe4ec 50%, #ffd6e0 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.exam-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 12px 16px 0;
}
.exam-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px 16px;
  flex-shrink: 0;
}
.exam-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.exam-title > i {
  font-size: 30px;
  color: #fff;
  background: linear-gradient(135deg, #ff9eb5, #ff7eb3);
  padding: 8px;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(255,126,179,0.35);
}
.exam-title h2 {
  font-size: 19px;
  font-weight: 700;
  color: #3a2a30;
  margin: 0;
}
.exam-title p {
  font-size: 12px;
  color: #8a6a72;
  margin: 2px 0 0;
}
.exam-progress {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ff9eb5, #ff7eb3);
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(255,126,179,0.3);
}

.exam-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 90px;
}
.exam-body::-webkit-scrollbar { width: 0; }

.exam-question {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 3px 12px rgba(255,126,179,0.12);
  border: 1px solid rgba(255,255,255,0.6);
}
.exam-q-head {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.exam-q-num {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff9eb5, #ff7eb3);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.exam-q-text {
  font-size: 15px;
  font-weight: 600;
  color: #3a2a30;
  line-height: 1.5;
  padding-top: 2px;
}
.exam-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.exam-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: #fff;
  border: 1.5px solid #f0dce2;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
}
.exam-option:active { transform: scale(0.98); }
.exam-option.selected {
  border-color: #ff7eb3;
  background: linear-gradient(135deg, #fff0f5, #ffe4ec);
  box-shadow: 0 2px 8px rgba(255,126,179,0.2);
}
.exam-opt-letter {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #f7e6eb;
  color: #b07080;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.exam-option.selected .exam-opt-letter {
  background: linear-gradient(135deg, #ff9eb5, #ff7eb3);
  color: #fff;
}
.exam-opt-text {
  font-size: 14px;
  color: #3a2a30;
}

.exam-footer {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(0deg, #ffe4ec 60%, transparent);
}
.exam-submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff9eb5, #ff7eb3);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255,126,179,0.4);
  transition: transform 0.15s;
}
.exam-submit:active { transform: scale(0.97); }
.exam-submit.disabled {
  background: #e8d0d8;
  box-shadow: none;
  cursor: not-allowed;
}
.exam-submit i { font-size: 20px; }

/* ---------- Report Card ---------- */
.report-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(58, 42, 48, 0.5);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.3s ease;
}
.report-card {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 24px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  position: relative;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.report-card.pass { border: 2px solid #ffd700; }
.report-card.fail { border: 2px solid #e8a0a0; }

.report-ribbon {
  text-align: center;
  padding: 22px 0 8px;
  background: linear-gradient(135deg, #fff8e1, #ffecb3);
}
.report-card.fail .report-ribbon {
  background: linear-gradient(135deg, #fce4ec, #f8bbd0);
}
.report-ribbon i {
  font-size: 52px;
  color: #ffb300;
  filter: drop-shadow(0 3px 6px rgba(255,179,0,0.3));
}
.report-card.fail .report-ribbon i { color: #e57373; }

.report-header {
  text-align: center;
  padding: 10px 20px 4px;
}
.report-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #3a2a30;
  margin: 0;
}
.report-sub {
  font-size: 13px;
  color: #a08890;
  margin: 2px 0 0;
  letter-spacing: 4px;
}

.report-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 4px;
}
.report-name-row label {
  font-size: 13px;
  color: #8a6a72;
  font-weight: 600;
  flex-shrink: 0;
}
.report-name-row input {
  flex: 1;
  border: 1.5px solid #f0dce2;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  color: #3a2a30;
  outline: none;
  background: #fffaf7;
}
.report-name-row input:focus { border-color: #ff9eb5; }

.report-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  padding: 16px 20px 6px;
}
.score-num {
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, #ffb300, #ff7043);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.report-card.fail .score-num {
  background: linear-gradient(135deg, #e57373, #c62828);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.score-unit {
  font-size: 20px;
  font-weight: 700;
  color: #b08890;
}

.report-result {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  padding: 4px 20px;
}
.pass-text { color: #ff9800; }
.fail-text { color: #e57373; }

.report-details {
  margin: 14px 20px;
  padding: 14px 16px;
  background: #faf5f7;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.report-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.report-detail-row span:first-child { color: #8a6a72; }
.report-detail-row span:last-child { color: #3a2a30; font-weight: 600; }

.report-actions {
  padding: 0 20px 22px;
  display: flex;
  gap: 10px;
}
.report-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px;
  border: none;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s;
}
.report-btn:active { transform: scale(0.96); }
.report-btn.retry {
  background: #f0dce2;
  color: #8a6a72;
}
.report-btn.enter {
  background: linear-gradient(135deg, #ff9eb5, #ff7eb3);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255,126,179,0.35);
}
.report-btn i { font-size: 18px; }

/* ---------- Account & Auth Panel (设置页账号) ---------- */
.account-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(0,0,0,0.04);
  margin-bottom: 22px;
}
.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.2s;
}
.account-row:active { background: var(--bg-2); }
.account-info { display: flex; align-items: center; gap: 12px; }
.account-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.account-avatar i { font-size: 22px; }
.account-name { font-size: 15px; font-weight: 600; color: var(--text); }
.account-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.account-action { display: flex; align-items: center; gap: 8px; }
.account-chevron {
  font-size: 22px;
  color: var(--text-2);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.account-chevron.open { transform: rotate(180deg); }
.btn-sm { padding: 7px 12px; font-size: 12px; }

/* Smooth expand/collapse using grid-rows trick */
.auth-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.auth-panel.expanded { grid-template-rows: 1fr; }
.auth-panel > .auth-inner {
  overflow: hidden;
  min-height: 0;
}
.auth-panel.expanded > .auth-inner {
  padding: 4px 16px 18px;
  border-top: 1px solid var(--border);
}

.auth-tabs {
  display: flex;
  gap: 6px;
  padding: 14px 0 16px;
}
.auth-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 6px;
  border: none;
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
}
.auth-tab i { font-size: 16px; }
.auth-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--primary) 30%, transparent);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeSlide 0.3s ease;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.auth-field {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-field input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}
.field-icon {
  position: absolute;
  left: 13px;
  font-size: 18px;
  color: var(--text-2);
  pointer-events: none;
}
.field-suffix {
  position: absolute;
  right: 13px;
  font-size: 18px;
  color: var(--text-2);
  cursor: pointer;
}
.auth-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  padding: 0 2px;
}
.auth-hint i { font-size: 15px; color: var(--primary); }
.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 30%, transparent);
  transition: transform 0.15s;
}
.auth-submit:active { transform: scale(0.97); }
.auth-submit i { font-size: 18px; }
.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
  margin: 4px 0 0;
}
.auth-switch span {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  margin-left: 4px;
}

/* ---------- Account Avatar Image ---------- */
.account-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* ---------- Profile Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.profile-modal {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  padding: 20px 18px 32px;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.15);
  animation: slideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  position: relative;
}
.profile-avatar-large {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.profile-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar-large .material-icons {
  font-size: 32px;
  color: var(--text-2);
}
.profile-title { flex: 1; min-width: 0; }
.profile-name-display {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 2px;
}
.profile-email-display {
  font-size: 13px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-close {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.profile-close:hover { background: var(--primary); color: #fff; }
.profile-close .material-icons { font-size: 20px; }

.profile-section { margin-bottom: 8px; }
.profile-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 12px;
}
.profile-section-title .material-icons {
  font-size: 18px;
  color: var(--primary);
}
.profile-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}
.profile-modal .auth-submit { width: 100%; }

.modal-fade-enter-active,
.modal-fade-leave-active {
  transition: opacity 0.3s ease;
}
.modal-fade-enter-from,
.modal-fade-leave-to { opacity: 0; }

@media (min-width: 600px) {
  .modal-overlay { align-items: center; padding: 20px; }
  .profile-modal {
    border-radius: 20px;
    max-height: 85vh;
    animation: popIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  }
  @keyframes popIn {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
  }
}

/* ---------- Responsive ---------- */
@media (min-width: 600px) {
  body { display: flex; justify-content: center; }
  #app {
    max-width: 480px;
    width: 100%;
    box-shadow: 0 0 40px rgba(0,0,0,0.1);
  }
  .bottom-nav { max-width: 480px; left: 50%; transform: translateX(-50%); }
}
