/* WKAI (悟空AI) Core Stylesheet - Zero External Dependencies */
:root {
  /* 取金之路品牌系统：纯黑 + 金 （与 qujin/styles.css 同源） */
  --bg-dark: #000000;
  --bg-card: #161617;
  --bg-card-hover: #202024;
  --bg-glass: rgba(22, 22, 24, 0.75);
  --border-color: rgba(230, 198, 135, 0.16);
  --border-focus: rgba(230, 198, 135, 0.4);
  --text-main: #F5F5F7;
  --text-muted: #86868B;
  --text-dim: #6E6E73;
  --primary-gradient: linear-gradient(135deg, #F5E5C9 0%, #E6C687 50%, #C59B3F 100%);
  --btn-hover-gradient: linear-gradient(135deg, #E6C687 0%, #C59B3F 100%);
  --accent-cyan: #D4AF37;
  --accent-emerald: #10b981;
  --user-msg-bg: linear-gradient(135deg, #E6C687, #C59B3F);
  --ai-msg-bg: #161617;
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-glow: 0 4px 20px rgba(212, 175, 55, 0.25);
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-stack);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header & Navigation */
.wkai-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1d1d1f;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: var(--shadow-glow);
  -webkit-text-fill-color: #1d1d1f;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #1d1d1f;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.30);
}

.btn-primary:hover {
  background: var(--btn-hover-gradient);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.25);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 20px;
  background: rgba(245, 245, 247, 0.08);
  color: var(--text-muted);
  border: 1px solid rgba(245, 245, 247, 0.15);
}

.badge-pro {
  background: rgba(230, 198, 135, 0.15);
  color: #E6C687;
  border-color: rgba(230, 198, 135, 0.4);
}

/* Landing Page Styles */
.hero-section {
  max-width: 960px;
  margin: 0 auto;
  padding: 80px 20px 60px;
  text-align: center;
}

.hero-tag {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 30px;
  background: rgba(230, 198, 135, 0.1);
  border: 1px solid rgba(230, 198, 135, 0.25);
  color: #E6C687;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero-title span {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 36px;
}

.hero-btns {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-btns .btn {
  padding: 14px 32px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

.features-section {
  max-width: 1040px;
  margin: 40px auto 80px;
  padding: 0 20px;
}

.section-title {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 40px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  transition: all 0.25s ease;
}

.feature-card:hover {
  border-color: rgba(230, 198, 135, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 16px;
  display: inline-block;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #fff;
}

.feature-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Footer */
.wkai-footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.footer-links {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.footer-link {
  color: #E6C687;
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #E6C687;
  text-decoration: underline;
}

/* App / Workspace Layout */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 900px;
  margin: 0 auto;
  background: var(--bg-dark);
}

.chat-main {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px 120px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
}

.chat-welcome {
  text-align: center;
  margin: 40px auto;
  max-width: 500px;
}

.chat-welcome h2 {
  font-size: 1.6rem;
  margin-bottom: 10px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.chat-welcome p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.msg-row {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  word-break: break-word;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-row.user {
  align-self: flex-end;
}

.msg-row.assistant {
  align-self: flex-start;
}

.msg-bubble {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.98rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.msg-row.user .msg-bubble {
  background: var(--user-msg-bg);
  color: #1d1d1f;
  border-bottom-right-radius: 4px;
}

.msg-row.assistant .msg-bubble {
  background: var(--ai-msg-bg);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
}

.msg-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 4px;
  padding: 0 4px;
}

.msg-row.user .msg-meta {
  text-align: right;
}

/* Chat Input Bar */
.input-bar-container {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 900px;
  padding: 16px 20px 24px;
  background: rgba(9, 13, 22, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  z-index: 90;
}

.input-box-wrapper {
  display: flex;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  transition: border-color 0.2s ease;
}

.input-box-wrapper:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(230, 198, 135, 0.2);
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.98rem;
  resize: none;
  max-height: 160px;
  min-height: 24px;
  line-height: 1.5;
}

.chat-input::placeholder {
  color: var(--text-dim);
}

.btn-send {
  align-self: flex-end;
  padding: 8px 16px;
  font-size: 0.9rem;
  height: 38px;
}

/* Modal Overlay & Card */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 32px 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  position: relative;
  transform: translateY(12px);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  margin-bottom: 20px;
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.modal-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.modal-close:hover {
  color: var(--text-main);
}

.form-group {
  margin-bottom: 20px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0.05em;
  outline: none;
}

.form-input:focus {
  border-color: var(--border-focus);
}

.wechat-hint {
  margin-top: 18px;
  padding: 12px;
  background: rgba(230, 198, 135, 0.1);
  border: 1px dashed rgba(230, 198, 135, 0.3);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.9rem;
  color: #E6C687;
}

.modal-error {
  color: #f87171;
  font-size: 0.88rem;
  margin-top: 10px;
  display: none;
}

/* Toast / Alert */
.toast-msg {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #161617;
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  z-index: 300;
  font-size: 0.9rem;
  display: none;
  animation: fadeIn 0.2s ease;
}

/* Mobile Adjustments */
@media (max-width: 640px) {
  .hero-title { font-size: 2.1rem; }
  .hero-subtitle { font-size: 1rem; }
  .wkai-header { padding: 12px 16px; }
  .features-grid { grid-template-columns: 1fr; }
  .msg-row { max-width: 92%; }
}
