@import url("https://fonts.googleapis.com/css2?family=Bevan:ital@0;1&family=Google+Sans+Flex:opsz,wght@6..144,400..800&display=swap");

html {
    background-color: rgb(73, 167, 185);
}

:root {
    --basic-0: #ffffff;
    --basic-100: rgba(31, 33, 35, 0.08);
    --basic-300: rgba(31, 33, 35, 0.48);
    --basic-500: rgba(31, 33, 35, 0.64);
    --basic-900: #1f2123;
    --glass-bg-200: rgba(255, 255, 255, 0.64);
    --glass-bg-100:
        linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.56) 0%,
            rgba(255, 255, 255, 0.56) 100%
        ),
        rgba(55, 89, 123, 0.03);
    --font:
        "Google Sans Flex", -apple-system, BlinkMacSystemFont, "Segoe UI",
        "Noto Sans TC", sans-serif;
    --font-display: "Bevan", var(--font);
}

* {
    box-sizing: border-box;
    font-family: var(--font);
    padding: 0;
    margin: 0;
}

body {
    margin: 0;
    /*background-image: url("image/calm.jpg");
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;*/
}

.data-bg {
    display: block;
    content: "";
    width: 100vw;
    height: 100vh;
    background: url("image/calm.jpg");
    background-size: cover;
    background-position: center center;
    position: fixed;
    z-index: -1;
    top: 0;
}

p {
    margin: 0;
    padding: 0;
}

.content-wrap {
    width: 544px;
    margin: 0 auto;
    position: relative;
    padding: 16px;
}

/*通用陰影*/
.gd-border {
    box-shadow:
        1.25px 0 0 -0.75px rgba(8, 8, 8, 0.2),
        -1.25px 0 0 -0.75px rgba(8, 8, 8, 0.2),
        0 0 0 0.75px rgba(26, 26, 26, 0.1);
}

.gd-border.gd-shadow-md {
    box-shadow:
        1.25px 0 0 -0.75px rgba(8, 8, 8, 0.2),
        -1.25px 0 0 -0.75px rgba(8, 8, 8, 0.2),
        0 0 0 0.75px rgba(26, 26, 26, 0.1),
        0 16px 32px 0 rgba(0, 0, 0, 0.12);
}

/*通用 input*/
.gd-input {
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    corner-shape: superellipse(1.05);
    display: flex;
    padding: 0 16px;
    align-items: center;
    background: var(--basic-100);
    color: var(--basic-300);
    font-size: 14px;
    font-weight: 500;
    line-height: 24px;
    cursor: text;
    box-shadow: inset 0 0 0 1px var(--basic-100);
}

.gd-input-label {
    min-width: fit-content;
    padding: 12px 0;
}

.gd-input-unit {
    color: var(--basic-300);
    line-height: 24px;
    padding: 12px 0;
}

.gd-input input {
    width: 100%;
    outline: 0;
    background: transparent;
    color: var(--basic-900);
    text-align: right;
    font-size: 14px;
    font-weight: 500;
    line-height: 24px;
    border: 0;
    flex-grow: 1;
    padding: 12px 8px;
}

/*通用 btn*/
.gd-btn {
    min-width: fit-content;
    min-height: 40px;
    border-radius: 999px;
    corner-shape: superellipse(1.05);
    border: 0;
    color: var(--basic-900);
    font-size: 14px;
    font-weight: 500;
    line-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    will-change: transform;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.gd-btn-md {
    padding: 8px;
}

.gd-btn-lg {
    padding: 12px;
}

.gd-btn_gray {
    background: var(--basic-100);
    box-shadow: inset 0 0 0 1px var(--basic-100);
}

.gd-btn_black {
    color: var(--basic-0);
    background: var(--basic-900);
}

.gd-btn img {
    width: 24px;
    height: 24px;
    aspect-ratio: 1 / 1;
}

.gd-btn > span {
    padding-inline: 8px;
}

.gd-btn_black img {
    filter: brightness(0) invert(1);
}

/* Custom Navbar */
.gd-navbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 24px;
    width: fit-content;
    margin: 0 auto;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0px;
    padding: 4px;
    border-radius: 999px;
    background: var(--glass-bg-200);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav-item {
    width: 96px;
    min-width: 0;
    height: 60px;
    border-radius: 999px;
    corner-shape: superellipse(1.05);
    display: grid;
    place-items: center;
    gap: 4px;
    padding: 8px 20px;
    color: var(--basic-900);
    background: transparent;
    font-size: 12px;
    font-weight: 700;
    line-height: 16px;
    position: relative;
    z-index: 20;
    text-decoration: none;
    will-change: transform;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;

    &:hover {
        background: var(--basic-100);
    }

    img {
        width: 24px;
        height: 24px;
    }
}

.permission-banner {
    border-radius: 24px;
    corner-shape: superellipse(1.05);
    padding: 24px;
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    color: var(--basic-900);
    font-size: 14px;
    font-weight: 500;
    line-height: 24px;
    background: var(--glass-bg-100);
}

#js-cup-water-level {
    background: rgba(255,255,255,0.64);
    overflow: hidden;
    mix-blend-mode: screen;
}

