* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f5f7f1;
    color: #14220f;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.phone {
    position: relative;
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    margin: 0 auto;
    overflow: hidden;
    background: #fffef8;
    /* border: 1px solid #31512c; */
}

.page-radio {
    display: none;
}

.page {
    display: none;
    min-height: calc(100vh - 72px);
    padding-bottom: 84px;
}

#home-page:checked~.page-home,
#profile-page:checked~.page-profile,
#record-page:checked~.page-record {
    display: block;
}

.app-header {
    min-height: 118px;
    padding: 10px 18px 16px;
    color: #fff;
    background: #3f9b3f;
    /* border-bottom: 1px solid #284d26; */
}

.status-bar,
.title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.status-bar {
    height: 24px;
    font-size: 13px;
    font-weight: 700;
}

.phone-status {
    letter-spacing: 1px;
}

.title-row h1 {
    flex: 1;
    margin: 8px 0 0;
    text-align: center;
    font-size: 24px;
    line-height: 1.2;
    letter-spacing: 0;
}

.capsule {
    min-width: 72px;
    margin-top: 6px;
    padding: 5px 10px;
    text-align: center;
    font-size: 15px;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, .85);
    border-radius: 18px;
    background: rgba(31, 99, 30, .35);
}

.content {
    padding: 16px 18px 0;
}

.hero-card {
    position: relative;
    min-height: 124px;
    padding: 0;
    overflow: hidden;
    border: 2px solid #2d4e28;
    border-radius: 7px;
    background: #fffef8;
}

.hero-bg {
    display: block;
    width: 100%;
    min-height: 124px;
    object-fit: cover;
}

.hero-text {
    position: absolute;
    top: 26px;
    left: 34px;
    right: 94px;
}

.hero-card h2 {
    margin: 0;
    font-size: 26px;
    line-height: 1.2;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    color: #31512c;
    font-size: 15px;
    font-weight: 700;
}

.section-title span {
    width: 72px;
    height: 1px;
    background: #31512c;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.feature-card {
    min-height: 116px;
    padding: 18px 8px 12px;
    text-align: center;
    border: 2px solid #31512c;
    border-radius: 7px;
    background: #fffef8;
}

.feature-card p {
    margin: 12px 0 0;
    font-size: 18px;
    font-weight: 700;
}

.feature-icon {
    display: block;
    width: 54px;
    height: 60px;
    margin: 0 auto;
}

.hex {
    position: relative;
    display: block;
    width: 48px;
    height: 54px;
    margin: 0 auto;
    border: 2px solid #31512c;
    clip-path: polygon(50% 0, 94% 24%, 94% 76%, 50% 100%, 6% 76%, 6% 24%);
}

.hex::after {
    position: absolute;
    inset: 13px;
    border: 2px solid #31512c;
    border-radius: 4px;
    content: "";
}

.icon-leaf::after,
.icon-sprout::after,
.icon-water::after,
.icon-shield::after {
    border-radius: 50% 0 50% 50%;
    transform: rotate(-45deg);
}

.icon-ph::after {
    height: 2px;
    border-width: 2px 0 0;
    border-radius: 0;
    box-shadow: 0 10px 0 #31512c, 16px 18px 0 -1px #31512c;
}

.profile-header {
    min-height: 156px;
    background:
        linear-gradient(150deg, rgba(255, 255, 255, .12) 0 12%, transparent 12% 24%, rgba(255, 255, 255, .12) 24% 36%, transparent 36%),
        #3f9b3f;
}

.profile-panel {
    margin-top: -58px;
    padding-bottom: 18px;
    text-align: center;
    background: #fffef8;
    border-radius: 24px 24px 0 0;
}

.avatar {
    width: 94px;
    height: 94px;
    margin: -35px auto 8px;
}

.profile-panel h2 {
    margin: 0;
    font-size: 16px;
}

.profile-content {
    padding-top: 14px;
}

.setting-title,
.setting-item,
.profile-actions {
    border-bottom: 1px solid #b9c8ad;
}

.setting-title {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 4px 12px;
    font-size: 18px;
}

.profile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 16px 0 18px;
}

.profile-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    border-width: 1.5px;
}

button {
    height: 44px;
    color: #14220f;
    font: inherit;
    font-weight: 700;
    border: 2px solid #31512c;
    border-radius: 6px;
    background: #fffef8;
}

button.primary {
    color: #fff;
    background: #3f9b3f;
}

.setting-list {
    margin-top: 12px;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 68px;
    font-size: 18px;
}

.setting-item i,
.mini-settings i {
    margin-left: auto;
    font-style: normal;
    font-size: 32px;
}

.line-icon,
.tab-icon {
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border: 2px solid #31512c;
}

.user-icon,
.mine-icon {
    border: 0;
}

