/* ============================================
   提示词优化器 v1.1 — 深色科技感主题
   ============================================ */

/* --- Design Tokens --- */
:root {
  --c-primary: #6366f1;
  --c-primary-600: #4f46e5;
  --c-primary-700: #4338ca;
  --c-primary-50: rgba(99,102,241,0.12);
  --c-accent: #8b5cf6;
  --c-accent-600: #7c3aed;
  --c-success: #10b981;
  --c-warning: #f59e0b;
  --c-danger: #ef4444;

  --c-bg: #0a0a0f;
  --c-surface: #13131a;
  --c-surface-alt: #1a1a24;
  --c-surface-hover: #1e1e2a;

  --c-text: #f1f5f9;
  --c-text-2: #94a3b8;
  --c-text-3: #64748b;
  --c-border: #1e293b;
  --c-border-light: #1a1a28;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow: 0 4px 6px rgba(0,0,0,0.4);
  --shadow-md: 0 10px 20px rgba(0,0,0,0.5);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.6);
  --shadow-xl: 0 30px 60px rgba(0,0,0,0.7);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

  --sidebar-width: 240px;
  --header-height: 60px;
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* --- Animated Background --- */
.bg-grid {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(99,102,241,0.08), transparent),
    radial-gradient(ellipse 60% 50% at 90% 50%, rgba(139,92,246,0.05), transparent),
    radial-gradient(ellipse 50% 70% at 10% 80%, rgba(99,102,241,0.04), transparent);
}

/* --- Header --- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,15,0.9);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--c-border);
  height: var(--header-height);
}
.header-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px;
  box-shadow: 0 0 20px rgba(99,102,241,0.3);
}
.logo-text { font-size: 18px; font-weight: 700; color: var(--c-text); }
.logo-text span { color: var(--c-primary); }

.nav { display: flex; gap: 4px; }
.nav-tab {
  color: var(--c-text-2); text-decoration: none;
  padding: 8px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 500;
  transition: all 0.2s; cursor: pointer;
  background: none; border: none; font-family: inherit;
}
.nav-tab:hover { color: var(--c-text); background: var(--c-surface-hover); }
.nav-tab.active { color: var(--c-primary); background: var(--c-primary-50); }

.header-right { display: flex; align-items: center; gap: 10px; }
.user-menu { display: flex; align-items: center; gap: 8px; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.user-name { font-size: 14px; font-weight: 500; color: var(--c-text); }

/* --- Layout --- */
.layout {
  display: flex; position: relative; z-index: 1;
  max-width: 1400px; margin: 0 auto;
  min-height: calc(100vh - var(--header-height));
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width); min-width: var(--sidebar-width);
  border-right: 1px solid var(--c-border);
  padding: 20px 0;
  background: var(--c-surface);
  overflow-y: auto;
  transition: margin-left 0.3s ease, width 0.3s ease, min-width 0.3s ease;
  position: sticky; top: var(--header-height);
  height: calc(100vh - var(--header-height));
}
.sidebar.collapsed {
  margin-left: calc(var(--sidebar-width) * -1);
}
.sidebar-header {
  padding: 0 16px 16px;
  border-bottom: 1px solid var(--c-border-light);
  margin-bottom: 8px;
}
.sidebar-header h3 {
  font-size: 16px; font-weight: 700;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar-hint { font-size: 12px; color: var(--c-text-3); margin-top: 2px; display: block; }
.sidebar-list { padding: 0 8px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-loading { text-align: center; padding: 20px; color: var(--c-text-3); font-size: 14px; }

.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.2s;
  border: 1px solid transparent;
  position: relative;
}
.sidebar-item:hover {
  background: var(--c-surface-alt);
  border-color: var(--c-border);
  transform: translateX(2px);
}
.sidebar-item.copied { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); }
.sidebar-item-icon {
  width: 36px; height: 36px; min-width: 36px;
  background: var(--c-surface-alt);
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: all 0.2s;
}
.sidebar-item:hover .sidebar-item-icon { background: var(--c-surface-hover); }
.sidebar-item-info { flex: 1; min-width: 0; }
.sidebar-item-title { font-size: 13px; font-weight: 600; color: var(--c-text); }
.sidebar-item-category { font-size: 11px; color: var(--c-text-3); margin-top: 1px; }
.sidebar-item-tip {
  position: absolute; right: 8px;
  font-size: 11px; color: var(--c-primary); font-weight: 500;
  opacity: 0; transition: opacity 0.2s;
}
.sidebar-item:hover .sidebar-item-tip { opacity: 1; }

