* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: #1e293b;
  line-height: 1.5;
}

.container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-box {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 20px;
  padding: 40px 28px 36px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  animation: cardFadeIn 0.4s ease-out;
  border-top: 3px solid #2563eb;
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-header {
  text-align: center;
  margin-bottom: 36px;
}

.login-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2563eb;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.login-header p {
  font-size: 0.85rem;
  color: #94a3b8;
}

/* 标签栏 - 滑动指示器 */
.tabs {
  display: flex;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 28px;
  gap: 4px;
  position: relative;
}

.tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: #64748b;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.3s ease;
  position: relative;
  z-index: 1;
}

.tab.active {
  color: #ffffff;
}

.tab-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  width: calc(50% - 6px);
  background: #2563eb;
  border-radius: 10px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
  z-index: 0;
}

/* 内容面板 */
.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 输入框组 */
.input-group {
  margin-bottom: 20px;
  position: relative;
}

.input-group input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  font-size: 0.95rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  outline: none;
  transition: all 0.25s ease;
  /* 加相对定位和 z-index，确保图标能正确浮在上方 */
  position: relative;
  z-index: 1;
}

/* 密码框右边有眼睛按钮时，padding-right 加大 */
.input-group:has(.toggle-pass) input {
  padding-right: 48px;
}

.input-group input::placeholder {
  color: #94a3b8;
}

.input-group input:focus {
  border-color: #2563eb;
  background: #ffffff;
  /* 去掉 transform，避免和绝对定位图标错位 */
}

/* 输入框图标 */
.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #94a3b8;
  pointer-events: none;
  transition: color 0.25s ease;
  /* 确保图标在输入框上层 */
  z-index: 2;
}

/* 用 :focus-within 代替 ~ 选择器，无论 DOM 顺序都能正确选中 */
.input-group:focus-within .input-icon {
  color: #2563eb;
}

/* 密码显示切换 */
.toggle-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  border-radius: 8px;
  transition: all 0.2s ease;
  padding: 0;
  z-index: 2;
}

.toggle-pass:hover {
  background: #f1f5f9;
  color: #64748b;
}

.toggle-pass svg {
  width: 18px;
  height: 18px;
}

.toggle-pass .eye-closed {
  display: none;
}

.toggle-pass.showing .eye-open {
  display: none;
}

.toggle-pass.showing .eye-closed {
  display: block;
}

/* 按钮 */
.btn {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.btn:disabled {
  background: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 错误抖动 */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.input-error {
  animation: shake 0.4s ease;
  border-color: #ef4444 !important;
}

/* Toast */
#toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 0.85rem;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  min-width: 160px;
  text-align: center;
}
