:root {
  color-scheme: light;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --brand-cyan: #47c2d9;
  --brand-blue: #1768c5;
  --brand-blue-deep: #074eb8;
  --ink: #17243a;
  --ink-soft: #526078;
  --muted: #7d899c;
  --line: #dbe6f1;
  --line-strong: #cbdbea;
  --surface: #ffffff;
  --surface-soft: #f5f9fd;
  --surface-blue: #eef7ff;
  --danger: #d14343;
  --shadow-sm: 0 8px 24px rgba(29, 76, 128, 0.08);
  --shadow-md: 0 18px 50px rgba(24, 78, 134, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--surface-soft);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--surface-soft);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(71, 194, 217, 0.34);
  outline-offset: 3px;
}

.auth-locked .home-page {
  display: none;
}

/* Login */
.login-body {
  background: #eef5fb;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(430px, 0.82fr);
}

.login-brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(38px, 5vw, 78px);
  color: #fff;
  background: linear-gradient(145deg, #083f94 0%, #0862bd 58%, #22a6cf 100%);
  position: relative;
  overflow: hidden;
}

.login-brand-logo {
  width: min(440px, 74%);
  height: auto;
  display: block;
  position: relative;
  z-index: 1;
}

.login-brand-copy {
  max-width: 680px;
  position: relative;
  z-index: 1;
}

