/* ============ 基础样式 · 年度先进评选 ============ */
:root {
  --brand: #1667c9;
  --brand-2: #2f8fe0;
  --brand-deep: #0b3d75;
  --brand-ink: #0d4f9c;
  --ink: #14243c;
  --ink-2: #364a63;
  --muted: #75859c;
  --muted-2: #93a1b5;
  --line: #e4ebf4;
  --line-strong: #d5e0ee;
  --bg: #eef4fb;
  --bg-2: #f6f9fd;
  --card: #ffffff;
  --ok: #159a63;
  --ok-bg: #e8f7f0;
  --warn: #c47a12;
  --warn-bg: #fdf3e2;
  --danger: #d14343;
  --danger-bg: #fdeeee;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 2px 8px rgba(16, 52, 96, 0.05);
  --shadow: 0 10px 30px rgba(16, 52, 96, 0.09);
  --shadow-lg: 0 24px 60px rgba(10, 40, 80, 0.18);
  --font: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  background:
    radial-gradient(1200px 620px at 4% -8%, #d9e9fb 0%, rgba(217, 233, 251, 0) 60%),
    radial-gradient(900px 520px at 104% 4%, #e2f2f0 0%, rgba(226, 242, 240, 0) 55%),
    #e9f0f8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid rgba(22, 103, 201, 0.55);
  outline-offset: 2px;
  border-radius: 8px;
}

.ico {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico-sm { width: 16px; height: 16px; stroke-width: 1.9; }
.ico-lg { width: 26px; height: 26px; }
.ico-xl { width: 34px; height: 34px; }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  background: #fff;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(0.985); }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #1a72d6 0%, #1461bd 55%, #0f55a6 100%);
  box-shadow: 0 8px 20px rgba(21, 96, 195, 0.28);
}
.btn-primary:hover { box-shadow: 0 10px 24px rgba(21, 96, 195, 0.36); }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--ink-2); }
.btn-ghost:hover { border-color: #b9cde4; background: #fbfdff; }
.btn-soft { background: #eaf3fe; color: var(--brand-ink); }
.btn-soft:hover { background: #dfedfd; }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: #fbdede; }
.btn-sm { height: 34px; padding: 0 12px; border-radius: 9px; font-size: 13px; }
.btn-lg { height: 50px; border-radius: 14px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[disabled] {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.btn .ico { width: 18px; height: 18px; }

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
  transition: background 0.18s, border-color 0.18s;
}
.icon-btn:hover { background: #f5f9ff; border-color: #c9dbea; }
.icon-btn.is-danger { color: var(--danger); }
.icon-btn.is-danger:hover { background: var(--danger-bg); border-color: #f3cccc; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  background: #f1f5fa;
  border: 1px solid #e9f0f7;
  white-space: nowrap;
}
.chip .ico { width: 13px; height: 13px; }
.chip.is-brand { color: var(--brand-ink); background: #e9f3ff; border-color: #d6e8fd; }
.chip.is-ok { color: var(--ok); background: var(--ok-bg); border-color: #cdeede; }
.chip.is-warn { color: var(--warn); background: var(--warn-bg); border-color: #f6e4c4; }
.chip.is-gray { color: #8393a8; background: #f3f5f8; border-color: #eceff4; }

.tag-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.8; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(220, 231, 243, 0.8);
}

.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .field-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.field-label .req { color: var(--danger); font-weight: 500; }
.field-label .counter { margin-left: auto; font-weight: 400; color: var(--muted-2); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.input::placeholder, .textarea::placeholder { color: #a7b4c6; }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: #8db9ea;
  box-shadow: 0 0 0 3px rgba(35, 120, 210, 0.12);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.7; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2375859c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
}
.form-hint { font-size: 11.5px; color: var(--muted-2); line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span-2 { grid-column: span 2; }

/* ---------- 提示 / 弹层 ---------- */
.toast-root {
  position: fixed;
  z-index: 300;
  left: 50%;
  top: calc(16px + var(--safe-top));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(92vw, 460px);
}
.toast {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 10px 15px;
  border-radius: 11px;
  color: #fff;
  background: rgba(21, 35, 55, 0.92);
  box-shadow: 0 10px 26px rgba(10, 30, 60, 0.25);
  font-size: 13px;
  line-height: 1.45;
  backdrop-filter: blur(8px);
  animation: toast-in 0.25s ease both;
}
.toast .ico { width: 17px; height: 17px; }
.toast.is-ok { background: rgba(15, 122, 81, 0.95); }
.toast.is-warn { background: rgba(158, 96, 11, 0.95); }
.toast.is-error { background: rgba(176, 44, 44, 0.95); }
.toast.is-out { animation: toast-out 0.22s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px); } }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(9, 24, 44, 0.46);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.overlay.is-open { opacity: 1; }
.overlay.is-sheet { align-items: flex-end; padding: 0; }

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(0.985);
  opacity: 0;
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease;
}
.overlay.is-open .modal { transform: none; opacity: 1; }
.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 20px 0;
}
.modal-head h3 { font-size: 17px; font-weight: 700; letter-spacing: 0.01em; }
.modal-head p { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.modal-head .icon-btn { margin-left: auto; flex: none; }
.modal-body { padding: 16px 20px 4px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px 20px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), #fff 30%);
}

.sheet {
  position: relative;
  width: min(620px, 100%);
  max-height: 90vh;
  background: #fff;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -20px 60px rgba(8, 30, 60, 0.25);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.85, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.overlay.is-open .sheet { transform: none; }
.sheet-grab {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: #dbe4ef;
  margin: 9px auto 2px;
  flex: none;
}
.sheet-body { overflow: auto; padding: 10px 20px 18px; }

body.is-locked { overflow: hidden; }

/* ---------- 骨架 / 空态 ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 44px 20px;
  color: var(--muted);
}
.empty .empty-ico {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #eef4fb;
  color: #93a9c4;
  margin-bottom: 12px;
}
.empty h4 { font-size: 14.5px; color: var(--ink-2); margin-bottom: 4px; }
.empty p { font-size: 12.5px; }

.skeleton {
  background: linear-gradient(90deg, #eef3f9 25%, #e3ebf5 37%, #eef3f9 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
.spinner.is-dark { border-color: rgba(22, 103, 201, 0.2); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }

.fade-up { animation: fade-up 0.4s cubic-bezier(0.2, 0.75, 0.25, 1) both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- 桌面适配 ---------- */
@media (min-width: 860px) {
  body { background: #e6edf6; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .modal { border-radius: 18px; }
  .modal-foot .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