/* Sidebar Toggle */
.sidebar-toggle {
  position: absolute; left: var(--sidebar-width); top: 50%;
  width: 24px; height: 48px;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-left: none; border-radius: 0 8px 8px 0;
  color: var(--c-text-2); cursor: pointer;
  font-size: 11px; display: flex; align-items: center; justify-content: center;
  transition: all 0.3s; z-index: 10;
}
.sidebar-toggle.collapsed { left: 0; }
.sidebar-toggle:hover { color: var(--c-primary); background: var(--c-surface-alt); }

/* --- Main Area --- */
.main-area {
  flex: 1; padding: 32px;
  min-width: 0;
  transition: margin-left 0.3s ease;
}
.main-area.expanded { /* sidebar collapsed */ }

.main-intro { text-align: center; margin-bottom: 32px; }
.main-title {
  font-size: 36px; font-weight: 800; letter-spacing: -0.03em;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 40%, #a855f7 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; line-height: 1.2;
}
.main-subtitle {
  font-size: 15px; color: var(--c-text-2); margin-top: 10px;
  max-width: 520px; margin-left: auto; margin-right: auto; line-height: 1.7;
}

/* --- Views --- */
.view { display: none; }
.view.active { display: block; }

/* --- Chat Container --- */
.chat-wrapper {
  max-width: 800px; margin: 0 auto;
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--c-border);
  overflow: hidden;
}
.chat-header {
  padding: 14px 20px;
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.06));
  border-bottom: 1px solid var(--c-border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.chat-header-left { display: flex; align-items: center; gap: 10px; }
.chat-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  color: white; font-size: 15px;
}
.chat-status { font-size: 14px; font-weight: 600; }
.chat-status-dot {
  display: inline-block; width: 7px; height: 7px;
  background: var(--c-success); border-radius: 50%; margin-right: 6px;
}
.chat-header-actions { display: flex; gap: 6px; }

/* Chat Messages */
.chat-messages {
  height: 480px; overflow-y: auto; padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
  scroll-behavior: smooth;
  background: var(--c-surface-alt);
}
.chat-messages::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 10px; }

/* Chat Bubbles */
.chat-msg { display: flex; gap: 10px; animation: msgIn 0.3s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.chat-msg.user { justify-content: flex-end; }
.chat-avatar-mini {
  width: 30px; height: 30px; min-width: 30px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  color: white; font-size: 14px;
}
.chat-bubble {
  max-width: 75%; padding: 12px 18px; border-radius: 16px;
  font-size: 14.5px; line-height: 1.7;
  word-break: break-word; white-space: pre-wrap;
}
.chat-msg.user .chat-bubble {
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent-600));
  color: white;
  border-bottom-right-radius: 6px;
}
.chat-msg.bot .chat-bubble {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-bottom-left-radius: 6px;
  box-shadow: var(--shadow-xs);
}
.chat-msg.system .chat-bubble {
  background: var(--c-primary-50);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--c-primary-700);
  text-align: center;
  max-width: 100%;
}
.chat-msg.typing .chat-bubble {
  display: flex; gap: 5px; padding: 14px 18px;
}
.typing-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-text-3); animation: dotBounce 1.4s infinite both;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

