:root {
    --paper: #fffdf8;
    --canvas: #f4f1e9;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-solid: #ffffff;
    --ink: #26332d;
    --muted: #728078;
    --line: #e7e2d7;
    --line-strong: #d9d2c3;
    --primary: #c9562e;
    --primary-dark: #a84425;
    --primary-soft: #fff0e8;
    --accent: #e6a126;
    --accent-soft: #fff7dd;
    --success: #2f7d5b;
    --success-soft: #e9f6ef;
    --danger: #c84b49;
    --danger-soft: #fff0ef;
    --info: #39738c;
    --shadow-sm: 0 1px 2px rgba(50, 44, 34, 0.04), 0 8px 24px rgba(50, 44, 34, 0.05);
    --shadow-md: 0 16px 40px rgba(50, 44, 34, 0.09);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 26px;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--canvas);
    color-scheme: light;
}

body.app-body {
    min-width: 320px;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 0%, rgba(230, 161, 38, 0.10), transparent 28rem),
        radial-gradient(circle at 100% 12%, rgba(47, 125, 91, 0.07), transparent 30rem),
        var(--canvas);
    font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0.005em;
}

button,
a,
select,
input,
textarea,
label {
    -webkit-tap-highlight-color: transparent;
}

button,
a,
select {
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

button:not(:disabled):active,
a:active {
    transform: translateY(1px);
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(230, 161, 38, 0.28) !important;
    outline-offset: 2px;
}

input,
textarea,
select {
    color: var(--ink);
    border-color: var(--line-strong) !important;
    background-color: var(--surface-solid);
}

input:hover,
textarea:hover,
select:hover {
    border-color: #c7bdab !important;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(201, 86, 46, 0.11) !important;
    outline: none;
}

::selection {
    color: var(--ink);
    background: #f7dba7;
}

#app {
    width: 100%;
}

/* 顶部导航 */
.app-topbar {
    position: sticky;
    z-index: 50;
    top: 0;
    border-bottom: 1px solid rgba(217, 210, 195, 0.78);
    background: rgba(255, 253, 248, 0.98);
    box-shadow: 0 6px 22px rgba(50, 44, 34, 0.04);
}

.app-topbar-inner {
    display: flex;
    width: min(1180px, calc(100% - 32px));
    min-height: 72px;
    margin: 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand-group,
.brand,
.child-control {
    display: flex;
    align-items: center;
}

.brand-group {
    min-width: 0;
    gap: 42px;
}

.brand {
    flex: none;
    gap: 11px;
    color: var(--ink);
}

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(168, 68, 37, 0.20);
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(145deg, #db714c, var(--primary));
    box-shadow: 0 7px 16px rgba(201, 86, 46, 0.24);
    transform: rotate(-3deg);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-name {
    font-size: 17px;
    font-weight: 780;
    letter-spacing: -0.025em;
}

.brand-tagline {
    margin-top: 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
}

.desktop-navigation {
    display: flex;
    align-self: stretch;
    gap: 4px;
    align-items: center;
}

.nav-item {
    position: relative;
    display: inline-flex;
    height: 42px;
    padding: 0 14px;
    align-items: center;
    border-radius: 13px;
    color: #69756e;
    cursor: pointer;
    font-size: 14px;
    font-weight: 650;
}

.nav-item:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.78);
}

.nav-item.is-active {
    color: var(--primary-dark);
    background: var(--primary-soft);
    box-shadow: inset 0 0 0 1px rgba(201, 86, 46, 0.11);
}

.nav-item.is-active::after {
    position: absolute;
    right: 16px;
    bottom: 5px;
    left: 16px;
    height: 2px;
    border-radius: 999px;
    background: var(--primary);
    content: "";
}

.child-control {
    flex: none;
    gap: 10px;
    position: relative;
}

.child-control-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.child-switcher-button {
    display: flex;
    min-width: 122px;
    height: 42px;
    padding: 0 11px 0 8px;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    color: var(--ink);
    background: #fff;
    box-shadow: 0 2px 10px rgba(50, 44, 34, 0.04);
    cursor: pointer;
    font-size: 14px;
    font-weight: 720;
}

