/* gsocip 共享样式 */
:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1f2329;
  --muted: #8a919f;
  --border: #e5e8ee;
  --blue: #185fa5;
  --blue-50: #e6f1fb;
  --green: #1d9e75;
  --amber: #854f0b;
  --amber-50: #faeeda;
  --red: #a32d2d;
  --red-50: #fcebeb;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--blue); text-decoration: none; }

.container { max-width: 480px; margin: 0 auto; padding: 16px 16px 48px; }
.container-wide { max-width: 1080px; margin: 0 auto; padding: 20px 20px 48px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

h1 { font-size: 18px; font-weight: 600; }
h2 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }

label { display: block; font-size: 13px; color: var(--text); margin: 14px 0 6px; }
label .opt { color: var(--muted); font-weight: 400; }

input[type=text], input[type=number], input[type=password], select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-50); border-color: var(--blue); }
textarea { resize: vertical; }

.btn {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
}
.btn:hover { background: var(--bg); }
.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  width: 100%;
  padding: 12px;
  font-size: 15px;
}
.btn-primary:hover { background: #124a84; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-50); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  background: #fff;
}
.chip.on { background: var(--blue-50); border-color: var(--blue); color: var(--blue); font-weight: 600; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
}
.badge-pending { background: var(--amber-50); color: var(--amber); }
.badge-scored { background: #e1f5ee; color: #0f6e56; }
.badge-partial { background: var(--blue-50); color: var(--blue); }

.photo-box {
  flex: 1;
  height: 84px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  background: #fafbfc;
}
.photo-box .ph-hint { pointer-events: none; }
.photo-box .ph-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}
.photo-box input[type=file] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.msg { margin-top: 12px; font-size: 13px; }
.msg-err { color: var(--red); }
.msg-ok { color: var(--green); }

.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 首页入口 */
.entry-grid { display: grid; gap: 12px; }
.entry {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 20px;
}
.entry-icon {
  width: 44px; height: 44px; border-radius: 10px; flex: none;
  background: var(--blue-50); color: var(--blue);
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 600;
}
.entry b { font-size: 15px; display: block; }
.entry span { font-size: 12px; color: var(--muted); }

/* 工作台 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 12px 20px; margin-bottom: 20px;
}
.topbar b { font-size: 15px; }
.topbar .user { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 10px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
}
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 24px; font-weight: 600; margin-top: 2px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.filter-bar select, .filter-bar input { width: auto; min-width: 110px; }

table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 12px; overflow: hidden; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
th { background: var(--bg); color: var(--muted); font-weight: 600; white-space: nowrap; }
tbody tr:hover { background: #fafbfc; }
.score-num { font-size: 16px; font-weight: 600; color: var(--blue); }

/* 编号可点击（打开评分详情） */
.case-no-link { color: var(--blue); font-weight: 600; cursor: pointer; }
.case-no-link:hover { text-decoration: underline; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(31, 35, 41, 0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; z-index: 50; overflow-y: auto;
}
.modal {
  background: var(--card); border-radius: 12px; padding: 24px;
  width: 100%; max-width: 640px;
}
.modal h2 { margin-bottom: 4px; }
.score-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.score-row label { flex: 0 0 150px; margin: 0; }
.score-row input[type=range] { flex: 1; }
.score-row .val { flex: 0 0 28px; text-align: center; font-weight: 600; color: var(--blue); }
.modal .case-text { font-size: 13px; color: var(--text); background: var(--bg); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.modal .case-text b { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.modal-photos { display: flex; gap: 10px; margin-bottom: 12px; }
.modal-photos figure { width: 50%; }
.modal-photos figcaption { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.modal-photos img { width: 100%; max-height: 180px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

/* 案例编辑 */
.edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 14px; }
.edit-grid label { margin-top: 0; }
#editBlock textarea { margin-bottom: 2px; }
.edit-photos { display: flex; gap: 12px; margin-top: 4px; }
.edit-photo { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: #fafbfc; }
.edit-photo .ep-head { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 8px; }
.edit-photo .ep-body {
  height: 96px; border-radius: 6px; overflow: hidden; background: #fff;
  border: 1px dashed var(--border); display: flex; align-items: center; justify-content: center;
}
.edit-photo .ep-body img { width: 100%; height: 100%; object-fit: cover; }
.edit-photo .ep-empty { font-size: 12px; color: var(--muted); text-align: center; padding: 0 8px; }
@media (max-width: 560px) { .edit-photos { flex-direction: column; } }

/* 二维码打印页 */
.qr-print-area { background: #fff; text-align: center; }
.qr-print-area .qr-box { display: inline-block; padding: 24px; }
@media print {
  body * { visibility: hidden; }
  .qr-print-area, .qr-print-area * { visibility: visible; }
  .qr-print-area { position: absolute; left: 0; top: 0; width: 100%; }
}
