:root {
    --cw-bg: #f7f3ec;
    --cw-bg-2: #fffdf8;
    --cw-panel: #ffffff;
    --cw-panel-soft: #f9f5ef;
    --cw-line: rgba(84, 64, 48, .10);
    --cw-text: #2f241c;
    --cw-muted: #7c6a5d;
    --cw-accent: #ff7a59;
    --cw-accent-2: #ffb36b;
    --cw-accent-3: #5a7cff;
    --cw-shadow: 0 18px 48px rgba(78, 56, 38, .08);
    --cw-radius: 22px;
    --cw-radius-sm: 14px;
    --cw-wrap: 1180px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(180deg, #fbf8f3 0%, #f6f1ea 100%);
    color: var(--cw-text);
    line-height: 1.8;
}

a {
    color: var(--cw-text);
    text-decoration: none;
    transition: .2s ease;
}

a:hover {
    color: var(--cw-accent);
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.cw-hidden {
    display: none;
}

.cw-wrap {
    width: min(var(--cw-wrap), calc(100% - 32px));
    margin: 0 auto;
}

.cw-main {
    padding: 28px 0 56px;
}

.cw-kicker {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--cw-accent);
    font-weight: 800;
}

.cw-meta {
    color: var(--cw-muted);
    font-size: 13px;
}

.cw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cw-accent), var(--cw-accent-2));
    color: #fff;
    font-weight: 700;
    box-shadow: 0 12px 28px rgba(255,122,89,.22);
}

.cw-btn:hover {
    color: #fff;
    transform: translateY(-1px);
}

.cw-btn-light {
    background: #fff;
    color: var(--cw-text);
    border: 1px solid var(--cw-line);
    box-shadow: none;
}

.cw-btn-light:hover {
    color: var(--cw-accent);
}

.cw-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 253, 248, .88);
    border-bottom: 1px solid var(--cw-line);
    backdrop-filter: blur(14px);
}

.cw-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 0 14px;
}

.cw-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 800;
}

.cw-brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--cw-accent), var(--cw-accent-2));
    color: #fff;
    font-size: 14px;
}

.cw-brand-desc {
    margin: 6px 0 0;
    color: var(--cw-muted);
    font-size: 13px;
}

.cw-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cw-search,
.cw-search-wide,
.cw-so-form {
    display: flex;
    align-items: center;
}

.cw-search input,
.cw-search-wide input,
.cw-so-form input {
    width: 280px;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--cw-line);
    border-right: 0;
    border-radius: 999px 0 0 999px;
    background: #fff;
    color: var(--cw-text);
    outline: none;
}

.cw-search-wide input {
    width: 340px;
}

.cw-search button,
.cw-search-wide button,
.cw-so-form button {
    height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 0 999px 999px 0;
    background: linear-gradient(135deg, var(--cw-accent), var(--cw-accent-2));
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.cw-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--cw-line);
    border-radius: 12px;
    background: #fff;
    color: var(--cw-text);
}

.cw-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 0 18px;
}

.cw-nav a {
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.68);
    border: 1px solid transparent;
    color: var(--cw-muted);
}

.cw-nav a:hover,
.cw-nav .cw-nav-home {
    color: var(--cw-text);
    border-color: var(--cw-line);
}

.cw-hero,
.cw-page-hero,
.cw-search-panel,
.cw-single-page,
.cw-empty-page,
.cw-so-hero,
.cw-so-results-wrap {
    background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.84));
    border: 1px solid rgba(84,64,48,.08);
    border-radius: 28px;
    box-shadow: var(--cw-shadow);
}

.cw-hero {
    display: grid;
    grid-template-columns: 1.15fr .95fr;
    gap: 24px;
    padding: 34px;
    margin-bottom: 28px;
}

.cw-hero-copy h1,
.cw-page-hero h1,
.cw-empty-page h1,
.cw-so-hero h1,
.cw-so-results-wrap h1 {
    font-size: clamp(32px, 4vw, 52px);
    line-height: 1.14;
    margin: 0 0 12px;
}

