:root {
    --pink: #FE678B;
    --pink-soft: #FFE4EC;
    --ink: #1a1a1a;
    --ink-soft: #555;
    --ink-muted: #888;
    --bg: #ffffff;
    --bg-soft: #f7f7f9;
    --border: #ececec;
    --hero-from: #e9f4ff;
    --hero-to: #eaf7ee;
    --shadow-card: 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

button { font: inherit; cursor: pointer; background: none; border: none; }

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

.page-wrapper { position: relative; overflow-x: hidden; min-height: 100vh; display: flex; flex-direction: column; }

.page-shape {
    position: absolute;
    top: 0;
    width: 220px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}
.page-shape--left { left: 0; }
.page-shape--right { right: 0; }
@media (max-width: 768px) { .page-shape { width: 120px; opacity: 0.35; } }

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* Header */
.site-header {
    position: relative;
    z-index: 2;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.site-header__logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: var(--ink);
}
.site-header__logo img { width: 28px; height: 28px; }
.site-header__link {
    font-size: 14px;
    color: var(--ink-soft);
    font-weight: 500;
}
.site-header__link:hover { color: var(--pink); }
@media (max-width: 480px) {
    .site-header__link { display: none; }
}

/* Hero / banner */
.hero {
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, var(--hero-from) 0%, var(--hero-to) 100%);
    padding: 64px 0 72px;
    text-align: center;
}
.hero__title {
    font-size: 32px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 28px;
}
@media (max-width: 600px) {
    .hero { padding: 44px 0 52px; }
    .hero__title { font-size: 24px; margin-bottom: 20px; }
}
.hero__search {
    position: relative;
    max-width: 560px;
    margin: 0 auto;
}
.hero__search-icon {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    color: var(--ink-muted);
}
.hero__search input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    font-family: inherit;
    font-size: 16px;
    color: var(--ink);
    background: #fff;
    border: 1px solid transparent;
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    outline: none;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.hero__search input::placeholder { color: var(--ink-muted); }
.hero__search input:focus {
    border-color: var(--pink);
    box-shadow: 0 4px 20px rgba(254, 103, 139, 0.15);
}

/* Main content */
.content {
    flex: 1;
    position: relative;
    z-index: 1;
    padding: 56px 0 80px;
}
.view { animation: fade 0.18s ease; }
.view[hidden] { display: none !important; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.view__title {
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 36px;
    color: var(--ink);
}

.view--loading, .view--error {
    text-align: center;
    padding: 60px 20px;
    color: var(--ink-muted);
}
.view--error { color: #c0392b; }

/* Breadcrumb */
.breadcrumb {
    font-size: 14px;
    color: var(--ink-muted);
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.breadcrumb a {
    color: var(--ink-muted);
    transition: color 0.15s;
}
.breadcrumb a:hover { color: var(--pink); }
.breadcrumb__sep { color: var(--ink-muted); opacity: 0.6; }
.breadcrumb__current { color: var(--ink); font-weight: 500; }

/* Categories grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
@media (max-width: 900px) { .categories-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .categories-grid { grid-template-columns: 1fr; } }

.category-card {
    background: var(--bg-soft);
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
    cursor: pointer;
    display: block;
    color: inherit;
}
.category-card:hover {
    transform: translateY(-2px);
    background: #fff;
    border-color: var(--border);
    box-shadow: var(--shadow-card-hover);
}
.category-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 14px;
    color: var(--pink);
}
.category-card__icon svg { width: 100%; height: 100%; }
.category-card__title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--ink);
}
.category-card__subtitle {
    font-size: 13px;
    color: var(--ink-soft);
    margin-bottom: 18px;
    min-height: 38px;
}
.category-card__count {
    font-size: 12px;
    color: var(--ink-muted);
}

/* Category header (question list page) */
.category-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}
.category-header__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--pink);
    flex-shrink: 0;
}
.category-header__icon svg { width: 100%; height: 100%; }
.category-header__title {
    font-size: 22px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
}
.category-header__subtitle {
    font-size: 14px;
    color: var(--ink-soft);
    margin-top: 2px;
}

/* Question list */
.question-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.question-list__item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    background: var(--bg-soft);
    border-radius: 10px;
    font-size: 15px;
    color: var(--ink);
    transition: background 0.15s ease, transform 0.15s ease;
}
.question-list__item a:hover {
    background: #fff;
    box-shadow: var(--shadow-card);
    transform: translateX(2px);
}
.question-list__item a::after {
    content: '';
    width: 8px;
    height: 8px;
    border-top: 2px solid var(--ink-muted);
    border-right: 2px solid var(--ink-muted);
    transform: rotate(45deg);
    flex-shrink: 0;
}

/* Article view */
.view--article { max-width: 800px; margin: 0 auto; }
.article__title {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--ink);
    line-height: 1.3;
}
.article__body { font-size: 16px; color: var(--ink-soft); line-height: 1.75; }
.article__body p { margin-bottom: 14px; }
.article__body p:last-child { margin-bottom: 0; }
.article__body strong { color: var(--ink); }
.article__body a { color: var(--pink); text-decoration: underline; }
.article__body a:hover { opacity: 0.85; }
.article__body ul,
.article__body ol {
    margin: 14px 0 18px;
    padding-left: 22px;
}
.article__body li {
    margin-bottom: 8px;
    line-height: 1.7;
}
.article__body li::marker { color: var(--ink-muted); }
.article__body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 18px 0;
    display: block;
    border: 1px solid var(--border);
}
.article__body figure {
    margin: 18px 0;
}
.article__body figure img { margin: 0; }
.article__body figcaption {
    font-size: 13px;
    color: var(--ink-muted);
    margin-top: 8px;
    text-align: center;
    font-style: italic;
}

/* Search results */
.view--search { max-width: 800px; margin: 0 auto; }
.search-group { margin-bottom: 28px; }
.search-group__label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: var(--ink-muted);
    margin-bottom: 10px;
}
.search-empty {
    text-align: center;
    color: var(--ink-muted);
    padding: 40px 20px;
}

/* Footer */
.site-footer {
    position: relative;
    z-index: 2;
    border-top: 1px solid var(--border);
    padding: 28px 0;
    background: var(--bg);
}
.site-footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.site-footer__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--ink-soft);
}
.site-footer__brand a { color: var(--pink); }
.site-footer__brand a:hover { text-decoration: underline; }
.site-footer__nav {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--ink-soft);
}
.site-footer__nav a:hover { color: var(--pink); }
@media (max-width: 600px) {
    .site-footer .container { flex-direction: column; align-items: flex-start; }
}
