:root {
    --primary-color: #ff6b35;
    --primary-hover: #e85a26;
    --secondary-color: #2ec4b6;
    --dark-color: #1e293b;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
    --transition: all 0.3s ease;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --author-bg: #fff8f5;
    --author-border: #ffd8cc;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 85px;
}

body {
    background-color: var(--light-bg);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
    width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
}

ul, ol {
    list-style-position: inside;
}

img, figure img {
    width: 100%;
    height: auto;
    /*aspect-ratio: 16 / 9;*/
    object-fit: cover;
    display: block;
    border-radius: var(--radius-md);
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部导航 Header */
header {
    position: sticky;
    top: 0;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

/* 导航菜单 */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-item {
    position: relative;
    padding: 24px 0;
}

.nav-link {
    font-weight: 600;
    font-size: 15px;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: white;
    min-width: 200px;
    padding: 12px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}

.dropdown.wide {
    min-width: 280px;
    grid-template-columns: 1fr 1fr;
}

.nav-item:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-item {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-item:hover, .dropdown-item.active {
    background-color: #fff1ec;
    color: var(--primary-color);
}

/* 搜索框 */
.search-box {
    position: relative;
    width: 220px;
}

.search-input {
    width: 100%;
    padding: 8px 16px 8px 38px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    background: var(--light-bg);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 14px;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--dark-color);
    cursor: pointer;
    padding: 4px;
}

/* 面包屑导航 Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb-separator {
    color: #cbd5e1;
}

.breadcrumb-current {
    color: var(--dark-color);
    font-weight: 600;
}

/* 文章主体布局 Layout */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    margin-bottom: 50px;
}

/* 文章核心内容区 Article Container */
.article-main {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 36px;
    box-shadow: var(--shadow-sm);
}

/* 文章头部 Header & Text Meta */
.article-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
    margin-bottom: 28px;
}

.article-category-tag {
    display: inline-block;
    background: #fff1ec;
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.article-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--dark-color);
    line-height: 1.3;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.article-meta-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 13.5px;
    color: var(--text-muted);
    background: var(--light-bg);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.meta-item-divider {
    color: #cbd5e1;
}

.meta-item strong {
    color: var(--dark-color);
    font-weight: 600;
}

/* 主图 Hero Image */
.article-cover-figure {
    margin: 0 0 28px 0;
    position: relative;
}

.article-cover-figure img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    box-shadow: var(--shadow-md);
}

.article-cover-caption {
    font-size: 12.5px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
}

/* 食谱摘要属性指标卡 */
.recipe-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    background: #fff8f5;
    border: 1px solid #ffd8cc;
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 32px;
    text-align: center;
}

.overview-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.overview-label {
    font-size: 12px;
    color: var(--text-muted);
}

.overview-val {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary-color);
}

/* 文章正文 Section Styling */
.article-section {
    margin-bottom: 36px;
    scroll-margin-top: 85px;
}

.article-section-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--dark-color);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 12px;
    border-left: 4px solid var(--primary-color);
}

.article-p {
    font-size: 15px;
    color: var(--text-main);
    margin-bottom: 16px;
    line-height: 1.8;
}

/* 食材清单 Checklist */
.ingredients-card {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 32px;
}

.ingredients-group-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark-color);
    margin: 16px 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1px dashed var(--border-color);
}

.ingredients-group-title:first-child {
    margin-top: 0;
}

.ingredients-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
    margin-top: 10px;
}

.ingredient-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 14px;
}

.ingredient-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--dark-color);
}

.ingredient-amount {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 13.5px;
}

/* 步骤列表 Step-by-step */
.recipe-steps {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.step-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.step-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.step-badge {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    flex-shrink: 0;
}

.step-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--dark-color);
}

.step-desc {
    font-size: 14.5px;
    color: var(--text-main);
    margin-bottom: 16px;
    line-height: 1.7;
}

.step-figure {
    margin: 0;
    width: 100%;
}

.step-figure img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.step-figcaption {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    text-align: right;
}

/* 技巧秘诀 Box */
.chef-tips-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 28px 0;
}

.chef-tips-title {
    font-size: 15px;
    font-weight: 800;
    color: #166534;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chef-tips-content {
    font-size: 13.5px;
    color: #14532d;
    line-height: 1.6;
}

/* FAQ 常见问题板块 */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
}

.faq-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.faq-question {
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 700;
    color: var(--dark-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fdfbf9;
    transition: var(--transition);
    user-select: none;
}

.faq-question:hover {
    background: #fff1ec;
    color: var(--primary-color);
}

.faq-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
    color: var(--primary-color);
    font-weight: bold;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.7;
    background: white;
}

.faq-item.active .faq-answer {
    padding: 16px 20px;
    max-height: 300px;
    border-top: 1px dashed var(--border-color);
}

/* 评价与互动 Section */
.comments-section {
    border-top: 1px solid var(--border-color);
    padding-top: 32px;
    margin-top: 40px;
}

.comment-form {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 28px;
}

.form-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 12px;
}