.cw-hero-copy p,
.cw-page-hero p,
.cw-empty-page p,
.cw-so-hero p,
.cw-feature-body p,
.cw-search-card p,
.cw-side-link span,
.cw-so-item p {
    color: var(--cw-muted);
}

.cw-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.cw-hero-main-card,
.cw-feature-card,
.cw-article-card,
.cw-search-card,
.cw-diy-card {
    background: #fff;
    border: 1px solid rgba(84,64,48,.08);
    border-radius: var(--cw-radius);
    box-shadow: var(--cw-shadow);
}

.cw-hero-main-card {
    padding: 24px;
    position: relative;
}

.cw-card-label {
    display: inline-flex;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255,122,89,.10);
    color: var(--cw-accent);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 14px;
}

.cw-hero-main-card h2 {
    font-size: 30px;
    line-height: 1.25;
    margin: 0 0 10px;
}

.cw-hero-main-card p {
    margin-bottom: 12px;
}

.cw-section {
    margin-bottom: 28px;
}

.cw-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.cw-section-head h2 {
    margin: 0;
    font-size: 28px;
}

.cw-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.cw-feature-thumb {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 22px 22px 0 0;
}

.cw-feature-thumb img,
.cw-article-thumb img,
.cw-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cw-feature-fallback,
.cw-article-thumb-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255,122,89,.14), rgba(90,124,255,.12));
    color: var(--cw-text);
    letter-spacing: .16em;
    font-size: 13px;
    font-weight: 800;
}

.cw-feature-body {
    padding: 16px 18px 18px;
}

.cw-feature-body h3 {
    font-size: 20px;
    line-height: 1.45;
    margin: 8px 0;
}

.cw-content-grid,
.cw-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
}

.cw-article-list {
    display: grid;
    gap: 18px;
}

.cw-article-card {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    overflow: hidden;
}

.cw-article-thumb,
.cw-article-thumb-fallback {
    aspect-ratio: 16 / 11;
}

.cw-article-body {
    padding: 20px 20px 18px;
}

.cw-article-body h3 {
    margin: 8px 0 10px;
    font-size: 26px;
    line-height: 1.35;
}

.cw-article-actions {
    margin-top: 14px;
}

.cw-article-actions a {
    color: var(--cw-accent);
    font-weight: 800;
}

.cw-side-col,
.cw-detail-side {
    display: grid;
    gap: 16px;
    align-content: start;
}

.cw-side-panel {
    padding: 18px;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(84,64,48,.08);
    border-radius: 20px;
    box-shadow: var(--cw-shadow);
}

.cw-side-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 14px;
}

.cw-side-list {
    display: grid;
    gap: 12px;
}

.cw-side-link {
    display: grid;
    gap: 4px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(84,64,48,.08);
}

.cw-side-link:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.cw-side-link strong,
.cw-after-link strong {
    font-size: 14px;
    line-height: 1.55;
}

.cw-tag-mini,
.cw-tag-cloud,
.cw-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cw-tag-mini a,
.cw-tag-cloud a,
.cw-tags a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(84,64,48,.10);
    color: var(--cw-text);
    font-size: 13px;
}

.cw-tag-cloud {
    padding: 28px;
    margin-bottom: 20px;
    background: rgba(255,255,255,.86);
    border: 1px solid rgba(84,64,48,.08);
    border-radius: 24px;
    box-shadow: var(--cw-shadow);
}

.cw-tag-cloud a span,
.cw-tag-mini a span {
    color: var(--cw-muted);
}

.cw-breadcrumb {
    margin-bottom: 18px;
    color: var(--cw-muted);
}

.cw-breadcrumb a {
    color: var(--cw-muted);
}

.cw-page-hero,
.cw-single-page,
.cw-search-panel,
.cw-empty-page {
    padding: 28px;
    margin-bottom: 24px;
}

.cw-article-detail {
    padding: 28px;
    background: rgba(255,255,255,.95);
    border: 1px solid rgba(84,64,48,.08);
    border-radius: 28px;
    box-shadow: var(--cw-shadow);
}

