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

:root {
  /* 取自斗鱼官网首页 logo SVG；其余交互色由品牌橙混合生成。 */
  --dy-orange: #ff552e;
  --dy-yellow: #f8c100;
  --sm-primary: color-mix(in srgb, var(--dy-orange) 68%, black);
  --sm-primary-hover: color-mix(in srgb, var(--dy-orange) 62%, black);
  --sm-primary-active: color-mix(in srgb, var(--dy-orange) 56%, black);
  --sm-link: color-mix(in srgb, var(--dy-orange) 62%, black);
  --sm-primary-light: color-mix(in srgb, var(--dy-orange) 6%, white);
  --sm-text: #212121;
  --sm-text-secondary: #666666;
  --sm-text-placeholder: #999999;
  --sm-border: #d9d9d9;
  --sm-divider: #e5e5e5;
  --sm-bg: #ffffff;
  --sm-layout: #e2e7ef;
  --sm-danger: #fb2323;
  --sm-danger-bg: #fff2f4;
  --sm-danger-border: #ffbec8;
  --sm-shadow-low: 0 3px 8px 1px rgb(0 0 0 / 6%);
}

body {
  height: 100vh;
  overflow: hidden;
  color: var(--sm-text);
  font-family:
    Roboto, 'San Francisco', 'Helvetica Neue', Helvetica, Arial, 'PingFang SC', 'Hiragino Sans GB',
    'WenQuanYi Micro Hei', 'Microsoft YaHei UI', 'Microsoft YaHei', sans-serif;
}

/* ===== 整体布局 ===== */
.sm-login {
  display: flex;
  height: 100%;
  background: var(--sm-layout);
}

/* ===== 左侧 Banner ===== */
.sm-login-banner {
  container-type: inline-size;
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(32px, 5vw, 88px);
  color: #231815;
  background:
    radial-gradient(ellipse at 95% 90%, var(--dy-orange) 0, transparent 65%),
    linear-gradient(135deg, color-mix(in srgb, var(--dy-yellow) 20%, white), var(--dy-yellow));
  overflow: hidden;
}

.sm-brand-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
}

.sm-brand-manifesto {
  margin-block: auto;
  padding: 36px 0;
}

