/* SUSTech Alumni Agent — Styles */

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

:root {
  --primary: #1a5276;
  --primary-light: #2980b9;
  --accent: #e67e22;
  --accent-light: #f0b37b;
  --bg: #f0f2f5;
  --sidebar-bg: #1a1d23;
  --sidebar-text: #9ca3af;
  --sidebar-active: #ffffff;
  --card: #ffffff;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --success: #10b981;
  --danger: #ef4444;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  height: 100vh;
  overflow: hidden;
}

/* ── App Layout ─────────────────────────── */

.app {
  display: flex;
  height: 100vh;
}

/* ── Sidebar ────────────────────────────── */

.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  user-select: none;
}

.sidebar-logo-top {
  padding: 16px 18px 4px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sustech-logo {
  width: 100%;
  max-width: 170px;
  height: auto;
  display: block;
  filter: brightness(0) invert(1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.brand-text h2 {
  font-size: .95rem;
  color: #e5e7eb;
  font-weight: 600;
  line-height: 1.3;
}

.brand-text span {
  font-size: .75rem;
  color: var(--sidebar-text);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--sidebar-text);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  cursor: pointer;
  transition: all .15s;
  text-align: left;
  width: 100%;
}

.nav-item:hover { background: rgba(255,255,255,.06); color: #d1d5db; }

.nav-item.active {
  background: rgba(255,255,255,.1);
  color: var(--sidebar-active);
}

.nav-item kbd {
  margin-left: auto;
  font-size: .7rem;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255,255,255,.08);
  color: var(--sidebar-text);
  font-family: inherit;
}

.nav-item.active kbd { color: #d1d5db; }

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  color: var(--sidebar-text);
}

.sidebar-powered-by {
  padding: 10px 18px 14px;
  border-top: 1px solid rgba(255,255,255,.04);
  font-size: .68rem;
  color: rgba(255,255,255,.25);
  display: flex;
  align-items: center;
  gap: 6px;
}

.jimax-logo-img {
  height: 14px;
  width: auto;
  opacity: .35;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6b7280;
}

.status-dot.online { background: var(--success); }

.version { margin-left: auto; opacity: .5; }

/* ── Sidebar User ─────────────────────────── */

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.15);
}

.user-name {
  font-size: .8rem;
  color: #d1d5db;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  opacity: .5;
  transition: opacity .15s;
}

.btn-logout:hover { opacity: 1; color: var(--danger); }

/* ── Login Overlay ────────────────────────── */

.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(6px);
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 44px 40px 36px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.login-logo {
  width: 56px;
  height: 56px;
  background: var(--primary);
  color: #fff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 16px;
}

.login-card h2 {
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 8px;
}

.login-desc {
  color: var(--text-secondary);
  font-size: .88rem;
  margin-bottom: 28px;
}

.btn-wechat {
  width: 100%;
  padding: 13px 20px;
  background: #07c160;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s;
}

