/* 互粉助手 — 独立 App 设计系统（不依赖博客 style.css） */
:root {
  --mf-header-height: 56px;
  --mf-tab-height: 56px;
  --mf-bg: #0c0a14;
  --mf-bg-card: #161222;
  --mf-bg-elevated: #1e1a2e;
  --mf-border: rgba(255, 255, 255, 0.08);
  --mf-border-strong: rgba(255, 255, 255, 0.14);
  --mf-text: #f4f2ff;
  --mf-text-muted: #9b93b8;
  --mf-text-secondary: #c4bdd9;
  --mf-accent: #8b5cf6;
  --mf-accent-hover: #a78bfa;
  --mf-accent-soft: rgba(139, 92, 246, 0.15);
  --mf-success: #22c55e;
  --mf-danger: #ef4444;
  --mf-warning: #f59e0b;
  --mf-radius-sm: 8px;
  --mf-radius-md: 12px;
  --mf-radius-lg: 16px;
  --mf-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --mf-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
}

body.mf-app {
  font-family: var(--mf-font);
  background: var(--mf-bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.25), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(236, 72, 153, 0.12), transparent);
  color: var(--mf-text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
}

.mf-app button {
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
}

a { color: var(--mf-accent-hover); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.mf-header {
  position: sticky;
  top: 0;
  z-index: 900;
  height: var(--mf-header-height);
  background: rgba(12, 10, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--mf-border);
}

.mf-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 100%;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mf-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--mf-text);
  font-weight: 700;
  font-size: 1.05rem;
}

.mf-logo:hover { text-decoration: none; }

.mf-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.mf-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

body[data-mf-nav="dashboard"] #mf-user-slot,
body.mf-nav-dashboard #mf-user-slot {
  display: none !important;
}

/* Buttons */
.mf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--mf-radius-md);
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, background 0.15s;
  min-height: 44px;
}

.mf-btn:hover { text-decoration: none; transform: translateY(-1px); }
.mf-btn:active { transform: translateY(0); }

.mf-btn-primary {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
}

.mf-btn-primary:hover { background: linear-gradient(135deg, #a78bfa, #8b5cf6); color: #fff; }

.mf-btn-secondary {
  background: var(--mf-bg-elevated);
  color: var(--mf-text);
  border: 1px solid var(--mf-border);
}

.mf-btn-secondary:hover { border-color: var(--mf-border-strong); color: var(--mf-text); }

.mf-btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.mf-btn-danger:hover { background: rgba(239, 68, 68, 0.2); color: #fecaca; border-color: rgba(239, 68, 68, 0.5); }

.mf-btn-sm { padding: 8px 14px; font-size: 0.88rem; min-height: 44px; }

.mf-btn-block { width: 100%; }

/* Layout */
.mf-page-body {
  padding-bottom: calc(var(--mf-bottom-nav-offset, 80px) + 24px + env(safe-area-inset-bottom, 0px));
}

.mf-page-body.has-sidebar {
  padding-bottom: 48px;
}

.mf-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.mf-sidebar {
  position: sticky;
  top: calc(var(--mf-header-height) + 16px);
  align-self: start;
  background: var(--mf-bg-card);
  border: 1px solid var(--mf-border);
  border-radius: var(--mf-radius-lg);
  padding: 12px;
}

.mf-sidebar a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--mf-radius-sm);
  color: var(--mf-text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  margin-bottom: 2px;
}

.mf-sidebar a:hover,
.mf-sidebar a.active {
  background: var(--mf-accent-soft);
  color: var(--mf-text);
  text-decoration: none;
}

.mf-main { min-width: 0; }

.mf-hero-block {
  margin-bottom: 20px;
}

.mf-hero-block h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.mf-hero-block p {
  color: var(--mf-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.mf-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.mf-card {
  background: var(--mf-bg-card);
  border: 1px solid var(--mf-border);
  border-radius: var(--mf-radius-lg);
  padding: 18px;
  transition: border-color 0.2s, transform 0.2s;
}

.mf-card:hover {
  border-color: var(--mf-border-strong);
  transform: translateY(-2px);
}

.mf-card-muted {
  opacity: 0.65;
}

.mf-card-muted:hover {
  transform: none;
}

.mf-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.mf-platform-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--mf-bg-elevated);
  color: var(--mf-text-secondary);
}

.mf-reward {
  color: var(--mf-warning);
  font-weight: 700;
  font-size: 1.05rem;
}

.mf-form-panel {
  max-width: 420px;
  margin: 0 auto;
  background: var(--mf-bg-card);
  border: 1px solid var(--mf-border);
  border-radius: var(--mf-radius-lg);
  padding: 28px 22px;
  box-shadow: var(--mf-shadow);
}

.mf-auth-wrap {
  min-height: calc(100dvh - var(--mf-header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.mf-field { margin-bottom: 16px; }

.mf-field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--mf-text-secondary);
}

.mf-field input,
.mf-field select,
.mf-field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--mf-radius-md);
  border: 1px solid var(--mf-border);
  background: var(--mf-bg-elevated);
  color: var(--mf-text);
  font-family: inherit;
  font-size: 1rem;
  -webkit-appearance: none;
  appearance: none;
}

.mf-field input:-webkit-autofill,
.mf-field input:-webkit-autofill:hover,
.mf-field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--mf-bg-elevated) inset;
  -webkit-text-fill-color: var(--mf-text);
  caret-color: var(--mf-text);
  transition: background-color 9999s ease-out 0s;
}

