/* 计然咨询 · 系统导航页样式（登录+导航单页） */

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

[hidden] { display: none !important; }

:root {
  --bg: #eef4fc;
  --bg-light: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --accent: #2563eb;
  --accent-light: #3b82f6;
  --accent-soft: #dbeafe;
  --accent-pale: #eff6ff;
  --line: #cbd5e1;
  --line-light: #e2e8f0;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Serif SC", "Segoe UI", serif;
  background: linear-gradient(135deg, #e0eafc 0%, #eef4fc 50%, #f8fafc 100%);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* 背景纹理 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 10% 90%, rgba(37, 99, 235, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 90% 10%, rgba(59, 130, 246, 0.02) 0%, transparent 50%),
    linear-gradient(rgba(37, 99, 235, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.012) 1px, transparent 1px);
  background-size: auto, auto, 60px 60px, 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  min-height: 100vh;
}

/* 左侧：品牌 + 登录/已登录态 */
.hero {
  padding: 72px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg) 100%);
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  right: -1px;
  width: 3px;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent), transparent 25%, transparent 75%, var(--accent-light));
  opacity: 0.7;
}

.hero-top { animation: fadeInLeft 0.8s ease-out; }

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 40px;
  font-weight: 500;
}

.hero-label .line {
  width: 40px;
  height: 1px;
  background: var(--accent);
}

.hero h1 {
  font-size: 60px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero h1 .highlight {
  display: block;
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
  font-family: "Noto Serif SC", Georgia, serif;
  text-indent: 1em;
}

.hero-slogan {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.5s forwards;
}

.hero-slogan::before {
  content: '';
  width: 20px;
  height: 2px;
  background: var(--accent);
}

/* 登录表单 */
.login-form {
  max-width: 360px;
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.6s forwards;
}

.login-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line-light);
}

.form-group {
  margin-bottom: 18px;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.form-input-wrapper { position: relative; }

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 40px;
  background: var(--bg-light);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  outline: none;
}

.form-input::placeholder { color: var(--text-tertiary); }
.form-input:hover { border-color: var(--accent-light); }
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
  background: white;
}

.form-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 1;
}

.form-group:focus-within .form-input-icon { color: var(--accent); }

.form-toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  border-radius: 6px;
  transition: all 0.2s ease;
  z-index: 2;
}

.form-toggle-password:hover { color: var(--accent); background: rgba(37, 99, 235, 0.08); }
.form-toggle-password svg { width: 16px; height: 16px; }

.form-error {
  min-height: 20px;
  margin-bottom: 10px;
  font-size: 12px;
  color: #dc2626;
}

.login-btn {
  width: 100%;
  height: 46px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
}

.login-btn:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -8px rgba(37, 99, 235, 0.5);
}
.login-btn:active { transform: translateY(0); }
.login-btn svg { width: 16px; height: 16px; transition: transform 0.3s ease; }
.login-btn:hover svg { transform: translateX(3px); }

.login-btn.loading { pointer-events: none; opacity: 0.9; }
.login-btn.loading svg { display: none; }

.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.login-btn.loading .btn-spinner { display: inline-block; }

/* 已登录态 */
.logged-in {
  max-width: 360px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.logged-in-user { display: flex; align-items: center; gap: 14px; }
.logged-in-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.logged-in-name { font-size: 17px; font-weight: 600; color: var(--text-primary); }
.logged-in-role { font-size: 12px; color: var(--text-tertiary); }

/* 底部信息 */
.hero-bottom {
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  animation: fadeInUp 0.8s ease-out 0.8s both;
  line-height: 1.8;
}

.hero-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.hero-footer-row:last-child { margin-bottom: 0; }
.hero-bottom .version { font-weight: 600; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.hero-bottom .page { display: flex; align-items: center; gap: 8px; }
.hero-bottom .page .bar { width: 24px; height: 2px; background: var(--accent); }
.hero-footer-links { display: flex; gap: 14px; }
.hero-footer-links a { color: var(--text-tertiary); text-decoration: none; transition: color 0.2s ease; }
.hero-footer-links a:hover { color: var(--accent); }
.hero-footer-beian { display: flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; transition: color 0.2s ease; }
.hero-footer-beian:hover { color: var(--accent); }
.hero-footer-beian svg { width: 12px; height: 12px; }

/* 右侧：卡片区 */
.content {
  padding: 80px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.section-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeInRight 0.6s ease-out;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 28px 24px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  width: 100%;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: inherit;
  position: relative;
  opacity: 0;
  animation: slideInRight 0.6s ease-out forwards;
}

.card:nth-child(2) { animation-delay: 0.3s; }
.card:nth-child(3) { animation-delay: 0.4s; }
.card:nth-child(4) { animation-delay: 0.5s; }
.card:nth-child(5) { animation-delay: 0.6s; }
.card:nth-child(6) { animation-delay: 0.7s; }

.card:first-of-type { border-top: 1px solid var(--line); }

.card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--card-color, var(--accent));
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.08;
}
.card:hover::before { width: 100%; }
.card:hover { padding-left: 32px; }

.card-number {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  width: 28px;
  transition: color 0.3s ease;
}
.card:hover .card-number { color: var(--card-color, var(--accent)); }

.card-body {
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.card-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--icon-bg, #f5f5f0);
  border-radius: 8px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}
