/* ===========================================================
   婚礼账本 · 样式
   暖米色底 + 玫瑰棕主色 + 柔和纸感卡片
   =========================================================== */

:root {
  --bg: #F6F1EC;
  --bg-2: #FBF7F3;
  --surface: #FFFFFF;
  --surface-soft: #FCF9F6;
  --line: #EDE3DA;
  --line-strong: #E0D2C6;

  --text: #2B2521;
  --text-2: #6C6058;
  --text-3: #9E9289;

  --rose: #B87B6C;
  --rose-deep: #9A5C4E;
  --rose-soft: #F6E7E1;
  --sage: #7A9880;
  --sage-soft: #E8F0E9;
  --gold: #B99A5B;
  --gold-soft: #F6EEDA;
  --danger: #C0554A;
  --danger-soft: #FBEAE7;

  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 11px;

  --shadow-xs: 0 1px 2px rgba(70, 45, 32, .05);
  --shadow-sm: 0 1px 3px rgba(70, 45, 32, .05), 0 8px 20px -16px rgba(70, 45, 32, .38);
  --shadow-md: 0 2px 6px rgba(70, 45, 32, .05), 0 18px 38px -24px rgba(70, 45, 32, .45);

  --font-display: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(.2, .7, .3, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 8% -8%, #F8EAE2 0%, rgba(248, 234, 226, 0) 62%),
    radial-gradient(900px 460px at 94% 2%, #F1EBDF 0%, rgba(241, 235, 223, 0) 58%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: .2px; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }
input, select { font-family: inherit; font-size: 14px; color: var(--text); }
[hidden] { display: none !important; }

::selection { background: var(--rose-soft); color: var(--rose-deep); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #DED0C4; border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #CDBBAE; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================ 启动遮罩 ============================ */

.boot {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; color: var(--text-3); font-size: 13px; letter-spacing: 1px;
  background: var(--bg); z-index: 90;
}
.boot-mark {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--rose-soft);
  border-top-color: var(--rose);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================ 登录 / 初始化 ============================ */

.auth-screen {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 20px 28px;
  position: relative;
}
.auth-deco {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(560px 320px at 18% 12%, rgba(214, 168, 152, .22), transparent 70%),
    radial-gradient(620px 360px at 84% 78%, rgba(185, 154, 91, .14), transparent 72%);
}

.auth-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow-md);
  padding: 34px 32px 30px;
}
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-mark {
  width: 52px; height: 52px; margin: 0 auto 16px;
  border-radius: 16px;
  background: linear-gradient(145deg, #C98F7F, #A96355);
  display: grid; place-items: center;
  box-shadow: 0 10px 22px -10px rgba(169, 99, 85, .7);
}
.auth-mark svg { width: 26px; height: 26px; fill: #fff; }
.auth-brand h1 {
  font-family: var(--font-display);
  font-size: 25px; letter-spacing: 2px; font-weight: 600;
  color: var(--text);
}
.auth-sub { margin-top: 8px; color: var(--text-3); font-size: 13px; letter-spacing: .3px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .field-row { gap: 12px; }
.auth-foot {
  position: relative; z-index: 1;
  margin-top: 22px; color: var(--text-3); font-size: 12px; letter-spacing: 1.4px;
}
.setup-tip {
  color: var(--text-2); font-size: 12.5px; line-height: 1.7;
  background: var(--surface-soft); border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.form-error {
  color: var(--danger); font-size: 12.5px;
  background: var(--danger-soft); border-radius: 9px; padding: 8px 11px;
}

/* ============================ 通用控件 ============================ */

.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.field > span {
  font-size: 11.5px; letter-spacing: .8px; color: var(--text-3); font-weight: 600;
}
.field input, .field select {
  height: 42px; padding: 0 13px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s var(--ease), background-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239E9289' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 14px;
  cursor: pointer;
}
.field input:hover { border-color: var(--line-strong); }
.field input:focus, .field select:focus {
  background-color: #fff;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(184, 123, 108, .13);
}
.field input::placeholder { color: #BCB0A7; }
.field.grow { flex: 1.6; }

.field-row { display: flex; gap: 12px; }
.field-row > .field { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 42px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; letter-spacing: .4px;
  cursor: pointer; white-space: nowrap;
  transition: transform .12s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(160deg, #C58A79, #A96455);
  color: #fff;
  box-shadow: 0 8px 18px -12px rgba(154, 92, 78, .95), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.btn-primary:hover { box-shadow: 0 12px 24px -12px rgba(154, 92, 78, .95), inset 0 1px 0 rgba(255, 255, 255, .25); }

.btn-ghost {
  background: #fff; border-color: var(--line-strong); color: var(--text-2);
}
.btn-ghost:hover { border-color: var(--text-3); color: var(--text); background: var(--surface-soft); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #A94A40; }
.btn-danger-ghost { background: #fff; border-color: #F0D3CE; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }

.btn-block { width: 100%; }
.btn-sm { height: 34px; padding: 0 13px; font-size: 12.5px; border-radius: 9px; }

.icon-btn {
  width: 36px; height: 36px; padding: 0;
  display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; border-radius: 10px;
  color: var(--text-2); cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--surface-soft); border-color: var(--line); color: var(--text); }

/* ============================ 顶栏 ============================ */

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(250, 246, 242, .82);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid rgba(224, 210, 198, .7);
}
.topbar-inner {
  max-width: 1160px; margin: 0 auto;
  padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  width: 36px; height: 36px; flex: none;
  border-radius: 11px;
  background: linear-gradient(145deg, #C98F7F, #A96355);
  display: grid; place-items: center;
  box-shadow: 0 8px 16px -10px rgba(169, 99, 85, .8);
}
.brand-mark svg { width: 19px; height: 19px; fill: #fff; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong {
  font-family: var(--font-display);
  font-size: 16.5px; letter-spacing: 1px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-text span {
  font-size: 10px; letter-spacing: 2.4px; color: var(--text-3); text-transform: uppercase;
}
.topbar-actions { display: flex; align-items: center; gap: 6px; }

.user-chip {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 10px 0 5px;
  border-radius: 99px; border: 1px solid transparent;
  cursor: pointer; user-select: none;
  transition: background .15s var(--ease), border-color .15s var(--ease);
  outline: none;
}
.user-chip:hover, .user-chip:focus-visible { background: #fff; border-color: var(--line); }
.avatar {
  width: 28px; height: 28px; flex: none;
  border-radius: 50%;
  background: linear-gradient(145deg, #E7D3CA, #D3B5A8);
  color: #7A4A3E;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--text-2); max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { width: 14px; height: 14px; color: var(--text-3); transition: transform .18s var(--ease); }
.user-chip.open .chev { transform: rotate(180deg); }

.menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 178px; padding: 6px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98);
  transition: opacity .16s var(--ease), transform .16s var(--ease), visibility .16s;
  z-index: 40;
}
.user-chip.open .menu { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.menu-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 9px 10px;
  background: none; border: 0; border-radius: 9px;
  font-size: 13px; color: var(--text-2); text-align: left; cursor: pointer;
  transition: background .13s var(--ease), color .13s var(--ease);
}
.menu-item svg { width: 16px; height: 16px; color: var(--text-3); transition: color .13s; }
.menu-item:hover { background: var(--surface-soft); color: var(--text); }
.menu-item:hover svg { color: var(--rose); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger svg { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-soft); }
.menu-sep { height: 1px; margin: 5px 6px; background: var(--line); }

/* ============================ 页面容器 ============================ */

.page {
  max-width: 1160px; margin: 0 auto;
  padding: 26px 24px 48px;
  display: flex; flex-direction: column; gap: 18px;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.col-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.col-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; position: sticky; top: 78px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
}
.card-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.card-head h2 {
  font-size: 15px; font-weight: 700; letter-spacing: .6px;
  display: flex; align-items: center; gap: 8px;
}
.card-sub { font-size: 11.5px; color: var(--text-3); letter-spacing: .3px; }

.count-badge {
  display: inline-grid; place-items: center;
  min-width: 21px; height: 19px; padding: 0 6px;
  border-radius: 99px;
  background: var(--rose-soft); color: var(--rose-deep);
  font-size: 11px; font-weight: 700; letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

/* ============================ 预算概览 ============================ */

.hero {
  position: relative; overflow: hidden;
  border-radius: 26px;
  background:
    radial-gradient(720px 300px at 88% -40%, rgba(201, 164, 106, .16), transparent 70%),
    linear-gradient(150deg, #FFFFFF 0%, #FDF8F5 58%, #FAF1EC 100%);
  border: 1px solid rgba(224, 205, 194, .9);
  box-shadow: 0 1px 2px rgba(70, 45, 32, .04), 0 26px 50px -38px rgba(120, 70, 50, .7);
  padding: 26px 28px 24px;
}
.hero::after {
  content: "";
  position: absolute; right: -70px; top: -70px;
  width: 260px; height: 260px; border-radius: 50%;
  border: 1px solid rgba(184, 123, 108, .16);
  box-shadow: 0 0 0 26px rgba(184, 123, 108, .05), 0 0 0 54px rgba(184, 123, 108, .03);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.hero-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 26px; flex-wrap: wrap; }
.hero-main { flex: 1 1 300px; min-width: 0; }
.hero-label {
  font-size: 12px; letter-spacing: 2px; color: var(--text-2); font-weight: 600;
  display: flex; align-items: center; gap: 7px;
}
.hero-label::before {
  content: ""; width: 16px; height: 2px; border-radius: 2px; background: var(--rose);
}
.hero-remaining {
  font-family: var(--font-display);
  font-size: clamp(38px, 6.4vw, 52px);
  line-height: 1.14; letter-spacing: 1px;
  margin: 6px 0 16px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  transition: color .2s var(--ease);
}
.hero-remaining.over { color: var(--danger); }

.progress {
  position: relative;
  height: 9px; border-radius: 99px;
  background: #F1E7DF;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(120, 80, 60, .08);
}
.progress-bar {
  height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, #D2A08E 0%, #B87B6C 55%, #A26455 100%);
  transition: width .6s var(--ease), background .3s var(--ease);
}
.progress-bar.warn { background: linear-gradient(90deg, #D9A57F, #C4805F); }
.progress-bar.over { background: linear-gradient(90deg, #CE7264, #B14A3E); }

.hero-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px;
  font-size: 12px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); flex: none; }

.hero-side { display: flex; gap: 26px; padding-bottom: 6px; }
.mini-stat { display: flex; flex-direction: column; gap: 3px; min-width: 74px; }
.mini-stat span { font-size: 11px; letter-spacing: 1px; color: var(--text-3); }
.mini-stat strong {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 600; letter-spacing: .4px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

/* ============================ 记账表单 ============================ */

.expense-form { display: flex; flex-direction: column; gap: 14px; }

.amount-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.amount-row:focus-within {
  background: #fff; border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(184, 123, 108, .12);
}
.amount-row .currency {
  font-family: var(--font-display);
  font-size: 22px; color: var(--text-3); padding-top: 2px;
}
.amount-row input {
  flex: 1; min-width: 0;
  height: 58px;
  border: 0; background: transparent; outline: none;
  font-family: var(--font-display);
  font-size: 32px; letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.amount-row input::placeholder { color: #D7CAC0; font-size: 26px; }
.amount-row input::-webkit-outer-spin-button,
.amount-row input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.amount-row input[type=number] { -moz-appearance: textfield; appearance: textfield; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 33px; padding: 0 12px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12.5px; color: var(--text-2);
  cursor: pointer;
  transition: all .14s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.chip::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--c, var(--rose));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--rose)) 16%, transparent);
  flex: none;
}
.chip:hover { border-color: var(--line-strong); color: var(--text); transform: translateY(-1px); }
.chip.active {
  background: var(--rose-soft);
  border-color: rgba(184, 123, 108, .5);
  color: var(--rose-deep);
  font-weight: 600;
}
.chip-add {
  border-style: dashed; color: var(--text-3); padding: 0 11px;
}
.chip-add::before { display: none; }
.chip-add:hover { color: var(--rose); border-color: var(--rose); }

.form-bottom { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.owner-field { flex: 1 1 150px; max-width: 190px; }
.quick-owners { display: flex; gap: 6px; padding-bottom: 6px; flex-wrap: wrap; }
.quick-owner {
  height: 28px; padding: 0 10px;
  border-radius: 8px; border: 1px dashed var(--line-strong);
  background: transparent; color: var(--text-3);
  font-size: 12px; cursor: pointer;
  transition: all .14s var(--ease);
}
.quick-owner:hover { color: var(--rose-deep); border-color: var(--rose); background: var(--rose-soft); }
.form-bottom .btn-primary { margin-left: auto; height: 44px; padding: 0 22px; }

/* ============================ 花销明细 ============================ */

.list-head { margin-bottom: 10px; align-items: center; }
.list-head h2 { margin-right: auto; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-wrap {
  position: relative; display: flex; align-items: center;
}
.search-wrap svg {
  position: absolute; left: 11px; width: 15px; height: 15px; color: var(--text-3); pointer-events: none;
}
.search-wrap input {
  width: 172px; height: 34px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface-soft); outline: none;
  font-size: 12.5px;
  transition: all .15s var(--ease);
}
.search-wrap input:focus { background: #fff; border-color: var(--rose); width: 200px; }
.select-sm {
  height: 34px; padding: 0 26px 0 10px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239E9289' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 7px center / 13px;
  font-size: 12.5px; color: var(--text-2);
  outline: none; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.select-sm:focus { border-color: var(--rose); background-color: #fff; }

.list-total {
  font-size: 12px; color: var(--text-3); letter-spacing: .4px;
  padding: 0 4px 10px;
  font-variant-numeric: tabular-nums;
}
.expense-list { display: flex; flex-direction: column; }

.exp-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto 62px;
  align-items: center; gap: 14px;
  padding: 11px 10px;
  border-radius: 13px;
  border-top: 1px solid transparent;
  transition: background .14s var(--ease);
}
.exp-row + .exp-row { border-top-color: #F5EEE8; }
.exp-row:hover { background: var(--surface-soft); }
.exp-row:hover + .exp-row { border-top-color: transparent; }

.exp-date {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 5px 0;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  line-height: 1.15;
}
.exp-row:hover .exp-date { background: #fff; }
.exp-date strong {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.exp-date span { font-size: 10px; color: var(--text-3); letter-spacing: .3px; }

.exp-main { min-width: 0; }
.exp-note {
  font-size: 13.8px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.exp-note.muted { color: var(--text-3); font-weight: 500; }
.exp-sub {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 3px;
  font-size: 11.5px; color: var(--text-3);
}
.cat-pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 20px; padding: 0 8px;
  border-radius: 99px;
  font-size: 11px; font-weight: 600;
  color: var(--c, var(--rose));
  background: color-mix(in srgb, var(--c, var(--rose)) 12%, #fff);
}
.exp-owner {
  padding: 0 7px; height: 19px; line-height: 19px;
  border-radius: 6px; background: #F4F0EC; color: var(--text-2);
  font-size: 11px;
}
.exp-by { color: #B4A79E; }

.exp-amount {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600; letter-spacing: .3px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}
.exp-actions { display: flex; gap: 2px; opacity: .38; transition: opacity .14s var(--ease); justify-content: flex-end; }
.exp-row:hover .exp-actions, .exp-row:focus-within .exp-actions { opacity: 1; }
.exp-actions .icon-btn { width: 28px; height: 28px; }
.exp-actions .icon-btn svg { width: 15px; height: 15px; }
.exp-actions .icon-btn:hover { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

.empty {
  padding: 34px 16px 30px;
  text-align: center; color: var(--text-3);
}
.empty svg { width: 42px; height: 42px; margin-bottom: 10px; color: #DCCFC5; }
.empty p { font-size: 13px; }
.empty small { display: block; margin-top: 4px; font-size: 11.5px; color: #B9ADA4; }

/* ============================ 统计 ============================ */

.donut-wrap { position: relative; display: grid; place-items: center; padding: 4px 0 18px; }
.donut {
  width: 168px; height: 168px; border-radius: 50%;
  background: conic-gradient(#EDE3DA 0 100%);
  position: relative;
  transition: background .5s var(--ease);
}
.donut::after {
  content: ""; position: absolute; inset: 27px;
  border-radius: 50%; background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(237, 227, 218, .7);
}
.donut-center {
  position: absolute; z-index: 2; text-align: center;
  display: flex; flex-direction: column; gap: 2px;
  pointer-events: none;
}
.donut-center span { font-size: 10.5px; letter-spacing: 1.4px; color: var(--text-3); }
.donut-center strong {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 600; letter-spacing: .3px;
  font-variant-numeric: tabular-nums;
}

.legend { display: flex; flex-direction: column; gap: 2px; }
.legend-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: 9px;
  cursor: pointer;
  transition: background .13s var(--ease);
  font-size: 12.5px;
}
.legend-item:hover { background: var(--surface-soft); }
.legend-item.active { background: var(--rose-soft); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--c); }
.legend-name { flex: 1; min-width: 0; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-val { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; font-size: 12px; }
.legend-pct { width: 38px; text-align: right; color: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }

.owner-list { display: flex; flex-direction: column; gap: 11px; }
.owner-row { display: flex; flex-direction: column; gap: 5px; }
.owner-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.owner-top span { color: var(--text-2); }
.owner-top strong { font-family: var(--font-display); font-size: 14px; font-variant-numeric: tabular-nums; }
.owner-bar { height: 6px; border-radius: 99px; background: #F3EBE5; overflow: hidden; }
.owner-bar i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #D7AC9C, #B87B6C);
  transition: width .5s var(--ease);
}

/* ============================ 动态记录 ============================ */

.logs-card { padding-bottom: 12px; }
.timeline { position: relative; padding-left: 6px; }
.timeline::before {
  content: ""; position: absolute; left: 19px; top: 12px; bottom: 12px;
  width: 1px; background: linear-gradient(180deg, var(--line), rgba(237, 227, 218, .2));
}
.tl-item {
  position: relative;
  display: flex; gap: 13px;
  padding: 9px 8px 9px 0;
  border-radius: 11px;
  transition: background .13s var(--ease);
}
.tl-item:hover { background: var(--surface-soft); }
.tl-dot {
  position: relative; z-index: 1;
  width: 27px; height: 27px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text-3);
}
.tl-dot svg { width: 13px; height: 13px; }
.tl-dot.a-create { color: var(--rose); border-color: #F0DAD2; background: #FDF4F1; }
.tl-dot.a-update { color: var(--gold); border-color: #EEE1C6; background: #FCF8EF; }
.tl-dot.a-delete { color: var(--danger); border-color: #F2D9D4; background: #FDF3F1; }
.tl-dot.a-cat { color: var(--sage); border-color: #DCE7DC; background: #F4F8F4; }
.tl-dot.a-user { color: #7C86A8; border-color: #DDE1EE; background: #F5F6FB; }
.tl-body { min-width: 0; padding-top: 2px; }
.tl-text {
  font-size: 13px; color: var(--text-2); line-height: 1.6;
  word-break: break-word;
}
.tl-text strong { color: var(--text); font-weight: 600; margin-right: 5px; }
.tl-time {
  display: block; margin-top: 2px;
  font-size: 11px; color: #B4A79E;
  font-variant-numeric: tabular-nums;
}
.logs-foot { display: flex; justify-content: center; padding: 12px 0 4px; }

.page-foot {
  text-align: center;
  font-family: var(--font-display);
  font-size: 12.5px; letter-spacing: 2px; color: #BCAFA5;
  padding: 12px 0 4px;
}

/* ============================ 弹窗 ============================ */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(52, 38, 32, .34);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn .16s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%; max-width: 500px;
  max-height: calc(100vh - 60px);
  display: flex; flex-direction: column;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 30px 70px -30px rgba(60, 35, 25, .6);
  animation: popIn .2s var(--ease);
  overflow: hidden;
}
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal.wide { max-width: 580px; }

.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 15.5px; font-weight: 700; letter-spacing: .5px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}
.modal-foot .spacer { flex: 1; }
.modal-form { display: flex; flex-direction: column; gap: 13px; }
.confirm-text { font-size: 13.5px; color: var(--text-2); line-height: 1.7; }
.confirm-text b { color: var(--text); }

.amount-inline {
  display: flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
.amount-inline span { color: var(--text-3); font-family: var(--font-display); }
.amount-inline input { flex: 1; border: 0; background: none; outline: none; font-size: 18px; font-family: var(--font-display); }

/* 分类管理 */
.cat-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cat-add input[type=text] {
  flex: 1 1 180px; height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); outline: none;
}
.cat-add input[type=text]:focus { border-color: var(--rose); background: #fff; }
.color-row { display: flex; gap: 5px; }
.color-dot {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer;
  transition: transform .12s var(--ease);
  padding: 0;
}
.color-dot:hover { transform: scale(1.12); }
.color-dot.sel { border-color: var(--text); box-shadow: 0 0 0 2px #fff inset; }

.cat-list { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.cat-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 9px; border-radius: 10px;
  border: 1px solid transparent;
}
.cat-row:hover { background: var(--surface-soft); border-color: var(--line); }
.cat-row .legend-dot { width: 10px; height: 10px; }
.cat-row input {
  flex: 1; min-width: 0; height: 32px; padding: 0 9px;
  border: 1px solid transparent; border-radius: 8px;
  background: transparent; outline: none; font-size: 13px; font-weight: 500;
}
.cat-row input:hover { background: #fff; border-color: var(--line); }
.cat-row input:focus { background: #fff; border-color: var(--rose); }
.cat-row .cat-count { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 成员 */
.member-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-soft);
}
.member-row .avatar { width: 32px; height: 32px; font-size: 13px; }
.member-info { flex: 1; min-width: 0; }
.member-name { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.member-meta { font-size: 11px; color: var(--text-3); }
.role-tag {
  font-size: 10px; font-weight: 700; letter-spacing: .5px;
  padding: 1px 6px; border-radius: 5px;
  background: var(--rose-soft); color: var(--rose-deep);
}
.role-tag.member { background: #F1F0EE; color: var(--text-3); }
.section-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 12px;
  font-size: 11.5px; letter-spacing: 1.2px; color: var(--text-3);
}
.section-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ============================ 轻提示 ============================ */

.toast-wrap {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  z-index: 100;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-radius: 99px;
  background: rgba(43, 37, 33, .93);
  color: #fff; font-size: 13px; letter-spacing: .3px;
  box-shadow: 0 12px 30px -14px rgba(0, 0, 0, .6);
  animation: toastIn .22s var(--ease);
}
.toast.err { background: rgba(176, 68, 56, .95); }
.toast.out { animation: toastOut .2s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px) scale(.97); } }

/* ============================ 响应式 ============================ */

@media (max-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .col-side { position: static; order: 2; }
  .hero-side { gap: 20px; }
}

@media (max-width: 720px) {
  .page { padding: 16px 14px 36px; gap: 14px; }
  .topbar-inner { padding: 10px 14px; gap: 8px; }
  .brand { gap: 9px; }
  .brand-text strong { font-size: 15px; letter-spacing: .2px; }
  .brand-text span { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .card { padding: 16px 16px; border-radius: 18px; }
  .hero { padding: 20px 18px; border-radius: 20px; }
  .hero::after { display: none; }
  .hero-top { gap: 14px; }
  .hero-remaining { margin: 4px 0 14px; }
  .hero-side { width: 100%; justify-content: space-between; gap: 10px; padding-bottom: 0; }
  .mini-stat { min-width: 0; }
  .mini-stat strong { font-size: 16px; }

  .amount-row input { height: 50px; font-size: 27px; }
  .field-row { flex-direction: column; gap: 10px; }
  .form-bottom { gap: 10px; }
  .owner-field { max-width: none; }
  .form-bottom .btn-primary { width: 100%; margin-left: 0; }

  .list-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .toolbar { width: 100%; }
  .search-wrap { flex: 1; }
  .search-wrap input { width: 100%; }
  .search-wrap input:focus { width: 100%; }

  .exp-row { grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; padding: 10px 4px; }
  .exp-actions { grid-column: 1 / -1; justify-content: flex-end; opacity: 1; margin-top: -4px; }
  .exp-amount { font-size: 15.5px; }
  .exp-date strong { font-size: 15px; }

  .auth-card { padding: 26px 20px 24px; border-radius: 22px; }
  .auth-brand h1 { font-size: 22px; }
  .modal { max-height: calc(100vh - 32px); }
  .modal-body { padding: 14px 16px; }
  .modal-head { padding: 15px 16px 12px; }
  .modal-foot { padding: 12px 16px 15px; }
  .user-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
