/* ============================================================
   柜玲珑 · 设计系统 v1.0
   金属高定美学：石墨黑 / 香槟铜 / 暖象牙纸白
   ============================================================ */
@font-face {
  font-family: 'Outfit';
  src: url('/assets/fonts/outfit-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('/assets/fonts/outfit-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('/assets/fonts/outfit-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('/assets/fonts/outfit-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --ink: #0E1215;
  --ink-2: #151B20;
  --ink-3: #1E252C;
  --ink-4: #2A323A;
  --paper: #F3F1EB;
  --paper-2: #FAF8F3;
  --card: #FFFFFF;
  --line: #E6E1D7;
  --line-2: #EFECE4;
  --text: #1A1E23;
  --text-2: #5B6169;
  --text-3: #8D939B;
  --copper: #B57E45;
  --copper-2: #D3A46C;
  --copper-3: #EBD7BC;
  --copper-soft: #F7EEDF;
  --teal: #2D5A60;
  --green: #3B7657;
  --green-soft: #E7F2EA;
  --red: #AE4F3B;
  --red-soft: #F8E9E5;
  --amber: #A97C32;
  --amber-soft: #F8EFDD;
  --blue: #44688B;
  --blue-soft: #E8EFF6;
  --violet: #6E5B85;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-xs: 0 1px 2px rgba(16, 20, 24, .05);
  --shadow-sm: 0 2px 6px rgba(16, 20, 24, .05), 0 14px 30px -22px rgba(16, 20, 24, .28);
  --shadow-md: 0 24px 60px -28px rgba(12, 16, 20, .45);
  --shadow-lg: 0 40px 100px -40px rgba(8, 12, 16, .55);
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
  --font-cn: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
  --num: 'Outfit', 'DIN Alternate', -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-cn);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.app-body {
  background:
    radial-gradient(900px 420px at 92% -6%, rgba(255, 244, 226, .85) 0%, transparent 62%),
    radial-gradient(760px 520px at -8% 100%, rgba(219, 228, 226, .5) 0%, transparent 60%),
    var(--paper);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
svg { display: block; }
::selection { background: var(--copper-3); color: var(--ink); }

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(90, 97, 105, .24); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(90, 97, 105, .4); }

/* ---------- 排版 ---------- */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -.01em; }
.num, .money { font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.muted { color: var(--text-3); }
.strong { font-weight: 600; }
.tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.text-right { text-align: right; }

/* ---------- 按钮 ---------- */
.btn-primary, .btn-ghost, .btn-dark, .btn-soft, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: 10px;
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s;
}
.btn-primary {
  color: #FFF9F0;
  background: linear-gradient(135deg, #C08A4E 0%, #A9713B 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 8px 18px -10px rgba(165, 112, 58, .8);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 14px 26px -12px rgba(165, 112, 58, .85); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-primary.danger { background: linear-gradient(135deg, #BB5B45, #9C4130); box-shadow: 0 8px 18px -10px rgba(155, 65, 48, .8); }
.btn-ghost {
  background: #fff; color: var(--text-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}
.btn-ghost:hover { color: var(--text); border-color: #D7D1C5; background: #FDFBF7; }
.btn-dark {
  background: linear-gradient(140deg, #222A31, #12171B);
  color: #F5F1E8;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 10px 22px -14px rgba(10, 14, 18, .9);
}
.btn-dark:hover { transform: translateY(-1px); }
.btn-soft { background: var(--copper-soft); color: #8A5E2F; }
.btn-soft:hover { background: #F2E2CB; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #F3D9D2; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 11.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 9px; }
.btn-primary i, .btn-ghost i, .btn-dark i, .btn-soft i { font-size: 15px; }

.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(226, 221, 210, .8);
  transition: .18s;
}
.icon-btn:hover { color: var(--text); background: #fff; box-shadow: var(--shadow-xs); }
.icon-btn i { font-size: 18px; }
.icon-btn.has-dot em {
  position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--copper); box-shadow: 0 0 0 2px #fff;
}

/* ---------- 表单控件 ---------- */
.inp, select.inp, textarea.inp {
  width: 100%; height: 40px; padding: 0 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  outline: none; transition: border-color .16s, box-shadow .16s, background .16s;
  font-size: 13px; color: var(--text);
}
textarea.inp { height: auto; padding: 10px 12px; line-height: 1.6; resize: vertical; }
select.inp { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238D939B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }
.inp:focus, select.inp:focus, textarea.inp:focus { border-color: var(--copper-2); box-shadow: 0 0 0 3px rgba(181, 126, 69, .12); }
.inp::placeholder { color: #A9AEB5; }
.inp:disabled { background: #F6F4EF; color: var(--text-3); }
.inp.code { font-family: 'SFMono-Regular', Consolas, monospace; font-size: 12px; background: #FBF9F5; }

.field label, .fld label { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); margin-bottom: 7px; font-weight: 500; }
.field label em, .fld label em { color: var(--red); font-style: normal; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 16px; pointer-events: none; }
.input-wrap input, .input-wrap select {
  width: 100%; height: 44px; padding: 0 38px 0 38px;
  border: 1px solid var(--line); border-radius: 11px; background: #fff;
  outline: none; transition: .18s; font-size: 13.5px;
}
.input-wrap input:focus, .input-wrap select:focus { border-color: var(--copper-2); box-shadow: 0 0 0 3px rgba(181, 126, 69, .12); }
.input-wrap .eye { position: absolute; right: 8px; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; color: var(--text-3); border-radius: 7px; }
.input-wrap .eye:hover { background: var(--paper); color: var(--text-2); }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check > span {
  width: 16px; height: 16px; border-radius: 5px; border: 1px solid #CFC8BA; background: #fff;
  display: inline-flex; align-items: center; justify-content: center; transition: .15s; flex: 0 0 auto;
}
.check input:checked + span { background: var(--copper); border-color: var(--copper); }
.check input:checked + span::after { content: ''; width: 8px; height: 4px; border-left: 1.7px solid #fff; border-bottom: 1.7px solid #fff; transform: rotate(-45deg) translateY(-1px); }

.switch-line { display: inline-flex; align-items: center; gap: 9px; height: 36px; cursor: pointer; font-size: 12.5px; color: var(--text-2); }
.switch-line input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { width: 40px; height: 22px; border-radius: 20px; background: #D9D5CC; position: relative; transition: .2s; flex: 0 0 auto; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: .2s; }
.switch-line input:checked + .switch-track { background: linear-gradient(135deg, var(--copper-2), var(--copper)); }
.switch-line input:checked + .switch-track::after { transform: translateX(18px); }
.switch-line b { font-weight: 500; }

.form-error { color: var(--red); font-size: 12px; min-height: 16px; margin-top: 6px; }

/* ---------- 状态胶囊 ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
  border-radius: 7px; font-size: 11.5px; font-weight: 500; white-space: nowrap;
  background: #F1F0EC; color: var(--text-2);
}
.pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .7; }
.pill.success { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--amber-soft); color: var(--amber); }
.pill.danger { background: var(--red-soft); color: var(--red); }
.pill.info { background: var(--blue-soft); color: var(--blue); }
.pill.primary { background: var(--copper-soft); color: #8D5F2E; }
.pill.muted { background: #F0EFEB; color: #71777F; }
.pill.violet { background: #F0EBF5; color: var(--violet); }
.pill.plain::before { display: none; }

.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 11.5px; background: #F4F2ED; color: var(--text-2); white-space: nowrap;
}
.tag.copper { background: var(--copper-soft); color: #8D5F2E; }
.tag.line { background: transparent; border: 1px solid var(--line); }

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(145deg, #2B323A, #12171B);
  color: #F0DFC6; font-weight: 600; font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14);
  flex: 0 0 auto;
}
.avatar.lg { width: 54px; height: 54px; border-radius: 16px; font-size: 20px; }

/* ---------- 通用动画 ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { 0% { background-position: -340px 0; } 100% { background-position: 340px 0; } }
.fade-up { animation: fadeUp .4s ease both; }

/* ---------- 空状态 / 骨架 ---------- */
.empty-state { padding: 46px 20px; text-align: center; }
.empty-ico { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: #F5F2EC; color: #B3AA9B; font-size: 24px; }
.empty-state b { display: block; font-size: 13.5px; color: var(--text-2); font-weight: 500; }
.empty-state p { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.sk-table { padding: 6px 0; }
.sk-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr .8fr; gap: 20px; padding: 15px 18px; border-bottom: 1px solid var(--line-2); }
.sk-row span { height: 12px; border-radius: 6px; background: linear-gradient(90deg, #F1EEE8 25%, #F8F6F1 37%, #F1EEE8 63%); background-size: 680px 100%; animation: shimmer 1.3s infinite linear; }

/* ---------- 页脚 ---------- */
.app-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 28px 22px; color: #9AA0A7; font-size: 11px; letter-spacing: .2px;
}
.app-foot span:last-child { font-family: var(--num); }

/* ---------- 打印 ---------- */
@media print {
  .sidebar, .topbar, .app-foot, .page-head-actions, .toolbar, .pager, .share-bar { display: none !important; }
  .app-main { margin: 0 !important; }
  .main { padding: 0 !important; }
  body { background: #fff; }
}
