/* ============================================
   无袤创意工作室 - 管理系统样式
   ============================================ */

:root {
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-card: #111111;
  --bg-glass: rgba(17, 17, 17, 0.92);
  --bg-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.10);
  --border-active: rgba(255, 255, 255, 0.25);
  --text-primary: #ffffff;
  --text-secondary: #999999;
  --text-muted: #666666;
  --accent: #ffffff;
  --danger: #dc2626;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
  --transition: 0.15s ease;
  --font: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ====== 导航栏 ====== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}

.nav-brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.nav-links {
  display: flex; gap: 2px; align-items: center;
}

.nav-links a {
  color: var(--text-secondary); text-decoration: none;
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  transition: all var(--transition);
}

.nav-links a:hover { color: var(--text-primary); background: var(--bg-hover); }

.nav-links a.active {
  color: var(--text-primary);
  background: rgba(255,255,255,0.1);
}

.nav-links a .nav-badge {
  display: inline-block; background: var(--danger);
  color: #fff; font-size: 10px; padding: 1px 5px;
  border-radius: 8px; margin-left: 4px; min-width: 16px; text-align: center;
}

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

.user-info {
  display: flex; align-items: center; gap: 8px;
}

.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #000;
  background: var(--text-primary); flex-shrink: 0;
}

.user-name { font-size: 13px; font-weight: 600; }

.user-role-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 8px;
  font-weight: 500; color: var(--text-primary);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
}

/* ====== 按钮 ====== */
.btn {
  padding: 7px 16px; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  background: transparent; color: var(--text-primary);
  white-space: nowrap;
}

.btn:hover { border-color: rgba(255,255,255,0.3); background: var(--bg-hover); }

.btn-primary {
  background: var(--text-primary); color: #000;
  border-color: var(--text-primary); font-weight: 600;
}
.btn-primary:hover { background: #e5e5e5; border-color: #e5e5e5; }

.btn-danger { border-color: rgba(220,38,38,0.4); color: #fca5a5; }
.btn-danger:hover { background: rgba(220,38,38,0.15); border-color: rgba(220,38,38,0.6); }

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-ghost { border-color: transparent; }
.btn-ghost:hover { background: var(--bg-hover); }

/* ====== 主容器 ====== */
#app { padding-top: 56px; min-height: 100vh; }

.page {
  max-width: 1100px; margin: 0 auto; padding: 24px;
  display: none;
}
.page.active { display: block; }

.page-header {
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 22px; font-weight: 700; color: var(--text-primary);
}
.page-header p {
  color: var(--text-muted); margin-top: 4px; font-size: 13px;
}

/* ====== 卡片 ====== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color var(--transition);
}

.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

/* ====== 表单 ====== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 4px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 14px;
  font-family: var(--font);
  transition: border-color var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: rgba(255,255,255,0.4);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-select option { background: var(--bg-secondary); color: var(--text-primary); }

/* ====== 认证页面 ====== */
.auth-container {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
}

.auth-card {
  width: 100%; max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
}

.auth-logo {
  text-align: center; margin-bottom: 28px;
}

.auth-logo h1 {
  font-size: 22px; font-weight: 700;
  color: var(--text-primary);
  margin-top: 8px;
  letter-spacing: 2px;
}

.auth-tabs {
  display: flex; gap: 0; margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.auth-tab {
  flex: 1; text-align: center; padding: 9px;
  cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--text-muted); transition: all var(--transition);
  background: transparent;
}
.auth-tab.active {
  color: var(--text-primary); background: rgba(255,255,255,0.08);
}
.auth-tab:first-child { border-right: 1px solid var(--border); }

.role-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px;
}

.role-option {
  padding: 10px; text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--transition);
}
.role-option:hover { border-color: rgba(255,255,255,0.4); }
.role-option.selected { border-color: var(--text-primary); background: rgba(255,255,255,0.06); }
.role-option .role-icon { font-size: 20px; display: block; }
.role-option .role-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.auth-error { color: var(--danger); font-size: 13px; margin-top: 8px; display: none; }
.auth-error.show { display: block; }

/* ====== 数据看板 ====== */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  text-align: left;
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: rgba(255,255,255,0.2); }

.stat-value { font-size: 32px; font-weight: 700; margin-bottom: 4px; }
.stat-label { font-size: 13px; color: var(--text-muted); }

.announcement-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.announcement-card h3 {
  font-size: 15px; margin-bottom: 10px; color: var(--text-primary);
  font-weight: 600;
}
.announcement-content {
  color: var(--text-secondary); font-size: 13px;
  line-height: 1.8; white-space: pre-wrap;
}

/* ====== 岗位卡片 ====== */
.position-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  cursor: pointer; transition: border-color var(--transition);
}
.position-card:hover { border-color: rgba(255,255,255,0.25); }

.position-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.position-icon { font-size: 24px; }
.position-title { font-size: 16px; font-weight: 700; }
.position-desc { color: var(--text-secondary); font-size: 13px; line-height: 1.6; margin-bottom: 10px; }
.position-req { color: var(--text-muted); font-size: 12px; line-height: 1.5; padding-left: 4px; border-left: 2px solid rgba(255,255,255,0.2); }

/* ====== 应聘记录 ====== */
.app-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  margin-bottom: 8px;
  transition: border-color var(--transition);
}

