* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #f0f7ff;
    padding: 1.5rem;
    color: #1e4663;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
}

.header-banner {
    background: linear-gradient(135deg, #5a9fd4 0%, #3b7bb0 100%);
    border-radius: 2rem;
    padding: 1.8rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    color: white;
}
.header-banner h1 {
    font-weight: 700;
    font-size: 1.9rem;
    letter-spacing: -0.3px;
}
.header-banner p {
    margin-top: 0.5rem;
    opacity: 0.9;
}

.card-custom {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.03);
    border: 1px solid #c5dff2;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.today-section {
    background: linear-gradient(145deg, #e8f1fa, #d9e9f5);
    border-left: 8px solid #5a9fd4;
}
.today-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c5a7a;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.today-empty {
    color: #5c8db0;
    font-style: italic;
}

.form-label {
    font-weight: 600;
    color: #2c5a7a;
    margin-bottom: 0.4rem;
    display: block;
}
input, textarea {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 1px solid #c5dff2;
    border-radius: 1rem;
    font-family: inherit;
    font-size: 1rem;
}
/* 禁止文本域拖拽 */
.no-drag {
    resize: none;
}
/* 缩短菜名输入框和搜索框 */
.name-input, .search-input {
    max-width: 300px;
}
input:focus, textarea:focus {
    outline: none;
    border-color: #5a9fd4;
    box-shadow: 0 0 0 3px rgba(90,159,212,0.1);
}
button {
    cursor: pointer;
}
.btn-add {
    background: #5a9fd4;
    border: none;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    border-radius: 2rem;
    color: white;
    transition: 0.2s;
}
.btn-add:hover {
    background: #3b7bb0;
    transform: translateY(-2px);
}
.btn-primary {
    background: #7eb6d6;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 2rem;
    font-weight: 500;
}
.btn-primary:hover {
    background: #5a9fd4;
}
.btn-outline {
    background: transparent;
    border: 1px solid #7eb6d6;
    color: #2c5a7a;
    border-radius: 2rem;
    padding: 0.4rem 1rem;
    text-decoration: none;
    display: inline-block;
}
.btn-delete {
    background: #ffe6dd;
    border: none;
    color: #c23d1f;
    border-radius: 2rem;
    padding: 0.3rem 1rem;
    font-size: 0.85rem;
}
.btn-delete:hover {
    background: #f9cfbf;
}
.btn-edit {
    background: #e9f0f5;
    border: none;
    color: #2c5a7a;
    border-radius: 2rem;
    padding: 0.3rem 1rem;
    font-size: 0.85rem;
}
.btn-edit:hover {
    background: #d4e3f0;
}

.search-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.search-box input {
    flex: 1;
    max-width: 300px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: white;
    border-radius: 2rem;
    text-decoration: none;
    color: #2c5a7a;
    border: 1px solid #c5dff2;
}
.pagination a:hover {
    background: #7eb6d6;
    color: white;
}
.pagination .active {
    background: #5a9fd4;
    color: white;
    border-color: #5a9fd4;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}
.recipe-card {
    background: white;
    border-radius: 1.4rem;
    padding: 1.2rem;
    box-shadow: 0 5px 12px rgba(0,0,0,0.05);
    border: 1px solid #e1eff9;
    transition: 0.25s;
    display: flex;
    flex-direction: column;
    position: relative;
}
.recipe-card:hover {
    transform: translateY(-4px);
    border-color: #c5dff2;
}
.recipe-check {
    position: absolute;
    top: 1rem;
    right: 1rem;
}
.recipe-name {
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #2c5a7a;
    border-left: 5px solid #7eb6d6;
    padding-left: 0.7rem;
    word-break: break-word;
    padding-right: 2rem;
}
.ingredient-block, .notes-block {
    margin-top: 0.5rem;
}
.ingredient-label, .notes-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #5c8db0;
    margin-bottom: 0.25rem;
}
.ingredient-text, .notes-text {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #1e4663;
    word-break: break-word;
    white-space: pre-wrap;
    background: #f5faff;
    padding: 0.6rem;
    border-radius: 1rem;
}
.recipe-time {
    font-size: 0.7rem;
    color: #5c8db0;
    margin-top: 0.5rem;
    text-align: right;
    border-top: 1px dashed #c5dff2;
    padding-top: 0.5rem;
}
.card-footer-actions {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.8rem;
}
.empty-state {
    text-align: center;
    padding: 3rem;
    background: #f0f7ff;
    border-radius: 2rem;
    color: #5c8db0;
}
footer {
    text-align: center;
    margin-top: 2.5rem;
    padding: 1rem;
    font-size: 0.8rem;
    color: #8cacc7;
    border-top: 1px solid #c5dff2;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
}
.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 1.8rem;
    border-radius: 2rem;
    width: 90%;
    max-width: 550px;
    box-shadow: 0 20px 30px rgba(0,0,0,0.2);
    border: 1px solid #c5dff2;
    position: relative;
}
.close-modal {
    color: #5c8db0;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close-modal:hover {
    color: #5a9fd4;
}
.modal h3 {
    color: #2c5a7a;
    margin-bottom: 1rem;
}
.modal .form-group {
    margin-bottom: 1rem;
}
.modal .form-group label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.3rem;
    color: #2c5a7a;
}
.modal .btn-save {
    background: #5a9fd4;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 2rem;
    font-weight: bold;
    cursor: pointer;
    margin-right: 0.5rem;
}
.modal .btn-cancel {
    background: #e9f0f5;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 2rem;
    cursor: pointer;
}

.login-container {
    max-width: 400px;
    margin: 5rem auto;
    background: white;
    border-radius: 2rem;
    padding: 2rem;
    box-shadow: 0 20px 30px rgba(0,0,0,0.1);
    border: 1px solid #c5dff2;
}
.login-container h2 {
    color: #2c5a7a;
    text-align: center;
    margin-bottom: 1.5rem;
}
.login-error {
    background: #ffe6dd;
    color: #c23d1f;
    padding: 0.5rem;
    border-radius: 1rem;
    text-align: center;
    margin-bottom: 1rem;
}
.login-hint {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #5c8db0;
}

@media (max-width: 768px) {
    body {
        padding: 0.8rem;
    }
    .header-banner {
        padding: 1.2rem 1rem;
    }
    .header-banner h1 {
        font-size: 1.5rem;
    }
    .recipe-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .card-custom {
        padding: 1rem;
    }
    .today-title {
        font-size: 1.2rem;
    }
    .name-input, .search-input {
        max-width: 100%; /* 移动端自动占满 */
    }
    .search-box input {
        max-width: 100%;
    }
}