/* =============================================================
   Minine Inc — Component layer (proposal)
   一套组件同时给 marketing 页面和 console 后台用。
   ============================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.12;
}

h1 {
  font-size: clamp(44px, 5.4vw, 76px);
}

h2 {
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1.16;
}

h3 {
  font-size: 22px;
  line-height: 1.25;
}

p {
  margin: 0;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ---------------------------------------------------------- eyebrow */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-ink);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}

.eyebrow--sun {
  color: var(--sun-ink);
}

/* ---------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--brand);
  color: var(--on-brand);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--fast), border-color var(--fast), color var(--fast);
}

.btn:hover {
  background: var(--brand-ink);
}

.btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
  box-shadow: none;
}

.btn--ghost:hover {
  background: var(--surface);
  border-color: var(--brand);
  color: var(--brand-ink);
}

.btn--sun {
  background: var(--sun);
  color: #3a2a05;
}

.btn--sun:hover {
  background: #f2b528;
  color: #3a2a05;
}

.btn--danger {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--danger);
  box-shadow: none;
}

.btn--danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn--sm {
  padding: 7px 14px;
  font-size: 13px;
  box-shadow: none;
}

.btn--block {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: center;
}

.linkish {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 14px;
  font-weight: 500;
  color: var(--brand-ink);
  border-bottom: 1px solid var(--brand-line);
  padding-bottom: 3px;
  transition: gap var(--fast) var(--ease), border-color var(--fast);
}

.linkish:hover {
  gap: 12px;
  border-color: var(--brand);
}

/* ---------------------------------------------------------- surfaces */

.card {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  transition: border-color var(--base), background var(--base);
}

.card--hover:hover {
  border-color: var(--brand);
  background: var(--raised);
}

.card--tint {
  background: var(--brand-soft);
  border-color: var(--brand-line);
}

.card--sun {
  background: var(--sun-soft);
  border-color: var(--sun-line);
}

/* 设计系统页里的示例底板：不描边，用下沉底色圈出范围 */
.card--flat {
  border-color: transparent;
  background: var(--sunken);
}

.panel {
  /* min-width:0 —— flex/grid 里的宽表格不能把整个后台顶出横向滚动条 */
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--line);
}

.panel__title {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}

.panel__body {
  padding: var(--s-5);
}

.panel__body--flush {
  padding: 0;
}

/* ---------------------------------------------------------- badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--sunken);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge--brand {
  background: var(--brand-soft);
  border-color: var(--brand-line);
  color: var(--brand-ink);
}

.badge--sun {
  background: var(--sun-soft);
  border-color: var(--sun-line);
  color: var(--sun-ink);
}

.badge--ok {
  background: color-mix(in srgb, var(--mint) 14%, transparent);
  border-color: color-mix(in srgb, var(--mint) 40%, transparent);
  color: color-mix(in srgb, var(--mint) 82%, var(--ink));
}

.badge--warn {
  background: var(--sun-soft);
  border-color: var(--sun-line);
  color: var(--sun-ink);
}

.badge--dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------------------------------------------------------- pills / tabs */

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.pill {
  padding: 7px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--fast) var(--ease);
}

.pill:hover {
  border-color: var(--brand-line);
  color: var(--brand-ink);
}

.pill[aria-selected="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.tabs {
  display: flex;
  gap: var(--s-5);
  border-bottom: 1px solid var(--line);
}

.tab {
  position: relative;
  padding: 10px 2px 12px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.tab[aria-selected="true"] {
  color: var(--ink);
}

.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}

/* ---------------------------------------------------------- fields */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}

.field__hint {
  font-size: 12px;
  color: var(--faint);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 14px;
  transition: border-color var(--fast), box-shadow var(--fast);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.input::placeholder {
  color: var(--faint);
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search .input {
  padding-left: 36px;
}

.search__icon {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--faint);
  pointer-events: none;
}

/* ---------------------------------------------------------- table */

.table-wrap {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  padding: 10px var(--s-5);
  text-align: left;
  background: var(--sunken);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.table th.is-sorted {
  color: var(--brand-ink);
}

.table th button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
}

.table td {
  padding: 13px var(--s-5);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table tbody tr {
  transition: background var(--fast);
}

.table tbody tr:hover {
  background: var(--brand-soft);
}

.table .num {
  text-align: right;
}

.table__actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  opacity: 0.35;
  transition: opacity var(--fast);
}

.table tbody tr:hover .table__actions {
  opacity: 1;
}

.tfoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-3) var(--s-5);
  font-size: 13px;
  color: var(--muted);
}

.pager {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pager button {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--fast);
}

.pager button:hover {
  border-color: var(--brand-line);
  color: var(--brand-ink);
}

.pager button[aria-current="page"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* ---------------------------------------------------------- stats */

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat__label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat__value {
  font-family: var(--serif);
  font-size: clamp(34px, 4vw, 56px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat__delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: color-mix(in srgb, var(--mint) 80%, var(--ink));
}

.stat--sm .stat__value {
  font-family: var(--mono);
  font-size: 24px;
  letter-spacing: -0.02em;
}

/* ---------------------------------------------------------- empty / skeleton */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-8) var(--s-5);
  text-align: center;
  color: var(--muted);
}

.empty__mark {
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  border: 1px dashed var(--line-strong);
  background: var(--sunken);
}

.empty__title {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink);
}

.empty__text {
  font-size: 14px;
  max-width: 34ch;
}