.child-switcher-button:hover,
.child-switcher-button[aria-expanded="true"] {
    border-color: #d6b28c;
    background: #fffaf4;
    box-shadow: 0 5px 14px rgba(50, 44, 34, 0.07);
}

.child-avatar {
    display: grid;
    width: 25px;
    height: 25px;
    flex: none;
    place-items: center;
    border-radius: 9px;
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-size: 11px;
    font-weight: 820;
}

.child-switcher-name {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.child-switcher-arrow {
    color: #929b95;
    font-size: 9px;
    transition: transform 160ms ease;
}

.child-switcher-button[aria-expanded="true"] .child-switcher-arrow {
    transform: rotate(180deg);
}

.child-menu {
    position: absolute;
    z-index: 90;
    top: calc(100% + 8px);
    right: 0;
    width: max(174px, 100%);
    padding: 6px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(42, 36, 28, 0.16);
}

.child-menu-option {
    display: flex;
    width: 100%;
    min-height: 42px;
    padding: 6px 9px;
    align-items: center;
    gap: 9px;
    border-radius: 10px;
    color: var(--ink);
    background: transparent;
    text-align: left;
    font-size: 13px;
    font-weight: 680;
}

.child-menu-option:hover {
    background: #f8f5ef;
}

.child-menu-option.is-active {
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.child-menu-option > i {
    margin-left: auto;
    color: var(--primary);
    font-size: 10px;
}

.bottom-navigation {
    display: none;
}

/* 通用页面结构 */
.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 38px 0 56px;
}

.page-shell.page-shell-narrow {
    width: min(880px, calc(100% - 32px));
}

.page-header {
    display: flex;
    margin-bottom: 24px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.page-title {
    margin: 0;
    color: var(--ink);
    font-size: clamp(25px, 3vw, 36px);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.16;
}

.page-subtitle {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    min-height: 44px;
    padding: 0 18px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 720;
}

.primary-button {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 8px 18px rgba(201, 86, 46, 0.18);
}

.primary-button:hover {
    border-color: var(--primary-dark);
    background: var(--primary-dark);
    box-shadow: 0 10px 22px rgba(168, 68, 37, 0.23);
    transform: translateY(-1px);
}

.secondary-button {
    color: var(--ink);
    border-color: var(--line-strong);
    background: #fff;
    box-shadow: 0 3px 10px rgba(50, 44, 34, 0.04);
}

.secondary-button:hover {
    border-color: #c8bdaa;
    background: #fffdf8;
}

.surface-card {
    border: 1px solid rgba(217, 210, 195, 0.86);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 17px;
    font-weight: 760;
    letter-spacing: -0.018em;
}

.section-heading::before {
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 5px var(--accent-soft);
    content: "";
}

/* 总览 */
.overview-hero {
    position: relative;
    display: grid;
    min-height: 252px;
    margin-bottom: 18px;
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
    overflow: hidden;
    border: 1px solid rgba(173, 141, 78, 0.18);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(120deg, rgba(255, 248, 228, 0.98), rgba(255, 253, 248, 0.92)),
        #fff;
    box-shadow: var(--shadow-md);
}

.overview-hero::after {
    position: absolute;
    width: 280px;
    height: 280px;
    right: -90px;
    top: -130px;
    border: 46px solid rgba(230, 161, 38, 0.11);
    border-radius: 50%;
    content: "";
}

.balance-panel {
    position: relative;
    z-index: 1;
    display: flex;
    padding: 34px 38px;
    flex-direction: column;
    justify-content: center;
}

.balance-label {
    display: flex;
    margin-bottom: 6px;
    align-items: center;
    gap: 8px;
    color: #796943;
    font-size: 13px;
    font-weight: 700;
}

.balance-value {
    display: flex;
    align-items: baseline;
    gap: 10px;
    color: var(--ink);
    font-size: clamp(60px, 8vw, 84px);
    font-weight: 850;
    letter-spacing: -0.075em;
    line-height: 1;
}

.balance-value small {
    color: #796943;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
}

.balance-note {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.hero-stamp {
    position: absolute;
    right: 28px;
    bottom: 18px;
    display: grid;
    width: 68px;
    height: 68px;
    place-items: center;
    border: 2px dashed rgba(201, 86, 46, 0.40);
    border-radius: 50%;
    color: var(--primary);
    background: rgba(255, 255, 255, 0.54);
    font-size: 26px;
    transform: rotate(8deg);
}

.monthly-stats {
    position: relative;
    z-index: 2;
    display: grid;
    padding: 28px;
    align-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.72);
}

.stat-row {
    display: grid;
    min-height: 58px;
    padding: 10px 14px;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(217, 210, 195, 0.70);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}

.stat-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.stat-note {
    display: block;
    margin-top: 3px;
    color: #929b95;
    font-size: 10px;
}

.stat-number {
    font-size: 24px;
    font-weight: 820;
    letter-spacing: -0.04em;
}

.stat-number.is-positive {
    color: var(--success);
}

.stat-number.is-negative {
    color: var(--danger);
}

.stat-number.is-neutral {
    color: var(--info);
}

.chart-card {
    padding: 26px 28px 22px;
}

.chart-card-header {
    display: flex;
    margin-bottom: 18px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.segmented-control {
    display: inline-flex;
    padding: 4px;
    gap: 3px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #f5f2eb;
}

.segment {
    min-height: 32px;
    padding: 0 13px;
    border-radius: 9px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.segment:hover {
    color: var(--ink);
}

.segment.is-active {
    color: var(--primary-dark);
    background: #fff;
    box-shadow: 0 2px 8px rgba(50, 44, 34, 0.08);
}

.chart-wrap {
    width: 100%;
    height: 330px;
}

/* 记印章 */
.record-card {
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.record-intro {
    position: relative;
    display: flex;
    padding: 27px 30px;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(120deg, #324f42, #263d34);
}

.record-intro::after {
    position: absolute;
    right: -18px;
    width: 130px;
    height: 130px;
    border: 22px solid rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    content: "";
}

.record-intro h2 {
    margin: 0;
    font-size: 23px;
    font-weight: 780;
    letter-spacing: -0.03em;
}

.record-intro p {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.70);
    font-size: 13px;
}

.record-intro-icon {
    position: relative;
    z-index: 1;
    display: grid;
    width: 50px;
    height: 50px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    color: #ffd99a;
    background: rgba(255, 255, 255, 0.08);
    font-size: 20px;
}

.record-body {
    padding: 30px;
}

.form-section + .form-section {
    margin-top: 26px;
}

.step-label {
    display: flex;
    margin-bottom: 12px;
    align-items: center;
    gap: 9px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 760;
}

.step-number {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 8px;
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-size: 11px;
    font-weight: 800;
}

.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-pill {
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: #69756e;
    background: #f8f6f1;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.category-pill:hover {
    color: var(--ink);
    border-color: #cfc5b4;
    background: #fff;
}

.category-pill.is-active {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 6px 14px rgba(201, 86, 46, 0.18);
}

.event-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.event-card {
    display: flex;
    min-height: 70px;
    padding: 14px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--line) !important;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
}

.event-card:hover {
    border-color: #d6b28c !important;
    background: #fffaf4;
    box-shadow: 0 7px 16px rgba(50, 44, 34, 0.05);
    transform: translateY(-1px);
}

.event-card.selected {
    border-color: var(--primary) !important;
    background: var(--primary-soft) !important;
    box-shadow: 0 0 0 2px rgba(201, 86, 46, 0.10);
}

.event-name {
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
}

.stamp-badge {
    display: inline-flex;
    min-width: 35px;
    min-height: 28px;
    padding: 0 7px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 820;
}

.stamp-badge.is-positive {
    color: var(--success);
    background: var(--success-soft);
}

.stamp-badge.is-negative {
    color: var(--danger);
    background: var(--danger-soft);
}

.form-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.stamp-stepper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stepper-button {
    display: grid;
    width: 42px;
    height: 42px;
    flex: none;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    color: var(--ink);
    background: #fff;
}

.stepper-button:hover {
    color: var(--primary);
    border-color: #d6b28c;
    background: #fffaf4;
}

.stamp-value-input {
    width: 86px;
    height: 42px;
    border-radius: 13px !important;
    text-align: center;
    font-size: 19px;
    font-weight: 820;
}

.field-control {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 13px !important;
    font-size: 13px;
}

textarea.field-control {
    min-height: 92px;
    resize: vertical;
}

.field-hint {
    color: var(--muted);
    font-size: 11px;
}

.form-actions {
    display: flex;
    margin-top: 28px;
    padding-top: 22px;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--line);
}

/* 历史 */
.history-filter {
    display: flex;
    margin-bottom: 12px;
    padding: 15px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.date-range,
.quick-filters {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-range input {
    min-height: 38px;
    padding: 6px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    font-size: 12px;
}

.quick-filter {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--muted);
    background: #fff;
    font-size: 12px;
    font-weight: 650;
}

.quick-filter:hover {
    color: var(--primary-dark);
    border-color: #d6b28c;
    background: var(--primary-soft);
}

.table-card {
    overflow: hidden;
}

.table-card table {
    width: 100%;
    border-collapse: collapse;
}

.table-card thead,
.manage-content thead {
    background: #f7f4ee !important;
}

.table-card th,
.manage-content th {
    color: #7a857e !important;
    font-size: 10px !important;
    font-weight: 780 !important;
    letter-spacing: 0.10em !important;
}

.table-card tbody,
.manage-content tbody {
    background: transparent !important;
}

.table-card tbody tr,
.manage-content tbody tr {
    border-color: var(--line) !important;
}

.table-card tbody tr:hover,
.manage-content tbody tr:hover {
    background: #fffcf7;
}

.mobile-history-list {
    display: none;
}

/* 兑换 */
.redeem-hero {
    position: relative;
    display: flex;
    min-height: 210px;
    margin-bottom: 32px;
    padding: 34px 38px;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    border: 1px solid rgba(120, 74, 38, 0.18);
    border-radius: var(--radius-lg);
    color: #fff;
    background:
        radial-gradient(circle at 88% 10%, rgba(255, 220, 155, 0.17), transparent 15rem),
        linear-gradient(125deg, #314e41, #22382f);
    box-shadow: var(--shadow-md);
}

.redeem-hero::after {
    position: absolute;
    right: 26px;
    bottom: -52px;
    color: rgba(255, 255, 255, 0.055);
    content: "\f06b";
    font-family: "Font Awesome 6 Free";
    font-size: 178px;
    font-weight: 900;
}

.redeem-balance-label {
    color: rgba(255, 255, 255, 0.68);
    font-size: 13px;
    font-weight: 650;
}

.redeem-balance {
    display: flex;
    margin-top: 8px;
    align-items: baseline;
    gap: 10px;
    color: #fff;
    font-size: clamp(50px, 7vw, 68px);
    font-weight: 850;
    letter-spacing: -0.06em;
    line-height: 1;
}

.redeem-balance small {
    color: rgba(255, 255, 255, 0.67);
    font-size: 15px;
    font-weight: 650;
    letter-spacing: 0;
}

.redeem-note {
    margin: 12px 0 0;
    color: #c8d6cf;
    font-size: 13px;
}

.hero-light-button {
    position: relative;
    z-index: 2;
    display: inline-flex;
    min-height: 44px;
    padding: 0 18px;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 14px;
    color: #314e41;
    background: #fff9ed;
    box-shadow: 0 9px 24px rgba(0, 0, 0, 0.12);
    font-size: 13px;
    font-weight: 750;
}

.reward-section-title {
    margin: 0 0 16px;
}

.reward-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
}

.reward-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.reward-card.is-available:hover {
    border-color: #d6b28c;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.reward-card.is-locked {
    background: #f8f6f1;
    filter: saturate(0.65);
}

.reward-visual {
    position: relative;
    display: grid;
    height: 120px;
    place-items: center;
    overflow: hidden;
    font-size: 35px;
}

.reward-visual::after {
    position: absolute;
    width: 94px;
    height: 94px;
    border: 1px dashed currentColor;
    border-radius: 50%;
    opacity: 0.17;
    content: "";
}

.reward-visual i {
    position: relative;
    z-index: 1;
}

.reward-card-body {
    padding: 16px;
}

.reward-name {
    min-height: 42px;
    margin: 0 0 12px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 760;
    line-height: 1.45;
}

.reward-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.reward-cost {
    color: var(--primary);
    font-size: 19px;
    font-weight: 820;
}

.reward-action {
    min-height: 34px;
    padding: 0 13px;
    border-radius: 10px;
    color: #fff;
    background: var(--primary);
    font-size: 12px;
    font-weight: 720;
}

.reward-action:hover {
    background: var(--primary-dark);
}

.reward-action:disabled {
    color: #8e9791;
    background: #e5e2dc;
}

.reward-shortfall {
    margin: 7px 0 0;
    color: var(--danger);
    font-size: 10px;
    text-align: right;
}

/* 管理与弹窗 */
.manage-shell {
    display: grid;
    grid-template-columns: 238px minmax(0, 1fr);
    gap: 20px;
}

.manage-tabs {
    position: sticky;
    top: 92px;
    align-self: start;
    padding: 8px;
}

.manage-tab {
    display: flex;
    min-height: 48px;
    padding: 0 13px;
    align-items: center;
    gap: 10px;
    border-radius: 12px;
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
    font-weight: 680;
}

.manage-tab i {
    width: 19px;
    text-align: center;
}

.manage-tab:hover {
    color: var(--ink);
    background: #f7f4ee;
}

.manage-tab.is-active {
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.manage-content {
    min-width: 0;
    padding: 26px;
}

.mobile-manage-tabs {
    display: none;
}

.manage-content > div:first-child {
    border-color: var(--line) !important;
}

.manage-content .border-gray-200 {
    border-color: var(--line) !important;
}

.manage-content .bg-gray-50,
.manage-content .bg-gray-100 {
    background-color: #f7f4ee !important;
}

.manage-content .text-indigo-600,
.table-card .text-indigo-600 {
    color: var(--primary) !important;
}

.manage-content .bg-indigo-600,
.manage-content button.bg-indigo-600 {
    background-color: var(--primary) !important;
}

.manage-content .bg-indigo-600:hover,
.manage-content button.bg-indigo-600:hover {
    background-color: var(--primary-dark) !important;
}

.manage-content .bg-indigo-100 {
    background-color: var(--primary-soft) !important;
}

.manage-content .text-indigo-800 {
    color: var(--primary-dark) !important;
}

.manage-content .border-indigo-200 {
    border-color: #efc8b8 !important;
}

.manage-content table {
    border-radius: 14px;
}

.modal-overlay {
    background: rgba(27, 34, 30, 0.52) !important;
}

.modal-card {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 20px !important;
    background: #fff;
    box-shadow: 0 24px 70px rgba(22, 29, 25, 0.24) !important;
}

.modal-header {
    display: flex;
    min-height: 62px;
    padding: 0 22px !important;
    align-items: center;
    justify-content: space-between;
    color: var(--ink) !important;
    background: #faf7f0 !important;
    border-bottom: 1px solid var(--line);
}

.modal-header button {
    color: var(--muted) !important;
}

.modal-card .bg-indigo-600 {
    background: var(--primary) !important;
}

.modal-card .text-indigo-600 {
    color: var(--primary) !important;
}

/* 兼容尚未改为专用类的旧组件 */
.bg-indigo-600 {
    background-color: var(--primary) !important;
}

.hover\:bg-indigo-700:hover {
    background-color: var(--primary-dark) !important;
}

.text-indigo-600,
.text-indigo-500 {
    color: var(--primary) !important;
}

.text-indigo-700,
.text-indigo-800,
.text-indigo-900 {
    color: var(--primary-dark) !important;
}

.bg-indigo-50,
.bg-indigo-100 {
    background-color: var(--primary-soft) !important;
}

.border-indigo-500,
.border-indigo-200 {
    border-color: var(--primary) !important;
}

.text-green-600,
.text-green-700 {
    color: var(--success) !important;
}

.bg-green-50,
.bg-green-100 {
    background-color: var(--success-soft) !important;
}

.text-red-500,
.text-red-600,
.text-red-700 {
    color: var(--danger) !important;
}

.bg-red-50,
.bg-red-100 {
    background-color: var(--danger-soft) !important;
}

.bg-purple-100 {
    background-color: #eef5f1 !important;
}

.text-purple-500,
.text-purple-800 {
    color: #42705a !important;
}

.text-gray-900,
.text-gray-800,
.text-gray-700 {
    color: var(--ink);
}

.text-gray-500,
.text-gray-400 {
    color: var(--muted);
}

.shadow,
.shadow-sm {
    box-shadow: var(--shadow-sm);
}

#globalToast {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px !important;
    background: #24332c !important;
    box-shadow: 0 14px 34px rgba(30, 39, 35, 0.24) !important;
}

@media (max-width: 1023px) {
    .brand-group {
        gap: 20px;
    }

    .desktop-navigation {
        gap: 1px;
    }

    .nav-item {
        padding: 0 10px;
    }

    .reward-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    body.app-body {
        padding-bottom: 76px;
        background:
            radial-gradient(circle at 0% 0%, rgba(230, 161, 38, 0.10), transparent 20rem),
            var(--canvas);
    }

    .app-topbar-inner {
        width: calc(100% - 24px);
        min-height: 62px;
    }

    .brand-group {
        gap: 0;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 11px;
    }

    .brand-name {
        font-size: 15px;
    }

    .brand-tagline,
    .desktop-navigation,
    .child-control-label {
        display: none;
    }

    .child-switcher-button {
        min-width: 98px;
        max-width: 130px;
        height: 38px;
        border-radius: 12px;
        font-size: 13px;
    }

    .child-switcher-button .child-avatar {
        display: none;
    }

    .bottom-navigation {
        position: fixed;
        z-index: 60;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        height: 68px;
        padding: 7px max(8px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
        grid-template-columns: repeat(5, 1fr);
        border-top: 1px solid rgba(217, 210, 195, 0.88);
        background: rgba(255, 253, 248, 0.99);
        box-shadow: 0 -8px 24px rgba(50, 44, 34, 0.07);
    }

    .bottom-nav-item {
        display: flex;
        min-width: 0;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 3px;
        border-radius: 12px;
        color: #8b958f;
        font-size: 9px;
        font-weight: 700;
    }

    .bottom-nav-item i {
        font-size: 16px;
    }

    .bottom-nav-item.is-active {
        color: var(--primary);
        background: var(--primary-soft);
    }

    .page-shell,
    .page-shell.page-shell-narrow {
        width: calc(100% - 24px);
        padding: 23px 0 32px;
    }

    .page-header {
        margin-bottom: 17px;
        align-items: center;
    }

    .eyebrow {
        margin-bottom: 6px;
        font-size: 9px;
    }

    .page-title {
        font-size: 24px;
    }

    .page-subtitle {
        display: none;
    }

    .primary-button,
    .secondary-button {
        min-height: 40px;
        padding: 0 14px;
        border-radius: 12px;
        font-size: 12px;
    }

    .overview-hero {
        display: block;
        min-height: 0;
        margin-bottom: 12px;
        border-radius: 20px;
    }

    .balance-panel {
        min-height: 190px;
        padding: 25px 24px 20px;
    }

    .balance-value {
        font-size: 62px;
    }

    .hero-stamp {
        right: 22px;
        bottom: 22px;
        width: 58px;
        height: 58px;
        font-size: 22px;
    }

    .monthly-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding: 12px;
        gap: 6px;
        border-top: 1px solid rgba(217, 210, 195, 0.65);
    }

    .stat-row {
        display: flex;
        min-height: 82px;
        padding: 10px 7px;
        flex-direction: column;
        align-items: flex-start;
        justify-content: space-between;
        gap: 5px;
    }

    .stat-label {
        font-size: 10px;
    }

    .stat-note {
        display: none;
    }

    .stat-number {
        font-size: 20px;
    }

    .chart-card {
        padding: 18px 15px 14px;
        border-radius: 18px;
    }

    .chart-card-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .chart-wrap {
        height: 245px;
    }

    .record-card {
        border-radius: 20px;
    }

    .record-intro {
        padding: 21px 20px;
    }

    .record-intro h2 {
        font-size: 19px;
    }

    .record-intro-icon {
        width: 44px;
        height: 44px;
    }

    .record-body {
        padding: 20px 16px;
    }

    .form-section + .form-section {
        margin-top: 22px;
    }

    .event-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .event-card {
        min-height: 62px;
        padding: 11px;
    }

    .event-name {
        font-size: 12px;
    }

    .form-columns {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .form-actions {
        display: grid;
        grid-template-columns: 0.8fr 1.2fr;
    }

    .history-filter {
        padding: 12px;
        align-items: stretch;
        flex-direction: column;
    }

    .date-range {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
    }

    .date-range input {
        min-width: 0;
        width: 100%;
        font-size: 11px;
    }

    .quick-filters {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .desktop-history-table {
        display: none !important;
    }

    .mobile-history-list {
        display: block;
        overflow: hidden;
    }

    .mobile-record-card {
        display: flex;
        padding: 12px;
        align-items: center;
        gap: 11px;
        border-bottom: 1px solid var(--line);
        background: #fff;
    }

    .mobile-record-card:last-child {
        border-bottom: 0;
    }

    .redeem-hero {
        min-height: 190px;
        margin-bottom: 26px;
        padding: 26px 22px;
        align-items: flex-start;
        flex-direction: column;
        border-radius: 20px;
    }

    .redeem-balance {
        font-size: 53px;
    }

    .hero-light-button {
        min-height: 38px;
        padding: 0 14px;
        font-size: 11px;
    }

    .reward-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .reward-visual {
        height: 88px;
        font-size: 28px;
    }

    .reward-visual::after {
        width: 68px;
        height: 68px;
    }

    .reward-card-body {
        padding: 12px;
    }

    .reward-name {
        min-height: 35px;
        font-size: 12px;
    }

    .reward-cost {
        font-size: 16px;
    }

    .reward-action {
        padding: 0 10px;
    }

    .manage-shell {
        display: block;
    }

    .manage-tabs {
        display: none;
    }

    .mobile-manage-tabs {
        display: flex;
        margin: 0 -12px 12px;
        padding: 0 12px 3px;
        overflow-x: auto;
        gap: 7px;
        scrollbar-width: none;
    }

    .mobile-manage-tabs::-webkit-scrollbar {
        display: none;
    }

    .mobile-manage-tab {
        display: inline-flex;
        min-height: 36px;
        padding: 0 12px;
        flex: none;
        align-items: center;
        gap: 6px;
        border: 1px solid var(--line);
        border-radius: 11px;
        color: var(--muted);
        background: #fff;
        white-space: nowrap;
        font-size: 11px;
        font-weight: 700;
    }

    .mobile-manage-tab.is-active {
        color: #fff;
        border-color: var(--primary);
        background: var(--primary);
    }

    .manage-content {
        padding: 17px 13px;
        border-radius: 18px;
    }

    .modal-card {
        border-radius: 18px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
