* {
    box-sizing: border-box;
}


body {
    margin: 0;
    padding: 0;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Microsoft YaHei",
        sans-serif;

    background: #f6f3ef;
    color: #3d342d;
}


.container {
    max-width: 680px;

    margin: 0 auto;

    padding: 28px 16px 50px;
}


/* =====================
   页面标题
===================== */

.page-header {
    margin-bottom: 22px;
}


.page-header h1 {
    margin: 0 0 8px;

    font-size: 28px;

    letter-spacing: -0.5px;
}


.page-header p {
    margin: 0;

    color: #766d66;

    font-size: 14px;

    line-height: 1.7;
}


/* =====================
   卡片
===================== */

.card,
.result-card,
.saved-section {
    background: #ffffff;

    border-radius: 16px;

    padding: 22px;

    margin-bottom: 16px;

    box-shadow:
        0 4px 16px rgba(60, 45, 35, 0.06);
}


.card h2,
.result-header h2,
.saved-section h2 {
    margin: 0;

    font-size: 20px;
}


.result-card h3 {
    margin: 0 0 5px;

    font-size: 16px;
}


/* =====================
   描述文字
===================== */

.section-desc {
    margin: 6px 0 16px;

    font-size: 13px;

    color: #8a817a;

    line-height: 1.6;
}


.small-note {
    margin: 12px 0 0;

    font-size: 12px;

    color: #99918b;

    line-height: 1.6;
}


/* =====================
   输入区域
===================== */

.input-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;
}


.input-item {
    display: flex;

    flex-direction: column;
}


.input-item label {
    margin-bottom: 6px;

    font-size: 14px;

    font-weight: 600;

    color: #4a4038;
}


input {
    width: 100%;

    padding: 11px 12px;

    border: 1px solid #ded8d2;

    border-radius: 10px;

    background: #fff;

    font-size: 16px;

    color: #3d342d;

    transition: 0.2s;
}


input:focus {
    outline: none;

    border-color: #9a7b62;

    box-shadow:
        0 0 0 3px rgba(154, 123, 98, 0.1);
}


.optional-section {
    margin-top: 22px;

    padding-top: 18px;

    border-top:
        1px solid #eee8e2;
}


.optional-section h3 {
    margin: 0 0 12px;

    font-size: 15px;
}


.optional-section h3 span {
    margin-left: 5px;

    font-size: 12px;

    font-weight: normal;

    color: #999;
}


/* =====================
   按钮
===================== */

button {
    font-family: inherit;

    cursor: pointer;
}


.primary-btn {
    width: 100%;

    margin-top: 22px;

    padding: 14px;

    border: none;

    border-radius: 11px;

    background: #4c3828;

    color: white;

    font-size: 16px;

    font-weight: 600;

    transition: 0.2s;
}


.primary-btn:hover {
    background: #624a36;
}


.action-row {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 10px;

    margin-top: 10px;
}


.secondary-btn {
    padding: 11px;

    border: 1px solid #ded8d2;

    border-radius: 10px;

    background: #fff;

    color: #685d54;

    font-size: 14px;
}


.secondary-btn:hover {
    background: #f7f4f1;
}


/* =====================
   结果区域
===================== */

.result {
    display: none;

    margin-top: 20px;
}


.result-header {
    margin-bottom: 14px;
}


/* 基础数据 */

.compact-grid {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 10px;
}


.data-item {
    padding: 12px;

    border-radius: 10px;

    background: #f8f6f3;
}


.data-label {
    display: block;

    margin-bottom: 6px;

    font-size: 12px;

    color: #817870;
}


.data-item strong {
    font-size: 21px;

    color: #3d342d;
}


/* =====================
   营养数据网格
===================== */

.nutrition-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 8px;

    margin-top: 14px;
}


.nutrition-item {
    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: 11px 12px;

    border-radius: 10px;

    background: #f8f6f3;

    min-height: 46px;
}


.nutrition-item span {
    font-size: 13px;

    color: #716860;
}


.nutrition-item strong {
    font-size: 17px;

    color: #40362f;
}


.energy-card {
    text-align: center;
}


.energy-value {
    margin: 12px 0 5px;
}


.energy-value strong {
    font-size: 34px;

    letter-spacing: -1px;
}


.energy-value span {
    margin-left: 5px;

    font-size: 14px;

    color: #847a72;
}


/* =====================
   保存区域
===================== */

.save-section {
    display: flex;

    gap: 10px;

    margin-bottom: 20px;
}


.save-section input {
    flex: 1;
}


.save-btn {
    padding: 0 16px;

    border: none;

    border-radius: 10px;

    background: #6c8975;

    color: white;

    font-size: 14px;

    white-space: nowrap;
}


.save-btn:hover {
    opacity: 0.9;
}


/* =====================
   已保存猫粮
===================== */

.saved-section {
    margin-top: 20px;
}


.saved-list {
    margin-top: 16px;
}


.saved-item {
    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: 13px;

    margin-bottom: 8px;

    border-radius: 10px;

    background: #f8f6f3;
}


.saved-name {
    font-size: 15px;

    font-weight: 600;
}


.saved-date {
    margin-top: 3px;

    font-size: 11px;

    color: #999;
}


.saved-actions {
    display: flex;

    gap: 6px;
}


.saved-actions button {
    padding: 7px 9px;

    border: 1px solid #ded8d2;

    border-radius: 7px;

    background: white;

    font-size: 12px;
}


.empty-text {
    text-align: center;

    color: #aaa;

    font-size: 13px;

    padding: 15px;
}


/* =====================
   免责声明
===================== */

.disclaimer {
    margin-top: 28px;

    padding: 0 6px;

    color: #aaa39c;

    font-size: 11px;

    line-height: 1.7;
}


.disclaimer p {
    margin: 6px 0;
}


/* =====================
   手机优化
===================== */

@media (max-width: 480px) {

    .container {
        padding: 20px 12px 40px;
    }


    .page-header h1 {
        font-size: 24px;
    }


    .card,
    .result-card,
    .saved-section {
        padding: 17px;

        border-radius: 14px;
    }


    .input-grid {
        gap: 10px;
    }


    .nutrition-item {
        padding: 10px;
    }


    .energy-value strong {
        font-size: 30px;
    }


    .save-section {
        flex-direction: column;
    }


    .save-btn {
        height: 42px;
    }

}


/* 超窄手机 */

@media (max-width: 360px) {

    .input-grid {
        grid-template-columns: 1fr;
    }


    .nutrition-grid {
        grid-template-columns: 1fr;
    }

}