* { box-sizing: border-box; }
[v-cloak] { display: none; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f7;
    color: #202124;
    -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; color: inherit; }
.app-shell {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    margin: 0 auto;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 14px 42px rgba(0,0,0,.05);
}
.hero {
    position: relative;
    z-index: 20;
    flex: 0 0 auto;
    padding: max(10px, env(safe-area-inset-top)) 14px 16px;
    background: linear-gradient(180deg, #ffdc3d 0%, #ffd438 100%);
}
.topbar {
    display: grid;
    grid-template-columns: 42px 1fr 78px;
    align-items: center;
    min-height: 38px;
}
.topbar h1 {
    margin: 0;
    text-align: center;
    letter-spacing: 2px;
    font-size: clamp(24px, 7vw, 32px);
    font-weight: 500;
    line-height: 1.05;
}
.round-icon {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
}
.round-icon svg, .plain-icon svg, .search-box svg, .money-title svg, .float-add svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: #202124;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.round-icon svg { width: 30px; height: 30px; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.plain-icon { width: 28px; height: 28px; display: grid; place-items: center; }
.hidden-month { position: absolute; left: -1000px; opacity: 0; pointer-events: none; }
.search-box {
    margin: 10px 0 2px;
    height: 38px;
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(255,255,255,.65);
    border-radius: 13px;
    backdrop-filter: blur(16px);
}
.search-box svg { width: 20px; height: 20px; stroke-width: 2.2; opacity: .72; }
.search-box input { border: 0; outline: none; background: transparent; font-size: 14px; }
.search-box button { font-size: 13px; color: rgba(0,0,0,.55); }
.summary-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1.05fr 1.35fr 1.35fr;
    gap: 10px;
    align-items: end;
}
.month-card {
    min-width: 0;
    text-align: left;
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: end;
    column-gap: 6px;
    position: relative;
    padding-right: 10px;
}
.month-card:after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 2px;
    height: 34px;
    width: 1px;
    background: rgba(0,0,0,.34);
}
.month-card span {
    grid-column: 1 / -1;
    margin-bottom: 6px;
    font-size: 13px;
    color: rgba(0,0,0,.55);
}
.month-card strong {
    font-size: clamp(31px, 9vw, 42px);
    font-weight: 400;
    line-height: .9;
    letter-spacing: -1px;
}
.month-card em { font-style: normal; font-size: 16px; line-height: 1; padding-bottom: 4px; }
.month-card i {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #202124;
    margin-bottom: 6px;
}
.money-card { min-width: 0; }
.money-card span {
    display: block;
    margin-bottom: 9px;
    font-size: 13px;
    color: rgba(0,0,0,.54);
}
.money-card strong {
    display: block;
    font-size: clamp(24px, 6.4vw, 34px);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.money-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.money-title button { width: 22px; height: 22px; display: grid; place-items: center; opacity: .9; }
.money-title svg { width: 18px; height: 18px; stroke-width: 2.1; }
.tool-card {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    margin-top: 18px;
    padding: 13px 8px 11px;
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 16px;
    box-shadow: 0 14px 34px rgba(35,35,35,.12);
}
.tool-card button {
    display: grid;
    justify-items: center;
    gap: 6px;
    min-width: 0;
    border-radius: 12px;
    padding: 3px 0;
}
.tool-card button.active { background: rgba(255,213,56,.17); }
.tool-card span, .empty-card > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
}
.tool-card svg, .category-grid svg, .cat-icon svg, .empty-card svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: #292935;
    stroke-width: 2.15;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.tool-card .fill-yellow, .category-grid .fill-yellow, .cat-icon .fill-yellow, .empty-card .fill-yellow { fill: #ffdc3d; }
.tool-card em {
    max-width: 100%;
    font-style: normal;
    font-size: 13px;
    color: rgba(0,0,0,.68);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 0 24px;
    background: #fff;
}
.balance-line {
    margin: 0 14px 8px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border-radius: 13px;
    background: #f7f7f8;
}
.balance-line span { font-size: 13px; color: #8e8e93; }
.balance-line strong { font-size: 18px; font-weight: 500; }
.day-block { border-top: 1px solid #ececec; }
.day-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 0 14px;
    color: #a0a0a7;
}
.day-head div {
    min-width: 104px;
    font-size: 14px;
    white-space: nowrap;
}
.day-head p {
    margin: 0;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.record-row {
    width: 100%;
    min-height: 62px;
    display: grid;
    grid-template-columns: 62px 1fr auto;
    align-items: center;
    text-align: left;
    background: #fff;
}
.record-row:active { background: #f8f8f8; }
.cat-icon {
    width: 36px;
    height: 36px;
    margin-left: 14px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #f3f3f5;
}
.cat-icon svg { width: 25px; height: 25px; }
.record-main {
    min-width: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-bottom: 1px solid #eeeeef;
}
.record-main strong { font-size: 17px; font-weight: 400; color: #25252b; }
.record-main em {
    margin-top: 4px;
    font-style: normal;
    font-size: 12px;
    color: #a1a1a7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.record-money {
    height: 100%;
    min-width: 72px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-right: 14px;
    padding-left: 12px;
    border-bottom: 1px solid #eeeeef;
    font-size: 20px;
    font-weight: 400;
    color: #2a2a30;
    letter-spacing: -.4px;
}
.plus { color: #24242b; }
.minus { color: #24242b; }
.empty {
    padding: 34px 18px;
    text-align: center;
    color: #a0a0a7;
    font-size: 14px;
}
.empty-card {
    margin: 18px 14px 0;
    padding: 28px 18px;
    border-radius: 18px;
    background: #f7f7f8;
}
.empty-card > span { width: 46px; height: 46px; margin: 0 auto 10px; }
.empty-card strong { display: block; color: #33333a; font-size: 16px; font-weight: 500; }
.empty-card p { margin: 8px 0 0; }
.float-add {
    display: none !important;
    position: fixed;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 30;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #ffdc3d;
    box-shadow: 0 16px 36px rgba(215, 164, 0, .34);
}
.float-add svg { width: 27px; height: 27px; stroke-width: 2.5; }
.sheet-mask {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0,0,0,.20);
    backdrop-filter: blur(4px);
}
.bottom-sheet {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 50;
    width: min(100%, 480px);
    max-height: min(86vh, 640px);
    overflow: auto;
    padding: 8px 14px max(20px, env(safe-area-inset-bottom));
    border-radius: 26px 26px 0 0;
    background: #fff;
    box-shadow: 0 -20px 60px rgba(0,0,0,.16);
}
.sheet-handle {
    width: 42px;
    height: 5px;
    margin: 0 auto 8px;
    border-radius: 99px;
    background: #dedee3;
}
.sheet-head {
    height: 42px;
    display: grid;
    grid-template-columns: 60px 1fr 60px;
    align-items: center;
}
.sheet-head strong { text-align: center; font-size: 15px; font-weight: 600; }
.sheet-head button { color: #8e8e93; font-size: 14px; }
.sheet-head .save { color: #111; font-weight: 600; }
.type-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 5px;
    margin-top: 6px;
    border-radius: 16px;
    background: #f2f2f7;
}
.type-switch button {
    height: 36px;
    border-radius: 11px;
    font-size: 14px;
    color: #666;
}
.type-switch button.active { background: #fff; color: #111; box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.amount-input {
    display: grid;
    grid-template-columns: 48px 1fr;
    align-items: center;
    height: 60px;
    margin-top: 12px;
    border-bottom: 1px solid #eeeeef;
}
.amount-input span, .form-list span { color: #8e8e93; font-size: 14px; }
.amount-input input {
    width: 100%;
    border: 0;
    outline: 0;
    text-align: right;
    font-size: 30px;
    font-weight: 300;
    background: transparent;
}
.category-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px 6px;
    padding: 14px 0;
}
.category-grid button {
    display: grid;
    justify-items: center;
    gap: 5px;
    padding: 8px 2px;
    border-radius: 13px;
}
.category-grid button.active { background: #fff6cb; }
.category-grid span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #f3f3f5;
}
.category-grid svg { width: 24px; height: 24px; }
.category-grid em { font-style: normal; font-size: 12px; color: #555; }
.form-list { border-top: 1px solid #eeeeef; }
.form-list label {
    height: 44px;
    display: grid;
    grid-template-columns: 58px 1fr;
    align-items: center;
    border-bottom: 1px solid #eeeeef;
}
.form-list input {
    width: 100%;
    border: 0;
    outline: 0;
    text-align: right;
    background: transparent;
    font-size: 14px;
}
.delete-btn {
    width: 100%;
    height: 42px;
    margin-top: 14px;
    border-radius: 16px;
    background: #fff2f2;
    color: #d84d4d;
    font-size: 14px;
}
.toast {
    position: fixed;
    left: 50%;
    bottom: 94px;
    transform: translateX(-50%);
    z-index: 90;
    max-width: 86vw;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(28,28,30,.86);
    color: #fff;
    font-size: 14px;
    box-shadow: 0 12px 26px rgba(0,0,0,.18);
}
@media (min-width: 761px) {
    body { padding: 18px 0; }
    .app-shell { height: calc(100vh - 36px); height: calc(100dvh - 36px); min-height: 0; border-radius: 28px; }
    .hero { border-radius: 28px 28px 0 0; }
    .float-add { bottom: 34px; }
    .bottom-sheet { border-radius: 24px; bottom: 18px; max-width: 460px; }
}
@media (max-width: 420px) {
    .hero { padding-left: 12px; padding-right: 12px; padding-bottom: 14px; }
    .topbar { grid-template-columns: 38px 1fr 70px; min-height: 34px; }
    .topbar h1 { font-size: 25px; letter-spacing: 1.5px; }
    .round-icon { width: 30px; height: 30px; }
    .round-icon svg { width: 27px; height: 27px; }
    .plain-icon { width: 25px; height: 25px; }
    .plain-icon svg { width: 21px; height: 21px; }
    .top-actions { gap: 8px; }
    .summary-grid { gap: 8px; margin-top: 12px; }
    .month-card span, .money-card span { font-size: 12px; }
    .month-card strong { font-size: 34px; }
    .month-card em { font-size: 15px; }
    .money-card strong { font-size: 24px; }
    .tool-card { margin-top: 14px; border-radius: 15px; padding: 11px 5px 10px; }
    .tool-card span { width: 31px; height: 31px; }
    .tool-card em { font-size: 12px; }
    .content { padding-top: 10px; }
    .balance-line { margin: 0 12px 6px; height: 38px; }
    .day-head { min-height: 38px; padding: 0 12px; }
    .day-head div { font-size: 13px; min-width: 96px; }
    .day-head p { font-size: 12px; }
    .record-row { grid-template-columns: 56px 1fr auto; min-height: 58px; }
    .cat-icon { margin-left: 12px; width: 33px; height: 33px; }
    .cat-icon svg { width: 23px; height: 23px; }
    .record-main strong { font-size: 16px; }
    .record-money { min-width: 66px; margin-right: 12px; font-size: 19px; }
    .float-add { width: 48px; height: 48px; }
    .float-add svg { width: 25px; height: 25px; }
    .category-grid { grid-template-columns: repeat(4, 1fr); }
}
.page-loading {
    min-height: 100vh;
    display: grid;
    place-items: center;
    color: rgba(0,0,0,.48);
    font-size: 15px;
}
.error-box {
    margin: 14px 18px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #fff5f5;
    color: #b42318;
    font-size: 14px;
    line-height: 1.6;
}
.form-list select {
    border: 0;
    outline: none;
    background: transparent;
    text-align: right;
    color: #202124;
    appearance: none;
}

.content::-webkit-scrollbar { width: 0; height: 0; }
.login-shell {
    justify-content: center;
    align-items: center;
    padding: 24px;
    background: linear-gradient(180deg, #ffdc3d 0%, #ffd438 100%);
}
.login-card {
    width: 100%;
    max-width: 360px;
    padding: 26px 20px 22px;
    border-radius: 24px;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(255,255,255,.72);
    box-shadow: 0 18px 42px rgba(35,35,35,.14);
    text-align: center;
}
.login-logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: #ffdc3d;
    color: #202124;
    font-size: 26px;
    font-weight: 600;
}
.login-card h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 500;
    letter-spacing: 1px;
}
.login-card p {
    margin: 10px 0 18px;
    font-size: 13px;
    line-height: 1.7;
    color: rgba(0,0,0,.56);
}
.login-form { display: grid; gap: 10px; }
.login-form input {
    width: 100%;
    height: 46px;
    border: 0;
    outline: none;
    border-radius: 15px;
    padding: 0 14px;
    background: #f4f4f6;
    text-align: center;
    font-size: 16px;
}
.login-form button {
    width: 100%;
    height: 46px;
    border-radius: 15px;
    background: #202124;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
}
.login-form button:disabled { opacity: .58; }
.login-card small {
    display: block;
    margin-top: 13px;
    color: rgba(0,0,0,.42);
    font-size: 12px;
    line-height: 1.6;
}
@media (max-width: 420px) {
    .login-shell { padding: 18px; }
    .login-card { border-radius: 22px; padding: 24px 18px 20px; }
    .login-card h1 { font-size: 24px; }
}
