* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #4A90D9;
  --primary-dark: #357ABD;
  --success: #52C41A;
  --warning: #FAAD14;
  --danger: #FF4D4F;
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --text: #333333;
  --text-light: #888888;
  --border: #e8e8e8;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* 导航栏 */
.navbar {
  background: linear-gradient(135deg, #1a73e8, #4A90D9);
  color: #fff;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.navbar .logo { font-size: 18px; font-weight: bold; }
.navbar .user-info { font-size: 14px; display: flex; align-items: center; gap: 12px; }
.navbar .btn-outline {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.5);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.navbar .btn-outline:hover { background: rgba(255,255,255,0.3); }

/* 容器 */
.container { max-width: 800px; margin: 0 auto; padding: 16px; }
.container-wide { max-width: 900px; margin: 0 auto; padding: 16px; }

/* 卡片 */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card-header {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header .badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: normal;
}

/* 表单 */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #555;
}
.form-group .required::after { content: ' *'; color: var(--danger); }
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border 0.2s;
  font-family: inherit;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--primary); }
.form-textarea { min-height: 100px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #45a818; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: #f0f5ff; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 状态标签 */
.status-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.status-pending { background: #FFF7E6; color: #D46B08; }
.status-accepted { background: #E6F7FF; color: #096DD9; }
.status-completed { background: #F6FFED; color: #389E0D; }

.priority-high { color: var(--danger); }
.priority-normal { color: var(--warning); }

/* 工单列表项 */
.ticket-item {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}
.ticket-item:last-child { border-bottom: none; }
.ticket-item:hover { background: #fafafa; }
.ticket-item .ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.ticket-item .ticket-title {
  font-size: 15px;
  font-weight: 500;
  flex: 1;
}
.ticket-item .ticket-meta {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 6px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* 附件列表 */
.file-list { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.file-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 13px;
}
.file-item a { color: var(--primary); text-decoration: none; }

/* 评分星星 */
.rating-stars {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 10px 0;
}
.rating-star {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.2s;
  background: #fff;
  color: #999;
}
.rating-star:hover, .rating-star.active {
  border-color: var(--warning);
  background: var(--warning);
  color: #fff;
  transform: scale(1.1);
}

/* 评分展示 */
.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}
.rating-high { background: #F6FFED; color: #389E0D; }
.rating-mid { background: #FFF7E6; color: #D48806; }
.rating-low { background: #FFF2F0; color: #CF1322; }

/* 弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.modal h3 { margin-bottom: 16px; font-size: 18px; }

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-card .stat-value {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary);
}
.stat-card .stat-label { font-size: 13px; color: var(--text-light); margin-top: 4px; }

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* 登录页 */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 36px 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-card h1 {
  text-align: center;
  font-size: 22px;
  margin-bottom: 8px;
  color: #333;
}
.login-card .subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 24px;
  font-size: 14px;
}

/* 工单时间线 */
.timeline { padding: 0; list-style: none; }
.timeline li {
  padding: 10px 0 10px 24px;
  border-left: 2px solid var(--border);
  position: relative;
  font-size: 13px;
  color: #666;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}
.timeline li .time { font-size: 12px; color: #aaa; display: block; }

/* 转单选择器 */
.transfer-select {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* 响应式 */
@media (max-width: 600px) {
  .container, .container-wide { padding: 10px; }
  .card { padding: 14px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .navbar .logo { font-size: 15px; }
  .rating-star { width: 32px; height: 32px; font-size: 13px; }
}

/* Tab切换 */
.tab-bar {
  display: flex;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.tab-item {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  transition: all 0.2s;
}
.tab-item.active {
  background: var(--primary);
  color: #fff;
}

/* Toast提示 */
.toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  padding: 12px 24px;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  animation: slideDown 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--primary); }

@keyframes slideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 文件上传按钮样式 */
.file-upload-wrapper {
  position: relative;
  display: inline-block;
}
.file-upload-wrapper input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* 灰度条背景 */
.progress-bar-bg {
  background: #f0f0f0;
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
  margin-top: 4px;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.3s;
}

/* 页面切换入口 */
.role-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  padding: 20px;
}
.role-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid transparent;
}
.role-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  border-color: var(--primary);
}
.role-card .role-icon { font-size: 48px; margin-bottom: 12px; }
.role-card h3 { font-size: 18px; margin-bottom: 8px; }
.role-card p { font-size: 13px; color: var(--text-light); }
