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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #f7f8fa;
  min-height: 100vh;
  color: #1d2129;
  display: flex;
  flex-direction: column;
}

/* 顶部导航栏 */
.header {
  background: #fff;
  border-bottom: 1px solid #e5e6eb;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

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

.logo-icon {
  width: 32px;
  height: 32px;
  background: #165DFF;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.logo-text {
  font-size: 16px;
  font-weight: 600;
  color: #1d2129;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-info {
  font-size: 13px;
  color: #86909c;
}

/* 用户区域 */
.user-area {
  position: relative;
}

.login-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  color: #165DFF;
  border: 1px solid #165DFF;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.login-btn:hover {
  background: #e8f3ff;
}

.user-menu {
  position: relative;
}

.user-avatar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
  color: #1d2129;
}

.user-avatar:hover {
  background: #f2f3f5;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid #e5e6eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  min-width: 150px;
  display: none;
  z-index: 100;
}

.user-dropdown.active {
  display: block;
}

.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  color: #4e5969;
  cursor: pointer;
  transition: background 0.2s;
}

.user-dropdown a:hover {
  background: #f7f8fa;
  color: #165DFF;
}

/* 认证相关 */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid #e5e6eb;
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-size: 14px;
  color: #86909c;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.auth-tab.active {
  color: #165DFF;
  border-bottom-color: #165DFF;
}

.form-error {
  color: #f53f3f;
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 20px;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* 个人中心 */
.profile-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid #f2f3f5;
  margin-bottom: 20px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  background: #e8f3ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.profile-detail {
  width: 100%;
}

.profile-item {
  display: flex;
  align-items: center;
  padding: 8px 0;
}

.profile-label {
  width: 80px;
  font-size: 14px;
  color: #86909c;
}

.profile-item input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #e5e6eb;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
}

.profile-item input:focus {
  border-color: #165DFF;
}

.profile-value {
  font-size: 14px;
  color: #1d2129;
}

.profile-section {
  margin-top: 16px;
}

.profile-section h4 {
  font-size: 14px;
  font-weight: 500;
  color: #1d2129;
  margin-bottom: 12px;
}

/* 账号管理 */
.modal-lg {
  width: 720px;
}

.account-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.user-table {
  overflow-x: auto;
}

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

.user-table th {
  text-align: left;
  padding: 10px 12px;
  background: #f7f8fa;
  color: #86909c;
  font-weight: 500;
  border-bottom: 1px solid #e5e6eb;
}

.user-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f2f3f5;
  color: #1d2129;
}

.user-table tr:hover td {
  background: #f7f8fa;
}

.user-table .role-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.role-admin {
  background: #e8f3ff;
  color: #165DFF;
}

.role-user {
  background: #f2f3f5;
  color: #4e5969;
}

.table-actions {
  display: flex;
  gap: 8px;
}

.table-actions button {
  padding: 4px 8px;
  font-size: 12px;
}

.form-tip {
  font-size: 13px;
  color: #86909c;
  padding: 8px 12px;
  background: #f7f8fa;
  border-radius: 4px;
  margin-top: 12px;
}

/* 主体内容 */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* 工具栏 */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: #1d2129;
}

.project-count {
  font-size: 13px;
  color: #86909c;
  background: #f2f3f5;
  padding: 2px 8px;
  border-radius: 4px;
}

.search-box {
  position: relative;
  width: 240px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #c9cdd4;
}

.search-box input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 36px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.search-box input:focus {
  border-color: #165DFF;
  box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.1);
}

.search-box input::placeholder {
  color: #c9cdd4;
}

/* 项目卡片网格 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* 项目卡片 */
.card {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e5e6eb;
  padding: 20px;
  transition: all 0.2s;
  cursor: default;
}

.card:hover {
  border-color: #165DFF;
  box-shadow: 0 4px 12px rgba(22, 93, 255, 0.08);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-title {
  font-size: 16px;
  font-weight: 500;
  color: #1d2129;
  line-height: 1.4;
}

.card-tag {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.tag-active {
  background: #e8f3ff;
  color: #165DFF;
}

.tag-dev {
  background: #fff7e8;
  color: #ff7d00;
}

.tag-archived {
  background: #f2f3f5;
  color: #86909c;
}

.card-desc {
  font-size: 13px;
  color: #86909c;
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 12px;
  color: #c9cdd4;
  margin-bottom: 16px;
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 操作按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn svg {
  width: 14px;
  height: 14px;
}

.btn-primary {
  background: #165DFF;
  color: #fff;
  border-color: #165DFF;
}

.btn-primary:hover {
  background: #4080FF;
  border-color: #4080FF;
}

.btn-secondary {
  background: #fff;
  color: #4e5969;
  border-color: #e5e6eb;
}

.btn-secondary:hover {
  background: #f7f8fa;
  border-color: #165DFF;
  color: #165DFF;
}

.btn-ghost {
  background: transparent;
  color: #4e5969;
  border-color: transparent;
}

.btn-ghost:hover {
  background: #f2f3f5;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 80px 0;
  color: #c9cdd4;
}

.empty-state p {
  margin-top: 16px;
  font-size: 14px;
}

/* 弹窗 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 8px;
  width: 480px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e6eb;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 500;
  color: #1d2129;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #86909c;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: #f2f3f5;
  color: #1d2129;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid #e5e6eb;
}

/* 表单 */
.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #1d2129;
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: #165DFF;
  box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.1);
}

/* 版本列表 */
.version-list {
  max-height: 400px;
  overflow-y: auto;
}

.version-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f2f3f5;
}

.version-item:last-child {
  border-bottom: none;
}

.version-hash {
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 13px;
  color: #165DFF;
  background: #e8f3ff;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.version-info {
  flex: 1;
  min-width: 0;
}

.version-message {
  font-size: 14px;
  color: #1d2129;
  margin-bottom: 4px;
  word-break: break-word;
}

.version-date {
  font-size: 12px;
  color: #c9cdd4;
}

.version-empty {
  text-align: center;
  padding: 40px 0;
  color: #c9cdd4;
  font-size: 14px;
}

/* 响应式 */
@media (max-width: 640px) {
  .header-inner {
    padding: 0 16px;
  }

  .main {
    padding: 16px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-left {
    justify-content: space-between;
  }

  .search-box {
    width: 100%;
  }

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

  .card-actions {
    flex-direction: column;
  }

  .card-actions .btn {
    justify-content: center;
  }
}

/* 主内容区 */
.main {
  flex: 1;
}

/* 页脚 */
.footer {
  text-align: center;
  padding: 20px;
  border-top: 1px solid #e5e6eb;
  color: #86909c;
  font-size: 13px;
}