/* Mode Pills */
.mode-pills {
  display: flex; gap: 6px; padding: 14px 20px;
  border-top: 1px solid var(--c-border-light);
  flex-wrap: wrap; align-items: center;
}
.mode-label { font-size: 13px; color: var(--c-text-3); padding: 6px 4px; }
.mode-pill {
  padding: 6px 14px; border: 1.5px solid var(--c-border); border-radius: 20px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  background: var(--c-surface); color: var(--c-text-2);
  transition: all 0.15s; font-family: inherit;
}
.mode-pill:hover { border-color: var(--c-primary); color: var(--c-primary); }
.mode-pill.active { border-color: var(--c-primary); background: var(--c-primary-50); color: var(--c-primary); }

/* Chat Input Area */
.chat-input-area {
  border-top: 1px solid var(--c-border-light);
  background: var(--c-surface);
}
.chat-input-wrap {
  padding: 16px 20px 8px;
  display: flex; gap: 10px; align-items: flex-end;
}
.chat-input-wrap textarea {
  flex: 1; padding: 12px 16px;
  border: 2px solid var(--c-border); border-radius: var(--radius-sm);
  font-size: 14.5px; font-family: inherit;
  outline: none; transition: all 0.2s;
  background: var(--c-surface-alt); color: var(--c-text);
  resize: none; min-height: 48px; max-height: 120px;
}
.chat-input-wrap textarea:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }
.chat-input-wrap textarea::placeholder { color: var(--c-text-3); }
.chat-input-wrap textarea.error { border-color: var(--c-danger); }
.chat-input-wrap textarea.warning { border-color: var(--c-warning); }

.input-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 20px 14px; font-size: 13px;
}
.char-count { color: var(--c-text-3); transition: color 0.2s; }
.char-count.warning { color: var(--c-warning); }
.char-count.limit { color: var(--c-danger); }
.char-count.over { color: var(--c-danger); }
.char-hint { color: var(--c-danger); font-size: 12px; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.2s ease-in-out; font-family: inherit;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent-600));
  color: white; box-shadow: 0 2px 10px rgba(99,102,241,0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 18px rgba(99,102,241,0.5); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .typing-dot { display: inline-block; background: currentColor; opacity: 0.85; }
.btn.is-loading { min-width: 126px; }
.btn-ghost {
  background: transparent; color: var(--c-text-2);
  padding: 8px 14px; border-radius: var(--radius-xs);
}
.btn-ghost:hover { background: var(--c-surface-alt); color: var(--c-text); }
.btn-ghost.icon-only { padding: 8px; width: 36px; height: 36px; }
.btn-sm { padding: 7px 15px; font-size: 13px; border-radius: var(--radius-xs); }
.btn-outline {
  background: transparent; border: 1.5px solid var(--c-border);
  color: var(--c-text-2);
}
.btn-outline:hover { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-50); }
.btn-icon { font-size: 16px; }

/* --- Category Tabs --- */
.category-tabs {
  display: flex; gap: 8px; justify-content: center;
  margin-bottom: 24px; flex-wrap: wrap;
}
.category-tab {
  padding: 8px 18px; border: 1.5px solid var(--c-border); border-radius: 20px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  background: var(--c-surface); color: var(--c-text-2);
  transition: all 0.15s; font-family: inherit;
}
.category-tab:hover { border-color: var(--c-primary); color: var(--c-primary); }
.category-tab.active { border-color: var(--c-primary); background: var(--c-primary-50); color: var(--c-primary); }

/* --- Community --- */
.community-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px; flex-wrap: wrap; gap: 14px;
}
.sort-pills { display: flex; gap: 4px; background: var(--c-surface); padding: 4px; border-radius: 12px; }
.sort-pill {
  padding: 7px 18px; border: none; border-radius: 9px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  background: transparent; color: var(--c-text-2);
  transition: all 0.2s; font-family: inherit;
}
.sort-pill.active { background: var(--c-surface-alt); color: var(--c-primary); }