.mf-field input:focus,
.mf-field select:focus,
.mf-field textarea:focus {
  outline: none;
  border-color: var(--mf-accent);
  box-shadow: 0 0 0 3px var(--mf-accent-soft);
}

.mf-field textarea { min-height: 100px; resize: vertical; }

.mf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.mf-actions .mf-btn { flex: 1; min-width: 120px; }

.mf-user-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--mf-bg-elevated);
  color: var(--mf-text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--mf-border);
}

.mf-user-chip:hover { color: var(--mf-text); text-decoration: none; }

.mf-bell {
  position: relative;
  display: inline-flex;
  font-size: 1.2rem;
  text-decoration: none;
  padding: 6px 8px;
}

.mf-badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--mf-danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mf-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 800;
  background: rgba(12, 10, 20, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--mf-border);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}

.mf-bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  max-width: 480px;
  margin: 0 auto;
}

.mf-bottom-nav a {
  flex: 1;
  text-align: center;
  padding: 6px 4px;
  text-decoration: none;
  color: var(--mf-text-muted);
  font-size: 0.72rem;
}

.mf-bottom-nav a.active { color: var(--mf-accent-hover); font-weight: 600; }
.mf-bottom-nav a:hover { text-decoration: none; color: var(--mf-text); }

.mf-bottom-nav span {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 2px;
}

.mf-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.mf-stat {
  background: var(--mf-bg-card);
  border: 1px solid var(--mf-border);
  border-radius: var(--mf-radius-md);
  padding: 16px;
  text-align: center;
}

.mf-stat strong { display: block; font-size: 1.45rem; margin-bottom: 4px; }
.mf-stat span { font-size: 0.82rem; color: var(--mf-text-muted); }

.mf-notify-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--mf-border);
}

.mf-notify-item.unread { background: var(--mf-bg-elevated); }
.mf-notify-item h4 { font-size: 0.95rem; margin-bottom: 4px; }
.mf-notify-item p { font-size: 0.88rem; color: var(--mf-text-muted); margin-bottom: 4px; }
.mf-notify-item time { font-size: 0.78rem; color: var(--mf-text-muted); }

.mf-disclaimer {
  margin-top: 28px;
  padding: 14px;
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-elevated);
  font-size: 0.8rem;
  color: var(--mf-text-muted);
  line-height: 1.55;
  border: 1px solid var(--mf-border);
}

.mf-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--mf-text-muted);
}

.mf-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0;
}

.mf-filter-bar button {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--mf-border);
  background: var(--mf-bg-elevated);
  color: var(--mf-text-secondary);
  cursor: pointer;
  font-size: 0.88rem;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  min-height: 36px;
}

.mf-filter-bar button.active {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.mf-hall-toolbar {
  margin-bottom: 18px;
  padding: 14px;
  background: var(--mf-bg-card);
  border: 1px solid var(--mf-border);
  border-radius: var(--mf-radius-lg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mf-search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.mf-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mf-accent-hover);
  opacity: 0.85;
  pointer-events: none;
}

.mf-search-input {
  width: 100%;
  padding: 12px 40px 12px 44px;
  border-radius: 999px;
  border: 1px solid var(--mf-border);
  background: var(--mf-bg-elevated);
  color: var(--mf-text);
  font-size: 0.95rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.mf-search-input::placeholder {
  color: var(--mf-text-muted);
  opacity: 0.9;
}

.mf-search-input:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.55);
  background: rgba(30, 26, 46, 0.95);
  box-shadow: 0 0 0 3px var(--mf-accent-soft);
}