.btn-wechat:hover { background: #06ad56; }

.login-error {
  color: var(--danger);
  font-size: .82rem;
  margin-top: 14px;
  min-height: 20px;
}

.login-trust {
  color: var(--text-secondary);
  font-size: .8rem;
  margin-bottom: 8px;
  padding: 10px 14px;
  background: #fef9e7;
  border: 1px solid #fde68a;
  border-radius: 8px;
  line-height: 1.5;
  text-align: left;
}

.login-note {
  color: var(--text-light);
  font-size: .75rem;
  margin-top: 20px;
}

/* ── Main Content ────────────────────────── */

.main {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.tab-header {
  margin-bottom: 24px;
}

.tab-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.tab-header p {
  font-size: .9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Hero Header ─── */

.hero-header {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.hero-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.hero-subtitle {
  font-size: .88rem;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.6;
  max-width: 620px;
}


/* ── Chat ────────────────────────────────── */

.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 130px);
  max-width: 720px;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
  padding-bottom: 16px;
}

.chat-input-area {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-wrapper input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .93rem;
  outline: none;
  transition: border-color .15s;
}

.input-wrapper input:focus { border-color: var(--primary-light); }

.message {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.message.user { flex-direction: row-reverse; }

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

.message.user .avatar {
  background: var(--primary);
}

.bubble {
  max-width: 85%;
}

.bubble-text {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: .93rem;
  line-height: 1.7;
  white-space: pre-wrap;
  box-shadow: var(--shadow);
}

.message.user .bubble-text {
  background: var(--primary-light);
  color: #fff;
  border-color: var(--primary-light);
}

.bubble-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.hint-chip {
  padding: 5px 12px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: var(--primary-light);
  border-radius: 20px;
  font-size: .8rem;
  cursor: pointer;
  transition: all .15s;
}

.hint-chip:hover {
  background: #dbeafe;
  border-color: var(--primary-light);
}

.chat-input-area {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.school-select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

.input-wrapper input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .93rem;
  outline: none;
  transition: border-color .15s;
}

.input-wrapper input:focus { border-color: var(--primary-light); }

.send-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--primary-light);
  color: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  flex-shrink: 0;
}

.send-btn:hover { background: var(--primary); }
.send-btn:disabled { background: #bdc3c7; cursor: not-allowed; }

.input-hint {
  font-size: .75rem;
  color: var(--text-light);
  margin-top: 6px;
  margin-left: 4px;
}

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

.search-area { margin-bottom: 24px; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 4px 4px 14px;
  box-shadow: var(--shadow);
}

.search-icon { color: var(--text-light); flex-shrink: 0; }

.search-box input {
  flex: 1;
  border: none;
  padding: 10px 0;
  font-size: .93rem;
  outline: none;
  background: transparent;
}

.search-box button {
  padding: 10px 20px;
  background: var(--primary-light);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  cursor: pointer;
  transition: background .15s;
}

.search-box button:hover { background: var(--primary); }
.search-box button:disabled { background: #bdc3c7; cursor: not-allowed; }

.quick-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: .8rem;
  color: var(--text-light);
  margin-right: 4px;
}

.willingness-filters .chip {
  border-style: dashed;
}

.willingness-filters .chip.active {
  background: #059669;
  border-color: #059669;
  border-style: solid;
}

.chip {
  padding: 4px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  font-size: .82rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
}

.chip:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
}

.chip.active {
  background: var(--primary-light);
  color: #fff;
  border-color: var(--primary-light);
}

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.filters select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

.result-count {
  font-size: .8rem;
  color: var(--text-light);
  margin-left: auto;
}

/* ── Results Grid ────────────────────────── */

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

.alumni-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s;
}

.alumni-card:hover { box-shadow: var(--shadow-md); }

.alumni-card .card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}

