* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #f5f7fa;
  color: #333;
  min-height: 100vh;
}
a { color: #4a90d9; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 登录/注册卡片 */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.auth-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.auth-card h1 {
  font-size: 24px;
  text-align: center;
  margin-bottom: 8px;
  color: #1a1a2e;
}
.auth-card .subtitle {
  text-align: center;
  color: #888;
  font-size: 14px;
  margin-bottom: 32px;
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 14px;
  color: #555;
  margin-bottom: 8px;
  font-weight: 500;
}
.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.2s;
}
.form-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}
.btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(102,126,234,0.4); }
.btn-primary:active { transform: translateY(0); }
.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 14px;
}
.error-msg {
  background: #fee;
  color: #c33;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}
.success-msg {
  background: #efe;
  color: #3a3;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

/* 门户 */
.portal-header {
  background: #fff;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}
.portal-header .logo {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
}
.portal-header .user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.portal-header .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.portal-header .username { font-size: 14px; color: #555; }
.portal-header .logout {
  font-size: 14px;
  color: #999;
  cursor: pointer;
}
.portal-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}
.portal-main h2 {
  font-size: 22px;
  margin-bottom: 24px;
  color: #1a1a2e;
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.project-card {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
}
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-color: #667eea;
}
.project-card .icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}
.project-card .card-text {
  flex: 1;
  min-width: 0;
}
.project-card .name {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-card .desc {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 用户中心 */
.profile-container {
  max-width: 600px;
  margin: 40px auto;
  padding: 0 20px;
}
.profile-card {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.profile-card h2 { margin-bottom: 24px; }
.profile-info { margin-bottom: 24px; }
.profile-info .row {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}
.profile-info .label { width: 100px; color: #888; font-size: 14px; }
.profile-info .value { flex: 1; font-size: 15px; }

/* 502页面 */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background: #f5f7fa;
}
.error-page .code {
  font-size: 72px;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
}
.error-page h1 { font-size: 24px; margin-bottom: 12px; color: #1a1a2e; }
.error-page p { color: #888; margin-bottom: 32px; font-size: 15px; }
.error-page .btn { max-width: 200px; }

/* 手机自适应 */
@media (max-width: 600px) {
  .auth-card { padding: 28px 20px; }
  .auth-card h1 { font-size: 20px; }
  .portal-header { padding: 12px 16px; }
  .portal-header .username { display: none; }
  .portal-main { padding: 20px 16px; }
  .portal-main h2 { font-size: 18px; }
  .project-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .project-card { padding: 10px; }
  .profile-card { padding: 20px; }
  .error-page .code { font-size: 56px; }
}

/* 网络切换器 */
.network-toggle {
  display: flex;
  gap: 4px;
  background: #f0f0f0;
  border-radius: 8px;
  padding: 3px;
}
.network-toggle .net-btn {
  padding: 6px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #666;
  transition: all 0.2s;
}
.network-toggle .net-btn.active {
  background: #fff;
  color: #667eea;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.project-card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.project-card.disabled:hover {
  transform: none;
  box-shadow: none;
  border-color: #eee;
}
