:root { color-scheme: light; --ink: #21372f; --muted: #65756d; --green: #285744; --green-dark: #183f30; --cream: #f6f5ef; --border: #dce3dc; --light: #edf3ed; --orange: #9c4c24; --error: #9e352b; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: #fafbf8; font-size: 15px; line-height: 1.65; }
a { color: var(--green); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 3px solid #bb8d44; outline-offset: 3px; }
input, select, textarea { min-width: 0; width: 100%; color: var(--ink); background: #fff; border: 1px solid #b9c6bc; border-radius: 7px; padding: 10px 12px; }
textarea { resize: vertical; line-height: 1.7; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(26px, 3vw, 38px); line-height: 1.3; letter-spacing: -.5px; margin-bottom: 14px; }
h2 { font-size: 23px; line-height: 1.4; margin-bottom: 14px; }
h3 { font-size: 16px; margin-bottom: 12px; }
.site-header { display: flex; align-items: center; gap: 24px; min-height: 86px; padding: 14px max(24px, calc((100vw - 1200px) / 2)); background: #fff; border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 750; font-size: 19px; line-height: 1.25; white-space: nowrap; }
.brand small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; letter-spacing: 3px; margin-top: 5px; }
.brand-mark { display: grid; place-items: center; background: var(--green); color: #fff; border-radius: 11px; width: 43px; height: 43px; font-size: 24px; }
nav { display: flex; gap: 5px; margin-left: 20px; }
.nav-button { border: 0; background: transparent; color: var(--muted); padding: 10px 13px; border-radius: 7px; white-space: nowrap; }
.nav-button.active { color: var(--green); background: var(--light); font-weight: 700; }
.account { margin-left: auto; display: flex; gap: 12px; align-items: center; white-space: nowrap; }
.account span { font-size: 12px; color: var(--muted); }
.fridge-picker { flex-direction: row; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.fridge-picker select { width: auto; max-width: 200px; padding: 7px 10px; font-size: 13px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid var(--green); border-radius: 7px; padding: 10px 17px; background: var(--green); color: #fff; font-weight: 600; font-size: 14px; text-decoration: none; line-height: 1.5; transition: background .15s; }
.button:hover:not(:disabled) { background: var(--green-dark); }
.button.secondary { background: #fff; color: var(--green); border-color: #bdcbbf; }
.button.secondary:hover:not(:disabled) { background: var(--light); }
.button.danger { color: var(--error); border-color: #ddb8b2; background: #fff8f7; }
.button.small-button { padding: 5px 10px; font-size: 12px; }
main { max-width: 1248px; margin: 0 auto; padding: 32px 24px 0; min-height: calc(100vh - 86px); }
.hero { display: flex; justify-content: space-between; gap: 40px; padding: 40px 46px; border-radius: 16px; background: #eaf0e5; border: 1px solid #dce6d5; margin-bottom: 38px; }
.hero h1 { font-size: clamp(30px, 3.5vw, 44px); }
.hero p:not(.eyebrow) { color: #51664f; margin-bottom: 24px; }
.eyebrow { color: var(--green); font-size: 12px; letter-spacing: 2px; font-weight: 650; margin-bottom: 11px; }
.hero-stats { padding: 10px 38px; min-width: 210px; align-self: center; text-align: center; color: #476544; }
.hero-stats strong { display: block; font-size: 62px; font-weight: 500; line-height: 1.2; font-variant-numeric: tabular-nums; }
.hero-stats span { display: block; font-size: 13px; }
.stat-divider { height: 1px; background: #c8d5c1; margin: 20px 0 15px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.section-heading h1, .section-heading h2, .section-heading p:last-child { margin-bottom: 0; }
.section-heading .eyebrow { margin-bottom: 6px; }
.section-heading.compact { margin-bottom: 18px; }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: 11px; padding: 24px; background: #fff; }
.filters { display: flex; align-items: end; gap: 14px; padding: 18px 22px; margin-bottom: 20px; flex-wrap: wrap; }
.filters .grow { flex: 1; min-width: 180px; }
.checkbox { flex-direction: row; align-items: center; gap: 7px; min-height: 44px; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--green); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.recipe-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.recipe-card { display: flex; flex-direction: column; padding: 23px; background: #fff; border: 1px solid var(--border); border-radius: 11px; transition: box-shadow .15s, border-color .15s; }
.recipe-card:hover { border-color: #a8bfaa; box-shadow: 0 5px 18px #21372f09; }
.card-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 17px; }
.badge { display: inline-block; color: var(--green); background: var(--light); border-radius: 5px; padding: 3px 8px; font-size: 11px; line-height: 1.6; }
.badge.warning { color: var(--orange); background: #fbefdf; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge.status-ready { color: #17512f; background: #d9efd4; font-weight: 700; }
.badge.status-missing { color: #6b4a2b; background: #eee6da; }
.badge.status-unknown { color: #55605a; background: #e9ece8; }
.recipe-card.status-ready { border-color: #8fbc92; box-shadow: 0 0 0 1px #c9e2c6; }
.recipe-card.status-missing { background: #f2f3f0; border-color: #e1e5de; opacity: .68; }
.recipe-card.status-missing h3, .recipe-card.status-missing .card-summary, .recipe-card.status-missing .card-ingredients { color: #6b746d; }
.recipe-card.status-missing:hover, .recipe-card.status-missing:focus-within { opacity: 1; }
.recipe-card.status-unknown { border-style: dashed; }
.availability { padding: 14px 16px; margin-bottom: 18px; border-radius: 9px; background: var(--cream); font-size: 13px; }
.availability h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.availability p { margin-bottom: 6px; }
.availability p:last-child { margin-bottom: 0; }
.card-cover { margin: 0 0 14px; position: relative; }
/* 图片带有原始 width/height 属性用于占位；必须显式 height: auto，否则属性高度会盖过 aspect-ratio，把竖图撑到几千像素。 */
.card-cover img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; object-position: 50% 40%; border-radius: 8px; background: var(--cream); }
.cover-note { position: absolute; left: 8px; bottom: 8px; padding: 2px 7px; border-radius: 5px; background: #ffffffd9; color: #6b4a2b; font-size: 11px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 320px)); gap: 14px; margin-bottom: 18px; }
.gallery[hidden] { display: none; }
.gallery-item { margin: 0; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: #fff; }
.gallery-item img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; background: var(--cream); }
/* 可双击放大的图片：禁用移动端双击缩放，避免和放大手势冲突。 */
.card-cover img, .gallery-item img, .markdown img { cursor: zoom-in; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.lightbox { width: min(96vw, 1400px); max-height: 96vh; padding: 10px 14px 14px; background: #141817; color: #f1f3f0; border: 0; border-radius: 10px; }
.lightbox::backdrop { background: #000000d9; }
.lightbox-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.lightbox-bar .button.secondary { background: #2a302e; color: #f1f3f0; border-color: #4a534f; }
.lightbox img { display: block; max-width: 100%; max-height: calc(96vh - 110px); width: auto; height: auto; margin: 0 auto; object-fit: contain; cursor: zoom-out; }
.lightbox-caption { margin-top: 10px; font-size: 12px; color: #c4cbc7; text-align: center; }
.lightbox-caption[hidden] { display: none; }
.gallery-item figcaption { padding: 10px 12px; font-size: 12px; }
.gallery-item .badges { margin-bottom: 6px; }
.gallery-item .gallery-caption { margin-bottom: 4px; font-size: 13px; }
.gallery-item .actions { margin-top: 8px; }
.gallery-item.is-hidden img { opacity: .45; }
.gallery-item.is-cover { border-color: #8fbc92; box-shadow: 0 0 0 1px #c9e2c6; }
.image-admin { margin-bottom: 18px; padding: 12px 16px; border: 1px dashed var(--border); border-radius: 9px; }
.image-admin summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.image-admin form { margin-top: 12px; }
.recipe-card h3 { font-size: 20px; margin-bottom: 12px; }
.card-summary { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 18px; }
.card-ingredients { color: var(--muted); font-size: 12px; margin-top: auto; margin-bottom: 18px; }
.recipe-card .button { align-self: flex-start; }
.card-score { font-size: 24px; color: var(--green); line-height: 1; font-weight: 700; }
.match-detail { margin: 0 0 16px; padding-top: 13px; border-top: 1px solid #edf0eb; font-size: 12px; }
.match-detail p { margin-bottom: 7px; }
.missing { color: var(--orange); }
.matching { color: var(--green); }
.empty { padding: 35px 20px; text-align: center; color: var(--muted); border-radius: 9px; background: var(--cream); grid-column: 1 / -1; }
.pagination { display: flex; gap: 20px; align-items: center; justify-content: center; padding: 30px 0 10px; }
.pagination span { color: var(--muted); font-size: 13px; }
.status { padding: 12px 16px; background: #edf4ed; border: 1px solid #bfd1bd; border-radius: 7px; margin-bottom: 20px; white-space: pre-line; overflow-wrap: anywhere; }
.status.error { background: #fff3ef; border-color: #e9c2b9; color: var(--error); }
.notice { padding: 12px 16px; border-left: 3px solid #c09a5f; background: #f9f5ec; color: #755b37; border-radius: 3px; font-size: 13px; margin-bottom: 20px; white-space: pre-line; }
.locked { padding: 42px; text-align: center; margin-top: 28px; }
.inventory-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 22px; margin: 26px 0; }
.stack { display: flex; flex-direction: column; gap: 17px; }
.stack p, .stack .status { margin: 0; }
.stack > .button { align-self: flex-start; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.template-links { display: flex; gap: 22px; flex-wrap: wrap; font-size: 13px; margin-bottom: 20px; }
.file-label { border: 1px dashed #aabbab; border-radius: 9px; padding: 18px; background: #f9fbf7; }
.file-label input { background: transparent; border: 0; padding: 8px 0 0; font-size: 13px; }
#import-preview { margin-top: 22px; }
#import-preview .button { margin-top: 16px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th { font-weight: 600; color: var(--muted); background: #f7f9f5; }
th, td { padding: 12px 13px; border-bottom: 1px solid #e9ede6; vertical-align: middle; }
td:first-child { min-width: 115px; word-break: break-word; }
td .subtext { display: block; font-size: 11px; color: var(--muted); }
td .actions { flex-wrap: nowrap; }
.inventory-table { margin-bottom: 22px; }
.fridge-panel { margin: 26px 0 0; }
.fridge-panel .form-row { align-items: end; }
.inline-form { display: flex; gap: 10px; align-items: end; }
.inline-form label { flex: 1; }
.inline-form .button { white-space: nowrap; }
.users-table table { min-width: 620px; }
.users-table th, .users-table td:not(:first-child) { white-space: nowrap; }
.inventory-filter { max-width: 250px; margin-bottom: 14px; }
.inventory-table table { min-width: 680px; }
.inventory-table td:first-child { width: 42%; min-width: 180px; }
.inventory-notes { overflow-wrap: anywhere; white-space: normal; }
.inventory-table th, .inventory-table td:not(:first-child) { white-space: nowrap; }
#import-preview table { min-width: 500px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.guide-link { text-align: left; padding: 22px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--green); font-weight: 600; }
.guide-link:hover { background: var(--light); }
dialog { color: var(--ink); width: min(480px, calc(100vw - 30px)); max-height: 90vh; border: 1px solid var(--border); border-radius: 12px; padding: 27px; box-shadow: 0 20px 80px #122b2340; overflow-y: auto; }
dialog::backdrop { background: #14291f80; }
.wide-dialog { width: min(860px, calc(100vw - 30px)); }
.dialog-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 15px; }
.dialog-header h2 { margin-bottom: 0; }
.dialog-header > .button { flex-shrink: 0; }
.detail-actions { margin: 20px 0; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { padding: 5px 10px; background: var(--light); border-radius: 5px; font-size: 12px; }
.chip.optional { background: #f2f0ea; color: #746d5c; }
.markdown { padding-top: 12px; line-height: 1.9; overflow-wrap: anywhere; }
.markdown h1 { font-size: 28px; margin-top: 20px; }
.markdown h2 { font-size: 21px; border-bottom: 1px solid var(--border); padding-bottom: 9px; margin-top: 28px; }
.markdown h3 { margin-top: 22px; }
.markdown img { display: block; max-width: 100%; max-height: 520px; height: auto; margin: 20px auto; border-radius: 8px; }
.markdown pre { background: #f1f4ed; padding: 15px; border-radius: 6px; overflow-x: auto; }
.markdown code { font-size: .88em; background: #f1f4ed; padding: 2px 4px; border-radius: 3px; }
.markdown table { display: block; overflow-x: auto; }
.markdown blockquote { padding-left: 15px; border-left: 3px solid #bdc9b9; color: var(--muted); margin-left: 0; }
.image-unavailable { color: var(--muted); font-size: 12px; }
footer { border-top: 1px solid var(--border); margin-top: 44px; padding: 22px 0; text-align: center; color: var(--muted); font-size: 11px; }
.skip-link { position: absolute; left: 14px; top: -100px; background: #fff; padding: 10px; z-index: 10; }
.skip-link:focus { top: 10px; }
@media (max-width: 1050px) { .site-header { gap: 12px; flex-wrap: wrap; } nav { margin-left: 5px; } .account > span { display: none; } .recipe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .site-header { padding: 13px 18px; } nav { order: 3; width: 100%; margin-left: 0; justify-content: space-between; flex-wrap: wrap; } .nav-button { padding: 8px; font-size: 13px; } .account { flex-wrap: wrap; justify-content: flex-end; } .fridge-picker select { max-width: 150px; } main { padding: 20px 16px 0; } .hero { padding: 27px 24px; gap: 14px; } .hero-stats { display: none; } .hero br { display: none; } .hero h1 { font-size: 31px; } .recipe-grid, .guide-grid, .inventory-layout, .fridge-panel .form-row { grid-template-columns: 1fr; } .inline-form { flex-wrap: wrap; } .section-heading { flex-wrap: wrap; gap: 14px; } .filters { padding: 17px; gap: 12px; } .filters .grow { flex-basis: 100%; } .filters label:not(.checkbox) { flex-grow: 1; } .panel { padding: 19px; } .recipe-card { padding: 22px; } dialog { padding: 20px; } .account .button { padding: 8px 11px; font-size: 12px; } .form-row { gap: 12px; } .inventory-table .actions { gap: 7px; } th, td { padding: 11px 8px; } }
