/* 设计变量：3 个主色（蓝 / 深墨蓝 / 中性灰），4px 间距栅格 */
:root {
  --blue-700: #175CD3;
  --blue-800: #1249A8;
  --blue-500: #3B82F6;
  --blue-100: #DCE9FF;
  --blue-50: #EFF5FF;

  --ink-900: #0B1B33;
  --ink-700: #33415C;
  --ink-500: #5B6B84;
  --ink-400: #66768c;

  --line: #E2E8F0;
  --line-strong: #D3DCE8;
  --line-soft: #EDF1F7;

  --bg: #F5F7FB;
  --surface: #FFFFFF;

  --success: #12805C;
  --success-bg: #E9F7F1;
  --danger: #B42318;
  --danger-bg: #FEF3F2;
  --warning: #B54708;
  --warning-bg: #FFF6ED;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;

  --shadow-1: 0 1px 2px rgba(11, 27, 51, 0.06);
  --shadow-2: 0 12px 32px rgba(11, 27, 51, 0.1);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --ring: rgba(23, 92, 211, 0.16);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-900);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
p,
dl,
dd,
dt,
figure {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--blue-700);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

input,
select,
textarea {
  font: inherit;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  display: block;
  flex: none;
}

::selection {
  background: var(--blue-100);
}

:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

/* 品牌标识：领取页与登录页共用 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-900);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: var(--blue-700);
  color: #fff;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand-sub {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--ink-400);
}

/* 表格时间：日期与时间分两行，节省横向空间 */
.time-date,
.time-clock {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.time-clock {
  color: var(--ink-400);
}

.cell-empty {
  color: var(--ink-400);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--ink-500);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

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

.btn-primary {
  background: var(--blue-700);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--blue-800);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink-700);
}

.btn-secondary:hover:not(:disabled) {
  border-color: #b9c6d9;
  background: #f8fafd;
}

.btn-ghost {
  color: var(--ink-500);
}

.btn-ghost:hover:not(:disabled) {
  background: #eef2f8;
  color: var(--ink-900);
}

.btn-danger {
  background: var(--surface);
  border-color: #f0c2be;
  color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-bg);
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.btn-lg {
  height: 48px;
  padding: 0 22px;
  font-size: 15px;
  border-radius: var(--radius);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
}

/* 表单控件 */
.input,
.select {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
  color: var(--ink-900);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder {
  color: var(--ink-400);
}

.input:hover,
.select:hover {
  border-color: #b9c6d9;
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px var(--ring);
}

.input-lg {
  height: 48px;
  font-size: 15px;
}

textarea.input {
  height: auto;
  min-height: 84px;
  padding: 9px 11px;
  resize: vertical;
}

.select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%238695AB' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-500);
  letter-spacing: 0.02em;
}

.field-hint {
  font-size: 12px;
  color: var(--ink-400);
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-700);
  cursor: pointer;
}

.checkbox input {
  width: 15px;
  height: 15px;
  accent-color: var(--blue-700);
  cursor: pointer;
}

/* 状态标签 */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.pill-unclaimed {
  background: #f1f4f9;
  color: var(--ink-500);
}

.pill-claimed {
  background: var(--success-bg);
  color: var(--success);
}

/* 提示 */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
}

.alert-error {
  background: var(--danger-bg);
  border-color: #f5c6c0;
  color: #8e2c24;
}

.alert-info {
  background: var(--blue-50);
  border-color: #cfe0ff;
  color: #1249a8;
}

.alert-success {
  background: var(--success-bg);
  border-color: #bfe7d7;
  color: var(--success);
}

/* 表格 */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px;
  background: #fafbfd;
  border-bottom: 1px solid var(--line);
  color: var(--ink-500);
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-700);
  vertical-align: middle;
}

.table tbody tr:hover td {
  background: #f8fafd;
}

.table tbody tr.is-selected td {
  background: var(--blue-50);
}

.table td.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-500);
  white-space: nowrap;
}

.table .cell-clip {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 320px;
}

.table .row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  white-space: nowrap;
}

/* 弹窗 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(11, 27, 51, 0.45);
  animation: fade-in 0.15s ease-out;
}

.modal {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  animation: pop-in 0.16s ease-out;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

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

.modal-desc {
  margin-top: 3px;
  font-size: 12px;
  color: var(--ink-500);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #fcfdfe;
}

/* 轻提示 */
.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 220px;
  max-width: 360px;
  padding: 10px 13px;
  border-radius: var(--radius);
  background: var(--ink-900);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-2);
  animation: slide-in 0.18s ease-out;
  pointer-events: auto;
}

.toast.is-leaving {
  animation: fade-out 0.15s ease-in forwards;
}

.toast-error {
  background: #7d2a22;
}

.toast-success {
  background: #0f5c43;
}

/* 空状态 */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 48px 16px;
  text-align: center;
}

.empty-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-700);
}

.empty-desc {
  font-size: 12px;
  color: var(--ink-400);
}

/* 分页 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-500);
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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