:root {
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --secondary-color: #8b5cf6;
  --accent-color: #06b6d4;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-dark: #111827;
  --border-color: #e5e7eb;
  --gradient-1: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  background: var(--bg-primary);
  overflow-x: hidden;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.logo span {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Navigation welcome + time widget */
.nav-welcome {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8125rem;
    white-space: nowrap;
}
.nav-welcome .welcome-text {
    color: var(--text-secondary);
    font-weight: 500;
}
.nav-welcome .welcome-text #visitorCount {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.9rem;
}
.nav-welcome .nav-time {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--primary-color);
}

.cta-btn {
    background: var(--gradient-1);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

/* Page Header */
.page-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 20px 40px;
  text-align: center;
}
.page-header h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.page-header p { color: var(--text-secondary); font-size: 1.125rem; }

/* Main Content */
.main-content { max-width: 1200px; margin: 0 auto; padding: 0 20px 60px; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.animate-fade-in { animation: fadeIn 0.6s ease-out forwards; }
.animate-pulse { animation: pulse 1.5s ease-in-out infinite; }
.animate-spin { animation: spin 1s linear infinite; }

/* Layout helpers */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-0 { min-height: 0; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-auto { overflow-x: auto; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-pre-wrap { white-space: pre-wrap; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Spacing */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

/* Typography */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-light { font-weight: 300; }
.font-mono { font-family: Consolas, Monaco, 'Courier New', monospace; }
.font-serif { font-family: 'Noto Serif SC', 'Source Han Serif SC', serif; }
.italic { font-style: italic; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }
.leading-relaxed { line-height: 1.7; }
.leading-loose { line-height: 2; }

/* Colors */
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: var(--text-secondary); }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #111827; }
.text-white { color: white; }
.text-black { color: black; }
.text-blue-500 { color: #3b82f6; }
.text-blue-600 { color: #2563eb; }
.text-green-600 { color: #16a34a; }
.text-green-700 { color: #15803d; }
.text-red-500 { color: #ef4444; }
.text-red-600 { color: #dc2626; }
.text-orange-600 { color: #ea580c; }
.text-emerald-600 { color: #059669; }

/* Backgrounds */
.bg-white { background: white; }
.bg-black { background: black; }
.bg-gray-50 { background: #f9fafb; }
.bg-gray-100 { background: #f3f4f6; }
.bg-gray-900 { background: #111827; }
.bg-blue-50 { background: #eff6ff; }
.bg-blue-100 { background: #dbeafe; }
.bg-green-50 { background: #f0fdf4; }
.bg-green-100 { background: #dcfce7; }
.bg-orange-100 { background: #ffedd5; }
.bg-emerald-100 { background: #d1fae5; }
.bg-red-50 { background: #fef2f2; }
.bg-yellow-50 { background: #fefce8; }
.bg-yellow-100 { background: #fef9c3; }

/* Borders */
.border { border: 1px solid var(--border-color); }
.border-2 { border-width: 2px; }
.border-4 { border-width: 4px; }
.border-0 { border: none; }
.border-t { border-top: 1px solid var(--border-color); }
.border-b { border-bottom: 1px solid var(--border-color); }
.border-l-2 { border-left: 2px solid var(--border-color); }
.border-dashed { border-style: dashed; }
.border-gray-100 { border-color: #f3f4f6; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-blue-100 { border-color: #dbeafe; }
.border-blue-200 { border-color: #bfdbfe; }
.border-green-100 { border-color: #dcfce7; }
.border-green-200 { border-color: #bbf7d0; }
.border-yellow-100 { border-color: #fef9c3; }
.border-white\/10 { border-color: rgba(255,255,255,0.1); }
.rounded { border-radius: 4px; }
.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 12px; }
.rounded-2xl { border-radius: 16px; }
.rounded-3xl { border-radius: 24px; }
.rounded-full { border-radius: 9999px; }

/* Shadow */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  text-decoration: none;
}
.btn-primary { background: var(--gradient-1); color: white; box-shadow: var(--shadow-md); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-xl); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-outline { background: transparent; color: var(--primary-color); border: 2px solid var(--primary-color); }
.btn-outline:hover { background: var(--primary-color); color: white; }
.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
}

.btn-secondary:hover {
    border-color: #ffffff;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.25);
}
.btn-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.75rem; }

/* Cards */
.card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}
.card:hover { box-shadow: var(--shadow-lg); border-color: var(--primary-color); }

/* Forms */
input, textarea, select {
  font-family: inherit;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f3f4f6; }
::-webkit-scrollbar-thumb { background: #9ca3af; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #6b7280; }

/* Toast notification */
#toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(20px);
    background: var(--bg-dark);
    color: white;
    padding: 24px 48px;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 500;
    opacity: 0;
    transition: all 0.4s ease;
    pointer-events: none;
    z-index: 9999;
    box-shadow: var(--shadow-xl);
}

#toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0);
}

/* Chat Input Styles */
.chat-ft {
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 0;
    position: relative;
    width: 100%;
}

.chat-inner {
    position: relative;
    margin: 0 auto;
    max-width: 800px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.chat-tools {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.chat-tools button {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-tools button:hover {
    background: #e5e7eb;
    color: var(--text-primary);
}

.chat-tools button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.chat-tools button.has-file {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

#chatInput {
    width: 100%;
    min-height: 60px;
    max-height: 200px;
    padding: 0.875rem 1rem;
    padding-right: 3rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: white;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.3s ease;
}

#chatInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#chatInput:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

.send-btn {
    position: absolute;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.send-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.send-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

.send-btn svg {
    width: 16px;
    height: 16px;
}

.file-tag {
    display: inline-flex;
    align-items: center;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.typing {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 1rem;
}

.typing span {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing span:nth-child(1) { animation-delay: -0.32s; }
.typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Message Styles */
.msg {
    display: flex;
    margin-bottom: 1.5rem;
}

.msg.start {
    justify-content: flex-start;
}

.msg.end {
    justify-content: flex-end;
}

.msg-bubble {
    max-width: 85%;
    padding: 1rem 1.25rem;
}

.msg.start .msg-bubble {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 18px 18px 18px 4px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.msg.end .msg-bubble {
    background: var(--primary-color);
    color: white;
    border-radius: 18px 18px 4px 18px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.prose {
    font-size: 0.875rem;
    line-height: 1.6;
}

.prose h1, .prose h2, .prose h3 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.prose p {
    margin-bottom: 0.75rem;
}

.prose pre {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.8125rem;
}

.prose code {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.8125rem;
    background: #f1f5f9;
    padding: 0.125rem 0.25rem;
    border-radius: 4px;
}

.prose ul, .prose ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.prose li {
    margin-bottom: 0.25rem;
}

.prose blockquote {
    border-left: 3px solid var(--border-color);
    padding-left: 1rem;
    margin-left: 0;
    color: #6b7280;
    font-style: italic;
}

.prose hr {
    border: none;
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
}

.toolbar {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    justify-content: flex-end;
}

.toolbar button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.empty-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: #9ca3af;
    text-align: center;
}

.empty-hint .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}
}
  .nav-links {
    display: none;
  }
  .hamburger {
    display: flex;
  }
  .page-header h1 {
    font-size: 2.5rem;
  }
  .grid-cols-2, .grid-cols-3, .grid-cols-4, .grid-cols-5 {
    grid-template-columns: 1fr;
  }
  .flex-wrap-mobile {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .nav-container {
    padding: 0.75rem 16px;
  }
  .page-header {
    padding-top: 80px;
  }
  .page-header h1 {
    font-size: 2rem;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    gap: 0;
  }
  .nav-links.active {
    display: flex;
  }
  .nav-links a {
    padding: 0.75rem 20px;
    width: 100%;
  }
  .nav-welcome .welcome-text {
    display: none;
  }
  .nav-welcome .nav-time {
    font-size: 0.6875rem;
    padding: 2px 8px;
  }
  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
}

/* 防复刻 */
body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}
input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}