.prompt-list { display: flex; flex-direction: column; gap: 12px; }
.prompt-item {
  background: var(--c-surface); border-radius: var(--radius); border: 1px solid var(--c-border);
  padding: 22px 26px; transition: all 0.2s; box-shadow: var(--shadow-xs);
}
.prompt-item:hover { box-shadow: var(--shadow); border-color: var(--c-primary-50); }
.prompt-item-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 10px;
}
.prompt-item-name { font-size: 17px; font-weight: 700; }
.prompt-item-name a { color: var(--c-text); text-decoration: none; }
.prompt-item-name a:hover { color: var(--c-primary); }
.prompt-item-meta { font-size: 13px; color: var(--c-text-3); margin-top: 2px; }
.prompt-item-rating { display: flex; align-items: center; gap: 6px; }
.prompt-item-preview {
  font-size: 14px; color: var(--c-text-2); line-height: 1.6;
  max-height: 44px; overflow: hidden; margin-bottom: 14px;
}
.prompt-item-actions { display: flex; gap: 12px; align-items: center; }
.prompt-item-category {
  display: inline-block; padding: 2px 10px;
  background: var(--c-primary-50); color: var(--c-primary);
  border-radius: 12px; font-size: 11px; font-weight: 600;
}
.act-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border: 1px solid var(--c-border-light); border-radius: 18px;
  background: transparent; cursor: pointer; font-size: 13px;
  color: var(--c-text-2); transition: all 0.2s; font-family: inherit;
}
.act-btn:hover { border-color: var(--c-primary-50); color: var(--c-primary); background: var(--c-primary-50); }
.stars { display: inline-flex; gap: 1px; font-size: 16px; color: var(--c-border); }
.stars .star.on { color: var(--c-warning); }

/* --- Prompt Library --- */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.library-card {
  min-height: 156px;
  padding: 18px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.library-card:hover {
  border-color: rgba(99,102,241,0.45);
  background: var(--c-surface-alt);
  transform: translateY(-2px);
}
.library-card.loading { opacity: 0.7; pointer-events: none; }
.library-card.copied { border-color: rgba(16,185,129,0.55); background: rgba(16,185,129,0.08); }
.library-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--c-primary-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.library-card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}
.library-card-category {
  width: fit-content;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--c-surface-alt);
  color: var(--c-text-2);
  font-size: 12px;
}
.library-card-action {
  margin-top: auto;
  color: var(--c-primary);
  font-size: 13px;
  font-weight: 600;
}

/* --- Modal --- */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.on { display: flex; }
.modal {
  background: var(--c-surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); max-width: 600px; width: 100%;
  max-height: 85vh; overflow-y: auto; padding: 32px;
  position: relative; border: 1px solid var(--c-border);
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--c-text-3); width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--c-surface-alt); color: var(--c-text); }
.modal h3 { font-size: 22px; font-weight: 700; margin-bottom: 24px; color: var(--c-text); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--c-text-2); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px 14px; border: 2px solid var(--c-border);
  border-radius: var(--radius-sm); font-size: 14px; font-family: inherit;
  outline: none; transition: all 0.2s;
  background: var(--c-surface-alt); color: var(--c-text);
}
.form-group textarea { min-height: 120px; resize: vertical; }
.form-group select { cursor: pointer; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.code-row { display: flex; gap: 10px; align-items: center; }

/* --- Detail Modal --- */
.detail-name { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.detail-meta { font-size: 13px; color: var(--c-text-3); margin-bottom: 20px; display: flex; gap: 16px; flex-wrap: wrap; }
.detail-usage {
  background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-sm);
  padding: 16px; margin-bottom: 22px; font-size: 14px; color: var(--c-warning);
}
.detail-usage-label { font-weight: 600; color: var(--c-warning); margin-bottom: 6px; }
.detail-prompt {
  background: var(--c-surface-alt); border: 1px solid var(--c-border);
  border-radius: var(--radius-sm); padding: 18px;
  font-size: 14px; line-height: 1.7; white-space: pre-wrap; margin-bottom: 22px;
  font-family: var(--font-mono); color: var(--c-text);
}
.detail-actions { display: flex; gap: 8px; margin-bottom: 30px; }
.detail-comments h4 { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.comment-item { padding: 12px 0; border-bottom: 1px solid var(--c-border-light); }
.comment-author { font-size: 13px; font-weight: 600; color: var(--c-text); }
.comment-time { font-size: 12px; color: var(--c-text-3); font-weight: 400; margin-left: 8px; }
.comment-text { font-size: 14px; color: var(--c-text-2); margin-top: 4px; }
.comment-form { display: flex; gap: 8px; margin-top: 16px; }
.comment-form input {
  flex: 1; padding: 10px 14px; border: 2px solid var(--c-border);
  border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; outline: none;
  background: var(--c-surface-alt); color: var(--c-text);
}
.comment-form input:focus { border-color: var(--c-primary); }

/* --- Toast --- */
.toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(120px);
  z-index: 300; background: var(--c-text); color: var(--c-bg);
  padding: 12px 24px; border-radius: var(--radius); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}
.toast.on { transform: translateX(-50%) translateY(0); }

/* --- Empty State --- */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-text { font-size: 15px; color: var(--c-text-3); }

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--c-border); padding: 40px 0;
  text-align: center; color: var(--c-text-3); font-size: 13px;
}
.footer-links { display: flex; gap: 24px; justify-content: center; margin-bottom: 12px; }
.footer-links a { color: var(--c-text-2); text-decoration: none; }
.footer-links a:hover { color: var(--c-primary); }

