/* ============================================================
   YingMing Unified Login - front-end stylesheet
   ============================================================ */

:root {
  --brand: #008bff;
  --brand-600: #0071db;
  --brand-50: #eaf6ff;
  --ink-900: #111827;
  --ink-700: #333a45;
  --ink-500: #6b7280;
  --ink-400: #9aa3af;
  --line: #e7eaf0;
  --line-soft: #eef1f5;
  --bg: #f7f8fa;
  --white: #ffffff;
  --danger: #dc2626;
  --success: #16a34a;
  --qq: #12b7f5;
  --wx: #07c160;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(17, 24, 39, .04), 0 8px 24px rgba(17, 24, 39, .06);
  --shadow-lift: 0 2px 4px rgba(17, 24, 39, .05), 0 12px 32px rgba(17, 24, 39, .1);
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-700);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  color: var(--brand-600);
}

/* ------------------------------------------------------------
   Top bar
   ------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--line-soft);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: cover;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: .2px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--ink-500);
}

.topbar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.topbar-link {
  color: var(--ink-500);
  font-weight: 500;
}

.topbar-link:hover {
  color: var(--brand);
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 28px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
}

.btn-primary:hover {
  background: var(--brand-600);
  box-shadow: 0 6px 16px rgba(0, 139, 255, .28);
}

.btn-primary:active {
  transform: scale(.985);
}

.btn-primary:disabled {
  background: #c7d0da;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-primary.btn-sm {
  height: 38px;
  padding: 0 20px;
  font-size: 13px;
  letter-spacing: 1px;
}

.btn-plain {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--ink-700);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.btn-plain:hover {
  border-color: #d4d9e1;
  background: #fafbfc;
  color: var(--ink-700);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 14px;
  border: 1px solid #f3c8c8;
  border-radius: 8px;
  background: #fdf4f4;
  color: var(--danger);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease;
}

.btn-danger:hover {
  background: #fbe9e9;
}

/* ------------------------------------------------------------
   Auth pages (login / register)
   ------------------------------------------------------------ */

.auth-page {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 20px 64px;
}

.auth-card {
  width: 420px;
  max-width: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 40px 40px 32px;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.auth-logo img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
}

.auth-logo span {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-900);
}

.auth-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-900);
  line-height: 1.4;
}

.auth-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-400);
}

.form-error {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fdf2f2;
  border: 1px solid #f6d5d5;
  color: var(--danger);
  font-size: 13px;
}

.form {
  margin-top: 22px;
}

.form-group {
  margin-top: 16px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-700);
}

.form-input {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--ink-900);
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.form-input::placeholder {
  color: #b6bdc7;
}

.form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 139, 255, .14);
}

textarea.form-input {
  height: auto;
  min-height: 120px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.7;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-tip {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--ink-400);
  line-height: 1.7;
}

.form-tip code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  color: var(--ink-700);
  background: #f2f4f7;
  padding: 1px 6px;
  border-radius: 6px;
}

.form-message {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
}

.form-message.success {
  background: #f0fdf4;
  border: 1px solid #d6f0dd;
  color: var(--success);
}

.form-message.error {
  background: #fdf2f2;
  border: 1px solid #f6d5d5;
  color: var(--danger);
}

/* SMS verification fields */

.sms-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sms-row .form-input {
  flex: 1;
  min-width: 0;
}

.code-btn {
  flex-shrink: 0;
  width: 118px;
  height: 46px;
  border: 1px solid #bfe3ff;
  border-radius: var(--radius-md);
  background: var(--brand-50);
  color: var(--brand-600);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.code-btn:hover {
  background: #d8efff;
}

.code-btn:disabled {
  background: #f2f4f7;
  border-color: var(--line);
  color: var(--ink-400);
  cursor: not-allowed;
}

.auth-submit {
  width: 100%;
  margin-top: 26px;
}

.auth-switch {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-500);
}

.auth-switch a {
  font-weight: 600;
}

/* Social login divider + buttons */

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 28px 0 22px;
  color: var(--ink-400);
  font-size: 12.5px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.social-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.social-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.social-btn .social-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--white);
  transition: box-shadow .15s ease, transform .1s ease;
}

.social-btn .social-icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.social-btn.qq .social-icon {
  background: var(--qq);
  border-color: var(--qq);
}

.social-btn.wx .social-icon {
  background: var(--wx);
  border-color: var(--wx);
}

.social-btn.qq .social-icon img,
.social-btn.wx .social-icon img {
  filter: brightness(0) invert(1);
}

.social-btn:hover .social-icon {
  box-shadow: 0 6px 16px rgba(17, 24, 39, .14);
  transform: translateY(-1px);
}

.social-btn span {
  font-size: 12.5px;
  color: var(--ink-500);
}

.auth-tip {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--ink-400);
  text-align: center;
  line-height: 1.8;
}

.auth-tip a {
  color: var(--ink-500);
}

.auth-tip a:hover {
  color: var(--brand);
}

/* ------------------------------------------------------------
   User center
   ------------------------------------------------------------ */

.center-page {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 40px 20px 64px;
}

.center-inner {
  width: 680px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.center-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 28px 32px;
}

.center-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 20px;
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.avatar-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
}

.avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, .45);
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: opacity .15s ease;
}

.avatar-wrap:hover .avatar-mask {
  opacity: 1;
}

.avatar-hint {
  font-size: 13px;
  color: var(--ink-500);
  line-height: 1.8;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
}

.info-item {
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #fbfcfd;
}

.info-label {
  font-size: 12px;
  color: var(--ink-400);
}

.info-value {
  margin-top: 3px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
  word-break: break-all;
}

/* ------------------------------------------------------------
   Confirm / authorize pages
   ------------------------------------------------------------ */

.confirm-page {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 64px 20px;
}

.confirm-card {
  width: 420px;
  max-width: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 40px 40px 34px;
  text-align: center;
}

.confirm-app-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--brand-50);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-app-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-900);
}

.confirm-desc {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--ink-500);
  line-height: 1.8;
}

.confirm-user {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 22px 0 26px;
  padding: 12px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #fbfcfd;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
}

.confirm-user img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.confirm-btns {
  display: flex;
  gap: 12px;
}

.confirm-btns .btn-primary,
.confirm-btns .btn-plain {
  flex: 1;
}

/* ------------------------------------------------------------
   Docs (agreement / privacy)
   ------------------------------------------------------------ */

.doc-page {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 40px 20px 64px;
}

.doc-inner {
  width: 780px;
  max-width: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 36px 44px;
}

.doc-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 6px;
}

.doc-updated {
  font-size: 12.5px;
  color: var(--ink-400);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 18px;
}

.doc-content {
  font-size: 14px;
  color: var(--ink-700);
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */

.site-footer {
  border-top: 1px solid var(--line-soft);
  background: var(--white);
}

.site-footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 13px;
  color: var(--ink-400);
}

.site-footer-inner a {
  color: var(--ink-500);
}

.site-footer-inner a:hover {
  color: var(--brand);
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 560px) {
  .topbar-inner {
    padding: 0 16px;
  }

  .auth-page {
    padding: 28px 16px 48px;
  }

  .auth-card {
    padding: 28px 22px 26px;
  }

  .code-btn {
    width: 104px;
  }

  .center-page {
    padding: 24px 14px 48px;
  }

  .center-card {
    padding: 22px 18px;
  }

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

  .doc-inner {
    padding: 26px 20px;
  }

  .confirm-card {
    padding: 30px 22px 28px;
  }
}
