/* 注册常规体 (Regular) */
@font-face {
    font-family: 'Google Sans Flex';
    src: url('../fonts/GoogleSansFlex_36pt-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

/* 4. Regular (400) */
@font-face {
    font-family: 'Google Sans Flex';
    src: url('../fonts/GoogleSansFlex_36pt-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
/* 5. Medium (500) */
@font-face {
    font-family: 'Google Sans Flex';
    src: url('../fonts/GoogleSansFlex_36pt-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
/* 5. Medium (600) */
@font-face {
    font-family: 'Google Sans Flex';
    src: url('../fonts/GoogleSansFlex_36pt-SemiBold.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
html {
    font-size: 62.5%; 
    margin: 0;
    padding: 0;
}
p, h1, h2, h3, h4, h5, h6 {
    margin: 0; padding: .5rem;
}
body {
    font-family:var(--theme-font-family);
    -webkit-text-size-adjust: none;
    -moz-text-size-adjust: none;
    -ms-text-size-adjust: none;
    padding: 0;
    margin: 0;
    background-image: linear-gradient(90deg, var(--theme-surface) 0%, var(--theme-page) 100%);
    -webkit-tap-highlight-color: transparent;
    overflow-y: auto;        /* 纵向溢出允许滚动 */
    overflow-x: hidden; 
}
body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

:root {
    /* App theme: change these tokens to recolor the active PWA. */
    --theme-color-green:#2eb88e;
    --theme-color-orange:#FCA29D;
    --theme-color-blue:#9E9DFC;
    --theme-primary:var(--theme-color-green);
    --theme-primary-mid:#42c79d;
    --theme-primary-light:#72d8b5;
    --theme-primary-bright:#57cda7;
    --theme-primary-dark:#208665;
    --theme-primary-emphasis:#32ad86;
    --theme-primary-hover:#62cfaa;
    --theme-primary-soft:#e5f5ed;
    --theme-primary-wash:#eff8f4;
    --theme-primary-border:#c6f2e3;
    --theme-primary-rgb:46,184,142;
    --theme-white-rgb:255,255,255;
    --theme-black-rgb:0,0,0;
    --theme-progress-start:#4facfe;
    --theme-progress-end:#00f2fe;
    --theme-progress-start-rgb:79,172,254;
    --theme-page:#f4f5f7;
    --theme-surface:#ffffff;
    --theme-text:#202124;
    --theme-text-secondary:#303236;
    --theme-text-deep:#29332e;
    --theme-text-mid:#555555;
    --theme-text-heading:#303633;
    --theme-text-muted:#899096;
    --theme-text-subtle:#858c91;
    --theme-text-placeholder:#b0b5b8;
    --theme-text-light:#969da1;
    --theme-border:#eceef0;
    --theme-border-soft:#eef0f1;
    --theme-on-primary:#eafff5;
    --theme-on-primary-soft:#e8fff5;
    --theme-danger:#f56565;
    --theme-danger-strong:#ce5361;
    --theme-danger-soft:#fff1f2;
    --theme-danger-label:#e56f79;
    --theme-danger-light:#f17e89;
    --theme-positive:#55c5a3;
    --theme-positive-soft:#a9d9c9;
    --theme-warning:#e0b45a;
    --theme-health-alert:#e7793b;
    --theme-neutral-icon:#b9bdc1;
    --theme-neutral-line:#c9cdd0;
    --theme-neutral-fill:#dcdcdc;
    --theme-neutral-complete:#bfc4c7;
    /* SVG fills: accent follows the theme; neutral and status colors keep their roles. */
    --theme-icon-accent:var(--theme-primary-bright);
    --theme-icon-metric:var(--theme-positive);
    --theme-icon-on-color:var(--theme-surface);
    --theme-icon-muted:#c3c3c3;
    --theme-icon-inactive:#c4c2c3;
    --theme-icon-dark:#444444;
    --theme-icon-subtle:#9f9f9f;
    --theme-text-faint:#a1a7ab;
    --theme-text-footnote:#9ba1a5;
    --theme-text-unit:#91989c;
    --theme-text-caption:#929a96;
    --theme-text-time:#7c8580;
    --theme-text-body:#626b66;
    --theme-shadow-card-subtle:0 1px 8px rgba(30,50,60,.025);
    --theme-shadow-dropdown:0 .7rem 2rem rgba(14,46,34,.2);
    --theme-shadow-shell:0 0 2rem rgba(20,43,40,.06);
    --theme-font-family:'Google Sans Flex',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
    --theme-radius-control:.8rem;
    --theme-radius-card:1.2rem;
    --theme-radius-sheet:1.6rem;

    --font-color-f8:var(--theme-surface);
    --color-a18cd1:var(--theme-primary);
    --color-fbc2eb:#fbc2eb;
    --color-444444:var(--theme-text-secondary);
    --color-e7cb78:var(--theme-warning);
    --color-9f9f9f:var(--theme-text-muted);
    --color-666666:var(--theme-text-muted);
    --bg: #050505;
    --bg--white:var(--theme-surface);
    --bg-a18cd1:var(--theme-primary);
    --primary:var(--theme-primary);
    /* Color variable */
    --gap-1:1rem;
    --gap-2:2rem;
    --gap-3:3rem;
    --gap-4:4rem;
    --gap-7:7rem;
    --gap-V7:.7rem;
    --gap-V15:1.5rem;
    --gap-V5:.5rem;
    /* Distance variable */
    --line-hight:4rem;
    --line-hight-V25:2.5rem;
    --line-hight-2:2rem;
    /* line height */
    --font-title:clamp(6.800rem, calc(5.709rem + 3.409vw), 9.800rem);
    --font-large:clamp(3.000rem, calc(2.782rem + 0.682vw), 3.600rem);
    --font-body:clamp(1.600rem, calc(1.454rem + 0.455vw), 2.000rem);
    --font-mid:clamp(1.800rem, calc(1.655rem + 0.455vw), 2.200rem);
    --font-small:clamp(1.400rem, calc(1.327rem + 0.227vw), 1.600rem);
    --font-caption:1.2rem;
    --font-action:1.3rem;
    --font-label:1.4rem;
    --font-note:1.5rem;
    --font-control:1.6rem;
    --font-body-strong:1.7rem;
    --font-subtitle:1.8rem;
    --font-value:2rem;
    --font-heading:2.2rem;
    --font-dialog-title:2.4rem;
    /* Shared type scale */
    --ease: cubic-bezier(0.6, 0.01, 0.05, 0.95);
    /* --ease-2: cubic-bezier(.36,1.11,.48,1.07); */
    --ease-2:cubic-bezier(.42,0,.58,1);
    --transition-6: .5s var(--ease-2);
    --transition-5: .5s var(--ease);
    /* progress */
    --progress: 10%;    /* 核心变量 */

}
:root[data-theme="orange"] {
    --theme-primary:var(--theme-color-orange);
    --theme-primary-mid:#FCB0AC;
    --theme-primary-bright:#FDBEBA;
    --theme-primary-light:#FDD1CE;
    --theme-primary-dark:#AD5651;
    --theme-primary-emphasis:#C56963;
    --theme-primary-hover:#F78E88;
    --theme-primary-soft:#FFF0EF;
    --theme-primary-wash:#FFF8F7;
    --theme-primary-border:#FDD8D5;
    --theme-primary-rgb:252,162,157;
    --theme-on-primary:#FFF9F8;
    --theme-on-primary-soft:#FFF3F2;
    --theme-icon-accent:var(--theme-primary);
    --theme-icon-metric:var(--theme-primary);
}
:root[data-theme="blue"] {
    --theme-primary:var(--theme-color-blue);
    --theme-primary-mid:#ADACFD;
    --theme-primary-bright:#BCBBFD;
    --theme-primary-light:#CFCEFE;
    --theme-primary-dark:#5756AD;
    --theme-primary-emphasis:#6A69C5;
    --theme-primary-hover:#8C8BF4;
    --theme-primary-soft:#F0EFFF;
    --theme-primary-wash:#F8F7FF;
    --theme-primary-border:#D8D7FD;
    --theme-primary-rgb:158,157,252;
    --theme-on-primary:#F9F8FF;
    --theme-on-primary-soft:#F3F2FF;
    --theme-icon-accent:var(--theme-primary);
    --theme-icon-metric:var(--theme-primary);
}

button {
    margin: 0;
    border: none;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    /* 2. 核心 Flex 阵型（拨乱反正） */
}

/* Shared bottom-sheet base for record and goal forms. */
.app-sheet {
    position:fixed;
    inset:auto 0 0;
    width:min(100%,68rem);
    box-sizing:border-box;
    margin:0 auto;
    padding:0;
    overflow:hidden;
    border:0;
    border-radius:1.5rem 1.5rem 0 0;
    box-shadow:0 -8px 40px rgba(var(--theme-black-rgb),.13);
}
.app-sheet::backdrop { background:rgba(16,32,24,.4); }

.app-confirm-dialog {
    box-sizing:border-box;
    width:min(84vw,38rem);
    margin:auto;
    padding:2.4rem 2rem 1.8rem;
    border:0;
    border-radius:2rem;
    background:var(--theme-page);
    color:var(--theme-text);
    text-align:center;
    box-shadow:0 1.2rem 4rem rgba(var(--theme-black-rgb),.2);
}
.app-confirm-dialog::backdrop { background:rgba(16,32,24,.46); backdrop-filter:blur(3px); }
.app-confirm-dialog[open] { animation:app-confirm-enter .2s cubic-bezier(.2,.8,.2,1) both; }
.app-confirm-icon { width:5rem;height:5rem;margin:0 auto 1.4rem;display:grid;place-items:center;border-radius:50%;background:var(--theme-primary-soft);color:var(--theme-primary-dark); }
.app-confirm-dialog.is-danger .app-confirm-icon { background:var(--theme-danger-soft);color:var(--theme-danger-strong); }
.app-confirm-title { padding:0;color:var(--theme-text-heading);font-size:var(--font-value);font-weight:500; }
.app-confirm-message { margin:1rem 0 2rem;padding:0;color:var(--theme-text-muted);font-size:var(--font-note);line-height:1.5; }
.app-confirm-actions { display:grid;grid-template-columns:1fr 1fr;gap:1rem; }
.app-confirm-actions button { min-height:4.6rem;border-radius:1rem;font:inherit;font-size:var(--font-note);font-weight:500; }
.app-confirm-cancel { background:var(--theme-surface);color:var(--theme-text-secondary); }
.app-confirm-primary { background:var(--theme-primary);color:var(--theme-surface); }
.app-confirm-dialog.is-danger .app-confirm-primary { background:var(--theme-danger); }
@keyframes app-confirm-enter { from { opacity:0;transform:translateY(.8rem) scale(.98); } to { opacity:1;transform:translateY(0) scale(1); } }
@media (prefers-reduced-motion:reduce) { .app-confirm-dialog[open] { animation:none; } }

.addition {
    border-radius: 50%;
    width: 5rem;
    height: 5rem;
    background-color: var(--color-a18cd1);
    box-shadow: 0 0 12px 4px rgba(149, 149, 149, 0.3);
    /* 新增居中核心 */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: .8;
    position: fixed;
    bottom: 9rem;
    right: 2rem;
}

.Arrow-Back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
}