.cw-article-head h1 {
    font-size: clamp(32px, 4vw, 46px);
    line-height: 1.18;
    margin: 0 0 12px;
}

.cw-detail-meta {
    color: var(--cw-muted);
    margin-bottom: 16px;
}

.cw-detail-cover {
    overflow: hidden;
    border-radius: 20px;
    margin-bottom: 24px;
    aspect-ratio: 16 / 8;
}

.cw-article-content {
    color: #3a2e24;
    font-size: 16px;
    line-height: 1.85;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.cw-article-content > :first-child { margin-top: 0 !important; }

.cw-article-content h1,
.cw-article-content h2,
.cw-article-content h3,
.cw-article-content h4 {
    margin: 1.5em 0 .8em;
    line-height: 1.35;
}
.cw-article-content h1 { font-size: 26px; }
.cw-article-content h2 { font-size: 22px; border-bottom: 1px solid var(--cw-line); padding-bottom: 8px; }
.cw-article-content h3 { font-size: 19px; }
.cw-article-content h4 { font-size: 17px; }

.cw-article-content p,
.cw-article-content ul,
.cw-article-content ol,
.cw-article-content blockquote,
.cw-article-content pre {
    margin-bottom: 1.1em;
}

.cw-article-content ul { list-style: disc; padding-left: 28px; }
.cw-article-content ol { list-style: decimal; padding-left: 28px; }
.cw-article-content li { margin-bottom: 6px; }

.cw-article-content a { text-decoration: underline; text-underline-offset: 3px; }
.cw-article-content b, .cw-article-content strong { font-weight: 700; }

.cw-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
    margin: 18px auto;
    display: block;
}

.cw-article-content blockquote {
    padding: 14px 18px;
    border-left: 4px solid var(--cw-accent);
    background: #fff7f3;
    color: #5d4a3b;
    border-radius: 0 14px 14px 0;
}
.cw-article-content blockquote > :first-child { margin-top: 0; }
.cw-article-content blockquote > :last-child { margin-bottom: 0; }

.cw-article-content pre,
.cw-article-content code {
    font-family: Consolas, Monaco, monospace;
}

.cw-article-content code {
    padding: 2px 6px;
    background: #fff7f3;
    border: 1px solid var(--cw-line);
    border-radius: 6px;
    font-size: 14px;
}

.cw-article-content pre {
    padding: 16px;
    border-radius: 14px;
    overflow: auto;
    background: #2f241c;
    color: #fff7f1;
    font-size: 14px;
    line-height: 1.6;
}
.cw-article-content pre code {
    padding: 0; background: none; border: none; border-radius: 0;
}

.cw-article-content hr {
    border: 0;
    border-top: 1px solid var(--cw-line);
    margin: 24px 0;
}

.cw-article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    overflow-x: auto;
    display: block;
}
.cw-article-content td,
.cw-article-content th {
    min-width: 60px;
    border: 1px solid var(--cw-line);
    padding: 8px 12px;
    text-align: left;
}
.cw-article-content th {
    font-weight: 700;
    background: #fff7f3;
}

/* Title word-wrap */
.cw-detail-header h1 {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Side link truncation */
.cw-side-link strong {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cw-after-article {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid rgba(84,64,48,.10);
}

.cw-after-article h3 {
    font-size: 20px;
    margin: 0 0 14px;
}

.cw-after-links {
    display: grid;
    gap: 12px;
}

.cw-after-link {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #fff8f1;
    border: 1px solid rgba(84,64,48,.08);
}

.cw-after-link span {
    color: var(--cw-muted);
    font-size: 13px;
}

.cw-comments-box {
    margin-top: 24px;
}

.cw-search-top,
.cw-so-header,
.cw-footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.cw-search-results,
.cw-so-results {
    display: grid;
    gap: 14px;
}

.cw-search-card {
    padding: 20px;
}

.cw-pagination {
    margin-top: 22px;
}

.cw-pagination a,
.cw-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    margin: 0 8px 8px 0;
    padding: 0 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(84,64,48,.10);
    color: var(--cw-text);
}

.cw-empty,
.cw-empty-page {
    text-align: center;
}

.cw-empty {
    padding: 28px;
    border-radius: 18px;
    background: #fff;
    color: var(--cw-muted);
    border: 1px solid rgba(84,64,48,.08);
}

.cw-diy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.cw-diy-card {
    padding: 22px;
}

.cw-diy-card strong {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--cw-accent);
}

