/* 天琪科技 — 登录 / 注册 / 用户中心 */
:root {
  --auth-primary: #1172ff;
  --auth-primary-dark: #0d5cd9;
  --auth-bg: #eef2f7;
  --auth-panel: #fff;
  --auth-text: #1a2233;
  --auth-muted: #6b7280;
  --auth-border: #dde3ed;
  --auth-radius: 10px;
  --auth-success: #16a34a;
  --auth-warning: #d97706;
  --auth-danger: #dc2626;
}

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

body.auth-page {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif;
  background: var(--auth-bg);
  color: var(--auth-text);
  min-height: 100vh;
  line-height: 1.6;
}

.auth-header {
  background: #fff;
  border-bottom: 1px solid var(--auth-border);
}

.auth-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--auth-text);
  font-weight: 600;
  font-size: 16px;
}

.auth-header__logo img {
  height: 32px;
}

.auth-header__links a {
  color: var(--auth-muted);
  text-decoration: none;
  font-size: 14px;
  margin-left: 20px;
}

.auth-header__links a:hover {
  color: var(--auth-primary);
}

.auth-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.auth-card {
  max-width: 440px;
  margin: 0 auto;
  background: var(--auth-panel);
  border-radius: var(--auth-radius);
  border: 1px solid var(--auth-border);
  padding: 36px 40px 40px;
  box-shadow: 0 8px 32px rgba(17, 114, 255, 0.06);
}

.auth-card h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.auth-card__sub {
  color: var(--auth-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.auth-form .field {
  margin-bottom: 18px;
}

.auth-form label {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  color: #374151;
}

.auth-form .req {
  color: var(--auth-danger);
  margin-left: 2px;
}

.auth-form input,
.auth-form textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.auth-form input:focus,
.auth-form textarea:focus {
  outline: none;
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(17, 114, 255, 0.12);
}

.auth-form input.error {
  border-color: var(--auth-danger);
}

.auth-submit {
  width: 100%;
  height: 46px;
  margin-top: 8px;
  border: none;
  border-radius: 8px;
  background: var(--auth-primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.auth-submit:hover {
  background: var(--auth-primary-dark);
}

.auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-switch {
  text-align: center;
  margin-top: 22px;
  font-size: 14px;
  color: var(--auth-muted);
}

.auth-switch a {
  color: var(--auth-primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-msg {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

.auth-msg.show {
  display: block;
}

.auth-msg.error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.auth-msg.success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* 用户中心 */
.account-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

.account-sidebar {
  background: var(--auth-panel);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  overflow: hidden;
}

.account-user {
  padding: 24px 20px;
  border-bottom: 1px solid var(--auth-border);
  background: linear-gradient(135deg, #1172ff 0%, #0d5cd9 100%);
  color: #fff;
  text-align: center;
}

.account-user__avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}

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

.account-user__name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.account-user__phone {
  font-size: 13px;
  opacity: 0.9;
}

.avatar-field .avatar-editor {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.avatar-editor__preview {
  position: relative;
  width: 80px;
  height: 80px;
  flex: 0 0 80px;
  border-radius: 50%;
  background: #e8eef8;
  color: #2d75ff;
  display: block;
  overflow: hidden;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(17, 114, 255, 0.18);
  transition: box-shadow 0.18s ease;
}

.avatar-editor__preview:hover,
.avatar-editor__preview:focus-within {
  box-shadow: inset 0 0 0 1px rgba(17, 114, 255, 0.35), 0 0 0 3px rgba(17, 114, 255, 0.12);
}

.avatar-editor__face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  background: #2d75ff;
  color: #fff;
}

.avatar-editor__preview.has-img .avatar-editor__face {
  background: transparent;
  font-size: 0;
}

.avatar-editor__preview img,
.avatar-editor__face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.avatar-editor__mask {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(17, 28, 48, 0.55);
  color: #fff;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.avatar-editor__preview:hover .avatar-editor__mask,
.avatar-editor__preview:focus-within .avatar-editor__mask {
  opacity: 1;
}

.avatar-editor__mask svg {
  width: 18px;
  height: 18px;
}

.avatar-editor__mask em {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.avatar-editor__meta {
  flex: 1;
  min-width: 0;
}

.avatar-editor__desc {
  margin: 0 0 6px;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.55;
}

.avatar-hint {
  margin: 0;
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.4;
}

.account-nav a {
  display: block;
  padding: 14px 20px;
  color: var(--auth-text);
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
}

.account-nav a:hover,
.account-nav a.active {
  background: #f4f8ff;
  color: var(--auth-primary);
  border-left-color: var(--auth-primary);
}

.account-nav a.logout {
  color: var(--auth-danger);
  border-top: 1px solid var(--auth-border);
}

.account-content {
  background: var(--auth-panel);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  padding: 28px 32px;
  min-height: 480px;
}

.account-content h2 {
  font-size: 20px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--auth-border);
}

.account-panel {
  display: none;
}

.account-panel.active {
  display: block;
}

.orders-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--auth-muted);
}

.orders-empty a {
  color: var(--auth-primary);
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.orders-table .order-ship {
  max-width: 220px;
  font-size: 13px;
  color: #4b5563;
  line-height: 1.45;
}

.orders-table th,
.orders-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--auth-border);
}

.orders-table th {
  background: #f8fafc;
  color: var(--auth-muted);
  font-weight: 500;
}

.order-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.order-status.pending {
  background: #fef3c7;
  color: #b45309;
}

.order-status.paid,
.order-status.processing {
  background: #dbeafe;
  color: #1d4ed8;
}

.order-status.completed {
  background: #dcfce7;
  color: #15803d;
}

.order-status.cancelled {
  background: #f3f4f6;
  color: #6b7280;
}

.profile-form .field {
  max-width: 400px;
  margin-bottom: 18px;
}

.profile-form input[readonly] {
  background: #f8fafc;
  color: var(--auth-muted);
}

.profile-save {
  margin-top: 8px;
  padding: 10px 28px;
  border: none;
  border-radius: 8px;
  background: var(--auth-primary);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.profile-save:hover {
  background: var(--auth-primary-dark);
}

.pay-header__auth {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: 16px;
}

.pay-header__auth a {
  color: var(--auth-muted, #6b7280);
  text-decoration: none;
  font-size: 14px;
}

.pay-header__auth a:hover {
  color: var(--auth-primary, #1172ff);
}

.pay-header__auth .user-name {
  color: var(--auth-text, #1a2233);
  font-size: 14px;
}

.site-auth-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 16px;
  font-size: 14px;
  font-weight: normal;
  line-height: 1;
}

.site-auth-nav a {
  color: #333;
  text-decoration: none;
  line-height: 1;
}

.site-auth-nav a:hover {
  color: #1172ff;
}

.site-auth-nav .sep {
  color: #ccc;
}

@media (max-width: 768px) {
  .auth-card {
    padding: 28px 22px;
  }

  .account-layout {
    grid-template-columns: 1fr;
  }

  .orders-table {
    display: block;
    overflow-x: auto;
  }
}
