* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    background: #f5f7fb;
    color: #1f2937;
}

a {
    color: inherit;
    text-decoration: none;
}

.login-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 34%),
        linear-gradient(180deg, #eef4ff 0%, #f8fafc 100%);
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 24px;
    padding: 28px 22px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

.login-logo {
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    color: #111827;
}

.login-subtitle {
    margin-top: 8px;
    margin-bottom: 26px;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
}

.form-label {
    display: block;
    margin: 16px 0 8px;
    font-size: 14px;
    font-weight: 700;
    color: #374151;
}

.form-input {
    width: 100%;
    height: 52px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 0 15px;
    font-size: 17px;
    outline: none;
    background: #ffffff;
}

.form-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.primary-btn {
    width: 100%;
    height: 54px;
    margin-top: 24px;
    border: 0;
    border-radius: 16px;
    background: #2563eb;
    color: #ffffff;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
}

.alert-error {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 14px;
}

.login-tips {
    margin-top: 18px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.8;
}

.app-shell {
    min-height: 100vh;
    padding-bottom: 78px;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px 14px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #e5e7eb;
}

.hello {
    font-size: 22px;
    font-weight: 800;
    color: #111827;
}

.sub {
    margin-top: 4px;
    font-size: 13px;
    color: #6b7280;
}

.logout-link {
    padding: 8px 12px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
}

.main-content {
    padding: 16px;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.summary-card {
    min-height: 116px;
    padding: 16px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.summary-card.danger {
    background: #fff7f7;
}

.summary-card.warn {
    background: #fff8eb;
}

.summary-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 700;
}

.summary-value {
    margin-top: 10px;
    font-size: 23px;
    font-weight: 900;
    color: #111827;
}

.summary-small {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}

.notice-card {
    margin-top: 14px;
    padding: 16px;
    border-radius: 20px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.notice-title {
    font-size: 16px;
    font-weight: 900;
    color: #1d4ed8;
}

.notice-text {
    margin-top: 6px;
    font-size: 14px;
    color: #1e3a8a;
    line-height: 1.6;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 24px 2px 12px;
}

.section-title-row h2 {
    margin: 0;
    font-size: 18px;
    color: #111827;
}

.section-title-row span {
    font-size: 13px;
    color: #9ca3af;
}

.empty-card {
    padding: 26px 18px;
    border-radius: 20px;
    background: #ffffff;
    color: #6b7280;
    text-align: center;
    line-height: 1.7;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.expense-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.expense-card {
    padding: 16px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.expense-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.expense-category {
    font-size: 16px;
    font-weight: 900;
    color: #111827;
}

.expense-meta {
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
}

.expense-amount {
    white-space: nowrap;
    font-size: 20px;
    font-weight: 900;
    color: #111827;
}

.expense-bottom {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.status-tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.status-pending {
    background: #fee2e2;
    color: #b91c1c;
}

.status-wait {
    background: #ffedd5;
    color: #c2410c;
}

.status-done {
    background: #dcfce7;
    color: #15803d;
}

.status-default {
    background: #f3f4f6;
    color: #4b5563;
}

.remark {
    font-size: 13px;
    color: #6b7280;
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: 66px;
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid #e5e7eb;
    backdrop-filter: blur(12px);
}

.bottom-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: #6b7280;
}

.bottom-nav a.active {
    color: #2563eb;
}

@media (min-width: 768px) {
    .app-shell {
        max-width: 520px;
        margin: 0 auto;
        background: #f5f7fb;
        border-left: 1px solid #e5e7eb;
        border-right: 1px solid #e5e7eb;
    }
}

.success-toast {
    margin-bottom: 14px;
    padding: 13px 15px;
    border-radius: 16px;
    background: #ecfdf5;
    color: #047857;
    font-size: 14px;
    font-weight: 800;
    border: 1px solid #a7f3d0;
}

.form-card {
    padding: 18px;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.readonly-time {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 0 15px;
    border-radius: 16px;
    background: #f3f4f6;
    color: #111827;
    font-size: 18px;
    font-weight: 900;
}

.readonly-time span {
    font-size: 12px;
    color: #6b7280;
    font-weight: 700;
}

.form-select {
    width: 100%;
    height: 54px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 0 14px;
    font-size: 17px;
    outline: none;
    background: #ffffff;
}

.form-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.amount-input {
    font-size: 22px;
    font-weight: 900;
}

.form-textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 14px 15px;
    font-size: 16px;
    outline: none;
    resize: none;
    line-height: 1.6;
    font-family: inherit;
}

.form-textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.optional {
    color: #9ca3af;
    font-size: 12px;
    font-weight: 600;
}

.form-help {
    margin-top: 14px;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.7;
    text-align: center;
}


.notice-btn {
    display: inline-flex;
    margin-top: 12px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
}

.section-title-row a {
    font-size: 13px;
    color: #2563eb;
    font-weight: 800;
}

.bill-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.bill-summary div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.bill-summary span {
    font-size: 13px;
    color: #6b7280;
    font-weight: 800;
}

.bill-summary strong {
    font-size: 18px;
    color: #111827;
}

.bill-summary em {
    font-style: normal;
    font-size: 12px;
    color: #9ca3af;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 8px;
}

.filter-tabs a {
    white-space: nowrap;
    padding: 9px 13px;
    border-radius: 999px;
    background: #ffffff;
    color: #6b7280;
    font-size: 13px;
    font-weight: 800;
    border: 1px solid #e5e7eb;
}

.filter-tabs a.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.expense-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

.expense-actions form {
    margin: 0;
}

.mini-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 0;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.mini-btn.outline {
    background: #f3f4f6;
    color: #374151;
}

.mini-btn.danger {
    background: #fee2e2;
    color: #b91c1c;
}

.mini-btn.success {
    background: #dcfce7;
    color: #15803d;
}


.month-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 12px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.month-switch a {
    padding: 8px 14px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    font-size: 13px;
    font-weight: 800;
}

.month-switch strong {
    font-size: 17px;
    color: #111827;
}

.report-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-card {
    padding: 16px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.report-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.report-head strong {
    font-size: 17px;
    color: #111827;
}

.report-head span {
    font-size: 12px;
    color: #6b7280;
    font-weight: 800;
}

.report-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-top: 1px solid #f3f4f6;
}

.report-line span {
    color: #6b7280;
    font-size: 14px;
}

.report-line b {
    color: #111827;
    font-size: 15px;
}

.diff-up {
    color: #b91c1c !important;
}

.diff-down {
    color: #15803d !important;
}


.report-sub-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
    padding: 8px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.report-sub-tabs a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border-radius: 999px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 900;
}

.report-sub-tabs a.active {
    background: #2563eb;
    color: #ffffff;
}

.report-shortcuts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 14px;
}

.report-shortcuts a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 0 16px;
    border-radius: 16px;
    background: #ffffff;
    color: #2563eb;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.report-shortcuts a::after {
    content: ">";
    color: #9ca3af;
}

@media (max-width: 380px) {
    .report-sub-tabs {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* 统计页二级菜单强化版 */
.report-sub-tabs {
    position: sticky;
    top: 82px;
    z-index: 9;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 4px 0 18px;
    padding: 10px;
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
}

.report-sub-tabs a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 66px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #475569;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
}

.report-sub-tabs a::before {
    display: block;
    font-size: 20px;
    line-height: 1;
}

.report-sub-tabs a:nth-child(1)::before {
    content: "📊";
}

.report-sub-tabs a:nth-child(2)::before {
    content: "📈";
}

.report-sub-tabs a:nth-child(3)::before {
    content: "🧾";
}

.report-sub-tabs a:nth-child(4)::before {
    content: "👤";
}

.report-sub-tabs a.active {
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.34);
    transform: translateY(-1px);
}

.report-sub-tabs a.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -7px;
    width: 20px;
    height: 4px;
    border-radius: 999px;
    background: #2563eb;
    transform: translateX(-50%);
}

@media (max-width: 420px) {
    .report-sub-tabs {
        gap: 8px;
        padding: 8px;
    }

    .report-sub-tabs a {
        min-height: 60px;
        font-size: 12px;
        border-radius: 16px;
    }

    .report-sub-tabs a::before {
        font-size: 18px;
    }
}


/* 账单筛选 */
.filter-card {
    margin-bottom: 14px;
    padding: 14px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.filter-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.filter-title strong {
    font-size: 16px;
    color: #111827;
}

.filter-title a {
    color: #2563eb;
    font-size: 13px;
    font-weight: 900;
}

.filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.filter-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-grid span {
    font-size: 12px;
    color: #6b7280;
    font-weight: 800;
}

.filter-grid input,
.filter-grid select {
    width: 100%;
    height: 44px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 0 10px;
    background: #ffffff;
    color: #111827;
    font-size: 14px;
    font-weight: 700;
    outline: none;
}

.filter-submit {
    width: 100%;
    height: 46px;
    margin-top: 12px;
    border: 0;
    border-radius: 16px;
    background: #2563eb;
    color: #ffffff;
    font-size: 15px;
    font-weight: 900;
}

.mini-btn.delete {
    background: #111827;
    color: #ffffff;
}

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


/* 操作日志 */
.bottom-nav.nav-5 {
    grid-template-columns: repeat(5, 1fr);
}

.bottom-nav.nav-5 a {
    font-size: 12px;
}

.log-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.log-card {
    padding: 15px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.log-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.log-top div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.log-top strong {
    font-size: 16px;
    color: #111827;
}

.log-top span {
    font-size: 13px;
    color: #2563eb;
    font-weight: 900;
}

.log-top em {
    white-space: nowrap;
    font-style: normal;
    font-size: 12px;
    color: #6b7280;
}

.log-content {
    margin-top: 12px;
    padding: 12px;
    border-radius: 14px;
    background: #f8fafc;
    color: #374151;
    font-size: 14px;
    line-height: 1.6;
}

.log-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.log-meta span {
    padding: 5px 9px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
}

.list-tips {
    margin: 14px 0 4px;
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
}


/* PWA 添加到桌面按钮 */
.pwa-install-btn {
    position: fixed;
    right: 16px;
    bottom: 82px;
    z-index: 60;
    min-height: 42px;
    padding: 0 15px;
    border: 0;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.26);
}

@media (min-width: 768px) {
    .pwa-install-btn {
        right: calc(50% - 244px);
    }
}


/* 首页快捷操作 */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.quick-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 16px;
    background: #ffffff;
    color: #2563eb;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    border: 1px solid #e5e7eb;
}

.quick-actions a:first-child {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

@media (max-width: 380px) {
    .quick-actions {
        grid-template-columns: 1fr;
    }
}


/* 筛选区导出按钮 */
.filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #2563eb;
    font-size: 13px;
    font-weight: 900;
}

.filter-actions a:first-child {
    background: #2563eb;
    color: #ffffff;
}


/* 用户管理 */
.quick-actions.quick-actions-admin {
    grid-template-columns: repeat(2, 1fr);
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 14px;
}

.user-card {
    padding: 16px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.user-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.user-card-head strong {
    display: block;
    font-size: 20px;
    color: #111827;
}

.user-card-head span {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: #6b7280;
}

.user-card-head em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-style: normal;
    font-size: 12px;
    font-weight: 900;
}

.user-status-on {
    background: #dcfce7;
    color: #15803d;
}

.user-status-off {
    background: #fee2e2;
    color: #b91c1c;
}

.user-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 12px;
}