/**
 * 骨架屏。
 *
 * 灰条只是"还没印上去的字"，所以它压在真实版式的容器里（见 skeletons.js），
 * 自己不画边框也不画卡片；卡片轮廓由 .prod / .appcard / .panel 这些真容器提供。
 */
.skel {
  display: block;
  position: relative;
  overflow: hidden;
  flex: none;
  height: 11px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}

/* 一道很慢很淡的光带扫过去。快而亮的光带会把注意力抢走，加载态不该抢戏。 */
.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.45), transparent);
  animation: skel-shimmer 1.9s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

[data-theme="dark"] .skel::after {
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.06), transparent);
}

@keyframes skel-shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* 尺寸修饰符：对着真实排版的字号 / 控件高度来，换上内容时不跳行 */
.skel--tiny {
  height: 9px;
}

.skel--eyebrow {
  height: 9px;
  margin-bottom: 2px;
}

.skel--lede {
  height: 14px;
  max-width: 100%;
}

.skel--label {
  height: 9px;
}

.skel--h4 {
  height: 14px;
}

.skel--h3 {
  height: 18px;
  border-radius: var(--r-sm);
}

.skel--h2 {
  height: clamp(28px, 3.2vw, 44px);
  border-radius: var(--r-sm);
}

.skel--title {
  height: clamp(38px, 4.6vw, 64px);
  border-radius: var(--r-sm);
}

.skel--value {
  height: 26px;
  border-radius: var(--r-sm);
}

.skel--value-lg {
  height: clamp(40px, 4vw, 56px);
  border-radius: var(--r-sm);
}

.skel--pill {
  height: 20px;
}

.skel--btn {
  height: 42px;
  border-radius: var(--r-pill);
}

.skel--btn-sm {
  height: 30px;
  border-radius: var(--r-pill);
}

.skel--field {
  height: 40px;
  border-radius: var(--r-pill);
}

.skel--icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
}

.skel--icon-lg {
  width: 76px;
  height: 76px;
  border-radius: 20px;
}

.skel--icon-xl {
  width: 112px;
  height: 112px;
  border-radius: 30px;
}

/* 首页插画：占位跟成图一样大，图到位时不跳版 */
.skel--hero-art {
  display: block;
  width: auto;
  aspect-ratio: 612 / 720;
  height: clamp(260px, 30vw, 400px);
  border-radius: var(--r-lg);
}

/* 成段文字的占位：行距照着正文来 */
.skel-lines {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.skel-lines--title {
  gap: var(--s-3);
  align-self: stretch;
}

/* 区域内加载（列表、面板）用的多行占位 */
.skel-stack {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-2) 0;
}

.skel-row {
  height: 52px;
  border-radius: var(--r-sm);
}

/* 没有对应真实容器时的通用卡片轮廓（详情页侧栏、收据列表等） */
.skelcard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-5);
  border: 1px solid var(--edge);
  border-radius: var(--r-md);
  background: var(--surface);
}

.skelcard--tall {
  align-items: stretch;
  padding: var(--s-6);
}

.skelcard--tall .skel-lines {
  flex: 1;
  gap: var(--s-4);
}

.skel--spark {
  align-self: stretch;
  width: 100%;
  height: 34px;
  border-radius: var(--r-sm);
}

/* 深色墨块里的灰条要反过来提亮，否则整块只剩一片黑 */
.rmhero__big .skel {
  background: color-mix(in srgb, var(--on-ink-block) 16%, transparent);
}

.rmhero__big .skel::after {
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.1), transparent);
}

.rmhero__big .skel--value-lg {
  height: clamp(48px, 6vw, 78px);
}

/* 骨架用的"假卡片"不该有 hover 反应 */
.prod--skel,
.appcard--skel,
.job--skel {
  pointer-events: none;
}

.table--skel th,
.table--skel td {
  vertical-align: middle;
}

/* 整页骨架淡入：150ms 之后才挂，突然出现会像闪一下 */
.page-skel,
.skel-stack,
.skelcard {
  animation: skel-in 220ms var(--ease) both;
}

@keyframes skel-in {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skel::after {
    animation: none;
  }

  .page-skel,
  .skel-stack,
  .skelcard {
    animation: none;
  }
}

/* ---------------------------------------------------------- toast */

.toasts {
  position: fixed;
  right: var(--s-5);
  bottom: var(--s-5);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  min-width: 280px;
  max-width: 380px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-pop);
  animation: toast-in var(--base) var(--ease);
  pointer-events: auto;
}

.toast__mark {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--mint);
  color: #fff;
  font-size: 12px;
}

.toast--err .toast__mark {
  background: var(--danger);
}

.toast--copy .toast__mark {
  background: var(--brand);
}

.toast__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toast__title {
  font-size: 14px;
  font-weight: 600;
}

.toast__text {
  font-size: 13px;
  color: var(--muted);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

/* ---------------------------------------------------------- app icon */

.appicon {
  flex: none;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 15px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--on-brand);
  user-select: none;
}

/* 浅底图标（黄、薄荷）上用墨字，保证对比度 */
.appicon--ink {
  color: var(--ink);
}

.appicon--sm {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 16px;
}

.appicon--lg {
  width: 76px;
  height: 76px;
  border-radius: 21px;
  font-size: 30px;
}

/* ---------------------------------------------------------- misc */

.divider {
  height: 1px;
  border: 0;
  background: var(--line);
  margin: 0;
}

.lede {
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 62ch;
}

.muted {
  color: var(--muted);
}

.section-note {
  font-size: 14px;
  color: var(--muted);
  max-width: 56ch;
  line-height: 1.7;
}
