*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #ff5e3b;
  --primary-hover: #ff815e;
  --primary-light: #fff5f0;
  --text-primary: #222222;
  --text-secondary: #666666;
  --text-muted: #888888;
  --border: #d9d9d9;
  --bg-page: #f5f5f5;
  --bg-white: #ffffff;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  --radius: 8px;
  --transition: 0.2s ease;
  --font-xs: 12px;
  --font-sm: 13px;
  --font-md: 14px;
  --font-base: 16px;
  --font-lg: 18px;
  --font-xl: 20px;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--font-base);
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

/* Header */
.header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  height: 56px;
  flex-shrink: 0;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 20px;
}

.logo:hover {
  color: var(--text-primary);
}

.logo-icon {
  height: 1em;
  width: auto;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

.header-nav {
  display: flex;
  gap: 28px;
}

.header-nav a {
  color: var(--text-secondary);
  font-size: var(--font-base);
}

.header-nav a:hover {
  color: var(--primary);
}

/* Main */
.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.login-container {
  display: flex;
  max-width: 960px;
  width: 100%;
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 520px;
}

/* Left content panel */
.content-panel {
  flex: 1;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.article-carousel {
  position: relative;
  min-height: 280px;
}

.article-card {
  position: absolute;
  inset: 0;
  display: block;
  color: inherit;
  text-decoration: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
  cursor: pointer;
}

.article-card.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.article-card:hover .article-title {
  color: var(--primary);
}

.article-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: 4px;
}

.article-tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255, 94, 59, 0.2);
  color: var(--primary);
  border-radius: 4px;
  font-size: var(--font-md);
  margin-bottom: 16px;
}

.article-title {
  font-size: var(--font-xl);
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 16px;
  transition: color var(--transition);
}

.article-desc {
  font-size: var(--font-md);
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.8;
  margin-bottom: 24px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--font-md);
}

.carousel-dots {
  display: flex;
  gap: 8px;
  margin-top: 32px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
}

.dot.active {
  background: var(--primary);
  width: 24px;
  border-radius: 4px;
}

.dot:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Right login panel */
.login-panel {
  flex: 0 0 420px;
  padding: 40px 36px 24px;
  display: flex;
  flex-direction: column;
}

.login-box {
  flex: 1;
}

.welcome {
  text-align: center;
  margin-bottom: 28px;
}