.brand-eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--brand-blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.brand-eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.login-brand-copy h1 {
  margin: 0;
  font-size: clamp(40px, 5.2vw, 72px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.login-brand-copy p:last-child {
  max-width: 620px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.85;
}

.login-form-panel {
  display: grid;
  place-items: center;
  padding: clamp(28px, 5vw, 78px);
  background: var(--surface);
}

.login-card {
  width: min(430px, 100%);
}

.login-card-logo {
  display: none;
  width: 240px;
  height: auto;
  margin-bottom: 44px;
}

.login-card h2 {
  margin: 0;
  font-size: clamp(34px, 3.2vw, 44px);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.login-intro {
  margin: 14px 0 36px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.8;
}

.login-form {
  display: grid;
  gap: 22px;
}

.field {
  display: grid;
  gap: 9px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap > i {
  position: absolute;
  left: 17px;
  color: #7391ad;
  font-size: 16px;
  pointer-events: none;
}

.field input {
  width: 100%;
  height: 54px;
  padding: 0 52px 0 48px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field input::placeholder {
  color: #a2adbb;
}

.field input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px rgba(23, 104, 197, 0.1);
  background: #fbfdff;
}

.password-toggle {
  position: absolute;
  right: 8px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #7391ad;
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--brand-blue);
  background: var(--surface-blue);
}

.login-button {
  min-height: 54px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 12px;
  background: var(--brand-blue-deep);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(7, 78, 184, 0.2);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.login-button:hover {
  background: #06439e;
  box-shadow: 0 16px 32px rgba(7, 78, 184, 0.26);
  transform: translateY(-1px);
}

.login-button:disabled {
  cursor: wait;
  opacity: 0.76;
  transform: none;
}

.login-hint {
  min-height: 22px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.login-hint.is-error {
  color: var(--danger);
}

/* Home */
.home-page {
  min-height: 100vh;
  background: #f8fbfe;
}

.app-header {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 clamp(24px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.brand-link {
  display: inline-flex;
  align-items: center;
}

.brand-link img {
  display: block;
  width: clamp(210px, 18vw, 280px);
  height: auto;
}

.sign-out-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-soft);
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.sign-out-button i {
  color: var(--brand-blue);
}

.sign-out-button:hover {
  border-color: #a8c6e2;
  color: var(--brand-blue-deep);
  background: var(--surface-blue);
}

.home-main {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: clamp(30px, 3vw, 44px) clamp(20px, 4vw, 64px) 44px;
}

.page-intro {
  margin-bottom: 24px;
}

.page-intro h1 {
  margin: 0;
  padding-left: 20px;
  border-left: 5px solid var(--brand-blue);
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.16;
  letter-spacing: -0.03em;
}

.tool-section {
  margin-top: 20px;
  padding: clamp(18px, 1.7vw, 24px);
  border: 1px solid #d5e5f3;
  border-radius: 14px;
  background: #f2f8fd;
}

.section-heading {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 12px;
}

.heading-mark {
  width: 4px;
  border-radius: 4px;
  background: var(--brand-blue);
}

.section-heading h2 {
  margin: 0;
  color: #0f58aa;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.24;
}

.promotion-link {
  min-height: 102px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.promotion-link:hover {
  border-color: #afd0ea;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.tool-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #1387df;
  background: #e7f4ff;
}

.tool-icon-large {
  width: 70px;
  height: 70px;
  font-size: 30px;
}

.promotion-copy {
  display: flex;
  align-items: center;
}

.promotion-copy strong {
  font-size: clamp(19px, 1.7vw, 24px);
}

.link-arrow {
  padding: 14px;
  color: #168de3;
  font-size: 20px;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px 24px;
}

.demo-group {
  min-width: 0;
}

.demo-group h3 {
  min-height: 34px;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 2px 10px;
  border-bottom: 2px solid #2998e8;
  color: var(--ink);
  font-size: 17px;
}

.demo-group h3 i {
  width: 20px;
  color: #168de3;
  text-align: center;
}

.demo-links {
  display: grid;
  gap: 10px;
}

.demo-links a {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 650;
  box-shadow: 0 5px 16px rgba(29, 76, 128, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.demo-links a i {
  flex: 0 0 auto;
  color: #168de3;
  font-size: 13px;
}

.demo-links a:hover {
  border-color: #abd0ed;
  color: #075ab5;
  box-shadow: 0 10px 24px rgba(29, 76, 128, 0.1);
  transform: translateY(-2px);
}

.video-library {
  display: grid;
  gap: 18px;
}

.video-group {
  min-width: 0;
}

.video-group h3 {
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 17px;
}

.video-group h3 i {
  color: #168de3;
}

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

.video-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(29, 76, 128, 0.08);
}

.video-card video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0c1f38;
}

.video-card-body {
  display: grid;
  gap: 8px;
  padding: 14px 16px 16px;
}

.video-card-body h4 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}

.video-card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
}

.video-card-body a {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #075ab5;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.video-card-body a:hover {
  color: var(--brand-blue-deep);
}

.video-empty {
  margin: 0;
  padding: 18px;
  border: 1px dashed #bdd7ee;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-size: 14px;
}

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

  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    min-height: 300px;
    padding: 34px 28px;
  }

  .login-brand-logo {
    width: 320px;
  }

  .login-brand-copy h1 {
    font-size: 40px;
  }

  .login-brand-copy p:last-child {
    margin-top: 14px;
    font-size: 15px;
  }

  .login-form-panel {
    padding: 44px 28px 56px;
  }
}

@media (max-width: 640px) {
  .login-brand-panel {
    min-height: 250px;
    justify-content: flex-end;
    padding: 30px 22px;
  }

  .login-brand-logo {
    display: none;
  }

  .login-brand-copy h1 {
    font-size: 32px;
  }

  .brand-eyebrow {
    margin-bottom: 10px;
    font-size: 10px;
  }

  .login-brand-copy p:last-child {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.7;
  }

  .login-form-panel {
    display: block;
    padding: 30px 20px 44px;
  }

  .login-card-logo {
    display: block;
    width: 210px;
    margin-bottom: 30px;
  }

  .login-card h2 {
    font-size: 32px;
  }

  .login-intro {
    margin-bottom: 28px;
  }

  .app-header {
    height: 72px;
    padding: 0 18px;
  }

  .brand-link img {
    width: 175px;
  }

  .sign-out-button {
    width: 42px;
    min-height: 42px;
    padding: 0;
  }

  .sign-out-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .home-main {
    padding: 30px 16px 42px;
  }

  .page-intro {
    margin-bottom: 24px;
  }

  .page-intro h1 {
    padding-left: 14px;
    border-left-width: 4px;
    font-size: 30px;
    line-height: 1.28;
  }

  .tool-section {
    margin-top: 16px;
    padding: 18px 14px;
    border-radius: 12px;
  }

  .promotion-link {
    min-height: 104px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }

  .tool-icon-large {
    width: 54px;
    height: 54px;
    font-size: 23px;
  }

  .promotion-link > .link-arrow {
    display: none;
  }

  .demo-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

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

  .demo-links a {
    min-height: 62px;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