.app-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.app-position { font-weight: 600; font-size: 14px; }
.app-status {
  font-size: 11px; padding: 2px 8px; border-radius: 8px; font-weight: 500;
  border: 1px solid var(--border); color: var(--text-secondary);
}
.app-status.pending { color: #fbbf24; border-color: rgba(251,191,36,0.3); }
.app-status.approved { color: #4ade80; border-color: rgba(74,222,128,0.3); }
.app-status.rejected { color: #f87171; border-color: rgba(248,113,113,0.3); }
.app-resume { color: var(--text-secondary); font-size: 13px; margin: 6px 0; }
.app-time { color: var(--text-muted); font-size: 12px; }

/* ====== 审核面板 ====== */
.review-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  margin-bottom: 12px;
}
.review-card h3 { font-size: 15px; margin-bottom: 6px; }
.review-card .meta { color: var(--text-muted); font-size: 12px; margin-bottom: 8px; }
.review-card .content { color: var(--text-secondary); font-size: 13px; line-height: 1.6; margin-bottom: 12px; }
.review-card .actions { display: flex; gap: 8px; }

/* ====== 项目卡片 ====== */
.project-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  transition: border-color var(--transition);
}
.project-card:hover { border-color: rgba(255,255,255,0.2); }

.project-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.project-desc { color: var(--text-secondary); font-size: 13px; margin-bottom: 12px; line-height: 1.5; }
.project-meta {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin-bottom: 10px;
}
.member-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 8px;
  font-weight: 500; border: 1px solid var(--border); color: var(--text-secondary);
}

.project-status {
  font-size: 11px; padding: 2px 8px; border-radius: 8px; font-weight: 500;
  border: 1px solid var(--border); color: var(--text-secondary);
}

.project-creator { font-size: 12px; color: var(--text-muted); }

/* ====== 聊天页面 ====== */
.chat-layout {
  display: flex; height: calc(100vh - 104px);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}

.chat-sidebar {
  width: 260px; flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.chat-sidebar-header {
  padding: 16px; font-weight: 700; font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.chat-room-list {
  flex: 1; overflow-y: auto; padding: 6px;
}
.chat-room-item {
  padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; margin-bottom: 2px;
  transition: background var(--transition);
}
.chat-room-item:hover { background: var(--bg-hover); }
.chat-room-item.active { background: rgba(255,255,255,0.08); }
.chat-room-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.chat-room-preview { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-main { flex: 1; display: flex; flex-direction: column; }

.chat-main-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 14px;
}

.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}

.chat-msg {
  display: flex; flex-direction: column; max-width: 70%;
}
.chat-msg.self { align-self: flex-end; align-items: flex-end; }
.chat-msg.other { align-self: flex-start; align-items: flex-start; }

.chat-msg-sender { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }

.chat-msg-bubble {
  padding: 8px 14px; border-radius: 14px;
  font-size: 13px; line-height: 1.5;
  word-break: break-word;
}
.chat-msg.self .chat-msg-bubble {
  background: var(--text-primary); color: #000;
  border-bottom-right-radius: 4px; font-weight: 500;
}
.chat-msg.other .chat-msg-bubble {
  background: var(--bg-hover); border: 1px solid var(--border);
  color: var(--text-primary); border-bottom-left-radius: 4px;
}

.chat-msg-time { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

.chat-input-area {
  padding: 10px 14px; border-top: 1px solid var(--border);
  display: flex; gap: 8px;
}
.chat-input-area .form-input { flex: 1; }
.chat-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-muted); font-size: 13px; }

/* ====== 站内信 ====== */
.mail-tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.mail-tab {
  padding: 5px 14px; border-radius: var(--radius-sm); font-size: 13px;
  cursor: pointer; color: var(--text-muted); transition: all var(--transition);
  border: 1px solid var(--border); background: transparent;
}
.mail-tab.active { color: var(--text-primary); border-color: rgba(255,255,255,0.3); background: var(--bg-hover); }

.mail-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 6px;
  cursor: pointer; transition: border-color var(--transition);
}
.mail-item:hover { border-color: rgba(255,255,255,0.2); }
.mail-item.unread { border-left: 2px solid var(--text-primary); }

.mail-subject { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.mail-meta { font-size: 12px; color: var(--text-muted); }
.mail-preview { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.mail-detail { margin-bottom: 16px; }
.mail-detail h2 { font-size: 18px; margin-bottom: 10px; }
.mail-detail .mail-info { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.mail-detail .mail-body { font-size: 14px; line-height: 1.8; color: var(--text-secondary); white-space: pre-wrap; }

/* ====== 个人设置 ====== */
.settings-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 16px;
}
.settings-section h3 {
  font-size: 15px; font-weight: 700; margin-bottom: 16px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.settings-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.settings-row .form-input { max-width: 300px; }

/* ====== 弹窗 ====== */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
}
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px; width: 90%; max-width: 480px;
  max-height: 80vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.modal-lg { max-width: 600px; }
.modal h2 { font-size: 17px; font-weight: 700; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ====== Toast ====== */
.toast-container {
  position: fixed; top: 72px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 6px;
}
.toast {
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; min-width: 240px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-primary);
}

/* ====== 空状态 ====== */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-text { font-size: 13px; }

/* ====== 工具类 ====== */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.mt-md { margin-top: 16px; }
.hidden { display: none !important; }

/* ====== 响应式 ====== */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: 1fr; }
  .chat-layout { flex-direction: column; height: auto; }
  .chat-sidebar { width: 100%; max-height: 180px; border-right: none; border-bottom: 1px solid var(--border); }
  .chat-main { min-height: 380px; }
  .nav-links a { padding: 5px 8px; font-size: 12px; }
  .page { padding: 16px; }
}