.card:hover .card-icon { transform: scale(1.05); background: var(--icon-bg-hover, #ebebe4); }
.card-icon svg { width: 28px; height: 28px; }

.card-text h3 { font-size: 18px; font-weight: 600; margin-bottom: 4px; letter-spacing: -0.01em; }
.card-text p { font-size: 13px; color: var(--text-secondary); }
.card-text p span + span::before { content: ' / '; color: var(--text-tertiary); }

.card-arrow {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: all 0.3s ease;
  color: var(--text-tertiary);
  position: relative;
  z-index: 1;
}
.card:hover .card-arrow {
  background: var(--card-color, var(--accent));
  border-color: var(--card-color, var(--accent));
  color: white;
  transform: translateX(4px);
}
.card-arrow svg { width: 16px; height: 16px; }

/* 颜色主题 */
.card-manage { --card-color: #2563eb; --icon-bg: #dbeafe; --icon-bg-hover: #bfdbfe; }
.card-project { --card-color: #0891b2; --icon-bg: #cffafe; --icon-bg-hover: #a5f3fc; }
.card-review { --card-color: #0d9488; --icon-bg: #ccfbf1; --icon-bg-hover: #99f6e4; }
.card-settings { --card-color: #4f46e5; --icon-bg: #e0e7ff; --icon-bg-hover: #c7d2fe; }
.card-users { --card-color: #6366f1; --icon-bg: #e0e7ff; --icon-bg-hover: #c7d2fe; }
.card-bid { --card-color: #d97706; --icon-bg: #fef3c7; --icon-bg-hover: #fde68a; }

/* ===== 弹窗 / 表单 / 表格 / 头像 / 按钮 ===== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal {
  background: white;
  border-radius: 14px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  animation: fadeInUp 0.22s ease-out;
}
.modal-lg { max-width: 960px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-light);
}
.modal-header h3 { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.modal-header-actions { display: flex; align-items: center; gap: 8px; }

.modal-close {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--accent-pale); color: var(--accent); }

.modal-body { padding: 20px; }

.modal-body label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.modal-body label input {
  display: block;
  width: 100%;
  height: 40px;
  margin-top: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.modal-body label input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.roles-check {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line-light);
  border-radius: 8px;
  background: var(--bg-light);
}
.roles-check label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  margin-bottom: 0;
  font-weight: 400;
}
.roles-check input[type="checkbox"] {
  display: inline-block;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  accent-color: var(--accent);
}

.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.form-hint { font-size: 12px; color: var(--text-tertiary); margin: -8px 0 12px; }

.secret-box {
  padding: 12px;
  background: var(--accent-pale);
  border: 1px solid var(--accent-soft);
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
  word-break: break-all;
}
.secret-box p { margin: 4px 0; }

.avatar-upload { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.avatar-upload-actions { display: flex; flex-direction: column; gap: 8px; }
.avatar-btns { display: flex; gap: 8px; }
#a-avatar-file { font-size: 12px; color: var(--text-secondary); max-width: 220px; }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 44px; height: 44px; font-size: 16px; }
.avatar-xl { width: 64px; height: 64px; font-size: 22px; }

.btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-light); border-color: var(--accent-light); color: white; }
.btn-ghost { background: transparent; }
.btn-danger { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.btn-danger:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
.btn-approve { background: rgba(219, 234, 254, 0.7); border: 1px solid rgba(147, 197, 253, 0.7); color: #1d4ed8; font-weight: 700; }
.btn-approve:hover { background: rgba(219, 234, 254, 1); border-color: rgba(147, 197, 253, 1); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; border-radius: 8px; }

.table-wrap { max-height: 60vh; overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-light); white-space: nowrap; }
.table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}
.table tr:hover td { background: var(--accent-pale); }
.td-actions .btn { margin-left: 6px; font-weight: 600; }

.kind-tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.kind-tag.staff { background: #eff6ff; color: #1d4ed8; }
.kind-tag.client { background: #ecfdf5; color: #059669; }

.role-tag {
  display: inline-block;
  margin: 1px 2px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: #e5e7eb;
  color: #475569;
}
.role-tag.admin { background: #fef3c7; color: #b45309; }
.role-tag.staff { background: #dbeafe; color: #1d4ed8; }
.role-tag.reviewer1 { background: #ffe4e6; color: #be123c; }
.role-tag.reviewer2 { background: #ede9fe; color: #6d28d9; }
.role-tag.reviewer3 { background: #fef3c7; color: #b45309; }
.role-tag.finance { background: #dcfce7; color: #15803d; }

/* 用户管理弹窗页签 */
.modal-tabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--line-light); }
.modal-tab { height: 40px; padding: 0 16px; border: none; background: transparent; color: var(--text-secondary); font-size: 13px; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; font-family: inherit; }
.modal-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* 授权码状态徽标 */
.status-tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; }
.status-tag.active { background: #ecfdf5; color: #059669; }
.status-tag.idle { background: #eff6ff; color: #1d4ed8; }
.status-tag.revoked { background: #f3f4f6; color: #6b7280; }
.status-tag.expired { background: #fef3c7; color: #b45309; }
.status-tag.none { background: #f3f4f6; color: #9ca3af; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 200;
  max-width: 80vw;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 0.25s ease-out;
}

/* 动画 */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeInLeft { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* 响应式 */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .hero {
    padding: 60px 32px 40px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    min-height: auto;
  }
  .hero::after { display: none; }
  .hero h1 { font-size: 48px; }
  .content { padding: 48px 32px; }
}

@media (max-width: 640px) {
  .hero { padding: 48px 24px 32px; }
  .hero h1 { font-size: 36px; }
  .content { padding: 32px 24px; }
  .card { padding: 20px 16px; gap: 16px; grid-template-columns: auto 1fr; }
  .card-arrow { display: none; }
  .card-body { gap: 14px; }
  .card-icon { width: 44px; height: 44px; }
  .card-icon svg { width: 24px; height: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