.sm-brand-manifesto h1 {
  font-size: clamp(24px, 6.6cqw, 64px);
  line-height: 1.45;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.sm-brand-english {
  margin-top: 32px;
  font-size: clamp(20px, 4.4cqw, 50px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

/* ===== 右侧表单面板 ===== */
.sm-login-panel {
  display: flex;
  align-items: center;
  position: relative;
  flex-grow: 0;
  flex-shrink: 0;
  flex-basis: clamp(420px, 32vw, 480px);
  width: clamp(420px, 32vw, 480px);
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: #ffffff;
  border-left: 1px solid var(--sm-divider);
}

/* 语言切换 */
.sm-language {
  position: absolute;
  right: 20px;
  top: 20px;
  display: flex;
  align-items: center;
  cursor: default;
  color: var(--sm-text-secondary);
  font-size: 12px;
}

/* 表单卡片 */
.sm-login-card {
  flex: 1 0 auto;
  width: 340px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
  flex-shrink: 0;
}

.sm-login-card-item {
  box-sizing: border-box;
  display: flex;
  flex-shrink: 0;
  align-self: stretch;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  padding: 0;
  background: transparent;
}

/* ===== 品牌区域 ===== */
.sm-logo-container {
  width: 100%;
  height: 53px;
  margin: 72px 0 36px;
  user-select: none;
}

.sm-logo {
  width: 100%;
  height: 47px;
  /* 自定义 Logo 按原始比例完整显示，避免固定宽高拉伸图片。 */
  object-fit: contain;
  object-position: center;
}

.sm-login-title {
  display: flex;
  max-height: 48px;
  margin-bottom: 39px;
  justify-content: center;
  font-size: 18px;
  color: var(--sm-text);
  line-height: 24px;
  overflow: hidden;
  text-align: center;
}

/* ===== 表单 ===== */
.sm-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* hidden 必须覆盖表单的 flex 布局，避免登录与首次改密控件同时显示。 */
.sm-form[hidden] {
  display: none;
}

/* 输入框外层 */
.sm-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  border: 1px solid var(--sm-border);
  border-radius: 2px;
  transition: border-color 0.2s ease;
}

.sm-input-wrap + .sm-input-wrap {
  margin-top: 30px;
}

.sm-input-wrap:focus-within {
  border-color: var(--sm-primary);
}

/* 输入框内图标 */
.sm-input-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-left: 12px;
  margin-right: 12px;
  color: var(--sm-text-placeholder);
}

/* 输入框 */
.sm-input {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  border: 0;
  color: var(--sm-text);
  background: transparent;
  font-size: 14px;
  outline: none;
}

.sm-input::placeholder {
  color: var(--sm-text-placeholder);
}

/* 输入框尾部说明不参与纵向布局，鼠标与键盘均可展开。 */
.sm-field-help {
  position: relative;
  flex: 0 0 32px;
  margin-right: 4px;
}

.sm-input-wrap:has(.sm-field-help) .sm-input {
  min-width: 0;
}

.sm-input-wrap:has(.sm-password-toggle) .sm-input {
  min-width: 0;
}

/* 使用独立按钮提供一致的显示能力，避免浏览器原生按钮重复出现。 */
.sm-input-wrap:has(.sm-password-toggle) .sm-input::-ms-reveal {
  display: none;
}

.sm-password-toggle {
  display: flex;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  height: 32px;
  margin-right: 4px;
  border: 0;
  background: transparent;
  color: var(--sm-text-secondary);
  cursor: pointer;
}

.sm-password-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sm-password-toggle[aria-pressed='true'] .sm-password-toggle-slash {
  display: none;
}

.sm-password-toggle:hover {
  color: var(--sm-primary);
}

.sm-password-toggle:focus-visible {
  outline: 2px solid var(--sm-primary);
  outline-offset: -2px;
}

.sm-field-help-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sm-text-secondary);
  cursor: help;
}

.sm-field-help-trigger svg {
  width: 16px;
  height: 16px;
}

.sm-field-help-trigger:focus-visible {
  outline: 2px solid var(--sm-primary);
  outline-offset: -2px;
}

.sm-field-help-content {
  position: absolute;
  right: 0;
  bottom: 100%;
  z-index: 10;
  display: none;
  width: 240px;
  max-width: calc(100vw - 64px);
  padding: 8px 12px;
  border: 1px solid var(--sm-border);
  border-radius: 4px;
  background: var(--sm-text);
  color: #fff;
  font-size: 12px;
  line-height: 1.6;
}

.sm-field-help:hover .sm-field-help-content,
.sm-field-help:focus-within .sm-field-help-content {
  display: block;
}

/* ===== 登录辅助操作 ===== */
.sm-form-extra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  color: var(--sm-text-secondary);
  font-size: 12px;
}

/* 关闭注册时，找回密码入口仍固定在右侧。 */
.sm-login-recovery-link {
  margin-left: auto;
}

.sm-link-button {
  border: 0;
  color: var(--sm-link);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.sm-link-button:hover {
  color: #0041b0;
}

.sm-recovery-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  font-size: 12px;
}

.sm-recovery-hint {
  margin: 0 0 20px;
  color: var(--sm-text-secondary);
  font-size: 12px;
  line-height: 1.6;
}

.sm-input--plain {
  padding: 0 14px;
}

/* ===== 邮箱注册 ===== */
.sm-registration-code .sm-input {
  min-width: 0;
}

.sm-registration-code-send {
  flex: 0 0 auto;
  height: 24px;
  padding: 0 12px;
  border-left: 1px solid var(--sm-border);
  font-size: 12px;
  white-space: nowrap;
}

.sm-registration-code-send:disabled {
  color: var(--sm-text-placeholder);
  cursor: not-allowed;
}

.sm-registration-back {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
}

