*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --green-dark: #1a7a4a;
    --green-mid: #2db56e;
    --green-light: #e8f8ef;
    --teal: #4dd4ac;
    --text-main: #1a2e1f;
    --text-muted: #6b8f71;
    --text-label: #888;
    --white: #ffffff;
    --radius-pill: 999px;
    --shadow-soft: 0 2px 12px rgba(30, 100, 60, .08);
    --shadow-card: 0 8px 22px rgba(30, 100, 60, .12);
    --font: 'Nunito', sans-serif;
}

body {
    font-family: var(--font);
    background: #f0f7f3;
    color: var(--text-main);
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

img {
    display: block;
    max-width: 100%;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.app {
  width: 100%;
  min-height: 100dvh;
  background: var(--green-pale);
  display: flex;
  flex-direction: column;
  padding-bottom: 72px;
}

.scroll-content {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
}

.scroll-content::-webkit-scrollbar {
    display: none;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 0px 14px;
    background: #f5faf7;
    position: sticky;
    top: 0;
    z-index: 10;
}

.app-header h1 {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--green-mid);
    flex: 1;
    text-align: center;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    width: 32px;
    height: 32px;
}

.btn-back {
    text-decoration: none;
}

.header-spacer {
    width: 32px;
}

/* .section {
    padding: 0 18px;
} */

.arrow-icon {
    color: #b0c8b8;
    flex-shrink: 0;
}

.quality-section {
    padding-top: 22px;
    padding-bottom: 6px;
}

.quality-heading {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 12px;
}

.quality-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--green-mid), #20a96a);
    color: var(--white);
    font-size: .95rem;
    font-weight: 800;
    padding: 9px 28px;
    border-radius: var(--radius-pill);
    box-shadow: 0 2px 12px rgba(30, 100, 60, .08);
}

.history-section {
    padding-top: 26px;
}

.history-heading {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 14px;
}

.sleep-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 2px 12px rgba(30, 100, 60, .08);
    margin-bottom: 16px;
}

.sleep-row-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sleep-icon {
    font-size: 1.1rem;
}

.sleep-row-title {
    font-size: .92rem;
    font-weight: 800;
    color: var(--text-main);
}

.sleep-time-block {
    padding: 0 2px;
}

.sleep-time-label {
    font-size: .78rem;
    font-weight: 700;
    color: var(--text-label);
    display: block;
    margin-bottom: 4px;
}

.sleep-time-value {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.sleep-time-value strong {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-main);
}

.sleep-unit {
    font-size: .85rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-right: 4px;
}

.article-section {
    padding-top: 26px;
}

.sleep-article {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.article-img-wrap {
    width: 100%;
    height: 160px;
    background: linear-gradient(160deg, #5aade4, #3d8fc5 60%, #7ec8e3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.cloud-art {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.cloud {
    width: 120px;
    height: 50px;
    background: rgba(255, 255, 255, .92);
    border-radius: 50px;
    position: relative;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}

.cloud::before {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, .92);
    border-radius: 50%;
    top: -28px;
    left: 20px;
}

.cloud::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, .92);
    border-radius: 50%;
    top: -16px;
    right: 22px;
}

.zzz {
    font-size: 1.3rem;
    font-weight: 900;
    color: rgba(255, 255, 255, .85);
    letter-spacing: .3em;
    position: absolute;
    top: 14px;
    right: 60px;
}

.article-body {
    padding: 16px 16px 18px;
}

.article-title {
    font-size: 1rem;
    font-weight: 900;
    color: var(--text-main);
    margin-bottom: 6px;
    line-height: 1.3;
}