.cup-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cup-progress {
    z-index: 4;
    text-align: center;
    pointer-events: none;
}

.cup-progress-ml {
    font-family: var(--font-display);
    color: var(--basic-900);
    font-size: 32px;
    font-weight: 400;
    line-height: 40px;
    font-style: italic;

    span {
        font-family: var(--font-display);
        font-style: italic;
    }
}

.cup-progress-meta {
    color: var(--basic-500);
    font-size: 14px;
    font-weight: 400;
    line-height: 24px;
}

.cup-card {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 1000px;
    position: relative;
    overflow: hidden;
    background: rgba(172, 222, 225, 0.24);
    margin-bottom: 8px;
    margin-inline: auto;
    box-shadow: 1.25px 0 0 -0.75px rgba(8, 8, 8, 0.2),
            -1.25px 0 0 -0.75px rgba(8, 8, 8, 0.2),
            0 0 0 0.75px rgba(26, 26, 26, 0.1),
            0 2px 2px 0 rgba(255,255,255,0.24) inset,
            0 -2px 2px 0 rgba(255,255,255,0.24) inset;
}

/* Page Content Container */
.page-content {
    position: relative;
    padding-bottom: calc(env(safe-area-inset-bottom) + 16px + 68px);
}

.gd-title {
    color: var(--basic-900);
    font-size: 32px;
    font-weight: 700;
    line-height: 40px;
    padding: 8px;
    padding-top: 32px;
    margin: 0;
}

h1.gd-title {
    font-family: var(--font-display);
    font-style: italic;
    text-align: center;
    font-size: 64px;
    font-weight: 400;
    line-height: 80%;
}

/* Dashboard Cards Grid */
.cards-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Chrome / Edge / Safari */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/*控制*/
.control-card {
    min-height: 76px;
    border-radius: 24px;
    corner-shape: superellipse(1.05);
    padding: 24px;
    margin-top: -4px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--glass-bg-200);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    .gd-input {
        flex-grow: 1;
    }

    .gd-btn {
        width: auto;
    }
}

.card-label {
    font-size: 20px;
    line-height: 40px;
    font-weight: 700;
    min-width: 64px;
    color: var(--basic-900);
}

/*設定*/
.settings-card {
    border-radius: 24px;
    corner-shape: superellipse(1.05);
    padding: 24px;
    margin-top: -4px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: var(--glass-bg-200);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.section-heading {
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 8px;

    p {
        flex-grow: 1;
    }
}

.settings-row-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bottom-gradient {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 80px;
    background: linear-gradient(
        0deg,
        rgba(73, 167, 185, 0.8) 0%,
        rgba(73, 167, 185, 0) 100%
    );
    pointer-events: none;
    z-index: 10;
}

.toast {
    position: fixed;
    left: 50%;
    top: 24px;
    z-index: 1000;
    min-width: fit-content;
    max-width: calc(100vw - 16px);
    transform: translate(-50%, 12px);
    padding: 12px 16px;
    border-radius: 999px;
    corner-shape: superellipse(1.05);
    background: rgba(31, 33, 35, 0.88);
    opacity: 0;
    pointer-events: none;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    line-height: 20px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;

    .toast-message-text {
        color: var(--basic-0);
        padding: 8px;
    }
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

.toast-action {
    min-width: fit-content;
    min-height: 32px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    color: var(--basic-900);
    background: var(--basic-0);
    font-size: 12px;
    line-height: 32px;
    font-weight: 700;
}

/*rwd*/
@media (max-width: 768px) {
    body {
        min-width: 320px;
    }

    .content-wrap {
        width: 100%;
        max-width: 544px;
        padding: 12px;
    }
}

/* 暫時替代 glass-effect.js 的毛玻璃效果 */
[data-glass-effect*="bl:4"] {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
[data-glass-effect*="bl:2"] {
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
[data-glass-effect*="bl:0"] {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
/* 屬性為空，或沒有包含 bl: 的預設模糊值 */
[data-glass-effect=""],
[data-glass-effect]:not([data-glass-effect*="bl:"]) {
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.glass-effect-css-fallback [data-glass-effect] {
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}
