/* ============================================================
   Portal 门户 - 暗色主题
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #1D1F27;
  --bg-secondary: #252830;
  --bg-tertiary: #2D303A;
  --bg-card: #2A2D37;
  --bg-hover: #323540;
  --bg-input: #1A1C24;
  --text-primary: #E8E9ED;
  --text-secondary: #9CA0AC;
  --text-tertiary: #6B6F7C;
  --a-start: #a855f7;
  --a-mid: #8b5cf6;
  --a-end: #06b6d4;
  --gradient: linear-gradient(135deg, #a855f7, #06b6d4);
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --border: #363946;
  --border-light: #2E313C;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--a-mid); text-decoration: none; }
a:hover { color: var(--a-end); }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ---- 认证页面 ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.auth-header { text-align: center; margin-bottom: 24px; }
.auth-header h1 { font-size: 24px; font-weight: 600; margin-bottom: 4px; }
.auth-subtitle { color: var(--text-tertiary); font-size: 13px; }
.auth-error {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 14px;
}
.auth-footer-text { text-align: center; margin-top: 20px; color: var(--text-tertiary); font-size: 13px; }
.auth-footer-text a { font-weight: 500; }

.auth-copyright {
  text-align: center;
  padding-top: 20px;
  margin-top: 16px;
  border-top: 1px solid var(--border-light);
  color: var(--text-tertiary);
  font-size: 11px;
}

/* ---- 表单 ---- */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--a-mid);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border: none; border-radius: var(--radius);
  font-weight: 500; font-size: 13px; cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--gradient); color: white;
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 4px 15px rgba(168,85,247,0.3); transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: var(--text-secondary); border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-danger {
  background: rgba(239,68,68,0.15); color: var(--danger);
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-full { width: 100%; padding: 12px; font-size: 15px; }

/* ---- 通知横幅 ---- */
.notice-banner {
  background: rgba(139,92,246,0.1);
  border: 1px solid rgba(139,92,246,0.25);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ---- Portal 首页 ---- */
.portal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.portal-header {
  text-align: center;
  margin-bottom: 40px;
}

.portal-user {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-top: 12px;
}

.portal-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: white;
}

.portal-cards {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 40px;
}

.portal-card {
  width: 240px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.portal-card:hover:not(.portal-card-disabled) {
  border-color: var(--a-mid);
  box-shadow: 0 8px 30px rgba(139,92,246,0.15);
  transform: translateY(-4px);
}

.portal-card-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.portal-card-icon {
  font-size: 40px;
  line-height: 1;
}

.portal-card h3 {
  font-size: 16px;
  font-weight: 600;
}

.portal-card p {
  font-size: 12px;
  color: var(--text-tertiary);
}

.portal-footer {
  text-align: center;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 13px;
  z-index: 9999;
  animation: slideIn 0.3s ease;
  box-shadow: var(--shadow-lg);
}
.toast-success { background: rgba(34,197,94,0.9); color: white; }
.toast-error { background: rgba(239,68,68,0.9); color: white; }
.toast-info { background: rgba(59,130,246,0.9); color: white; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---- 移动端 ---- */
@media (max-width: 768px) {
  .portal-cards { flex-direction: column; align-items: center; }
  .portal-card { width: 100%; max-width: 280px; }
  .form-row { grid-template-columns: 1fr; }
  .auth-card { padding: 24px; }
}