.article-desc {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.5;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    /* max-width: 420px; */
    background: var(--white);
    border-top: 1px solid #eaf0ec;
    display: flex;
    z-index: 100;
    box-shadow: 0 -8px 26px rgba(30, 100, 60, .08);
    /* border-radius: 50px; */
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 4px 12px;
    gap: 3px;
    text-decoration: none;
    color: #4b4f52;
    font-size: .72rem;
    font-weight: 800;
    background: none;
    border: none;
    font-family: var(--font);
    cursor: pointer;
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-item.active {
    color: var(--green-mid);
}

.nav-item.active svg {
    stroke: var(--green-mid);
}

.desktop-sidebar {
    display: none;
}

.desktop-header {
    display: none;
}

.desktop-header {
    display: none;
}

@media (min-width: 768px) {
    body {
        display: flex;
        min-height: 100vh;
        background: #eef6f1;
    }

    .desktop-sidebar {
        display: flex;
        flex-direction: column;
        width: 240px;
        min-height: 100vh;
        background: #1a7a4a;
        padding: 32px 20px 24px;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 200;
        gap: 8px;
    }

    .sidebar-logo {
        font-size: 1.5rem;
        font-weight: 900;
        color: #fff;
        letter-spacing: .15em;
        margin-bottom: 32px;
        padding: 0 8px;
    }

    .sidebar-nav {
        display: flex;
        flex-direction: column;
        gap: 4px;
        flex: 1;
    }

    .sidebar-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 11px 14px;
        border-radius: 12px;
        text-decoration: none;
        color: rgba(255, 255, 255, .65);
        font-size: .92rem;
        font-weight: 700;
        transition: background .15s, color .15s;
    }

    .sidebar-link:hover,
    .sidebar-link.active {
        background: rgba(255, 255, 255, .18);
        color: #fff;
    }

    .sidebar-link svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

    .sidebar-badge {
        margin-top: auto;
        background: rgba(255, 255, 255, .12);
        border-radius: 12px;
        padding: 12px 14px;
        display: flex;
        align-items: center;
        gap: 8px;
        color: #fff;
        font-size: .85rem;
        font-weight: 800;
    }

    .sidebar-badge .dot {
        width: 10px;
        height: 10px;
        background: #2db56e;
        border-radius: 50%;
    }

    .app {
        margin-left: 240px;
        width: calc(100% - 240px);
        max-width: none;
        min-height: 100vh;
        padding-bottom: 0;
        background: transparent;
        padding: 20px;
    }

    .app-header {
        display: none;
    }

    .name-bar {
        display: none;
    }

    .bottom-nav {
        display: none;
    }

    .scroll-content {
        overflow: visible;
        max-height: none;
        padding: 0 36px 36px;
    }

    .desktop-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 28px 36px 20px;
    }

    .desktop-header h1 {
        font-size: 1.9rem;
        font-weight: 900;
        color: #1a2e1f;
    }

    .desktop-header-right {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .desktop-user-pill {
        display: flex;
        align-items: center;
        gap: 10px;
        background: #fff;
        border-radius: 999px;
        padding: 8px 16px;
        box-shadow: 0 2px 12px rgba(30, 100, 60, .08);
        font-size: .9rem;
        font-weight: 800;
        color: #1a2e1f;
    }

    .desktop-user-pill .dot {
        width: 10px;
        height: 10px;
        background: #2db56e;
        border-radius: 50%;
    }

    .section {
        padding: 0;
        margin-bottom: 24px;
    }

    .section-header {
        margin-bottom: 14px;
    }

    .section-header h2 {
        font-size: 1.25rem;
    }

    .banner {
        margin: 0;
        border-radius: 18px;
    }

    .tips-scroll {
        flex-wrap: wrap;
        overflow: visible;
    }

    .tip-card {
        flex: 0 0 calc(50% - 6px);
    }

    .tip-paragraph {
        padding: 4px 0 0;
    }

    .bar-chart {
        height: 160px;
    }

    .chart-box {
        border-radius: 18px;
        padding: 24px;
    }

    .meals-list,
    .exercise-list {
        gap: 14px;
    }

    .meal-item,
    .exercise-item {
        padding: 18px 20px;
        border-radius: 18px;
    }

    .meal-thumb,
    .ex-thumb {
        width: 54px;
        height: 54px;
    }

    .desktop-grid {
        display: grid;
        grid-template-columns: 1fr 300px;
        gap: 24px;
        align-items: start;
    }

    .desktop-main {
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .desktop-aside {
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .shop-card {
        padding: 18px;
        gap: 18px;
    }

    .shop-card-image {
        width: 90px;
        height: 90px;
    }

    .summary-card {
        padding: 24px;
        gap: 28px;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 1.7rem;
    }
}

@media (min-width: 1100px) {
    .scroll-content {
        padding: 0 44px 44px;
    }

    .desktop-header {
        padding: 28px 44px 20px;
    }

    .desktop-grid {
        grid-template-columns: 1fr 340px;
        gap: 28px;
    }

    .stat-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .tip-card {
        flex: 0 0 calc(33.33% - 8px);
    }

    .bar-chart {
        height: 180px;
    }
}

@media (max-width: 380px) {
    .app-header {
        padding-inline: 14px;
    }
}