/* ========== 全局变量 ========== */
:root {
  --bg-deep: #0F172A;
  --bg-mid: #1E293B;
  --bg-light: #334155;
  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --purple-main: #7C3AED;
  --purple-light: #A855F7;
  --purple-soft: #C084FC;
  --green: #22C55E;
  --red: #EF4444;
  --yellow: #F59E0B;
  --blue: #3B82F6;
  --glass-bg: rgba(30, 41, 59, 0.65);
  --glass-border: rgba(255,255,255,0.08);
  --card-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

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

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========== 登录页 ========== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0F172A 0%, #1E1B4B 40%, #312E81 70%, #0F172A 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124,58,237,0.15) 0%, transparent 70%);
  top: -200px;
  left: -200px;
  animation: floatBlob 8s ease-in-out infinite;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(168,85,247,0.1) 0%, transparent 70%);
  bottom: -150px;
  right: -150px;
  animation: floatBlob 10s ease-in-out infinite reverse;
}

@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -30px); }
}

.login-card {
  position: relative;
  z-index: 1;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 48px 40px;
  width: 380px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: cardIn 0.6s ease;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-icon { font-size: 48px; margin-bottom: 16px; }

.login-title {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple-light), var(--purple-soft));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.login-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.login-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: all 0.3s;
}

.login-input:focus {
  border-color: var(--purple-light);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2);
}

.login-input::placeholder { color: var(--text-muted); }

.login-error {
  color: var(--red);
  font-size: 13px;
  margin-top: 8px;
}

.login-btn {
  width: 100%;
  padding: 12px;
  margin-top: 20px;
  background: linear-gradient(135deg, var(--purple-main), var(--purple-light));
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124,58,237,0.4);
}

/* ========== 顶部导航 ========== */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
}

.top-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-logo { font-size: 24px; }

.app-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--purple-soft);
}

.top-center {
  flex: 1;
  max-width: 480px;
  margin: 0 32px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 0 14px;
  height: 38px;
  transition: all 0.3s;
}

.search-box:focus-within {
  border-color: var(--purple-light);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}

.search-icon { font-size: 14px; opacity: 0.5; }

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
}

.search-input::placeholder { color: var(--text-muted); }

.search-clear {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  transition: color 0.2s;
}

.search-clear:hover { color: var(--text-primary); }

.top-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-label {
  font-size: 13px;
  color: var(--text-muted);
}

.logout-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: rgba(239,68,68,0.15);
  color: var(--red);
  border-color: rgba(239,68,68,0.3);
}

/* ========== 专业层次 Tab ========== */
.level-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 24px;
  background: var(--bg-mid);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.level-tab {
  padding: 8px 20px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
}

.level-tab:hover {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.05);
}

.level-tab.active {
  color: white;
  background: linear-gradient(135deg, var(--purple-main), var(--purple-light));
  box-shadow: 0 2px 12px rgba(124,58,237,0.3);
}

/* ========== 主体 ========== */
.main-body {
  display: flex;
  height: calc(100vh - 110px);
}

/* ========== 左侧树状面板 ========== */
.tree-panel {
  width: 280px;
  min-width: 280px;
  background: var(--bg-mid);
  border-right: 1px solid rgba(255,255,255,0.05);
  overflow-y: auto;
  position: relative;
  transition: width 0.3s, min-width 0.3s;
}

.tree-panel.collapsed {
  width: 36px;
  min-width: 36px;
}

.tree-toggle {
  position: sticky;
  top: 0;
  z-index: 2;
  width: 100%;
  padding: 8px 0;
  background: var(--bg-light);
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  transition: color 0.2s;
}

.tree-toggle:hover { color: var(--purple-soft); }

.tree-content { padding: 8px 0; }

.tree-section { margin-bottom: 4px; }

.tree-cat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  user-select: none;
}

.tree-cat:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

.tree-arrow {
  font-size: 10px;
  color: var(--purple-soft);
  width: 14px;
}

.tree-cat-name { flex: 1; }

.tree-count {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 1px 8px;
}

.tree-children { padding-left: 12px; }

.tree-item {
  padding: 7px 16px 7px 28px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tree-item:hover {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.03);
}

.tree-item.selected {
  color: var(--purple-soft);
  background: rgba(124,58,237,0.1);
  border-left-color: var(--purple-light);
}

.tree-count-sm {
  font-size: 10px;
  color: var(--text-muted);
}

.tree-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ========== 右侧内容区 ========== */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  background: var(--bg-deep);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.bread-sep { margin: 0 2px; }

.bread-current {
  color: var(--purple-soft);
  font-weight: 600;
}

.result-count {
  margin-left: auto;
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  padding: 3px 10px;
  border-radius: 12px;
  color: var(--text-muted);
}

.bread-search {
  color: var(--purple-soft);
  font-weight: 500;
}

/* ========== 信息卡网格 ========== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.info-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.3s;
  animation: cardFadeIn 0.4s ease;
  position: relative;
  overflow: hidden;
}

.info-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--purple-main), var(--purple-light));
  opacity: 0;
  transition: opacity 0.3s;
}

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow);
  border-color: rgba(124,58,237,0.2);
}

.info-card:hover::before { opacity: 1; }

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

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

.card-level {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.level-benke { background: rgba(124,58,237,0.2); color: var(--purple-soft); }
.level-zhuanke { background: rgba(59,130,246,0.2); color: var(--blue); }
.level-zhigao { background: rgba(34,197,94,0.2); color: var(--green); }

.card-rank {
  font-size: 12px;
  color: var(--yellow);
  font-weight: 600;
  background: rgba(245,158,11,0.1);
  padding: 2px 8px;
  border-radius: 6px;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.3;
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.card-tag {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 6px;
}

.cat-tag { background: rgba(168,85,247,0.15); color: var(--purple-soft); }
.sub-tag { background: rgba(59,130,246,0.15); color: var(--blue); }

.card-highlight {
  display: flex;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.highlight-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hl-label {
  font-size: 11px;
  color: var(--text-muted);
}

.hl-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--purple-soft);
}

/* ========== 分页 ========== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
}

.pagination button {
  padding: 8px 20px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
  background: rgba(124,58,237,0.2);
  color: white;
}

.pagination button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-info {
  font-size: 14px;
  color: var(--text-muted);
}

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p { font-size: 16px; }
.empty-hint { font-size: 13px; margin-top: 6px; }

/* ========== 详情弹窗 ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  background: var(--bg-mid);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 28px;
  width: 90%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 16px 64px rgba(0,0,0,0.5);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(239,68,68,0.2);
  color: var(--red);
}

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

.modal-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.modal-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.modal-tag {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
}

/* ========== 核心信息区 ========== */
.modal-core {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.core-item {
  background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(168,85,247,0.06));
  border: 1px solid rgba(124,58,237,0.15);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

.core-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.core-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--purple-soft);
}

.rank-value { font-size: 24px; }

/* ========== 详细信息区 ========== */
.modal-detail {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 16px;
}

.detail-row {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  gap: 12px;
}

.detail-row.full {
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 100px;
  flex-shrink: 0;
  font-weight: 500;
}

.detail-value {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.pre-wrap { white-space: pre-wrap; }

/* ========== 滚动条 ========== */
::-webkit-scrollbar { width: 6px; }

::-webkit-scrollbar-track { background: transparent; }

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
}
