:root {
  --text: #f8fbff;
  --muted: rgba(248, 251, 255, .78);
  --line: rgba(255, 255, 255, .22);
  --shadow: 0 24px 70px rgba(7, 24, 34, .28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--text);
  background: #10251f;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.portal-login {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
  gap: 20px;
  padding: 24px;
  background:
    linear-gradient(110deg, rgba(7, 29, 35, .82), rgba(20, 51, 48, .42) 46%, rgba(13, 28, 32, .72)),
    url("https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?auto=format&fit=crop&w=1800&q=80") center / cover;
}

.login-card {
  width: min(520px, 100%);
  padding: clamp(28px, 5vw, 44px);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 28px 80px rgba(2, 16, 15, .34);
  color: #10251f;
}

.login-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 8px;
  background: #12a076;
  color: #fff;
  font-size: 30px;
  font-weight: 900;
}

.login-card .eyebrow {
  color: #0f766e;
}

.login-card h1 {
  color: #10251f;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.16;
  text-shadow: none;
}

.login-card p {
  margin: 16px 0 0;
  color: #52645e;
  font-size: 16px;
  line-height: 1.75;
}

.login-button {
  width: 100%;
  min-height: 50px;
  margin-top: 28px;
  border: 0;
  border-radius: 8px;
  background: #0f8b66;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 17px;
  font-weight: 900;
}

.login-button:hover {
  background: #0c7657;
}

.login-button:disabled {
  cursor: wait;
  opacity: .7;
}

.login-message {
  min-height: 22px;
  margin-top: 14px;
  color: #b42318;
  font-size: 14px;
  line-height: 1.55;
}

.login-footer {
  width: min(920px, 100%);
  display: grid;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background: rgba(7, 24, 28, .42);
  color: rgba(248, 251, 255, .78);
  font-size: 13px;
  line-height: 1.5;
  backdrop-filter: blur(10px);
}

.login-footer-links,
.login-beian-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
}

.login-footer a {
  color: rgba(248, 251, 255, .92);
  font-weight: 800;
}

.login-footer a:hover {
  color: #fff;
}

.portal-locked .portal-shell {
  display: none;
}

.portal-authenticated .portal-login {
  display: none;
}

.portal-shell {
  min-height: 100vh;
}

.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 34px;
  padding: clamp(28px, 5vw, 64px);
  overflow: hidden;
  background:
    linear-gradient(110deg, rgba(7, 29, 35, .76), rgba(20, 51, 48, .34) 44%, rgba(13, 28, 32, .66)),
    url("https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?auto=format&fit=crop&w=1800&q=80") center / cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(0deg, rgba(9, 22, 23, .84), transparent);
  pointer-events: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: .18;
  pointer-events: none;
}

.hero-content,
.system-grid,
.secondary-panel,
.portal-userbar {
  position: relative;
  z-index: 1;
}

.portal-userbar {
  width: min(1120px, 100%);
  margin: 0 auto -10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: rgba(248, 251, 255, .86);
  font-size: 14px;
  font-weight: 800;
}

.portal-userbar button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.portal-userbar button:hover {
  background: rgba(255, 255, 255, .2);
}

.hero-content {
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}

.eyebrow {
  margin: 0 0 10px;
  color: #aaf3d9;
  font-size: clamp(14px, 1.4vw, 18px);
  font-weight: 800;
}

h1 {
  margin: 0;
  max-width: 980px;
  font-size: clamp(42px, 8vw, 96px);
  line-height: 1.04;
  font-weight: 900;
  text-shadow: 0 4px 24px rgba(0, 0, 0, .36);
}

.subtitle {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 24px);
  line-height: 1.55;
}

.security-summary {
  max-width: 760px;
  margin: 14px 0 0;
  color: rgba(248, 251, 255, .86);
  font-size: 15px;
  line-height: 1.7;
}

.system-grid {
  width: min(1280px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 18px;
}

.system-card {
  min-height: 190px;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transform: translateY(0);
  transition: transform .18s ease, border-color .18s ease, filter .18s ease;
}

.system-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, .72);
  filter: saturate(1.08);
}

.system-card.copilot {
  background: linear-gradient(135deg, #10251f, #0f8b66);
}

.system-card.crm {
  background: linear-gradient(135deg, #0f7b5f, #17a777);
}

.system-card.finance {
  background: linear-gradient(135deg, #166076, #2563eb);
}

.system-card.mes {
  background: linear-gradient(135deg, #0b83d8, #20b7d9);
}

.system-card.wms {
  background: linear-gradient(135deg, #0e7490, #22c55e);
}

.system-card.purchase {
  background: linear-gradient(135deg, #b7791f, #0f766e);
}

.system-card.raw-wms {
  background: linear-gradient(135deg, #166534, #0e7490);
}

.system-card.cmms {
  background: linear-gradient(135deg, #7651c8, #bd5bd6);
}

.system-icon {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .78);
  border-radius: 8px;
  color: #fff;
  font-size: 19px;
  font-weight: 900;
}

.system-card strong {
  font-size: clamp(24px, 2.8vw, 34px);
  line-height: 1.15;
}

.system-card small {
  color: rgba(255, 255, 255, .82);
  font-size: 15px;
  line-height: 1.45;
}

.secondary-panel {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 25, 28, .46);
  backdrop-filter: blur(12px);
}

.secondary-panel span {
  color: var(--muted);
  font-weight: 800;
}

.secondary-panel div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.mini-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
  font-weight: 800;
}

.mini-link.disabled {
  opacity: .58;
}

.portal-footer {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  margin: -10px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: rgba(248, 251, 255, .72);
  font-size: 13px;
}

.footer-links,
.beian-info {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.footer-links a {
  color: rgba(248, 251, 255, .9);
  font-weight: 700;
}

.footer-links a:hover {
  color: #fff;
}

.legal-page {
  min-height: 100vh;
  padding: 42px 16px;
  color: #15231f;
  background: #f4f7f5;
}

.legal-doc {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid #d8e2dc;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(22, 45, 38, .08);
}

.legal-doc h1 {
  max-width: none;
  color: #10251f;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.18;
  text-shadow: none;
}

.legal-doc h2 {
  margin: 28px 0 10px;
  color: #123b30;
  font-size: 20px;
}

.legal-doc p,
.legal-doc li {
  color: #33413c;
  line-height: 1.8;
}

.legal-doc a {
  color: #0f766e;
  font-weight: 800;
}

.legal-meta {
  margin: 10px 0 24px;
  color: #68756f;
  font-size: 14px;
}

.legal-list {
  padding-left: 20px;
}

.legal-back {
  display: inline-flex;
  margin-top: 24px;
}

@media (max-width: 1180px) {
  .system-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1020px) {
  .system-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .hero {
    align-content: start;
    padding: 28px 16px 22px;
    gap: 22px;
  }

  .system-grid {
    grid-template-columns: 1fr;
  }

  .system-card {
    min-height: 142px;
    grid-template-columns: auto 1fr;
    align-items: center;
    align-content: center;
  }

  .system-card small {
    grid-column: 2;
  }

  .secondary-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .secondary-panel div {
    justify-content: flex-start;
  }

  .portal-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