.mf-search-input[type="search"]::-webkit-search-decoration,
.mf-search-input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.mf-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--mf-accent-soft);
  color: var(--mf-accent-hover);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.mf-search-clear:active {
  background: rgba(139, 92, 246, 0.28);
}

.mf-load-more-wrap {
  text-align: center;
  padding: 8px 0 4px;
}

.mf-load-more-end {
  text-align: center;
  padding: 12px 0 4px;
  color: var(--mf-text-muted);
  font-size: 0.85rem;
}

.mf-msg {
  padding: 10px 14px;
  border-radius: var(--mf-radius-md);
  margin-bottom: 14px;
  font-size: 0.9rem;
}

.mf-msg.error { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }
.mf-msg.success { background: rgba(34, 197, 94, 0.12); color: #86efac; }

.mf-page-title {
  font-size: 1.25rem;
  margin-bottom: 16px;
}

.mf-text-muted { color: var(--mf-text-muted); }
.mf-text-sm { font-size: 0.88rem; }

.mf-follow-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 850;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(12, 10, 20, 0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--mf-border);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
}

.mf-follow-bar-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.mf-follow-hint {
  font-size: 0.78rem;
  color: var(--mf-text-muted);
  flex: 1;
  min-width: 120px;
}

.mf-follow-tip {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--mf-text-muted);
  line-height: 1.45;
}

body.mf-has-follow-bar .mf-page-body,
body.mf-has-follow-bar.mf-app {
  padding-bottom: calc(140px + env(safe-area-inset-bottom));
}

@media (max-width: 768px) {
  .mf-layout {
    grid-template-columns: 1fr;
    padding: 12px 12px 0;
    gap: 0;
  }

  .mf-sidebar { display: none; }

  .mf-main {
    min-width: 0;
    overflow-x: hidden;
  }

  .mf-page-body,
  .mf-page-body.has-sidebar {
    padding-bottom: calc(var(--mf-bottom-nav-offset, 80px) + 28px + env(safe-area-inset-bottom, 0px));
  }

  body.mf-has-bottom-nav .mf-main {
    padding-bottom: 8px;
  }

  .mf-bottom-nav { display: block; }

  .mf-cards { grid-template-columns: 1fr; }

  .mf-page-title {
    font-size: 1.15rem;
    margin-bottom: 12px;
  }

  .mf-card {
    padding: 16px;
  }

  .mf-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .mf-actions .mf-btn {
    flex: none;
    width: 100%;
    min-width: 0;
  }

  .mf-actions--row {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .mf-actions--row .mf-btn {
    flex: 1 1 calc(50% - 5px);
    width: auto;
    min-width: 0;
  }

  .mf-filter-bar button {
    min-height: 44px;
    padding: 10px 14px;
  }

  .mf-form-panel {
    padding: 22px 16px;
  }

  .mf-notify-item .mf-actions {
    margin-top: 10px;
  }

  .mf-disclaimer {
    margin-bottom: 8px;
  }
}

@media (min-width: 769px) {
  .mf-page-body.has-sidebar .mf-hero-block {
    text-align: left;
  }
}

/* Language switcher */
.mf-lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.mf-lang-btn {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  line-height: 1;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 8px;
}
.mf-lang-btn:hover {
  background: rgba(139, 92, 246, 0.12);
}

.mf-auth-lang {
  margin-top: 20px;
  text-align: center;
}
.mf-auth-lang-btn {
  border: none;
  background: transparent;
  color: var(--mf-muted, #64748b);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
}
.mf-auth-lang-btn:hover {
  background: rgba(139, 92, 246, 0.08);
  color: var(--mf-primary, #8b5cf6);
}

/* RTL */
html[dir="rtl"] .mf-header-back,
html[dir="rtl"] .mf-menu-chevron {
  transform: scaleX(-1);
}
html[dir="rtl"] .mf-search-icon {
  left: auto;
  right: 14px;
}
html[dir="rtl"] .mf-search-input {
  padding: 12px 44px 12px 40px;
}
html[dir="rtl"] .mf-sidebar a {
  text-align: right;
}
