|
@@ -1,152 +1,121 @@
|
|
|
-.recipe-image-container {
|
|
|
- position: relative;
|
|
|
- width: 100%;
|
|
|
- height: 250px;
|
|
|
- overflow: hidden;
|
|
|
-
|
|
|
- .recipe-image {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- object-fit: cover;
|
|
|
- }
|
|
|
-
|
|
|
- .image-overlay {
|
|
|
- position: absolute;
|
|
|
- top: 10px;
|
|
|
- right: 10px;
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- gap: 5px;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
+/* 头部样式 & 菜品信息 */
|
|
|
.recipe-header {
|
|
|
padding: 16px;
|
|
|
-
|
|
|
- .recipe-title {
|
|
|
- font-size: 1.8rem;
|
|
|
- font-weight: bold;
|
|
|
- margin-bottom: 8px;
|
|
|
- color: var(--ion-color-dark);
|
|
|
- }
|
|
|
-
|
|
|
- .recipe-meta {
|
|
|
- display: flex;
|
|
|
- gap: 16px;
|
|
|
- margin-top: 8px;
|
|
|
-
|
|
|
- .meta-item {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- font-size: 0.9rem;
|
|
|
- color: var(--ion-color-medium);
|
|
|
-
|
|
|
- ion-icon {
|
|
|
- margin-right: 4px;
|
|
|
- font-size: 1rem;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ background: white;
|
|
|
+ margin-bottom: 16px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column; /* 统一布局方向 */
|
|
|
}
|
|
|
|
|
|
-.section-card {
|
|
|
- margin: 16px;
|
|
|
- border-radius: 12px;
|
|
|
+.recipe-header ion-toolbar {
|
|
|
+ --background: white;
|
|
|
+ --border-width: 0;
|
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
|
-
|
|
|
- ion-card-header {
|
|
|
- padding-bottom: 0;
|
|
|
-
|
|
|
- ion-card-title {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- font-size: 1.2rem;
|
|
|
- color: var(--ion-color-dark);
|
|
|
-
|
|
|
- ion-icon {
|
|
|
- margin-right: 8px;
|
|
|
- color: var(--ion-color-primary);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
-.step-item {
|
|
|
- --padding-start: 0;
|
|
|
- --inner-padding-end: 0;
|
|
|
- align-items: flex-start;
|
|
|
-
|
|
|
- .step-number {
|
|
|
- width: 28px;
|
|
|
- height: 28px;
|
|
|
- background: var(--ion-color-primary);
|
|
|
- color: white;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- font-size: 0.9rem;
|
|
|
- font-weight: bold;
|
|
|
- margin-right: 12px;
|
|
|
- }
|
|
|
-
|
|
|
- ion-label {
|
|
|
- margin-top: 4px;
|
|
|
- margin-bottom: 4px;
|
|
|
-
|
|
|
- p {
|
|
|
- margin: 0;
|
|
|
- color: var(--ion-color-dark);
|
|
|
- line-height: 1.5;
|
|
|
- }
|
|
|
- }
|
|
|
+.recipe-header .header-title,
|
|
|
+.recipe-header .recipe-title {
|
|
|
+ font-size: 1.8rem;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-bottom: 8px;
|
|
|
+ color: var(--ion-color-dark);
|
|
|
}
|
|
|
|
|
|
-@media (min-width: 768px) {
|
|
|
- .recipe-image-container {
|
|
|
- height: 350px;
|
|
|
- }
|
|
|
-
|
|
|
- .section-card {
|
|
|
- margin: 20px auto;
|
|
|
- max-width: 800px;
|
|
|
- }
|
|
|
+.recipe-header .recipe-meta {
|
|
|
+ display: flex;
|
|
|
+ gap: 16px;
|
|
|
+ margin-top: 8px;
|
|
|
}
|
|
|
|
|
|
-/* 头部样式 */
|
|
|
-.recipe-header {
|
|
|
-ion-toolbar {
|
|
|
- --background: white;
|
|
|
- --border-width: 0;
|
|
|
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
|
-
|
|
|
- .header-title {
|
|
|
- font-size: 1.2rem;
|
|
|
- font-weight: 600;
|
|
|
- color: var(--ion-color-dark);
|
|
|
- }
|
|
|
+.recipe-header .meta-item {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 0.9rem;
|
|
|
+ color: var(--ion-color-medium);
|
|
|
}
|
|
|
+
|
|
|
+.recipe-header .meta-item ion-icon {
|
|
|
+ margin-right: 4px;
|
|
|
+ font-size: 1rem;
|
|
|
}
|
|
|
|
|
|
-/* 内容区域 */
|
|
|
-.recipe-content {
|
|
|
---background: #f8f9fa;
|
|
|
-padding-bottom: 80px;
|
|
|
+/* 合并后的头部布局(适配不同场景) */
|
|
|
+.recipe-header.flex-between {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 12px;
|
|
|
+}
|
|
|
+
|
|
|
+.recipe-header.flex-between .recipe-title {
|
|
|
+ font-size: 1.5rem;
|
|
|
+ font-weight: 600;
|
|
|
+ flex: 1;
|
|
|
+ margin: 0;
|
|
|
+}
|
|
|
+
|
|
|
+.recipe-header.flex-between .recipe-rating {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.recipe-header.flex-between .recipe-rating ion-icon {
|
|
|
+ font-size: 1.2rem;
|
|
|
+ margin-right: 2px;
|
|
|
+}
|
|
|
+
|
|
|
+.recipe-header.flex-between .recipe-rating .rating-text {
|
|
|
+ font-size: 0.9rem;
|
|
|
+ color: var(--ion-color-medium);
|
|
|
+ margin-left: 4px;
|
|
|
}
|
|
|
|
|
|
-/* 菜品图片 */
|
|
|
+.recipe-header .recipe-meta.flex-wrap {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ gap: 8px;
|
|
|
+ margin-bottom: 16px;
|
|
|
+}
|
|
|
+
|
|
|
+.recipe-header .recipe-meta.flex-wrap .meta-item {
|
|
|
+ --padding-start: 0;
|
|
|
+ --inner-padding-end: 0;
|
|
|
+ --min-height: 32px;
|
|
|
+ flex: 1 0 calc(33.333% - 8px);
|
|
|
+}
|
|
|
+
|
|
|
+.recipe-header .recipe-meta.flex-wrap .meta-item ion-icon {
|
|
|
+ font-size: 1.2rem;
|
|
|
+}
|
|
|
+
|
|
|
+.recipe-header .recipe-meta.flex-wrap .meta-item ion-label {
|
|
|
+ font-size: 0.85rem;
|
|
|
+}
|
|
|
+
|
|
|
+/* 菜品图片容器(合并重复定义) */
|
|
|
.recipe-image-container {
|
|
|
-position: relative;
|
|
|
-width: 100%;
|
|
|
-height: 250px;
|
|
|
-overflow: hidden;
|
|
|
+ position: relative;
|
|
|
+ width: 100%;
|
|
|
+ height: 250px;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
|
|
|
-.recipe-image {
|
|
|
+.recipe-image-container .recipe-image {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
object-fit: cover;
|
|
|
}
|
|
|
|
|
|
-.image-overlay {
|
|
|
+.recipe-image-container .image-overlay-top {
|
|
|
+ position: absolute;
|
|
|
+ top: 10px;
|
|
|
+ right: 10px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ gap: 5px;
|
|
|
+}
|
|
|
+
|
|
|
+.recipe-image-container .image-overlay-bottom {
|
|
|
position: absolute;
|
|
|
bottom: 16px;
|
|
|
left: 240px;
|
|
@@ -154,196 +123,135 @@ overflow: hidden;
|
|
|
display: flex;
|
|
|
gap: 8px;
|
|
|
width: 150px;
|
|
|
- ion-chip {
|
|
|
- --background: rgba(255, 255, 255, 0.9);
|
|
|
- backdrop-filter: blur(5px);
|
|
|
- }
|
|
|
-}
|
|
|
}
|
|
|
|
|
|
-/* 菜品信息部分 */
|
|
|
-.recipe-info-section {
|
|
|
-padding: 16px;
|
|
|
-background: white;
|
|
|
-margin-bottom: 16px;
|
|
|
+.recipe-image-container ion-chip {
|
|
|
+ --background: rgba(255, 255, 255, 0.9);
|
|
|
+ backdrop-filter: blur(5px);
|
|
|
}
|
|
|
|
|
|
-.recipe-header {
|
|
|
-display: flex;
|
|
|
-justify-content: space-between;
|
|
|
-align-items: center;
|
|
|
-margin-bottom: 12px;
|
|
|
+/* 公共卡片样式(合并阴影层级) */
|
|
|
+.section-card {
|
|
|
+ margin: 16px;
|
|
|
+ border-radius: 12px;
|
|
|
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.05); /* 合并两种阴影 */
|
|
|
+}
|
|
|
|
|
|
-.recipe-title {
|
|
|
- font-size: 1.5rem;
|
|
|
- font-weight: 600;
|
|
|
- color: var(--ion-color-dark);
|
|
|
- margin: 0;
|
|
|
- flex: 1;
|
|
|
+.section-card ion-card-header,
|
|
|
+.section-card .section-header {
|
|
|
+ padding-bottom: 0;
|
|
|
}
|
|
|
|
|
|
-.recipe-rating {
|
|
|
+.section-card ion-card-title,
|
|
|
+.section-card .section-title {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
-
|
|
|
- ion-icon {
|
|
|
- font-size: 1.2rem;
|
|
|
- margin-right: 2px;
|
|
|
- }
|
|
|
-
|
|
|
- .rating-text {
|
|
|
- font-size: 0.9rem;
|
|
|
- color: var(--ion-color-medium);
|
|
|
- margin-left: 4px;
|
|
|
- }
|
|
|
-}
|
|
|
+ font-size: 1.2rem;
|
|
|
+ color: var(--ion-color-dark);
|
|
|
}
|
|
|
|
|
|
-.recipe-meta {
|
|
|
-display: flex;
|
|
|
-flex-wrap: wrap;
|
|
|
-gap: 8px;
|
|
|
-margin-bottom: 16px;
|
|
|
+.section-card ion-card-title ion-icon,
|
|
|
+.section-card .section-title .section-icon {
|
|
|
+ margin-right: 8px;
|
|
|
+ color: var(--ion-color-primary);
|
|
|
+}
|
|
|
|
|
|
-.meta-item {
|
|
|
+/* 步骤列表(统一样式) */
|
|
|
+.step-item,
|
|
|
+.step-list .step-item {
|
|
|
--padding-start: 0;
|
|
|
--inner-padding-end: 0;
|
|
|
- --min-height: 32px;
|
|
|
- flex: 1 0 calc(33.333% - 8px);
|
|
|
-
|
|
|
- ion-icon {
|
|
|
- font-size: 1.2rem;
|
|
|
- }
|
|
|
-
|
|
|
- ion-label {
|
|
|
- font-size: 0.85rem;
|
|
|
- color: var(--ion-color-medium);
|
|
|
- }
|
|
|
+ align-items: flex-start;
|
|
|
+ padding: 12px 0;
|
|
|
}
|
|
|
+
|
|
|
+.step-item .step-number,
|
|
|
+.step-list .step-item .step-number {
|
|
|
+ width: 28px;
|
|
|
+ height: 28px;
|
|
|
+ background: var(--ion-color-primary);
|
|
|
+ color: white;
|
|
|
+ font-size: 0.9rem;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-right: 12px;
|
|
|
}
|
|
|
|
|
|
-.recipe-description {
|
|
|
-font-size: 0.95rem;
|
|
|
-color: var(--ion-color-medium);
|
|
|
-line-height: 1.6;
|
|
|
-margin: 0;
|
|
|
+.step-item ion-label,
|
|
|
+.step-list .step-item .step-text {
|
|
|
+ margin-top: 4px;
|
|
|
+ margin-bottom: 4px;
|
|
|
+ font-size: 0.95rem;
|
|
|
+ color: var(--ion-color-medium);
|
|
|
+ line-height: 1.6;
|
|
|
}
|
|
|
|
|
|
-/* 卡片部分 */
|
|
|
-.section-card {
|
|
|
-margin: 16px;
|
|
|
-border-radius: 12px;
|
|
|
-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
|
|
|
+.step-item ion-label p {
|
|
|
+ margin: 0;
|
|
|
+ color: var(--ion-color-dark);
|
|
|
+ line-height: 1.5;
|
|
|
+}
|
|
|
|
|
|
-.section-header {
|
|
|
- padding-bottom: 0;
|
|
|
-
|
|
|
- .section-title {
|
|
|
- font-size: 1.1rem;
|
|
|
- font-weight: 600;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
-
|
|
|
- .section-icon {
|
|
|
- margin-right: 8px;
|
|
|
- color: var(--ion-color-primary);
|
|
|
- }
|
|
|
- }
|
|
|
+/* 其他独立样式 */
|
|
|
+.recipe-content {
|
|
|
+ --background: #f8f9fa;
|
|
|
+ padding-bottom: 80px;
|
|
|
}
|
|
|
+
|
|
|
+.recipe-info-section {
|
|
|
+ padding: 16px;
|
|
|
+ background: white;
|
|
|
+ margin-bottom: 16px;
|
|
|
+}
|
|
|
+
|
|
|
+.recipe-description {
|
|
|
+ font-size: 0.95rem;
|
|
|
+ color: var(--ion-color-medium);
|
|
|
+ line-height: 1.6;
|
|
|
}
|
|
|
|
|
|
-/* 食材列表 */
|
|
|
-.ingredient-list {
|
|
|
-.ingredient-item {
|
|
|
+.ingredient-list .ingredient-item {
|
|
|
--padding-start: 0;
|
|
|
--inner-padding-end: 0;
|
|
|
--min-height: 48px;
|
|
|
border-bottom: 1px dashed var(--ion-color-light-shade);
|
|
|
-
|
|
|
- &:last-child {
|
|
|
- border-bottom: none;
|
|
|
- }
|
|
|
-
|
|
|
- .bullet-icon {
|
|
|
- color: var(--ion-color-primary);
|
|
|
- font-size: 0.6rem;
|
|
|
- }
|
|
|
-
|
|
|
- .ingredient-name {
|
|
|
- font-size: 0.95rem;
|
|
|
- }
|
|
|
-
|
|
|
- .ingredient-amount {
|
|
|
- font-weight: 500;
|
|
|
- }
|
|
|
-}
|
|
|
}
|
|
|
|
|
|
-/* 步骤列表 */
|
|
|
-.step-list {
|
|
|
-.step-item {
|
|
|
- --padding-start: 0;
|
|
|
- --inner-padding-end: 0;
|
|
|
- --min-height: auto;
|
|
|
- align-items: flex-start;
|
|
|
- padding: 12px 0;
|
|
|
-
|
|
|
- .step-number {
|
|
|
- width: 28px;
|
|
|
- height: 28px;
|
|
|
- background: var(--ion-color-primary);
|
|
|
- color: white;
|
|
|
- font-size: 0.9rem;
|
|
|
- font-weight: 600;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- margin-right: 12px;
|
|
|
- }
|
|
|
-
|
|
|
- .step-text {
|
|
|
- font-size: 0.95rem;
|
|
|
- color: var(--ion-color-medium);
|
|
|
- line-height: 1.6;
|
|
|
- white-space: normal;
|
|
|
- }
|
|
|
+.ingredient-list .ingredient-item:last-child {
|
|
|
+ border-bottom: none;
|
|
|
}
|
|
|
+
|
|
|
+.ingredient-list .bullet-icon {
|
|
|
+ color: var(--ion-color-primary);
|
|
|
+ font-size: 0.6rem;
|
|
|
}
|
|
|
|
|
|
-/* 底部按钮 */
|
|
|
.action-buttons {
|
|
|
-position: fixed;
|
|
|
-bottom: 0;
|
|
|
-left: 0;
|
|
|
-right: 0;
|
|
|
-padding: 16px;
|
|
|
-background: linear-gradient(to top, white 50%, transparent 100%);
|
|
|
-
|
|
|
-.cook-button {
|
|
|
- --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
|
- --padding-top: 16px;
|
|
|
- --padding-bottom: 16px;
|
|
|
- font-weight: 600;
|
|
|
-}
|
|
|
+ position: fixed;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ padding: 16px;
|
|
|
+ background: linear-gradient(to top, white 50%, transparent 100%);
|
|
|
}
|
|
|
|
|
|
-/* 响应式调整 */
|
|
|
+/* 响应式调整(合并重复媒体查询) */
|
|
|
@media (min-width: 768px) {
|
|
|
-.recipe-image-container {
|
|
|
- height: 350px;
|
|
|
-}
|
|
|
+ .recipe-image-container {
|
|
|
+ height: 350px;
|
|
|
+ }
|
|
|
|
|
|
-.recipe-info-section {
|
|
|
- padding: 24px;
|
|
|
-}
|
|
|
+ .section-card {
|
|
|
+ margin: 20px auto;
|
|
|
+ max-width: 800px;
|
|
|
+ }
|
|
|
|
|
|
-.section-card {
|
|
|
- margin: 24px;
|
|
|
-}
|
|
|
+ .recipe-info-section {
|
|
|
+ padding: 24px;
|
|
|
+ }
|
|
|
|
|
|
-.action-buttons {
|
|
|
- padding: 24px;
|
|
|
- max-width: 600px;
|
|
|
- margin: 0 auto;
|
|
|
-}
|
|
|
+ .action-buttons {
|
|
|
+ padding: 24px;
|
|
|
+ max-width: 600px;
|
|
|
+ margin: 0 auto;
|
|
|
+ }
|
|
|
}
|