.user-info-grid div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 34px;
    border-bottom: 1px solid #f8fafc;
}

.user-info-grid span {
    font-size: 13px;
    color: #6b7280;
}

.user-info-grid b {
    text-align: right;
    font-size: 13px;
    color: #111827;
}

.user-reset-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 14px;
}

.user-reset-form input {
    height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 0 12px;
    outline: none;
    font-size: 14px;
}

.user-reset-form button,
.user-toggle-form button {
    min-height: 42px;
    border: 0;
    border-radius: 14px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.user-reset-form button {
    background: #2563eb;
    color: #ffffff;
}

.user-toggle-form {
    margin-top: 10px;
}

.user-toggle-form button {
    width: 100%;
}

.danger-toggle {
    background: #fee2e2;
    color: #b91c1c;
}

.success-toggle {
    background: #dcfce7;
    color: #15803d;
}

@media (max-width: 390px) {
    .user-reset-form {
        grid-template-columns: 1fr;
    }
}


/* 分类管理 */
.category-create-card {
    margin-bottom: 18px;
}

.card-form-title {
    margin: 0 0 14px;
    font-size: 18px;
    color: #111827;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.category-card {
    padding: 16px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.category-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid #f3f4f6;
}

.category-card-head strong {
    display: block;
    font-size: 19px;
    color: #111827;
}

.category-card-head span {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: #6b7280;
}

.category-card-head em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-style: normal;
    font-size: 12px;
    font-weight: 900;
}