/* ===== 登录按钮 ===== */
.sm-login-btn {
  width: 100%;
  height: 45px;
  margin-top: 10px;
  border: none;
  border-radius: 2px;
  color: #ffffff;
  background: var(--sm-primary);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.sm-login-btn:hover {
  background: var(--sm-primary-hover);
}

.sm-login-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.sm-registration-submit {
  margin-top: 24px;
}

.sm-secondary-btn {
  width: 100%;
  height: 45px;
  margin-top: 12px;
  border: 1px solid var(--sm-border);
  border-radius: 2px;
  color: var(--sm-text);
  background: var(--sm-bg);
  font-size: 12px;
  cursor: pointer;
}

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

.sm-secondary-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

/* ===== 错误提示 ===== */
.sm-error-msg {
  display: flex;
  align-items: center;
  min-height: 36px;
  max-height: 36px;
  margin-bottom: 18px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 2px;
  color: var(--sm-danger);
  background: var(--sm-danger-bg);
  font-size: 12px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.sm-error-msg.is-visible {
  border-color: var(--sm-danger-border);
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.sm-error-msg.is-success {
  border-color: #b7eb8f;
  color: #1ba854;
  background: #f6ffed;
}

.sm-error-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-right: 8px;
}

.sm-error-text {
  flex: 1 1 auto;
  min-width: 0;
}

.sm-error-close {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border: 0;
  color: var(--sm-text-placeholder);
  background: transparent;
  font-size: 18px;
  line-height: 22px;
  cursor: pointer;
}

.sm-error-close:hover {
  color: var(--sm-danger);
}

.sm-psv {
  display: flex;
  flex-direction: column;
  height: 24px;
  width: 100%;
  margin: 10px 0 60px 0;
  flex-shrink: 0;
}

.sm-footer {
  justify-content: space-around;
  font-size: 12px;
  width: 340px;
  max-height: 36px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-end;
  flex: 0 0 36px;
  padding-bottom: 6px;
  color: var(--sm-text-secondary);
}

/* ===== 弹出式滑块验证 ===== */
.sm-captcha-modal[hidden] {
  display: none;
}

.sm-captcha-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
}

.sm-captcha-dialog {
  width: 348px;
  max-width: 100%;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.24);
}

.sm-captcha-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
  padding: 0 18px;
  border-bottom: 1px solid var(--sm-border);
}

.sm-captcha-title {
  color: var(--sm-text);
  font-size: 16px;
  font-weight: 500;
}

.sm-captcha-close {
  width: 30px;
  height: 30px;
  border: 0;
  color: var(--sm-text-secondary);
  background: transparent;
  cursor: pointer;
  font-size: 24px;
  line-height: 28px;
}

.sm-captcha-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 24px 16px;
}

.sm-captcha-canvas,
.sm-captcha-slider {
  display: block;
  width: 300px;
  max-width: 100%;
}

.sm-captcha-canvas {
  height: auto;
  border-radius: 4px;
  background: #f5f7fa;
}

.sm-captcha-slider {
  height: 46px;
  margin-top: 12px;
  cursor: grab;
  touch-action: none;
}

.sm-captcha-slider:active {
  cursor: grabbing;
}

.sm-captcha-slider:focus-visible {
  outline: 2px solid var(--sm-primary);
  outline-offset: 2px;
}

.sm-captcha-status {
  min-height: 20px;
  margin-top: 10px;
  color: var(--sm-text-secondary);
  font-size: 13px;
  line-height: 20px;
}

.sm-captcha-status.is-error {
  color: var(--sm-danger);
}

.sm-captcha-status.is-success {
  color: #2f8f57;
}

.sm-captcha-refresh {
  margin-top: 2px;
  font-size: 14px;
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .sm-login-banner {
    display: none;
  }

  .sm-login-panel {
    flex: 1 1 auto;
    width: 100%;
    background: var(--sm-bg);
  }

  .sm-login-card {
    width: min(340px, calc(100% - 48px));
  }

  .sm-language {
    right: 24px;
  }
}
.dy-login-home {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 12px;
  color: #9a3415;
  font-size: 14px;
  text-decoration: none;
}
.dy-login-home:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.dy-login-home:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}
