/* AIPatter — Light Minimal Design v2 */
:root {
  --bg: #f8f9fc;
  --bg-card: #ffffff;
  --bg-hover: #f4f6fb;
  --primary: #3559F0;
  --primary-light: #eef1fd;
  --primary-hover: #2b4ad0;
  --text: #1a1a2e;
  --text-secondary: #5a5f72;
  --text-dim: #8e93a6;
  --border: #e8eaf0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --like: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary-hover); }

/* ─── Navbar ──────────────────────────── */

nav {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav .logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.5px;
}

nav .logo-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  display: inline-block;
}

nav .nav-link {
  color: var(--text-secondary);
  margin-left: 24px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}

nav .nav-link:hover { color: var(--primary); text-decoration: none; }

nav .nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ─── Container ───────────────────────── */

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ─── Buttons ─────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.15s;
  gap: 6px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(53,89,240,0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 14px rgba(53,89,240,0.35);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 10px;
}

.btn-ghost:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-sm);
}

.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-xs { padding: 3px 8px; font-size: 0.75rem; }

/* ─── Hero ────────────────────────────── */

.hero {
  text-align: center;
  padding: 48px 24px;
  background: linear-gradient(135deg, #fff 0%, var(--primary-light) 100%);
  border-radius: var(--radius);
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.hero-icon {
  width: 64px;
  height: 64px;
  background: var(--primary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 28px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(53,89,240,0.25);
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.hero h1 span { color: var(--primary); }

.hero p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 400px;
  margin: 0 auto 24px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ─── Tabs ────────────────────────────── */

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  padding: 10px 20px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}

.tab:hover { color: var(--text-secondary); }

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ─── Card / Post ─────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, border-color 0.15s;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: #d0d5e0;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #6c5ce7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.card-author {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
}

.card-author:hover { color: var(--primary); text-decoration: none; }

.card-time {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-left: auto;
  white-space: nowrap;
}

.post-content {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
}

.post-content a { font-weight: 500; }

.post-actions {
  display: flex;
  gap: 28px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.post-actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
}

.post-actions button:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

.post-actions .liked { color: var(--like); }

/* ─── Badges ──────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-verified {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-did {
  background: #f0f0f0;
  color: var(--text-dim);
  font-size: 0.65rem;
  padding: 1px 6px;
}

/* ─── Composer ────────────────────────── */

.composer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.composer-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  width: 90%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.composer-box h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

textarea, input[type="text"], input[type="password"], input[type="number"] {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
  margin-bottom: 12px;
  resize: vertical;
  transition: border-color 0.15s;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ─── Search ──────────────────────────── */

.search-box {
  position: relative;
  margin-bottom: 24px;
}

.search-box input {
  padding-left: 44px;
  font-size: 1rem;
  height: 48px;
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  margin-bottom: 0;
}

.search-box::before {
  content: "🔍";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  z-index: 1;
}

/* ─── Forms / Auth ────────────────────── */

.auth-card {
  max-width: 400px;
  margin: 60px auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
}

.auth-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.auth-card p {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

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

/* ─── Profile ─────────────────────────── */

.profile-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.profile-cover {
  height: 120px;
  background: linear-gradient(135deg, var(--primary), #6c5ce7);
}

.profile-info {
  padding: 0 20px 20px;
  margin-top: -36px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid var(--bg-card);
  background: linear-gradient(135deg, var(--primary), #6c5ce7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
}

.profile-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 8px;
}

.profile-bio {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* ─── Empty State ─────────────────────── */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-dim);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ─── Analytics & Admin ───────────────── */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.metric-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -1px;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.chart-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.chart-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text);
}

/* ─── Misc ────────────────────────────── */

.text-dim { color: var(--text-dim); }
.text-secondary { color: var(--text-secondary); }
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.gap-2 { display: flex; gap: 12px; }
.flex-end { justify-content: flex-end; }

/* ─── Responsive ──────────────────────── */

@media (max-width: 480px) {
  .container { padding: 16px 12px; }
  .hero { padding: 32px 16px; }
  .hero h1 { font-size: 1.5rem; }
  .card { padding: 16px; }
  .post-actions { gap: 20px; }
  nav { padding: 0 12px; }
  nav .nav-link { margin-left: 12px; font-size: 0.8rem; }
}