.cw-so-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.cw-so-shell {
    width: min(980px, 100%);
}

.cw-so-brand {
    display: inline-block;
    margin-bottom: 18px;
    font-size: 20px;
    font-weight: 800;
}

.cw-so-hero,
.cw-so-results-wrap {
    padding: 34px;
}

.cw-so-hot {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.cw-so-hot a {
    padding: 8px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(84,64,48,.10);
    color: var(--cw-text);
}

.cw-so-form {
    margin-top: 18px;
}

.cw-so-form-inline {
    margin-top: 0;
}

.cw-so-item {
    padding: 18px 0;
    border-bottom: 1px solid rgba(84,64,48,.08);
}

.cw-so-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.cw-so-item h3 {
    margin: 0 0 6px;
    font-size: 22px;
}

.cw-footer {
    border-top: 1px solid rgba(84,64,48,.08);
    background: rgba(255,255,255,.66);
    margin-top: 24px;
}

.cw-footer-top {
    padding: 28px 0 14px;
}

.cw-footer-top p,
.cw-footer-copy {
    color: var(--cw-muted);
}

.cw-footer-nav {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.cw-footer-copy {
    padding: 0 0 26px;
    font-size: 13px;
}

.cw-scrolltop {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cw-accent), var(--cw-accent-2));
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    box-shadow: 0 14px 28px rgba(255,122,89,.28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: .2s ease;
    cursor: pointer;
}

.cw-scrolltop.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (max-width: 1100px) {
    .cw-feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cw-content-grid,
    .cw-detail-layout,
    .cw-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .cw-wrap {
        width: min(var(--cw-wrap), calc(100% - 20px));
    }

    .cw-main {
        padding-top: 20px;
    }

    .cw-header-top,
    .cw-search-top,
    .cw-so-header,
    .cw-footer-top {
        flex-direction: column;
        align-items: stretch;
    }

    .cw-search,
    .cw-search-wide,
    .cw-so-form {
        width: 100%;
    }

    .cw-search input,
    .cw-search-wide input,
    .cw-so-form input {
        width: 100%;
    }

    .cw-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .cw-nav {
        display: none;
        padding-top: 0;
    }

    .cw-nav.open {
        display: flex;
        flex-direction: column;
        padding-bottom: 18px;
    }

    .cw-feature-grid,
    .cw-diy-grid {
        grid-template-columns: 1fr;
    }

    .cw-article-card {
        grid-template-columns: 1fr;
    }

    .cw-article-thumb,
    .cw-article-thumb-fallback {
        aspect-ratio: 16 / 9;
    }

    .cw-page-hero,
    .cw-single-page,
    .cw-search-panel,
    .cw-empty-page,
    .cw-article-detail,
    .cw-so-hero,
    .cw-so-results-wrap,
    .cw-hero {
        padding: 20px;
    }

    .cw-article-body h3,
    .cw-hero-main-card h2,
    .cw-so-item h3 {
        font-size: 20px;
    }

    /* Article content mobile */
    .cw-article-content { font-size: 15px; }
    .cw-article-content h1 { font-size: 22px; }
    .cw-article-content h2 { font-size: 19px; }
    .cw-article-content h3 { font-size: 17px; }
    .cw-article-content pre { font-size: 12px; padding: 12px; }
    .cw-article-content td, .cw-article-content th { padding: 6px 8px; min-width: 40px; }
    .cw-article-content img { border-radius: 10px; margin: 12px auto; }
    .cw-detail-header h1 { font-size: 26px; }
    .cw-detail-layout { grid-template-columns: 1fr; }
}
