/* 李翔ERP系统 — 全站样式 */
:root {
  --primary: #2563eb;
  --primary-deep: #1d4ed8;
  --sidebar-bg: #101c37;
  --sidebar-hover: rgba(255, 255, 255, .08);
  --text: #1f2937;
  --muted: #64748b;
  --bg: #f3f5f9;
  --card: #ffffff;
  --border: #e5e7eb;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 8px 24px rgba(15, 23, 42, .06);
}

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

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }

/* ---------- 彩色字块（模块图标 / 品牌） ---------- */

.tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--c, var(--primary));
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  flex: none;
}

.tile-lg { width: 44px; height: 44px; border-radius: 11px; font-size: 20px; }
.tile-xl { width: 56px; height: 56px; border-radius: 14px; font-size: 26px; }

/* ---------- 模块内嵌登录卡（未登录时占满右侧内容区） ---------- */

.gate-wrap {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 0;
}

.gate-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 34px 32px 28px;
  box-shadow: var(--shadow);
}

.gate-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.gate-head h2 { font-size: 19px; }
.gate-head p { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}

.input-group { display: flex; gap: 8px; }

.input-group input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.input-btn {
  border: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 10px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

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

.login-error {
  margin-top: 12px;
  color: var(--danger);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  animation: shake .3s;
}

@keyframes shake {
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

.btn-primary {
  width: 100%;
  height: 46px;
  margin-top: 18px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 6px;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}

.btn-primary:hover { opacity: .92; }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .6; cursor: default; }

/* ---------- 通用页脚（备案号） ---------- */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px 16px;
  font-size: 12.5px;
  color: var(--muted);
}

.login-footer { display: none; }
.site-footer .sep { color: var(--border); }
.site-footer a:hover { text-decoration: underline; }

/* ---------- 主布局（侧边栏 + 内容区） ---------- */

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex: none;
  background: var(--sidebar-bg);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }

.brand-tile { width: 38px; height: 38px; border-radius: 10px; font-size: 18px; }

.brand-text strong { display: block; color: #fff; font-size: 15.5px; letter-spacing: .5px; }
.brand-text small { display: block; font-size: 11px; color: #64748b; margin-top: 3px; }

.nav-group-label {
  font-size: 11px;
  color: #64748b;
  letter-spacing: 2px;
  padding: 4px 8px 8px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  color: #cbd5e1;
  font-size: 14px;
  position: relative;
  transition: background .15s, color .15s;
}

.nav-item:hover { background: var(--sidebar-hover); color: #fff; }

.nav-item.active { background: var(--sidebar-hover); color: #fff; font-weight: 600; }

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--primary);
}

.nav-item .tile { width: 28px; height: 28px; font-size: 13px; border-radius: 7px; }

.sidebar-foot {
  margin-top: auto;
  padding: 12px 8px 2px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: 11px;
  color: #64748b;
}

/* ---------- 内容区 ---------- */

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar-title h1 { font-size: 18px; }
.crumb { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }

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

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text);
}

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

.avatar-muted { background: #e2e8f0; }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.btn-ghost {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}

.btn-ghost:hover { color: var(--danger); border-color: var(--danger); }

.content { flex: 1; padding: 26px 28px 34px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* ---------- 介绍页（home） ---------- */

.hero {
  border-radius: 16px;
  padding: 34px 34px 30px;
  color: #fff;
  background:
    radial-gradient(600px 300px at 90% -40%, rgba(255, 255, 255, .18), transparent 60%),
    linear-gradient(120deg, #1e40af 0%, #2563eb 55%, #4f46e5 100%);
  box-shadow: var(--shadow);
}

.hero h2 { font-size: 26px; letter-spacing: 1px; }
.hero .hero-sub { margin-top: 10px; font-size: 14.5px; line-height: 1.8; color: rgba(255, 255, 255, .88); max-width: 720px; }
.hero .hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.hero-chips span {
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .25);
}

.section { margin-top: 30px; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 17px; margin-bottom: 16px; }
.section-title::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--primary); }

.intro-text { font-size: 14.5px; line-height: 2; color: #374151; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow); }

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

.feature-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.feature-card h4 { font-size: 15px; margin-bottom: 8px; }
.feature-card p { font-size: 13px; line-height: 1.8; color: var(--muted); }

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

.module-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}

.module-card:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, .45);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .12);
}

.module-card-head { display: flex; align-items: center; gap: 12px; }
.module-card-head h3 { font-size: 16px; }
.module-card-head p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.module-card-desc { font-size: 13.5px; line-height: 1.85; color: #475569; flex: 1; }
.module-card-link { font-size: 13px; font-weight: 600; }

/* ---------- 模块占位页 ---------- */

.module-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.module-head h2 { font-size: 22px; }
.module-tagline { font-size: 13px; color: var(--muted); margin-top: 5px; }

.module-desc { font-size: 14.5px; line-height: 2; color: #374151; margin-bottom: 18px; max-width: 860px; }

.notice {
  border: 1px solid #ffe1a6;
  background: #fffbeb;
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 13.5px;
  color: #92400e;
  margin-bottom: 18px;
}

.notice p { margin-top: 6px; line-height: 1.8; }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow); }
.panel h3 { font-size: 15px; margin-bottom: 12px; }

.feature-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }

.feature-list li { font-size: 13.5px; color: #374151; line-height: 1.7; padding-left: 24px; position: relative; }

.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 2px;
  color: var(--primary);
  font-weight: 700;
}

/* ---------- 响应式 ---------- */

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; padding: 12px; }
  .brand { padding: 2px 6px 10px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-group-label { display: none; }
  .nav-item.active::before { display: none; }
  .nav-item span:last-child { display: none; }  /* 窄屏只显示图标 */
  .nav-item { padding: 8px; }
  .sidebar-foot { display: none; }
  .content { padding: 18px 14px 26px; }
  .topbar { padding: 12px 14px; }
  .hero { padding: 22px 20px; }
}
