:root {
  --apple-bg: #f5f5f7;
  --apple-card: #ffffff;
  --apple-text: #1d1d1f;
  --apple-text-muted: #86868b;
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --apple-red: #ff3b30;
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--apple-bg);
  color: var(--apple-text);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.top-nav {
  width: 100%;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-content {
  width: 100%;
  max-width: 1000px;
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.5px;
  white-space: nowrap; /* 核心修复：防止文字被挤压成竖排 */
  flex-shrink: 0;      /* 核心修复：保持自身宽度不被右侧挤压 */
}

.nav-logo img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--apple-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
}

.nav-login:hover {
  background: var(--apple-blue-hover);
  transform: scale(0.98);
}

.admin-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: rgba(0, 0, 0, 0.06);
  padding: 4px;
  border-radius: 999px;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--apple-text);
  background: transparent;
  transition: all 0.2s ease;
}

.admin-link.active {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

button.admin-link {
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

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

.table th,
.table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  vertical-align: top;
}

/* 后台表格：表头与单元格 角色、验证、状态、是否被邀请、操作 锁定横向不换行 */
.table .cell-nowrap,
.table th:nth-child(3),
.table th:nth-child(4),
.table th:nth-child(5),
.table th:nth-child(6),
.table th:nth-child(11),
.table td:nth-child(3),
.table td:nth-child(4),
.table td:nth-child(5),
.table td:nth-child(6),
.table td:nth-child(11) {
  white-space: nowrap;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 14px;
}

.table-scroll .table {
  margin-top: 0;
  min-width: 860px;
}

.badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--apple-text);
  white-space: nowrap;
}

.badge.ok {
  background: rgba(0, 113, 227, 0.10);
  color: var(--apple-blue);
}

.badge.danger {
  background: rgba(255, 59, 48, 0.10);
  color: var(--apple-red);
}

.btn-secondary {
  background: rgba(0, 0, 0, 0.06);
  color: var(--apple-text);
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s ease;
  font-size: 13px;
  line-height: 1.2;
  box-sizing: border-box;
}

a.btn-secondary {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.btn-secondary:hover {
  transform: scale(0.99);
}

.page {
  width: 100%;
  max-width: 1040px;
  padding: 40px 24px;
  box-sizing: border-box;
  margin: 0 auto;
}

.card {
  width: 100%;
  max-width: 520px;
  background: var(--apple-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  box-sizing: border-box;
  margin: 24px auto;
}

.card h1 {
  margin: 0 0 8px 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.muted {
  color: var(--apple-text-muted);
  font-size: 13px;
  margin: 0 0 18px 0;
  line-height: 1.6;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--apple-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="email"],
input[type="password"],
input[type="text"],
textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background-color: var(--apple-bg);
  font-size: 15px;
  color: var(--apple-text);
  box-sizing: border-box;
  transition: all 0.2s ease;
  font-family: inherit;
  outline: none;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus,
textarea:focus {
  background-color: #fff;
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}

.btn-primary {
  background: var(--apple-blue);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 18px;
}

.btn-primary:hover {
  background: var(--apple-blue-hover);
  transform: scale(0.99);
}

.btn-primary-full {
  width: 100%;
}

.btn-primary-small {
  width: auto;
  padding-top: 10px;
  padding-bottom: 10px;
  padding-left: 18px;
  padding-right: 18px;
  font-size: 14px;
  margin-top: 8px;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.link {
  color: var(--apple-blue);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.link:hover {
  text-decoration: underline;
}

.alert {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 59, 48, 0.08);
  color: var(--apple-red);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.alert.show {
  display: block;
}

.ok {
  background: rgba(0, 113, 227, 0.08);
  color: var(--apple-blue);
}

.quick-links {
  width: 100%;
  background: #f5f5f7;
  border-top: 1px solid rgba(0,0,0,0.06);
  margin-top: 40px;
}

.quick-links-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 24px 32px;
  box-sizing: border-box;
}

.quick-links-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--apple-text);
}

.quick-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.quick-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #ffffff;
  font-size: 13px;
  color: var(--apple-text);
  text-decoration: none;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.quick-pill:hover {
  background: #f0f0f2;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.quick-links-icp {
  margin: 18px 0 0;
  font-size: 12px;
  color: var(--apple-text-muted);
}

/* 手机端：后台与通用布局 */
@media (max-width: 640px) {
  .nav-content {
    flex-direction: column;
    padding: 16px 12px;
    height: auto;
    gap: 14px;
  }
  .nav-right {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 8px;
  }
  .admin-bar {
    width: 100%;
    justify-content: center;
    margin-bottom: 6px;
  }
  .page {
    padding: 16px 12px;
  }
  .card {
    padding: 20px 16px;
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
    border-radius: var(--radius-md);
  }
  .table-scroll {
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }
}