.category-actions {
    margin-top: 14px;
}

.category-actions .mini-btn {
    width: 100%;
    min-height: 42px;
}

.category-toggle-form {
    margin-top: 10px;
}

.category-toggle-form .mini-btn {
    width: 100%;
    min-height: 42px;
}

.quick-actions.quick-actions-admin {
    grid-template-columns: repeat(2, 1fr);
}


/* 分类管理新版：弹窗 + 紧凑列表 */
.category-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 16px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.category-toolbar strong {
    display: block;
    font-size: 18px;
    color: #111827;
}

.category-toolbar span {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: #6b7280;
}

.toolbar-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
}

.category-notice {
    margin-top: 0;
    margin-bottom: 14px;
}

.compact-title {
    margin-top: 16px;
}

.category-row-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.category-row-main {
    min-width: 0;
    flex: 1;
}

.category-row-main strong {
    display: block;
    font-size: 17px;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-row-main div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.category-type-tag,
.category-sort-tag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.category-type-tag.fixed {
    background: #eff6ff;
    color: #1d4ed8;
}

.category-type-tag.variable {
    background: #f5f3ff;
    color: #6d28d9;
}

.category-sort-tag {
    background: #f3f4f6;
    color: #6b7280;
}

.category-row-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 9px;
}

.row-status-on,
.row-status-off {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.row-status-on {
    background: #dcfce7;
    color: #15803d;
}

.row-status-off {
    background: #fee2e2;
    color: #b91c1c;
}

.category-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-row-actions a,
.category-row-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.category-row-actions a {
    background: #2563eb;
    color: #ffffff;
}

.category-row-actions button {
    background: #f3f4f6;
    color: #374151;
}

.category-row-actions form {
    margin: 0;
}

/* 通用弹窗 */
.modal-mask {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(8px);
}

.modal-mask:target {
    display: flex;
}

.modal-panel {
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 18px;
    border-radius: 26px;
    background: #ffffff;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
    animation: modalUp .18s ease-out;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.modal-head strong {
    font-size: 20px;
    color: #111827;
}

.modal-head a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    font-size: 13px;
    font-weight: 900;
}

@keyframes modalUp {
    from {
        transform: translateY(18px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (min-width: 768px) {
    .modal-mask {
        align-items: center;
    }
}

@media (max-width: 390px) {
    .category-row {
        align-items: flex-start;
    }

    .category-row-right {
        min-width: 88px;
    }

    .category-row-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .category-row-actions a,
    .category-row-actions button {
        width: 100%;
    }
}


/* PWA 添加到桌面按钮：左上角显示，不挡底部操作 */
.pwa-install-btn {
    position: fixed !important;
    left: max(10px, env(safe-area-inset-left)) !important;
    top: max(10px, env(safe-area-inset-top)) !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 9999 !important;
    min-height: 34px !important;
    padding: 0 12px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: rgba(17, 24, 39, 0.92) !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22) !important;
}

/* 电脑端预览时，让按钮贴着手机容器左上角 */
@media (min-width: 768px) {
    .pwa-install-btn {
        left: calc(50% - 244px + 10px) !important;
        top: 10px !important;
    }
}


/* 年度分析 */
.report-sub-tabs {
    grid-template-columns: repeat(5, 1fr);
}

.report-sub-tabs a:nth-child(5)::before {
    content: "📅";
}

.trend-card {
    padding: 16px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.trend-row {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #f3f4f6;
}

.trend-row:last-child {
    border-bottom: 0;
}

.trend-row span {
    font-size: 13px;
    color: #6b7280;
    font-weight: 800;
}

.trend-row b {
    min-width: 82px;
    text-align: right;
    font-size: 13px;
    color: #111827;
}

.trend-bar-wrap {
    height: 10px;
    border-radius: 999px;
    background: #eff6ff;
    overflow: hidden;
}

.trend-bar-wrap i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #60a5fa, #2563eb);
}

.share-card {
    padding: 15px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.share-head,
.share-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.share-head strong {
    font-size: 16px;
    color: #111827;
}

.share-head span {
    font-size: 14px;
    color: #2563eb;
    font-weight: 900;
}

.share-bar {
    height: 10px;
    margin: 12px 0;
    border-radius: 999px;
    background: #f3f4f6;
    overflow: hidden;
}

.share-bar i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #34d399, #2563eb);
}

.share-foot span {
    color: #6b7280;
    font-size: 13px;
}

.share-foot b {
    color: #111827;
    font-size: 14px;
}

.rank-card {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.rank-card em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-style: normal;
    font-weight: 900;
}

.rank-card strong {
    display: block;
    font-size: 16px;
    color: #111827;
}

.rank-card span {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
}

.rank-card b {
    font-size: 15px;
    color: #111827;
}

@media (max-width: 420px) {
    .report-sub-tabs {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* 账单卡片新版：信息更清楚 */
.expense-card-v2 {
    padding: 16px;
}

.expense-main-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.expense-title-block {
    min-width: 0;
}

.expense-title-block strong {
    display: block;
    font-size: 18px;
    color: #111827;
    font-weight: 900;
    line-height: 1.3;
}

.expense-title-block span {
    display: inline-flex;
    margin-top: 7px;
    min-height: 24px;
    padding: 0 9px;
    align-items: center;
    border-radius: 999px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 12px;
    font-weight: 900;
}

.expense-amount-v2 {
    white-space: nowrap;
    font-size: 21px;
    font-weight: 950;
    color: #020617;
    line-height: 1.25;
}

.expense-info-box {
    padding: 12px 14px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}

.expense-info-row {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    align-items: center;
    min-height: 34px;
    border-bottom: 1px solid #e5e7eb;
}

.expense-info-row:last-child {
    border-bottom: 0;
}

.expense-info-row span {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

.expense-info-row b {
    color: #111827;
    font-size: 14px;
    font-weight: 900;
    text-align: left;
    word-break: break-word;
}

.expense-info-row .status-tag {
    margin: 0;
    min-height: 25px;
    padding: 0 9px;
    font-size: 12px;
    font-style: normal;
}

.remark-row b {
    color: #334155;
    font-weight: 800;
    line-height: 1.5;
}

.expense-actions-v2 {
    margin-top: 12px;
    padding-top: 12px;
}

.expense-actions-v2 .mini-btn {
    min-height: 36px;
    padding: 0 14px;
}

@media (max-width: 390px) {
    .expense-main-head {
        align-items: flex-start;
    }

    .expense-title-block strong {
        font-size: 17px;
    }

    .expense-amount-v2 {
        font-size: 19px;
    }

    .expense-info-row {
        grid-template-columns: 68px 1fr;
        gap: 8px;
    }

    .expense-actions-v2 {
        gap: 7px;
    }
}


/* 报销确认弹窗 */
.confirm-panel {
    padding-bottom: 20px;
}

.confirm-summary {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 12px 14px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.confirm-summary div {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    align-items: center;
    min-height: 36px;
    border-bottom: 1px solid #e5e7eb;
}

.confirm-summary div:last-child {
    border-bottom: 0;
}

.confirm-summary span {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

.confirm-summary b {
    color: #111827;
    font-size: 15px;
    font-weight: 900;
    word-break: break-word;
}

.confirm-warning {
    margin-top: 14px;
    padding: 13px 14px;
    border-radius: 16px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
    font-size: 14px;
    line-height: 1.7;
    font-weight: 700;
}

.confirm-warning.success-tip {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.confirm-form {
    margin-top: 14px;
}

.confirm-form .primary-btn {
    margin-top: 0;
}


/* 报销动作按钮强化 */
.mini-btn.reimburse-primary {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.mini-btn.receive-primary {
    background: #16a34a;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(22, 163, 74, 0.20);
}

/* 让报销处理按钮在操作区更醒目 */
.expense-actions-v2 .mini-btn.reimburse-primary,
.expense-actions-v2 .mini-btn.receive-primary {
    min-height: 38px;
    padding: 0 16px;
    font-size: 13px;
}


/* 底部菜单 APP 化美化 */
.app-shell {
    padding-bottom: 104px !important;
}

.bottom-nav {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    z-index: 50 !important;
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    height: 68px !important;
    padding: 7px !important;
    border-radius: 26px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16) !important;
    backdrop-filter: blur(16px) !important;
}

.bottom-nav.nav-5 {
    grid-template-columns: repeat(5, 1fr) !important;
}

.bottom-nav a {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    min-width: 0 !important;
    height: 54px !important;
    border-radius: 20px !important;
    color: #64748b !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    transition: all .18s ease !important;
}

.bottom-nav a::before {
    display: block;
    font-size: 18px;
    line-height: 1;
}

.bottom-nav a:nth-child(1)::before {
    content: "🏠";
}

.bottom-nav a:nth-child(2)::before {
    content: "✍️";
}

.bottom-nav a:nth-child(3)::before {
    content: "📋";
}

.bottom-nav a:nth-child(4)::before {
    content: "📊";
}

.bottom-nav a:nth-child(5)::before {
    content: "📝";
}

.bottom-nav a span {
    display: block !important;
    line-height: 1 !important;
}

.bottom-nav a.active {
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.28) !important;
    transform: translateY(-2px) !important;
}

.bottom-nav a.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -7px;
    width: 20px;
    height: 4px;
    border-radius: 999px;
    background: #2563eb;
    transform: translateX(-50%);
}

.bottom-nav a:active {
    transform: scale(0.96);
}

.bottom-nav a.active:active {
    transform: translateY(-2px) scale(0.96);
}

@media (min-width: 768px) {
    .bottom-nav {
        left: 50% !important;
        right: auto !important;
        width: 496px !important;
        max-width: calc(100% - 24px) !important;
        transform: translateX(-50%) !important;
    }
}

@media (max-width: 380px) {
    .bottom-nav {
        left: 8px !important;
        right: 8px !important;
        height: 64px !important;
        border-radius: 22px !important;
    }

    .bottom-nav a {
        height: 50px !important;
        font-size: 11px !important;
        border-radius: 17px !important;
    }

    .bottom-nav a::before {
        font-size: 16px;
    }
}


/* 设置页面 */
.settings-user-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    border: 1px solid #e5e7eb;
}

.settings-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 20px;
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    font-size: 24px;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.26);
}

.settings-user-card strong {
    display: block;
    font-size: 20px;
    color: #111827;
}

.settings-user-card span {
    display: block;
    margin-top: 5px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
}

.settings-group {
    margin-top: 16px;
}

.settings-group-title {
    margin: 0 4px 9px;
    color: #64748b;
    font-size: 13px;
    font-weight: 900;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 72px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border-radius: 20px;
    background: #ffffff;
    color: #111827;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    border: 1px solid #eef2f7;
}

.settings-row > div {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.settings-row i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 16px;
    background: #eff6ff;
    font-size: 20px;
    font-style: normal;
    flex: 0 0 auto;
}

.settings-row span {
    min-width: 0;
}

.settings-row strong {
    display: block;
    color: #111827;
    font-size: 16px;
    font-weight: 900;
}

.settings-row em {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
    font-style: normal;
    line-height: 1.4;
}

.settings-row b {
    color: #94a3b8;
    font-size: 24px;
    font-weight: 500;
}

.settings-row.danger-row i {
    background: #fef2f2;
}

.settings-row.danger-row strong {
    color: #b91c1c;
}

/* 首页快捷入口恢复成三项业务入口 */
.quick-actions {
    grid-template-columns: repeat(3, 1fr) !important;
}

@media (max-width: 390px) {
    .quick-actions {
        grid-template-columns: 1fr !important;
    }

    .settings-row {
        min-height: 66px;
        padding: 12px 14px;
    }

    .settings-row i {
        width: 38px;
        height: 38px;
        border-radius: 14px;
        font-size: 18px;
    }
}


/* 第五个底部菜单改为设置图标 */
.bottom-nav a:nth-child(5)::before {
    content: "⚙️" !important;
}


/* 页面切换流畅优化 */
.app-shell {
    transition: opacity .16s ease, transform .16s ease;
    will-change: opacity, transform;
    contain: paint;
}

.app-shell.page-leave {
    opacity: .72;
    transform: translateY(6px);
}

.app-shell.page-enter {
    opacity: 0;
    transform: translateY(8px);
}

/* 顶部细加载条 */
html.page-is-loading::before {
    content: "";
    position: fixed;
    left: 0;
    top: 0;
    z-index: 10000;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #60a5fa, #2563eb);
    animation: financeLoadingBar .8s linear infinite;
}

@keyframes financeLoadingBar {
    from {
        transform: translateX(-70%);
    }
    to {
        transform: translateX(70%);
    }
}

/* 底部菜单点击反馈 */
.bottom-nav a.is-pressing {
    transform: scale(.96) !important;
}

/* 降低部分重阴影和模糊对手机性能的影响 */
.bottom-nav {
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14) !important;
}

.summary-card,
.expense-card,
.report-card,
.filter-card,
.settings-row,
.settings-user-card {
    will-change: transform;
}

/* 减少移动端过重的背景重绘 */
@media (max-width: 520px) {
    .bottom-nav {
        backdrop-filter: blur(8px) !important;
    }

    .app-header {
        backdrop-filter: blur(8px) !important;
    }
}


/* 修复：关闭 PJAX 后，恢复页面清晰度和底部菜单固定 */
html,
body {
    overflow-x: hidden;
}

.app-shell {
    min-height: 100vh !important;
    padding-bottom: 112px !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    contain: none !important;
    will-change: auto !important;
}

.app-shell.page-leave,
.app-shell.page-enter {
    opacity: 1 !important;
    transform: none !important;
}

html.page-is-loading::before {
    display: none !important;
}

/* 强制底部菜单始终固定在屏幕底部 */
.bottom-nav {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    z-index: 999 !important;
    transform: none !important;
}

@media (min-width: 768px) {
    .bottom-nav {
        left: 50% !important;
        right: auto !important;
        width: 496px !important;
        max-width: calc(100% - 24px) !important;
        transform: translateX(-50%) !important;
    }
}

/* 降低模糊滤镜，避免页面发虚 */
.bottom-nav,
.app-header {
    backdrop-filter: none !important;
}


/* 首页统计卡片清晰版：去掉模糊感 */
.summary-grid {
    gap: 12px !important;
}

.summary-card {
    position: relative !important;
    min-height: 112px !important;
    padding: 16px 16px 14px 18px !important;
    border-radius: 18px !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06) !important;
    transform: none !important;
    filter: none !important;
    opacity: 1 !important;
    will-change: auto !important;
    overflow: hidden !important;
}

.summary-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 4px;
    border-radius: 999px;
    background: #2563eb;
}

.summary-card:nth-child(1)::before {
    background: #2563eb;
}

.summary-card:nth-child(2)::before {
    background: #0ea5e9;
}

.summary-card:nth-child(3)::before {
    background: #ef4444;
}

.summary-card:nth-child(4)::before {
    background: #f59e0b;
}

.summary-card.danger,
.summary-card.warn {
    background: #ffffff !important;
}

.summary-label {
    font-size: 14px !important;
    color: #475569 !important;
    font-weight: 900 !important;
    letter-spacing: 0 !important;
}

.summary-value {
    margin-top: 12px !important;
    font-size: 25px !important;
    line-height: 1.15 !important;
    font-weight: 900 !important;
    color: #020617 !important;
    letter-spacing: -0.4px !important;
    font-variant-numeric: tabular-nums !important;
    text-shadow: none !important;
}

.summary-small {
    margin-top: 9px !important;
    font-size: 13px !important;
    color: #64748b !important;
    font-weight: 800 !important;
}

/* 首页待处理卡片也顺便清晰一点 */
.notice-card {
    background: #eff6ff !important;
    border: 1px solid #93c5fd !important;
    box-shadow: none !important;
}

.notice-title {
    color: #1d4ed8 !important;
    font-weight: 900 !important;
}

.notice-text {
    color: #1e40af !important;
    font-weight: 700 !important;
}

/* 防止字体在移动端模拟器里被渲染得发虚 */
body,
.app-shell,
.summary-card,
.expense-card,
.report-card {
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: auto;
}

