:root {
  --hy-primary: #0e5d8f;
  --hy-primary-hover: #0b4d78;
  --hy-navy: #102a43;
  --hy-navy-deep: #0b1f33;
  --hy-bg: #f5f7fa;
  --hy-bg-strong: #eef2f6;
  --hy-surface: #ffffff;
  --hy-surface-soft: #f7f9fb;
  --hy-border: #e2e8f0;
  --hy-border-strong: #ccd6e2;
  --hy-text: #172033;
  --hy-text-secondary: #5f6f82;
  --hy-text-muted: #8794a6;
  --hy-success: #168a5b;
  --hy-warning: #b7791f;
  --hy-danger: #c2413d;
  --hy-info: #2f75b5;
  --hy-radius-sm: 4px;
  --hy-radius: 6px;
  --hy-radius-lg: 8px;
  --hy-shadow-pop: 0 18px 46px rgba(15, 23, 42, .14);
  --hy-shadow-soft: 0 12px 32px rgba(15, 23, 42, .07);
  --hy-sidebar: 224px;
  --hy-mail-list: 360px;
  --hy-space-1: 4px;
  --hy-space-2: 8px;
  --hy-space-3: 12px;
  --hy-space-4: 16px;
  --hy-space-5: 20px;
  --hy-space-6: 24px;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: no-preference) {
  * {
    transition:
      background-color .18s ease,
      border-color .18s ease,
      box-shadow .18s ease,
      color .18s ease,
      opacity .18s ease,
      transform .18s ease;
  }
}

body {
  margin: 0;
  color: var(--hy-text);
  background: var(--hy-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

html,
body {
  width: 100%;
  min-width: 0;
}

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

button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }

.primary,
.secondary,
.ghost,
.icon-btn,
.compose-btn,
.card button {
  min-height: 36px;
  border-radius: var(--hy-radius);
  border: 1px solid var(--hy-border);
  padding: 0 14px;
  background: var(--hy-surface);
  color: var(--hy-primary);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.primary,
.compose-btn {
  background: var(--hy-primary);
  border-color: var(--hy-primary);
  color: #fff;
}

.primary:hover,
.compose-btn:hover { background: var(--hy-primary-hover); border-color: var(--hy-primary-hover); }

.secondary:hover,
.card button:hover { background: #f0f6fb; border-color: #bdd3e4; }

.ghost {
  background: transparent;
  color: #dbeafe;
  border-color: rgba(255, 255, 255, .24);
}

.wide { width: 100%; }
.end { justify-content: flex-end; }

.link {
  border: 0;
  background: transparent;
  color: var(--hy-primary);
  padding: 0;
  min-height: 0;
  font-size: 14px;
  font-weight: 600;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--hy-text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.field input,
.field select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--hy-border);
  border-radius: var(--hy-radius);
  background: #fff;
  color: var(--hy-text);
  padding: 0 11px;
  outline: none;
}

.field input:focus,
.field select:focus,
textarea:focus,
.editor:focus {
  border-color: rgba(14, 93, 143, .72);
  box-shadow: 0 0 0 3px rgba(14, 93, 143, .1);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--hy-text-secondary);
  font-size: 13px;
}

.panel,
.card,
.metric {
  background: var(--hy-surface);
  border: 1px solid var(--hy-border);
  border-radius: var(--hy-radius-lg);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03), var(--hy-shadow-soft);
}

.panel { padding: var(--hy-space-4); }
.card { padding: var(--hy-space-4); display: grid; gap: 8px; }
.metric { padding: 14px 16px; display: grid; gap: 6px; }

.tag {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--hy-text-secondary);
  background: #eef2f6;
}

.tag.green { color: #0f6844; background: #e8f6ef; }
.tag.amber { color: #815711; background: #fff4db; }
.tag.red { color: #9b2f2c; background: #fdecec; }
.tag.blue { color: #185c91; background: #e7f1fa; }

.desc,
.metric-foot,
small {
  color: var(--hy-text-secondary);
  line-height: 1.55;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--hy-border);
  border-radius: var(--hy-radius-lg);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  min-height: 48px;
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--hy-border);
  font-size: 13px;
  vertical-align: middle;
}

th {
  color: var(--hy-text-secondary);
  background: var(--hy-surface-soft);
  font-weight: 600;
}

tbody tr:hover td { background: #fbfdff; }
tbody tr:last-child td { border-bottom: 0; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 380px;
  padding: 11px 14px;
  background: #142133;
  color: #fff;
  border-radius: var(--hy-radius);
  box-shadow: var(--hy-shadow-pop);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: .18s ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}
