/* ============ 白龙马AIGC学堂 · 设计系统 base.css ============ */
/* 标准色：瑞金 #C9A24B / 朱砂红 #A61B1B / 墨棕 #4A3728 / 米色 #F9F5ED */
:root {
  --paper: #F9F5ED;
  --paper-2: #F2EBDD;
  --paper-3: #EAE1CF;
  --card: #FDFBF6;
  --ink: #4A3728;
  --ink-2: #5C4735;
  --ink-soft: #8D7B66;
  --gold: #C9A24B;
  --gold-deep: #A07E2F;
  --gold-mist: #F3E9D2;
  --cinnabar: #A61B1B;
  --cinnabar-2: #C13A3A;
  --brown: #4A3728;
  --brown-deep: #35271C;
  --line: #E2D8C2;
  --line-2: #D3C5A8;
  --shadow: 0 10px 30px rgba(74, 55, 40, .13);
  --font-display: "Noto Serif SC", "Source Han Serif SC", "STZhongsong", "SimSun", serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "微软雅黑", sans-serif;
  --font-kai: "KaiTi", "STKaiti", "楷体", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 米色宣纸纹理 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.38 0 0 0 0 0.29 0 0 0 0 0.18 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
#app, .login-wrap, .shell, .mask { position: relative; z-index: 1; }

::selection { background: rgba(201, 162, 75, .3); }

/* ---------------- 按钮 ---------------- */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  background: linear-gradient(160deg, #D8B767, var(--gold) 55%, #B8903B);
  color: #35271C;
  box-shadow: 0 2px 8px rgba(160, 126, 47, .35), inset 0 1px 0 rgba(255, 255, 255, .38);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 5px 14px rgba(160, 126, 47, .4); }
.btn:active { transform: translateY(0); }
.btn.danger { background: linear-gradient(160deg, #C13A3A, var(--cinnabar)); color: #FBF3E4; box-shadow: 0 2px 8px rgba(166, 27, 27, .32), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn.ghost { background: transparent; color: var(--ink-2); border-color: var(--line-2); box-shadow: none; }
.btn.ghost:hover { border-color: var(--gold); color: var(--gold-deep); background: rgba(201, 162, 75, .08); }
.btn.sm { padding: 5px 12px; font-size: 12.5px; border-radius: 6px; }
.btn.block { width: 100%; padding: 12px; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.link-btn {
  appearance: none; background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 12.5px; font-weight: 600;
  color: var(--gold-deep); padding: 3px 6px; border-radius: 4px;
}
.link-btn:hover { background: var(--gold-mist); }
.link-btn.warn { color: var(--cinnabar); }
.link-btn.warn:hover { background: #F5DFDD; }
.link-btn + .link-btn { margin-left: 2px; }

/* ---------------- 表单 ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); letter-spacing: .06em; }
.field > label .req { color: var(--cinnabar); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--ink);
  background: #FFFEFA;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 9px 12px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 75, .18);
}
.textarea { resize: vertical; min-height: 72px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238D7B66' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; cursor: pointer; }
.hint { font-size: 12px; color: var(--ink-soft); }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.fgrid .full { grid-column: 1 / -1; }

/* ---------------- 卡片 / 面板 ---------------- */
.card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(74, 55, 40, .05);
}
.panel { padding: 18px 20px; }
.panel-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.panel-h h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: .02em; display: flex; align-items: center; gap: 8px; }
.panel-h h3::before { content: ''; width: 8px; height: 8px; background: var(--cinnabar); border-radius: 2px; transform: rotate(45deg); flex: none; }

/* ---------------- 表格 ---------------- */
.twrap { border: 1px solid var(--line); border-radius: 10px; overflow: auto; background: #FFFEFA; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tb thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--brown-deep); color: #EDE2CC;
  text-align: left; font-weight: 600; font-size: 12px;
  letter-spacing: .1em; padding: 11px 14px; white-space: nowrap;
}
.tb tbody td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tb tbody tr { transition: background .12s; }
.tb tbody tr:hover { background: #F5EEDF; }
.tb .wrap-cell { white-space: normal; min-width: 140px; line-height: 1.5; }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; text-align: right; }
.money { font-family: var(--font-display); font-weight: 700; color: #7E601B; font-variant-numeric: tabular-nums; text-align: right; }
.money.pending { color: var(--cinnabar); }
.cell-main { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: 12px; color: var(--ink-soft); margin-top: 1px; }

/* ---------------- 徽章 / 印章 ---------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2.5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid; line-height: 1.5; white-space: nowrap; }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .85; }
.b-paid { color: #6E5312; background: #F3E9D2; border-color: #DDC globalizeA267; }
.b-paid { color: #6E5312; background: #F3E9D2; border-color: #D9C58C; }
.b-part { color: #8A4A12; background: #F7E8D3; border-color: #E2C8A0; }
.b-none { color: var(--cinnabar); background: #F5DFDD; border-color: #E0B8B4; }
.b-info { color: #1D5C8A; background: #E4EEF5; border-color: #B5CFDF; }
.b-off { color: #6E6355; background: #EFE9DC; border-color: #D5CBB6; }
.b-plain { color: var(--ink-2); background: transparent; border-color: var(--line-2); }
.b-plain::before { display: none; }

.seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 8px; flex: none;
  background: linear-gradient(150deg, #C13A3A, var(--cinnabar) 60%, #8A1414);
  color: #FBF3E4; font-family: var(--font-kai); font-weight: 700;
  font-size: 15px; line-height: 1.1; text-align: center; padding: 3px;
  letter-spacing: .05em;
  box-shadow: inset 0 0 0 2px rgba(251, 243, 228, .5), inset 0 0 0 4px rgba(138, 20, 20, .55), 0 2px 6px rgba(53, 39, 28, .3);
  transform: rotate(-3deg);
}
.seal.lg { width: 56px; height: 56px; font-size: 19px; border-radius: 10px; }
.seal img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; transform: rotate(3deg); }

.stamp {
  display: inline-block; padding: 2px 9px; border-radius: 6px;
  border: 1.5px solid currentColor; font-family: var(--font-kai);
  font-size: 12.5px; font-weight: 700; letter-spacing: .18em;
  transform: rotate(-4deg); opacity: .9;
}

/* ---------------- 弹窗 ---------------- */
.mask { position: fixed; inset: 0; background: rgba(43, 32, 22, .52); backdrop-filter: blur(2px); display: none; align-items: flex-start; justify-content: center; z-index: 100; padding: 44px 16px; overflow: auto; }
.mask.on { display: flex; }
.modal {
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: 12px; width: 660px; max-width: 100%;
  box-shadow: 0 30px 70px rgba(30, 22, 15, .4);
  animation: pop .22s ease;
}
.modal.sm { width: 440px; }
.modal.lg { width: 780px; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 15px 22px; border-bottom: 3px double var(--line-2); }
.modal-h h3 { font-family: var(--font-display); font-size: 17px; }
.modal-x { appearance: none; border: none; background: none; font-size: 20px; color: var(--ink-soft); cursor: pointer; line-height: 1; padding: 4px; border-radius: 4px; }
.modal-x:hover { color: var(--cinnabar); background: #F5DFDD; }
.modal-b { padding: 20px 22px; }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: #F7F1E4; border-radius: 0 0 12px 12px; }

/* ---------------- 提示 ---------------- */
#toast { position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: var(--brown); color: #F2EADA; padding: 10px 20px; border-radius: 8px;
  font-size: 13.5px; box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
  border-left: 3px solid var(--gold); animation: rise .25s ease; max-width: 80vw;
}
.toast.err { border-left-color: var(--cinnabar-2); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.empty { text-align: center; padding: 46px 20px; color: var(--ink-soft); }
.empty .glyph { font-family: var(--font-kai); font-size: 34px; color: var(--line-2); letter-spacing: .3em; margin-bottom: 8px; }

/* ---------------- 杂项 ---------------- */
.vtext { writing-mode: vertical-rl; letter-spacing: .38em; }
.muted { color: var(--ink-soft); }
.kai { font-family: var(--font-kai); }
.serif { font-family: var(--font-display); }
.flex { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
summary.sum-h { cursor: pointer; font-weight: 600; color: var(--ink-2); padding: 4px 0; }
.divider { border: none; border-top: 1px dashed var(--line-2); margin: 16px 0; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #D6C9A9; border-radius: 8px; border: 2px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: #C3B288; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 900px) {
  .fgrid { grid-template-columns: 1fr; }
}