.welcome-title {
  font-size: var(--font-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.welcome-desc {
  font-size: var(--font-md);
  color: var(--text-muted);
  line-height: 1.6;
}

/* Tabs */
.login-tabs {
  display: flex;
  gap: 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.tab {
  flex: 0 0 auto;
  padding: 12px 0;
  background: none;
  border: none;
  font-size: var(--font-base);
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: color var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.tab:hover {
  color: var(--primary);
}

.tab.active {
  color: var(--primary);
  font-weight: 500;
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

.tab-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  font-size: var(--font-xs);
  background: var(--primary);
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px 4px 4px 0;
  white-space: nowrap;
}

/* Tab content — grid stacking keeps wrapper height constant */
.tab-pane-wrapper {
  display: grid;
  min-height: 248px;
}

.tab-content {
  grid-area: 1 / 1;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.tab-content.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  position: relative;
}

.form-group input {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--font-base);
  font-family: inherit;
  color: var(--text-primary);
  transition: border-color var(--transition);
  outline: none;
  background: var(--bg-white);
}

.form-group input:focus {
  border-color: var(--primary);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-group.is-error input {
  border-color: #ff4d4f;
}

.form-feedback {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  min-height: 22px;
  margin-top: -4px;
}

.form-feedback--solo {
  justify-content: flex-start;
}

.form-feedback .form-error {
  flex: 1;
  min-height: 22px;
  font-size: var(--font-sm);
  color: #ff4d4f;
  line-height: 22px;
}

.form-help-link {
  flex-shrink: 0;
  font-size: var(--font-sm);
  color: var(--text-muted);
  line-height: 22px;
}

.form-help-link:hover {
  color: var(--primary);
}

.form-group-code {
  display: flex;
  gap: 12px;
}

.form-group-code input {
  flex: 1;
}

.btn-code {
  flex-shrink: 0;
  padding: 0 16px;
  height: 44px;
  background: none;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: var(--font-md);
  font-family: inherit;
  white-space: nowrap;
  transition: all var(--transition);
}

.btn-code:hover:not(:disabled) {
  background: var(--primary-light);
}

.btn-code:disabled {
  border-color: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-toggle-pwd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.btn-toggle-pwd .icon-eye-off {
  display: none;
}

.btn-toggle-pwd.is-revealed .icon-eye {
  display: none;
}

.btn-toggle-pwd.is-revealed .icon-eye-off {
  display: block;
}

.btn-toggle-pwd:hover {
  color: var(--text-secondary);
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--font-md);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--primary);
  width: 14px;
  height: 14px;
}

.link-forgot {
  font-size: var(--font-md);
}

.btn-login {
  width: 100%;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: var(--font-base);
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition);
  margin-top: 4px;
}

.btn-login:hover {
  background: var(--primary-hover);
}

.login-agree-tip {
  margin: 12px 0 0;
  text-align: center;
  /* 显式 px：避免线上旧 CSS / 变量未生效时继承 body 16px；并抑制部分手机浏览器放大小号字 */
  font-size: 12px;
  color: var(--text-muted, #888888);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.login-agree-tip a {
  color: var(--text-secondary, #666666);
  text-decoration: none;
  font-size: inherit;
}

.login-agree-tip a:hover {
  color: var(--primary, #ff5e3b);
}

/* Other login */
.other-login {
  margin-top: 32px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  color: var(--text-muted);
  font-size: var(--font-md);
  white-space: nowrap;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
}

.social-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.social-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 94, 59, 0.15);
}

.social-btn--wechat {
  color: #07c160;
}

.social-btn--wechat:hover {
  border-color: #07c160;
  color: #07c160;
  box-shadow: 0 4px 12px rgba(7, 193, 96, 0.2);
}

.social-btn--douyin {
  color: #111111;
}

.social-btn--douyin:hover {
  border-color: #fe2c55;
  color: #fe2c55;
  box-shadow: 0 4px 12px rgba(254, 44, 85, 0.15);
}

.register-tip {
  text-align: center;
  font-size: var(--font-md);
  color: var(--text-muted);
}

.medal-tip {
  text-align: center;
  margin-top: 20px;
  font-size: var(--font-sm);
  color: var(--text-muted);
}

.medal-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: var(--font-xs);
  margin-right: 4px;
}

/* Footer */
.footer {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: var(--font-sm);
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .header-nav {
    display: none;
  }

  .login-container {
    flex-direction: column;
    max-width: 420px;
  }

  .content-panel {
    display: none;
  }

  .login-panel {
    flex: none;
    padding: 32px 24px 20px;
  }
}

@media (max-width: 480px) {
  .main {
    padding: 16px;
  }

  .login-container {
    border-radius: 8px;
  }

  .login-tabs {
    font-size: var(--font-md);
  }

  .tab {
    padding: 10px 0;
  }
}

/* 第三方登录暂不可用弹窗 */
.unavailable-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.unavailable-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.unavailable-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.unavailable-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: var(--bg-white);
  border-radius: 12px;
  padding: 32px 24px 24px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.unavailable-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.unavailable-modal-close:hover {
  color: var(--text-primary);
}

.unavailable-modal-icon {
  color: var(--primary);
  margin-bottom: 12px;
}

.unavailable-modal-title {
  font-size: var(--font-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.unavailable-modal-desc {
  font-size: var(--font-md);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.unavailable-modal-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: var(--font-base);
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition);
}

.unavailable-modal-btn:hover {
  background: var(--primary-hover);
}

/* 滑动验证码遮罩层 */
.captcha-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1200;
  align-items: center;
  justify-content: center;
}

.captcha-overlay.is-open {
  display: flex;
}

.captcha-overlay-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.captcha-overlay-panel {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#captcha-box {
  min-width: 318px;
  min-height: 318px;
}
