
:root {
  --front-bg: #f8fafc;
  --front-card: #ffffff;
  --front-text: #0f172a;
  --front-muted: #64748b;
  --front-line: #e5e7eb;
  --front-soft: #f1f5f9;
  --front-primary: #2563eb;
  --front-primary-dark: #1d4ed8;
  --front-green: #059669;
  --front-orange: #f97316;
  --front-red: #ef4444;
  --front-radius: 22px;
  --front-shadow: 0 14px 34px rgba(15, 23, 42, .08);
  --front-shadow-soft: 0 8px 22px rgba(15, 23, 42, .055);
  --front-container: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--front-bg);
  color: var(--front-text);
  line-height: 1.6;
  overflow-x: hidden;
}

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

img {
  max-width: 100%;
}

button,
input,
textarea,
select {
  font-family: inherit;
}

.front-container {
  width: 100%;
  max-width: var(--front-container);
  margin: 0 auto;
  padding: 0 18px;
}

.front-section {
  padding: 44px 0;
}

.front-card {
  background: var(--front-card);
  border: 1px solid var(--front-line);
  border-radius: var(--front-radius);
  box-shadow: var(--front-shadow-soft);
}

.front-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--front-primary);
  background: var(--front-primary);
  color: #fff !important;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.front-btn:hover {
  transform: translateY(-1px);
  background: var(--front-primary-dark);
  box-shadow: 0 12px 24px rgba(37, 99, 235, .18);
}

.front-btn.secondary {
  background: #fff;
  color: var(--front-primary) !important;
}

.front-btn.dark {
  background: #0f172a;
  border-color: #0f172a;
}

.front-btn.green {
  background: var(--front-green);
  border-color: var(--front-green);
}

.front-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: #eff6ff;
  color: var(--front-primary);
  font-size: 12px;
  font-weight: 900;
}

.front-muted {
  color: var(--front-muted);
}

.front-page {
  min-height: calc(100vh - 72px);
  padding: 34px 0 66px;
}

.front-page-title {
  margin: 0;
  color: var(--front-text);
  font-size: 34px;
  line-height: 1.18;
  font-weight: 950;
  letter-spacing: -0.035em;
}

.front-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.front-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.front-grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid rgba(226, 232, 240, .9);
  backdrop-filter: blur(16px);
}

.site-header-inner {
  max-width: var(--front-container);
  height: 72px;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #0f172a !important;
  font-weight: 950;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.site-logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, .22);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a,
.site-nav .site-logout-button {
  border: 0;
  background: transparent;
  color: #334155;
  font-size: 14px;
  font-weight: 850;
  padding: 9px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.site-nav a:hover,
.site-nav .site-logout-button:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.site-nav .nav-cta {
  background: #2563eb;
  color: #fff !important;
  padding: 9px 14px;
}

.site-nav .nav-cta:hover {
  background: #1d4ed8;
  color: #fff;
}

.site-logout-form {
  display: inline;
  margin: 0;
}

.mobile-menu-button {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #fff;
  color: #0f172a;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

/* Drawer */
.mobile-drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(15, 23, 42, .46);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1110;
  width: min(86vw, 350px);
  height: 100vh;
  background: #fff;
  box-shadow: -24px 0 50px rgba(15, 23, 42, .18);
  transform: translateX(105%);
  transition: transform .24s ease;
  display: flex;
  flex-direction: column;
}

body.drawer-open {
  overflow: hidden;
}

body.drawer-open .mobile-drawer-mask {
  opacity: 1;
  visibility: visible;
}

body.drawer-open .mobile-drawer {
  transform: translateX(0);
}

.mobile-drawer-head {
  height: 72px;
  padding: 0 18px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-drawer-close {
  width: 42px;
  height: 42px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.mobile-drawer-nav {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.mobile-drawer-nav a,
.mobile-drawer-nav .site-logout-button {
  width: 100%;
  display: flex;
  min-height: 46px;
  align-items: center;
  border: 0;
  border-radius: 14px;
  background: #f8fafc;
  color: #0f172a;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 900;
  text-align: left;
}

.mobile-drawer-nav a.primary {
  background: #2563eb;
  color: #fff;
}

.mobile-drawer-nav .site-logout-form {
  display: block;
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: rgba(255, 255, 255, .76);
  padding: 42px 0 26px;
}

.site-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr .8fr .8fr;
  gap: 24px;
}

.site-footer h3 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 17px;
}

.site-footer p {
  margin: 0;
  line-height: 1.8;
}

.site-footer a {
  display: block;
  color: rgba(255, 255, 255, .78);
  margin: 6px 0;
}

.site-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .1);
  margin-top: 26px;
  padding-top: 18px;
  font-size: 13px;
}

/* Messages */
.front-messages {
  max-width: var(--front-container);
  margin: 18px auto 0;
  padding: 0 18px;
}

.front-message {
  border-radius: 14px;
  padding: 12px 14px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #bbf7d0;
  margin-bottom: 10px;
}

.front-message.error {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.front-message.warning {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fed7aa;
}

/* Forms */
.front-auth-page {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  padding: 44px 0;
}

.front-auth-shell {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 18px;
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 22px;
  align-items: stretch;
}

.front-auth-brand {
  border-radius: 28px;
  background: linear-gradient(135deg, #0f172a, #2563eb);
  color: #fff;
  padding: 34px;
  box-shadow: var(--front-shadow);
}

.front-auth-brand h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.22;
  letter-spacing: -0.04em;
}

.front-auth-brand p {
  color: rgba(255, 255, 255, .78);
  line-height: 1.85;
}

.front-auth-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.front-auth-list div {
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .08);
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 850;
}

.front-auth-card {
  border-radius: 28px;
  background: #fff;
  border: 1px solid #e5e7eb;
  padding: 30px;
  box-shadow: var(--front-shadow-soft);
}

.front-auth-card h2 {
  margin: 0 0 18px;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.front-auth-card form p {
  margin: 0 0 14px;
}

.front-auth-card label {
  display: block;
  margin-bottom: 6px;
  color: #334155;
  font-size: 14px;
  font-weight: 850;
}

.front-auth-card input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 0 12px;
  font-size: 15px;
}

.front-auth-card .helptext,
.front-auth-card ul {
  display: block;
  color: #64748b;
  font-size: 12px;
  line-height: 1.65;
  margin-top: 6px;
}

.front-form-submit {
  width: 100%;
  margin-top: 8px;
}

/* Responsive */
@media (max-width: 900px) {
  .front-grid-2,
  .front-grid-3,
  .site-footer-grid,
  .front-auth-shell {
    grid-template-columns: 1fr;
  }

  .site-nav {
    display: none;
  }

  .mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-header-inner {
    height: 64px;
  }

  .front-page-title {
    font-size: 28px;
  }

  .front-section {
    padding: 32px 0;
  }

  .front-auth-page {
    padding: 24px 0;
    align-items: flex-start;
  }

  .front-auth-brand,
  .front-auth-card {
    border-radius: 22px;
    padding: 22px;
  }

  .front-auth-brand h1 {
    font-size: 27px;
  }
}

@media (max-width: 620px) {
  .front-container {
    padding: 0 14px;
  }

  .front-page {
    padding: 22px 0 48px;
  }

  .front-card {
    border-radius: 18px;
  }

  .front-btn {
    width: 100%;
  }

  .site-logo-text {
    max-width: 168px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
