* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f0f2f5;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: #1677ff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 导航 */
.navbar {
  background: #1677ff;
  color: #fff;
  padding: 0 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-brand {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-links a { color: rgba(255,255,255,0.9); text-decoration: none; font-size: 14px; }
.nav-links a:hover { color: #fff; }
.nav-user { font-size: 14px; color: rgba(255,255,255,0.7); }

/* 主内容 */
.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: opacity 0.2s;
}

.btn:hover { opacity: 0.85; text-decoration: none; }
.btn-primary { background: #1677ff; color: #fff; }
.btn-danger { background: #fff; color: #f5222d; border: 1px solid #f5222d; }
.btn-outline { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.6); }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }

/* 卡片 */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

/* 表单 */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: #333;
}

.form-group label .required { color: #f5222d; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgba(22,119,255,0.1);
}

textarea.form-control { resize: vertical; min-height: 120px; }

select.form-control { cursor: pointer; }

/* 提示 */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-success { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.alert-error { background: #fff2f0; color: #f5222d; border: 1px solid #ffccc7; }
.alert-info { background: #e6f4ff; color: #1677ff; border: 1px solid #91caff; }

/* 登录页 */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  padding: 24px;
}

.auth-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.auth-card h1 {
  font-size: 24px;
  text-align: center;
  margin-bottom: 8px;
}

.auth-card .subtitle {
  text-align: center;
  color: #999;
  font-size: 14px;
  margin-bottom: 32px;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: #666;
}

/* 工单列表 */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.page-header h1 { font-size: 22px; }

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  color: #666;
  background: #fff;
  text-decoration: none;
  border: 1px solid #e8e8e8;
}

.tab.active, .tab:hover {
  background: #1677ff;
  color: #fff;
  border-color: #1677ff;
  text-decoration: none;
}

.ticket-item {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: block;
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.2s;
}

.ticket-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-decoration: none;
}

.ticket-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.ticket-title { font-size: 16px; font-weight: 600; flex: 1; margin-right: 12px; }

.ticket-desc {
  color: #666;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 12px;
}

.ticket-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #999;
}

/* 标签 */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.status-pending { color: #faad14; background: #fffbe6; border: 1px solid #ffe58f; }
.status-processing { color: #1677ff; background: #e6f4ff; border: 1px solid #91caff; }
.status-resolved { color: #52c41a; background: #f6ffed; border: 1px solid #b7eb8f; }
.status-closed { color: #999; background: #fafafa; border: 1px solid #d9d9d9; }

.priority-low { color: #999; }
.priority-normal { color: #1677ff; }
.priority-high { color: #fa8c16; }
.priority-urgent { color: #f5222d; }

/* 详情页 */
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.detail-header h1 { font-size: 22px; flex: 1; margin-right: 16px; }

.meta-list { margin-bottom: 20px; }

.meta-item {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 14px;
}

.meta-label { width: 100px; color: #999; flex-shrink: 0; }

.description {
  font-size: 15px;
  line-height: 1.8;
  color: #444;
  white-space: pre-wrap;
}

.reply-box {
  background: #f6ffed;
  border: 1px solid #b7eb8f;
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
}

.reply-box .reply-label {
  font-size: 13px;
  color: #52c41a;
  font-weight: 600;
  margin-bottom: 8px;
}

/* 空状态 */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-icon { font-size: 48px; margin-bottom: 16px; }

/* 统计 */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.stat-num { font-size: 28px; font-weight: 700; color: #1677ff; }
.stat-label { font-size: 13px; color: #999; margin-top: 4px; }

/* 页脚 */
.footer {
  text-align: center;
  padding: 24px;
  color: #999;
  font-size: 13px;
}

/* 响应式 */
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .nav-inner { flex-direction: column; height: auto; padding: 12px 0; gap: 8px; }
  .page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .auth-card { padding: 24px; }
}

/* 登录切换 */
.login-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.login-tabs button {
  flex: 1;
  padding: 10px;
  border: 1px solid #e8e8e8;
  background: #fafafa;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.login-tabs button.active {
  background: #1677ff;
  color: #fff;
  border-color: #1677ff;
}

/* 手势九宫格 */
.gesture-pad {
  position: relative;
  width: 280px;
  max-width: 100%;
  margin: 12px auto 8px;
  touch-action: none;
  user-select: none;
}
.gesture-pad canvas {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
}
.gesture-dots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  place-items: center;
  position: relative;
  z-index: 1;
  margin: 0 auto;
}
.gesture-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d9d9d9;
  border: 2px solid #bfbfbf;
  box-shadow: 0 0 0 12px rgba(22,119,255,0.0);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.gesture-dot.active {
  background: #1677ff;
  border-color: #1677ff;
  box-shadow: 0 0 0 10px rgba(22,119,255,0.15);
}
.gesture-dot.ok {
  background: #52c41a;
  border-color: #52c41a;
}
.gesture-dot.error {
  background: #f5222d;
  border-color: #f5222d;
}
.gesture-tip {
  text-align: center;
  color: #666;
  font-size: 13px;
  min-height: 20px;
  margin-bottom: 8px;
}
.gesture-tip.error { color: #f5222d; }
.gesture-tip.ok { color: #52c41a; }

/* 地图选点 */
.map-box {
  width: 100%;
  height: 320px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e8e8e8;
  background: #f5f5f5;
}
.map-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  align-items: center;
}
.map-toolbar .form-control {
  flex: 1;
  min-width: 160px;
}
.map-coords {
  font-size: 12px;
  color: #999;
  margin-top: 8px;
}