.line-icon.user-icon,
.badge-icon,
.safe-icon,
.notice-icon,
.help-icon {
    border: 0;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.line-icon.user-icon {
    background-image: url("./assets/icons/profile-user.svg");
}

.badge-icon {
    background-image: url("./assets/icons/profile-badge.svg");
}

.safe-icon {
    background-image: url("./assets/icons/profile-safe.svg");
}

.notice-icon {
    background-image: url("./assets/icons/profile-notice.svg");
}

.help-icon {
    background-image: url("./assets/icons/profile-help.svg");
}

.line-icon.user-icon::before,
.line-icon.user-icon::after {
    content: none;
}

.user-icon::before,
.mine-icon::before {
    position: absolute;
    left: 6px;
    top: 1px;
    width: 10px;
    height: 10px;
    border: 2px solid #31512c;
    border-radius: 50%;
    content: "";
}

.user-icon::after,
.mine-icon::after {
    position: absolute;
    left: 2px;
    top: 14px;
    width: 18px;
    height: 10px;
    border: 2px solid #31512c;
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    content: "";
}

.badge-icon,
.safe-icon,
.notice-icon,
.help-icon {
    border-radius: 50%;
}

.record-content {
    padding-top: 18px;
}

.mini-settings {
    padding: 10px 16px 14px;
    border: 2px solid #31512c;
    border-radius: 7px;
}

.mini-settings div {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    border-bottom: 1px solid #c9d4c0;
    font-size: 14px;
    font-weight: 700;
}

.mini-settings em {
    margin-left: auto;
    color: #3f9b3f;
    font-size: 12px;
    font-style: normal;
}

.mini-settings .pill-row {
    justify-content: space-between;
    gap: 22px;
    padding-top: 12px;
    border-bottom: 0;
}

.pill-row button {
    flex: 1;
    height: 34px;
    border-radius: 18px;
    font-size: 13px;
}

.records {
    margin-top: 28px;
}

.records h2 {
    margin: 0 0 22px;
    font-size: 22px;
}

.records h3 {
    margin: 0 0 14px;
    font-size: 18px;
}

.chart {
    display: grid;
    grid-template-columns: 34px 1fr;
    height: 224px;
}

.y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-bottom: 24px;
    color: #5c6657;
    font-size: 12px;
}

.bars {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    align-items: end;
    gap: 14px;
    height: 200px;
    padding: 0 4px 24px;
    border-left: 1px solid #87937f;
    border-bottom: 1px solid #87937f;
    background: repeating-linear-gradient(to top, transparent 0 39px, #d6ddce 40px);
}

.bars span {
    position: relative;
    display: block;
    width: 14px;
    height: var(--h);
    justify-self: center;
    border: 1px solid #3a8a38;
    background: repeating-linear-gradient(90deg, #4b9d3d 0 3px, #9dcd78 3px 6px);
}

.bars i {
    position: absolute;
    left: 50%;
    bottom: -24px;
    width: 32px;
    transform: translateX(-50%);
    color: #5c6657;
    font-size: 12px;
    font-style: normal;
    text-align: center;
}

.tabbar {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
    max-width: 430px;
    height: 72px;
    transform: translateX(-50%);
    border-top: 1px solid #31512c;
    /* border: 1px solid #31512c; */
    border-bottom: 0;
    background: #fffef8;
}

.tabbar label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 13px;
    font-weight: 700;
}

.tab-icon {
    border: 0;
    background: #31512c;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    width: 24px;
    height: 24px;
}

.home-icon {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.5 11.2 12 4l8.5 7.2v8.3h-5.4v-5.8H8.9v5.8H3.5z' fill='none' stroke='white' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.5 11.2 12 4l8.5 7.2v8.3h-5.4v-5.8H8.9v5.8H3.5z' fill='none' stroke='white' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.record-icon {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4.5' y='5' width='15' height='13.8' rx='2.2' fill='none' stroke='white' stroke-width='1.8'/%3E%3Cpath d='M8 9h2.2M13.2 9H16M8 13h1.8M12.7 13H16' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4.5' y='5' width='15' height='13.8' rx='2.2' fill='none' stroke='white' stroke-width='1.8'/%3E%3Cpath d='M8 9h2.2M13.2 9H16M8 13h1.8M12.7 13H16' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

.tool-icon {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5.2 5.3h13.6v6.2c0 4.1-2.4 6.9-6.8 8.1-4.4-1.2-6.8-4-6.8-8.1z' fill='none' stroke='white' stroke-width='1.8' stroke-linejoin='round'/%3E%3Cpath d='M8.4 9.2h7.2' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5.2 5.3h13.6v6.2c0 4.1-2.4 6.9-6.8 8.1-4.4-1.2-6.8-4-6.8-8.1z' fill='none' stroke='white' stroke-width='1.8' stroke-linejoin='round'/%3E%3Cpath d='M8.4 9.2h7.2' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

.tabbar .mine-icon {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='7.4' r='3.5' fill='none' stroke='white' stroke-width='1.8'/%3E%3Cpath d='M5.2 20c.7-4 3.1-6.1 6.8-6.1s6.1 2.1 6.8 6.1' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='7.4' r='3.5' fill='none' stroke='white' stroke-width='1.8'/%3E%3Cpath d='M5.2 20c.7-4 3.1-6.1 6.8-6.1s6.1 2.1 6.8 6.1' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

.tabbar .mine-icon::before,
.tabbar .mine-icon::after {
    content: none;
}

#home-page:checked~.tabbar .nav-home,
#profile-page:checked~.tabbar .nav-profile,
#record-page:checked~.tabbar .nav-record {
    color: #3f9b3f;
}

#home-page:checked~.tabbar .nav-home .tab-icon,
#profile-page:checked~.tabbar .nav-profile .tab-icon,
#record-page:checked~.tabbar .nav-record .tab-icon {
    background: #3f9b3f;
}

@media (max-width: 360px) {
    .hero-card h2 {
        font-size: 22px;
    }

    .feature-card p,
    .setting-item {
        font-size: 16px;
    }

    .profile-actions {
        gap: 10px;
    }
}