/* --- Mobile Nav --- */
.mobile-nav { display: none; }
.mobile-drawer-overlay { display: none; }

/* --- Utility --- */
.hidden { display: none !important; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  :root { --sidebar-width: 200px; }
  .main-title { font-size: 28px; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .sidebar-toggle { display: none; }
  .layout { display: block; }
  .main-area { padding: 20px 16px 80px; }
  .main-title { font-size: 24px; }
  .main-subtitle { font-size: 14px; }
  .chat-messages { height: 380px; }
  .chat-bubble { max-width: 88%; }
  .chat-input-wrap { flex-direction: column; }
  .chat-input-wrap textarea { width: 100%; }
  .chat-input-wrap .btn { width: 100%; }
  .community-toolbar { flex-direction: column; align-items: flex-start; }
  .header-inner { padding: 0 16px; }
  .nav-tab { padding: 6px 12px; font-size: 13px; }
  .category-tabs { gap: 4px; }
  .category-tab { padding: 6px 12px; font-size: 12px; }
  .library-grid { grid-template-columns: 1fr; }

  /* Mobile bottom nav */
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: rgba(10,10,15,0.95); backdrop-filter: blur(20px);
    border-top: 1px solid var(--c-border);
    padding: 8px 0 env(safe-area-inset-bottom);
  }
  .mobile-nav-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: none; border: none; color: var(--c-text-3);
    font-size: 11px; font-family: inherit; cursor: pointer; padding: 6px;
    transition: color 0.2s;
  }
  .mobile-nav-btn.active { color: var(--c-primary); }
  .mobile-nav-icon { font-size: 20px; }

  /* Mobile sidebar drawer */
  .mobile-drawer-overlay.on { display: flex; }
  .mobile-drawer-overlay {
    position: fixed; inset: 0; z-index: 250;
    background: rgba(0,0,0,0.6);
    align-items: flex-end; justify-content: center;
  }
  .mobile-drawer {
    background: var(--c-surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%; max-height: 70vh; overflow-y: auto;
    padding: 20px; border: 1px solid var(--c-border);
  }
  .mobile-drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; padding-bottom: 12px;
    border-bottom: 1px solid var(--c-border-light);
  }
  .mobile-drawer-header h3 { font-size: 16px; font-weight: 700; }
  .mobile-drawer-hint { font-size: 12px; color: var(--c-text-3); }
  .mobile-drawer-close {
    background: none; border: none; font-size: 20px; cursor: pointer;
    color: var(--c-text-3); padding: 4px 8px; border-radius: 6px;
  }
  .mobile-drawer-close:hover { background: var(--c-surface-alt); color: var(--c-text); }
  .mobile-drawer-list { display: flex; flex-direction: column; gap: 6px; }
}