.form-group {
    margin-bottom: 12px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.comment-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.comment-user {
    font-weight: 700;
    font-size: 14px;
    color: var(--dark-color);
}

.comment-rating {
    color: #f59e0b;
    font-size: 12px;
    margin-left: 4px;
}

.comment-date {
    font-size: 12px;
    color: var(--text-muted);
}

.comment-text {
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 10px;
}

/* 评论操作区：点赞与回复图标按钮 */
.comment-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    padding-top: 8px;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.action-btn:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.action-btn.liked {
    color: var(--primary-color);
    font-weight: bold;
}

.action-btn .icon {
    font-size: 14px;
}

/* 动态回复输入框容器 */
.inline-reply-box {
    margin-top: 12px;
    padding: 12px;
    background: var(--light-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.inline-reply-box textarea {
    width: 100%;
    min-height: 60px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    outline: none;
    resize: vertical;
    margin-bottom: 8px;
}

.inline-reply-box textarea:focus {
    border-color: var(--primary-color);
}

.reply-box-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12.5px;
    border-radius: 20px;
}

.btn-secondary-sm {
    background: #e2e8f0;
    color: var(--text-main);
    border: none;
    padding: 6px 14px;
    font-size: 12.5px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary-sm:hover {
    background: #cbd5e1;
}

/* 回复层级样式 nested replies */
.reply-list {
    margin-top: 12px;
    padding-left: 16px;
    border-left: 3px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reply-card {
    background: var(--light-bg);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    border: 1px solid var(--border-color);
}

.reply-card.author-reply {
    background: var(--author-bg);
    border-color: var(--author-border);
}

.author-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

/* 侧边栏 Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.widget {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.widget-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--dark-color);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #fff1ec;
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary-color);
}

/* 推荐食谱侧栏列表 */
.related-recipes-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.related-item {
    display: flex;
    gap: 12px;
    align-items: center;
    transition: var(--transition);
}

.related-item:hover {
    transform: translateX(4px);
}

.related-img {
    width: 100px;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.related-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.related-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-meta {
    font-size: 11.5px;
    color: var(--text-muted);
}

/* 文章目录 Sticky TOC Widget */
.toc-widget {
    position: sticky;
    top: 92px;
    z-index: 10;
}

.toc-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #fff1ec;
    position: relative;
}

.toc-widget-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary-color);
}

.toc-widget-header .widget-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.toc-widget-header .widget-title::after {
    display: none;
}

.toc-toggle-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.toc-toggle-btn .toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.toc-widget.collapsed .toc-toggle-btn .toggle-icon {
    transform: rotate(-90deg);
}

.toc-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}

.toc-widget.collapsed .toc-content {
    max-height: 0;
    opacity: 0;
}

.toc-group {
    margin-bottom: 6px;
}

.toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.toc-header:hover {
    background-color: #fff1ec;
}

.toc-header .toc-link {
    flex-grow: 1;
}

.toc-sub-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: var(--transition);
}

.toc-sub-toggle:hover {
    color: var(--primary-color);
    background: rgba(255,107,53,0.1);
}

.toc-sub-toggle .sub-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.toc-group.collapsed .toc-sub-toggle .sub-icon {
    transform: rotate(-90deg);
}

.toc-sub-list {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
    padding-left: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.toc-group.collapsed .toc-sub-list {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.toc-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13.5px;
}

.toc-link {
    color: var(--text-muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.toc-link:hover, .toc-link.active {
    color: var(--primary-color);
    font-weight: 700;
}

/* 按钮 Button */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary-color);
    color: white;
    padding: 10px 22px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
}

/* Footer 页脚 */
footer {
    background: var(--dark-color);
    color: #94a3b8;
    padding: 50px 0 24px;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 30px;
}

.footer-brand .logo {
    color: white;
    margin-bottom: 12px;
}

.footer-title {
    color: white;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
}

.footer-links li {
    margin-bottom: 8px;
    font-size: 13px;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid #334155;
    text-align: center;
    font-size: 13px;
}

/* 响应式自适应 Media Queries */
@media (max-width: 992px) {
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 72px;
        left: 0;
        width: 100%;
        background: white;
        padding: 20px;
        box-shadow: var(--shadow-lg);
    }

    .nav-menu.show {
        display: flex;
    }

    .mobile-toggle { display: block; }
    .search-box { width: 180px; }

    .article-layout {
        grid-template-columns: 1fr;
    }

    .toc-widget {
        position: static;
    }

    .recipe-overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 14px;
    }

    .header-inner {
        height: 58px;
    }

    .search-box {
        display: none;
    }

    .article-main {
        padding: 20px 14px;
    }

    .article-title {
        font-size: 20px;
    }

    .article-meta-bar {
        font-size: 12px;
        padding: 10px;
        gap: 10px;
    }

    .ingredients-grid {
        grid-template-columns: 1fr;
    }

    .step-item {
        padding: 16px;
    }

    .step-title {
        font-size: 15px;
    }

    .reply-list {
        padding-left: 10px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}
