/* ==================== CSS Variables & Reset ==================== */
:root {
  --primary: #1677ff;
  --primary-dark: #0958d9;
  --primary-light: #e6f4ff;
  --success: #52c41a;
  --success-light: #f6ffed;
  --danger: #ff4d4f;
  --danger-light: #fff2f0;
  --warning: #faad14;
  --warning-light: #fffbe6;
  /* 积分场景：奖励=绿色，扣分=红色 */
  --reward: #52c41a;
  --reward-light: #f6ffed;
  --deduction: #ff4d4f;
  --deduction-light: #fff2f0;
  --text-1: #1a1a1a;
  --text-2: #666;
  --text-3: #999;
  --bg-page: #f5f5f5;
  --bg-card: #ffffff;
  --border: #e8e8e8;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --header-h: 56px;
  --tab-h: 48px;
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--text-1);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

#app { min-height: 100vh; }

/* ==================== Login Page ==================== */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1677ff 0%, #0958d9 100%);
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  text-align: center;
}

.login-logo {
  width: 110px;
  height: 110px;
  margin: 0 auto 12px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(184, 134, 11, 0.25));
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 32px;
}

.login-form .input-group {
  margin-bottom: 16px;
  text-align: left;
}

.login-form label {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
  font-weight: 500;
}

.login-form input {
  width: 100%;
  height: 48px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 16px;
  font-size: 16px;
  transition: border-color 0.2s;
  outline: none;
}

.login-form input:focus {
  border-color: var(--primary);
}

.login-btn {
  width: 100%;
  height: 48px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.login-btn:active { background: var(--primary-dark); }

.login-hint {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.6;
}

.login-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
  min-height: 18px;
}

/* ==================== Excel Upload ==================== */
.excel-upload-area {
  margin: 16px 0;
}
.excel-placeholder {
  border: 2px dashed #d9d9d9;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafafa;
}
.excel-placeholder:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.excel-placeholder:active {
  transform: scale(0.99);
}

/* ==================== Header ==================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: linear-gradient(180deg, #fff8e7 0%, #fdf3d8 100%);
  color: #5a4400;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  border-bottom: 1px solid #f0e2b8;
}

.app-header.app-header--preview {
  background: var(--primary);
  color: #fff;
  border-bottom: none;
}

.app-header .header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-header .header-logo { font-size: 22px; }

.app-header .header-logo-img {
  height: 44px;
  width: auto;
  display: block;
  object-fit: contain;
}

.app-header .header-title {
  font-size: 17px;
  font-weight: 700;
  color: #8b6914;
  letter-spacing: 0.5px;
}

.app-header.app-header--preview .header-title {
  color: #fff;
}

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

.header-user {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #5a4400;
}

.app-header.app-header--preview .header-user { color: #fff; }

.header-logout {
  background: rgba(184, 134, 11, 0.12);
  border: 1px solid rgba(184, 134, 11, 0.3);
  color: #8b6914;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.app-header.app-header--preview .header-logout {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
}

.header-logout:active { background: rgba(255,255,255,0.3); }

/* ==================== Tabs ==================== */
.tab-bar {
  display: flex;
  background: #fff;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: sticky;
  top: var(--header-h);
  z-index: 90;
}