.alumni-card .card-meta {
  font-size: .82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.alumni-card .card-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.tag {
  display: inline-block;
  padding: 2px 9px;
  background: #eef2ff;
  color: var(--primary-light);
  border-radius: 12px;
  font-size: .75rem;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.btn-contact {
  padding: 5px 14px;
  background: var(--primary-light);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: .78rem;
  cursor: pointer;
  transition: background .15s;
}
.btn-contact:hover { background: #1d4ed8; }
.btn-contact:disabled { opacity: .6; cursor: not-allowed; }
.btn-contact.sent { background: #16a34a; }

/* ── Skeleton Loading ────────────────────── */

.skeleton-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.skel-line {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  margin-bottom: 10px;
}

.skel-line.w80 { width: 80%; }
.skel-line.w60 { width: 60%; }
.skel-line.w50 { width: 50%; }
.skel-line.w40 { width: 40%; }
.skel-line.w70 { width: 70%; }
.skel-line.w90 { width: 90%; }

.skel-tags {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.skel-tag {
  width: 48px;
  height: 22px;
  border-radius: 12px;
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

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

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

.empty-state svg { margin-bottom: 12px; opacity: .4; }

.empty-state h3 {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.empty-state p { font-size: .85rem; }

.empty-suggestion {
  margin-top: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.empty-actions {
  text-align: left;
  display: inline-block;
  margin-top: 8px;
  font-size: .85rem;
  color: var(--text-secondary);
  line-height: 2;
  padding-left: 20px;
}

.empty-actions a {
  color: var(--primary-light);
  text-decoration: underline;
}

.hidden { display: none; }

/* ── Events ──────────────────────────────── */

.events-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.events-timeline h3, .summarize-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.event-card .event-title {
  font-weight: 600;
  font-size: .93rem;
  color: var(--text);
}

.event-card .event-date {
  font-size: .78rem;
  color: var(--text-light);
  margin-bottom: 6px;
}

.event-card .event-summary {
  font-size: .85rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.summarize-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-desc {
  font-size: .82rem;
  color: var(--text-light);
  margin-bottom: 14px;
}

.summarize-card input,
.summarize-card textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: inherit;
  margin-bottom: 10px;
  resize: vertical;
}

.summarize-card textarea { resize: vertical; min-height: 120px; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--primary-light);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  cursor: pointer;
  transition: background .15s;
}

.btn-primary:hover { background: var(--primary); }
.btn-primary:disabled { background: #bdc3c7; cursor: not-allowed; }

.summary-result {
  margin-top: 14px;
  padding: 14px;
  background: #fef9e7;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  line-height: 1.7;
  white-space: pre-wrap;
  display: none;
}

.summary-result.show { display: block; }

/* ── Weekly Brief Card ───────────────────── */

.weekly-card {
  margin-top: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.weekly-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.weekly-header h3 { margin-bottom: 0; font-size: 1.05rem; }

.weekly-header span {
  font-size: .8rem;
  color: var(--text-light);
}

.weekly-stats { font-size: .88rem; line-height: 1.7; }

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

@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-brand { padding: 14px 12px; justify-content: center; }
  .brand-text { display: none; }
  .nav-item span { display: none; }
  .nav-item kbd { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .sidebar-footer { justify-content: center; }

  .main { padding: 20px 16px; }

  .events-grid { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr; }
  .chat-container { max-width: 100%; }

  .filters { flex-direction: column; align-items: stretch; }
  .result-count { margin-left: 0; }
}

@media (max-width: 480px) {
  .search-box { flex-wrap: wrap; }
  .search-box button { width: 100%; }
  .quick-filters { gap: 4px; }
  .chip { font-size: .75rem; padding: 3px 10px; }
}

/* ── Source Labels ───────────────────────── */

.source-label {
  display: inline-block;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: .82rem;
  margin-bottom: 10px;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

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

.match-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.match-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: .73rem;
  font-weight: 500;
}

.match-badge.match-industry,
.match-badge.match-city,
.match-badge.match-class,
.match-badge.match-school {
  background: #dcfce7;
  color: #166534;
}

.match-badge.match-skill,
.match-badge.match-expertise {
  background: #dbeafe;
  color: #1e40af;
}

.match-badge.match-name {
  background: #fef9c3;
  color: #854d0e;
}

.match-badge.match-willingness {
  background: #fce7f3;
  color: #9d174d;
}

.match-badge.match-default {
  background: #f3f4f6;
  color: #6b7280;
}

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

.feedback-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.message.bot .feedback-row {
  border-top: none;
  margin-top: 10px;
  padding-top: 6px;
}

.feedback-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 4px 14px;
  font-size: .78rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all .15s;
}

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

.feedback-btn.active {
  background: var(--primary-light);
  color: #fff;
  border-color: var(--primary-light);
}

.feedback-btn.feedback-sm {
  padding: 3px 10px;
  font-size: .75rem;
  border-radius: 12px;
}