.tab-item {
  flex: 1;
  min-width: 80px;
  height: var(--tab-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  padding: 0 12px;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tab-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ==================== Content ==================== */
.page-content {
  padding: 16px;
  max-width: 900px;
  margin: 0 auto;
  padding-bottom: 40px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==================== Cards ==================== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  transition: transform 0.1s;
}

.user-card:active { transform: scale(0.98); }

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

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.user-meta {
  font-size: 12px;
  color: var(--text-3);
}

/* ==================== Badges ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
/* 标签 - 奖励绿/扣分红 */
.badge-success { background: var(--deduction-light); color: var(--deduction); }
.badge-danger { background: var(--reward-light); color: var(--reward); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-default { background: #f0f0f0; color: var(--text-2); }

.position-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  margin-left: 6px;
}

.pos-admin { background: #722ed1; color: #fff; }
.pos-zhudiangzong { background: #c41d7f; color: #fff; }
.pos-fuzong { background: #2f54eb; color: #fff; }
.pos-yanjingli { background: #13c2c2; color: #fff; }
.pos-yanzhuli { background: #7cb305; color: #fff; }
.pos-yanguanjia { background: #fa8c16; color: #fff; }

/* ==================== Buttons ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text-1); }
.btn-outline:active { background: #f5f5f5; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-icon { padding: 0 8px; min-width: 32px; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==================== Forms ==================== */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group textarea {
  height: auto;
  padding: 10px 12px;
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group { flex: 1; }

/* ==================== Table ==================== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: #fff;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data-table th {
  background: #fafafa;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

table.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.data-table tr:last-child td { border-bottom: none; }

table.data-table tr:hover { background: #fafafa; }

/* ==================== Modal ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s;
}

.modal-overlay .modal-content {
  background: #fff;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  border-radius: 20px 20px 0 0;
  overflow-y: auto;
  animation: slideUp 0.3s;
  padding-bottom: 20px;
}

@media (min-width: 500px) {
  .modal-overlay { align-items: center; }
  .modal-overlay .modal-content { border-radius: 20px; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  border-radius: 20px 20px 0 0;
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-3);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 0 20px 16px;
  display: flex;
  gap: 12px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ==================== Score Item Selection ==================== */
.score-item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.score-item-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.score-item-option:active { transform: scale(0.98); }

.score-item-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.score-item-option .item-name {
  font-size: 14px;
  font-weight: 500;
}

.score-item-option .item-value {
  font-size: 16px;
  font-weight: 700;
}

.score-value-display {
  padding: 16px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.score-value-display .value-rule {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 12px;
  padding: 8px 10px;
  background: #fff;
  border-radius: 6px;
  border-left: 3px solid var(--primary);
}

.score-value-display .value-input-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.score-value-display .value-sign {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}
.score-value-display .value-sign.pos { color: var(--reward); }
.score-value-display .value-sign.neg { color: var(--deduction); }

.score-value-display .value-input {
  width: 110px;
  font-size: 34px;
  font-weight: 700;
  text-align: center;
  padding: 6px 4px;
  border: 2px solid var(--primary);
  border-radius: 8px;
  background: #fff;
  color: var(--text-1);
  -moz-appearance: textfield;
}
.score-value-display .value-input::-webkit-outer-spin-button,
.score-value-display .value-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.score-value-display .value-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-light);
}

.score-value-display .value-unit {
  font-size: 16px;
  color: var(--text-2);
}

.score-value-display .value-preview {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-2);
  text-align: center;
}
.score-value-display .value-preview b.pos { color: var(--reward); font-size: 16px; }
.score-value-display .value-preview b.neg { color: var(--deduction); font-size: 16px; }

/* Note: In Chinese stock market convention, red = up, green = down.
   Here positive score = reward = red, negative = deduction = green */

/* ==================== Photo Upload ==================== */
.photo-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
  position: relative;
}

.photo-upload-area:active { border-color: var(--primary); }

.photo-upload-area.has-image {
  border-style: solid;
  padding: 0;
  overflow: hidden;
}

.photo-preview {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
}

.photo-placeholder {
  color: var(--text-3);
  font-size: 14px;
}

.photo-placeholder .camera-icon {
  font-size: 36px;
  display: block;
  margin-bottom: 8px;
}

.photo-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==================== Stats ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 6px;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .stat-value.danger { color: var(--reward); }
.stat-card .stat-value.success { color: var(--deduction); }

/* ==================== Score Record ==================== */
.score-record {
  display: flex;
  gap: 12px;
  background: #fff;
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

.score-record .record-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.score-record .record-icon.reward { background: var(--reward-light); color: var(--reward); }
.score-record .record-icon.deduction { background: var(--deduction-light); color: var(--deduction); }

.score-record .record-body {
  flex: 1;
  min-width: 0;
}

.score-record .record-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.score-record .record-item {
  font-size: 14px;
  font-weight: 600;
}

.score-record .record-value {
  font-size: 16px;
  font-weight: 700;
}

.score-record .record-value.positive { color: var(--reward); }
.score-record .record-value.negative { color: var(--deduction); }

.score-record .record-meta {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.score-record .record-photo {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 8px;
}

.score-record .record-remark {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 6px;
  padding: 6px 10px;
  background: #fafafa;
  border-radius: 6px;
}

/* ==================== Empty State ==================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state .empty-text {
  font-size: 14px;
}

/* ==================== Toast ==================== */
.toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 2000;
  animation: toastIn 0.3s, toastOut 0.3s 2s forwards;
}

@keyframes toastIn { from { opacity: 0; top: 60px; } to { opacity: 1; top: 70px; } }
@keyframes toastOut { to { opacity: 0; top: 60px; } }

/* ==================== Search & Filter ==================== */
.search-bar {
  margin-bottom: 12px;
}

.search-bar input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0 16px;
  font-size: 14px;
  outline: none;
  background: #fff;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-row select {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  font-size: 13px;
  outline: none;
  background: #fff;
}

/* ==================== Misc ==================== */
.text-center { text-align: center; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; gap: 8px; }
.gap-8 { gap: 8px; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--text-3); }
/* 文本颜色工具类 - 奖励绿/扣分红 */
.text-danger { color: var(--reward); }
.text-success { color: var(--deduction); }
.font-bold { font-weight: 700; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

.total-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #1677ff, #0958d9);
  color: #fff;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
}

.total-bar .total-label { font-size: 13px; opacity: 0.9; }
.total-bar .total-value { font-size: 28px; font-weight: 700; margin-top: 4px; }

.info-banner {
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--primary);
}
.info-banner > span:first-child {
  font-size: 18px;
  margin-right: 6px;
  vertical-align: middle;
}
.info-banner strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark, #1d4ed8);
  padding: 0 2px;
}

@media (max-width: 768px) {
  .info-banner {
    font-size: 15px;
    padding: 14px 16px;
    line-height: 1.8;
  }
  .info-banner > span:first-child {
    font-size: 20px;
  }
  .info-banner strong {
    font-size: 17px;
  }
}

/* ===== 同步状态条 ===== */
.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  transition: background .2s, color .2s;
  margin-right: 12px;
  font-weight: 500;
}
.sync-badge:hover { opacity: 0.85; }
.sync-badge .sync-icon { font-size: 14px; }
.sync-badge.sync-pending {
  background: #f0f0f0;
  color: #999;
}
.sync-badge.sync-online {
  background: #e6f7ff;
  color: #1890ff;
}
.sync-badge.sync-offline {
  background: #fff1f0;
  color: #ff4d4f;
}
.sync-badge.sync-syncing {
  background: #fffbe6;
  color: #d48806;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@media (max-width: 768px) {
  .sync-badge {
    padding: 4px 8px;
    font-size: 11px;
    margin-right: 6px;
  }
  .sync-badge .sync-icon { font-size: 13px; }
}

/* Image viewer overlay */
.image-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s;
}

.image-viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.image-viewer .close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

/* ==================== Item Card (考核项目) ==================== */
.item-card { padding: 14px 16px; }
.item-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}
.item-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
}
.item-card-actions { display: flex; gap: 6px; }
.item-card-body { display: flex; flex-direction: column; gap: 8px; }
.item-rule {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
}
.item-rule.reward { background: var(--reward-light); }
.item-rule.deduction { background: var(--deduction-light); }
.item-rule-tag {
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  padding: 1px 8px;
  border-radius: 4px;
  margin-top: 1px;
}
.item-rule.reward .item-rule-tag { background: var(--reward); color: #fff; }
.item-rule.deduction .item-rule-tag { background: var(--deduction); color: #fff; }
.item-rule-value {
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 50px;
}
.item-rule.reward .item-rule-value { color: var(--reward); }
.item-rule.deduction .item-rule-value { color: var(--deduction); }
.item-rule-text { flex: 1; color: var(--text-1); }

/* ==================== Import Table (批量导入) ==================== */
.import-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}
table.import-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 500px;
}
table.import-table th {
  background: #fafafa;
  padding: 10px 8px;
  text-align: left;
  font-weight: 600;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.import-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.import-table tr:last-child td { border-bottom: none; }
table.import-table tr:hover { background: #fafafa; }
.cell-input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 8px;
  font-size: 13px;
  outline: none;
  background: #fff;
  font-family: inherit;
}
.cell-input:focus { border-color: var(--primary); }

/* ==================== Direction Options (打分方向选择) ==================== */
.direction-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.direction-option {
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 12px;
}
.direction-option:active { transform: scale(0.98); }
.direction-option.selected.reward { border-color: var(--reward); background: var(--reward-light); }
.direction-option.selected.deduction { border-color: var(--deduction); background: var(--deduction-light); }
.direction-label {
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  min-width: 50px;
}
.direction-option.reward .direction-label { color: var(--reward); }
.direction-option.deduction .direction-label { color: var(--deduction); }
.direction-value {
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 50px;
}
.direction-option.reward .direction-value { color: var(--reward); }
.direction-option.deduction .direction-value { color: var(--deduction); }
.direction-rule {
  font-size: 12px;
  color: var(--text-2);
  flex: 1;
  line-height: 1.5;
}

/* ==================== Item Selection in Scorer ==================== */
.score-item-option .item-values {
  display: flex;
  gap: 6px;
  align-items: center;
}
.score-item-option .item-reward {
  color: var(--reward);
  font-size: 14px;
  font-weight: 700;
}
.score-item-option .item-deduction {
  color: var(--deduction);
  font-size: 14px;
  font-weight: 700;
}

/* ==================== Score Value Display ==================== */
.score-value-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.csv-format-hint {
  background: #f6f8fa;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 8px;
  line-height: 1.6;
}

.csv-format-hint code {
  background: #e8e8e8;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 11px;
}

/* Date range picker */
.date-range {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.date-range input {
  flex: 1;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  font-size: 13px;
  outline: none;
}

.date-range span { color: var(--text-3); font-size: 13px; }

/* Action buttons row */
.action-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.action-row .btn { flex: 1; min-width: 120px; }

/* Quick stats for scorer */
.quick-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.quick-stat {
  flex: 1;
  background: #fff;
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow);
}

.quick-stat .qs-label { font-size: 12px; color: var(--text-3); }
.quick-stat .qs-value { font-size: 22px; font-weight: 700; margin-top: 4px; }

/* ==================== 门店排行 ==================== */
.ranking-list {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
}

.ranking-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #f0f0f0;
}
.ranking-row:last-child { border-bottom: none; }

.ranking-row.me {
  background: var(--primary-light);
}

.rank-no {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.rank-no.top {
  background: linear-gradient(135deg, #ffb300, #ff8f00);
  color: #fff;
}
.rank-no.normal {
  background: #f0f0f0;
  color: var(--text-2);
}

.rank-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.rank-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rank-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 6px;
}
.rank-me-tag {
  font-size: 11px;
  background: var(--primary);
  color: #fff;
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: 500;
}
.rank-info .position-badge {
  font-size: 11px;
  padding: 1px 8px;
  align-self: flex-start;
}

.rank-score {
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}
.rank-score.positive { color: var(--reward); }
.rank-score.negative { color: var(--deduction); }

/* Responsive */
@media (max-width: 600px) {
  .page-content { padding: 12px; }
  .form-row { flex-direction: column; gap: 0; }
  .tab-item { font-size: 13px; min-width: 70px; padding: 0 8px; }
  .app-header .header-title { font-size: 14px; }
  .header-user .user-store { display: none; }
  .score-value-display .value-input { width: 90px; font-size: 28px; }
}
