/* ========================================
   Apple Design Language Blog Theme
   Pure white, generous whitespace, SF Pro,
   glassmorphism header, subtle animations
   ======================================== */

:root {
    /* Colors */
    --primary: #0071E3;
    --primary-dark: #0077ED;
    --accent: #0071E3;
    --bg: #FFFFFF;
    --bg-secondary: #F5F5F7;
    --bg-card: #FFFFFF;
    --text: #1D1D1F;
    --text-light: #86868B;
    --text-muted: #6E6E73;
    --border: #D2D2D7;
    --border-light: #E5E5E5;
    --success: #34C759;
    --warning: #FF9500;
    --danger: #FF3B30;
    --info: #007AFF;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
                 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB',
                 'Microsoft YaHei', sans-serif;
    --font-mono: 'SF Mono', 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    /* Spacing */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-pill: 980px;

    /* Shadows */
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);

    /* Layout */
    --max-width: 980px;
    --header-height: 48px;
    --sidebar-width: 240px;
    --prose-width: 680px;
    --code-width: 780px;
}

/* ==================== Reset & Base ==================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover { color: var(--primary-dark); }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 22px;
}

img { max-width: 100%; height: auto; }

/* ==================== Header ==================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 9999;
    min-height: var(--header-height);
    background: rgba(255, 255, 255, 0.86);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(29, 29, 31, 0.08);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.site-header .logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.01em;
    flex-shrink: 0;
}
.site-header .logo:hover { color: var(--text); }

.site-header nav {
    display: flex;
    gap: 28px;
    align-items: center;
}
.site-header nav a {
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: color 0.2s ease;
    text-decoration: none;
    padding: 0;
    border-radius: 0;
    background: none;
}
.site-header nav a:hover,
.site-header nav a.active {
    color: var(--primary);
    background: none;
    text-decoration: none;
}

.header-search {
    display: flex;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}
.header-search form {
    display: flex;
    align-items: center;
}
.site-header .header-search input {
    width: 200px;
    height: 34px;
    background: rgba(245, 245, 247, 0.68);
    border: 1px solid rgba(210, 210, 215, 0.68);
    color: var(--text);
    padding: 7px 14px 7px 34px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8);
    transition: width 0.3s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: var(--font-sans);
}
.header-search::before {
    content: "";
    position: absolute;
    left: 13px;
    top: 50%;
    width: 12px;
    height: 12px;
    border: 1.7px solid var(--text-muted);
    border-radius: 50%;
    transform: translateY(-58%);
    pointer-events: none;
    opacity: 0.72;
}
.header-search::after {
    content: "";
    position: absolute;
    left: 24px;
    top: 25px;
    width: 6px;
    height: 1.7px;
    background: var(--text-muted);
    border-radius: 2px;
    transform: rotate(45deg);
    pointer-events: none;
    opacity: 0.72;
}
.site-header .header-search input::placeholder { color: #8D8D92; }
.site-header .header-search input:focus {
    outline: none;
    width: 280px;
    background: #fff;
    border-color: rgba(0, 113, 227, 0.34);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.08);
}
/* Mobile menu toggle */
.menu-toggle {
    display: none;
    width: 36px;
    height: 36px;
    background: rgba(245, 245, 247, 0.72);
    border: 1px solid rgba(210, 210, 215, 0.72);
    border-radius: 50%;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10000;
}

/* ==================== Main Layout ==================== */
.main-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 22px 80px;
}
.content-area { min-width: 0; }

/* ==================== Widget Row ==================== */
.widget-row-section {
    background: var(--bg-secondary);
    padding: 64px 0;
    margin-top: 0;
}
.widget-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 22px;
}
.widget-row .widget {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.widget-row .widget h3 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
    margin-bottom: 16px;
    padding-bottom: 0;
    border-bottom: none;
    display: block;
}
.widget-row .widget ul { list-style: none; }
.widget-row .widget li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
}
.widget-row .widget li:last-child { border-bottom: none; }
.widget-row .widget li a {
    color: var(--text);
    font-size: 14px;
    display: block;
    transition: color 0.2s ease;
}
.widget-row .widget li a:hover { color: var(--primary); text-decoration: none; }
.widget-row .widget form input {
    width: 100%;
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius-pill);
    padding: 10px 16px;
    font-size: 14px;
    font-family: var(--font-sans);
    transition: background 0.2s ease;
}
.widget-row .widget form input:focus {
    outline: none;
    background: #EDEDF0;
}
.widget-row .tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ==================== Announcement Bar ==================== */
.announcement-bar {
    padding: 16px 22px;
    display: flex;
    justify-content: center;
}
.announcement-inner {
    max-width: var(--prose-width);
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #E8F4FD;
    border-radius: var(--radius);
    padding: 12px 20px;
    font-size: 14px;
    color: var(--text);
}
.announcement-icon { font-size: 16px; flex-shrink: 0; }
.announcement-text { flex: 1; }
.announcement-close {
    background: rgba(0, 0, 0, 0.06);
    border: none;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s ease;
}
.announcement-close:hover { background: rgba(0, 0, 0, 0.12); }

/* ==================== Post Grid ==================== */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* List toolbar (view toggle) - hidden in Apple theme */
.list-toolbar { display: none; }
.view-toggle { display: none; }

.post-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
                box-shadow 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    display: flex;
    flex-direction: column;
}
.post-card:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-hover);
}

.post-card .card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-secondary);
    border-radius: var(--radius) var(--radius) 0 0;
}
.post-card .card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.post-card:hover .card-thumb img { transform: scale(1.04); }

.post-card .card-thumb .card-category {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.post-card .card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card .card-category-text {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    margin-bottom: 4px;
}

.post-card .card-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 8px;
    letter-spacing: -0.003em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-card .card-title a {
    color: var(--text);
    text-decoration: none;
}
.post-card .card-title a:hover { color: var(--primary); }

.post-card .card-excerpt {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
    flex: 1;
}

.post-card .card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: auto;
}

.pin-badge {
    display: inline-block;
    background: var(--warning);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 4px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ==================== Hero Section ==================== */
.hero-section {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(0, 113, 227, 0.08), rgba(255, 149, 0, 0.06) 52%, rgba(52, 199, 89, 0.05)),
        linear-gradient(180deg, #fff, #f7f8fa);
    border-top: 1px solid rgba(210, 210, 215, 0.55);
    border-bottom: 1px solid rgba(210, 210, 215, 0.55);
    padding: 56px 48px;
    margin: -40px -22px 48px;
    text-align: left;
}
.hero-label {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(210, 210, 215, 0.7);
    border-radius: var(--radius-pill);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary);
    margin-bottom: 18px;
}
.hero-title {
    max-width: 820px;
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--text);
    margin-bottom: 14px;
    line-height: 1.18;
}
.hero-title a { color: var(--text); text-decoration: none; }
.hero-title a:hover { color: var(--primary); }
.hero-excerpt {
    font-size: 16px;
    color: var(--text-light);
    max-width: 720px;
    margin: 0 0 28px;
    line-height: 1.65;
}
.hero-cta {
    display: inline-flex;
    align-items: center;
    height: 42px;
    padding: 0 22px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(0, 113, 227, 0.22);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.hero-cta:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(0, 113, 227, 0.26);
}

/* ==================== Post Detail ==================== */
.post-detail {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.post-detail .post-cover {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    max-height: 520px;
    overflow: hidden;
    margin-bottom: 48px;
}
.post-detail .post-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-detail .post-header {
    max-width: var(--prose-width);
    margin: 0 auto;
    padding: 0 22px 40px;
    border-bottom: none;
}
.post-detail .post-category-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
    margin-bottom: 16px;
}
.post-detail h1 {
    font-size: 40px;
    line-height: 1.1;
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text);
}
.post-detail .post-meta-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-light);
    flex-wrap: wrap;
}
.post-detail .post-meta-info .meta-separator {
    color: var(--border);
}
.post-detail .post-meta-info .meta-category {
    background: var(--bg-secondary);
    color: var(--text);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
}

.post-detail .post-body {
    max-width: var(--prose-width);
    margin: 0 auto;
    padding: 0 22px 48px;
}

/* ==================== Prose ==================== */
.prose {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text);
}
.prose h1, .prose h2, .prose h3, .prose h4 {
    line-height: 1.25;
    font-weight: 700;
    color: var(--text);
}
.prose h1 {
    font-size: 32px;
    letter-spacing: -0.02em;
    margin: 2em 0 0.6em;
}
.prose h2 {
    font-size: 28px;
    letter-spacing: -0.015em;
    margin-top: 48px;
    margin-bottom: 16px;
    padding-bottom: 0;
    border-bottom: none;
    display: block;
}
.prose h3 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-top: 36px;
    margin-bottom: 12px;
    color: var(--text);
}
.prose h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 1.4em 0 0.5em;
}
.prose p { margin-bottom: 24px; }
.prose ul, .prose ol { margin: 1em 0 1.5em; padding-left: 1.5em; }
.prose li { margin-bottom: 8px; line-height: 1.7; }
.prose blockquote {
    border-left: 4px solid var(--primary);
    padding: 16px 24px;
    margin: 2em 0;
    background: var(--bg-secondary);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-light);
    font-style: italic;
}
.prose code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.88em;
    font-family: var(--font-mono);
    color: #E11D48;
}
.prose pre {
    background: var(--bg-secondary);
    color: var(--text);
    padding: 20px 24px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1.5em 0;
    line-height: 1.6;
    font-size: 14px;
    max-width: var(--code-width);
}
.prose pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}
.prose img {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 1.5em 0;
    box-shadow: var(--shadow);
}
.prose a {
    color: var(--primary);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}
.prose a:hover { border-bottom-color: var(--primary); }
.prose table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5em 0;
    font-size: 15px;
}
.prose th, .prose td {
    border-bottom: 1px solid var(--border-light);
    padding: 12px 16px;
    text-align: left;
}
.prose th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
}
.prose tr:hover { background: #FAFAFA; }
.prose hr {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 3em 0;
}

/* Post footer */
.post-footer {
    max-width: var(--prose-width);
    margin: 0 auto;
    padding: 24px 22px;
    border-top: 1px solid var(--border-light);
    background: transparent;
    font-size: 13px;
    color: var(--text-muted);
}
.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    max-width: var(--prose-width);
    margin: 0 auto;
    padding: 16px 22px;
}
.post-nav a {
    font-size: 14px;
    color: var(--primary);
    padding: 8px 0;
    transition: color 0.2s ease;
}
.post-nav a:hover { color: var(--primary-dark); }

/* ==================== Tags ==================== */
.post-tags {
    margin-top: 48px;
    padding-top: 0;
    border-top: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tag {
    display: inline-block;
    background: var(--bg-secondary);
    color: var(--text-light);
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    transition: all 0.2s ease;
    border: none;
    font-weight: 500;
}
.tag:hover {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

/* Tag cloud */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
    background: var(--bg-secondary);
    color: var(--text-light);
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    border: none;
    transition: all 0.2s ease;
    font-weight: 500;
}
.tag-cloud a:hover {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

/* ==================== Comments ==================== */
.comments-section {
    max-width: var(--prose-width);
    margin: 80px auto 0;
    padding: 40px 22px 0;
    border-top: 1px solid var(--border-light);
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}
.comments-section h3 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 24px;
    padding-bottom: 0;
    border-bottom: none;
    display: block;
}
.comment {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-light);
}
.comment:last-of-type { border-bottom: none; }
.comment-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    gap: 12px;
    align-items: center;
}
.comment-meta strong { color: var(--text); font-weight: 600; }
.comment-date { font-size: 12px; color: var(--text-muted); }
.comment-text {
    font-size: 15px;
    color: var(--text);
    margin: 4px 0;
    line-height: 1.6;
}
.comment-post { font-size: 12px; color: var(--text-muted); }
.comment-form { margin-top: 32px; }
.comment-form h4 {
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
}
.form-row { display: flex; gap: 12px; margin-bottom: 12px; }
.form-row input { flex: 1; }

/* ==================== Page Header ==================== */
.page-header-section {
    position: relative;
    background:
        linear-gradient(135deg, rgba(0, 113, 227, 0.065), rgba(52, 199, 89, 0.045)),
        linear-gradient(180deg, #fff, #f8f9fb);
    border-top: 1px solid rgba(210, 210, 215, 0.55);
    border-bottom: 1px solid rgba(210, 210, 215, 0.55);
    padding: 44px 48px;
    margin: -40px -22px 48px;
    text-align: left;
}
.page-header-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(210, 210, 215, 0.68);
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 16px;
    letter-spacing: 0.02em;
}
.page-header-breadcrumb a { color: var(--text-muted); }
.page-header-breadcrumb a:hover { color: var(--primary); }
.page-header-title {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.15;
}
.page-header-desc {
    font-size: 16px;
    color: var(--text-light);
    max-width: 660px;
    margin: 0;
    line-height: 1.6;
}

/* Legacy page-header class */
.page-header {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: 32px;
    box-shadow: none;
    display: block;
    text-align: center;
}
.page-header h1 {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 8px;
}
.page-header .breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}
.page-header .breadcrumb a { color: var(--text-muted); }

/* ==================== Pagination ==================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 64px 0 0;
}
.pagination a, .pagination span {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
}
.pagination a {
    background: var(--bg-secondary);
    color: var(--text);
    border: none;
    box-shadow: none;
}
.pagination a:hover {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}
.pagination .current {
    background: var(--primary);
    color: #fff;
    border: none;
}
.page-info { color: var(--text-muted); font-size: 13px; }

/* ==================== Empty State ==================== */
.empty-state {
    text-align: center;
    padding: 80px 22px;
    color: var(--text-muted);
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    grid-column: 1 / -1;
}
.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

/* ==================== Search Results ==================== */
.search-result {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}
.search-result:hover { transform: translateX(4px); }
.search-result h3 { font-size: 17px; margin-bottom: 6px; font-weight: 600; }
.search-result h3 a { color: var(--text); }
.search-result h3 a:hover { color: var(--primary); }
.search-result .search-excerpt { font-size: 14px; color: var(--text-light); line-height: 1.6; }
.search-result .search-meta { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

/* ==================== Forms ==================== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="search"],
textarea, select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
    background: var(--bg-secondary);
    color: var(--text);
    height: 44px;
}
textarea {
    height: auto;
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: none;
}

button, .btn-primary, .btn-secondary, .btn-danger {
    padding: 0 28px;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 44px;
    font-family: var(--font-sans);
}
button, .btn-primary {
    background: var(--primary);
    color: #fff;
}
button:hover, .btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
}
.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text);
    border: none;
}
.btn-secondary:hover { background: #EDEDF0; }
.btn-danger {
    background: #FEF2F2;
    color: var(--danger);
    border: 1px solid #FECACA;
    padding: 0 14px;
    height: 36px;
    font-size: 13px;
}
.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

/* ==================== Footer ==================== */
.site-footer {
    background: var(--bg-secondary);
    color: var(--text-muted);
    padding: 40px 0;
    text-align: center;
    font-size: 12px;
    border-top: 1px solid var(--border);
}
.site-footer a {
    color: var(--text-muted);
    transition: color 0.2s ease;
}
.site-footer a:hover { color: var(--primary); }
.site-footer p { margin: 4px 0; }
.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 12px;
}
.footer-filing {
    margin-top: 8px;
    display: flex;
    justify-content: center;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}
.footer-filing a { color: var(--text-muted); font-size: 12px; }
.gongan-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.gongan-badge img { vertical-align: middle; }

/* ==================== Fade-in Animation ==================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
.fade-in:nth-child(2) { transition-delay: 0.1s; }
.fade-in:nth-child(3) { transition-delay: 0.2s; }
.fade-in:nth-child(4) { transition-delay: 0.3s; }
.fade-in:nth-child(5) { transition-delay: 0.4s; }
.fade-in:nth-child(6) { transition-delay: 0.5s; }

/* ==================== Admin Login ==================== */
body:has(.login-card) {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(0, 113, 227, 0.09), rgba(52, 199, 89, 0.05) 48%, rgba(255, 149, 0, 0.07)),
        #f7f8fb;
}
body:has(.login-card)::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 18%, rgba(0, 113, 227, 0.12), transparent 28%),
        radial-gradient(circle at 78% 72%, rgba(255, 149, 0, 0.1), transparent 30%);
    pointer-events: none;
}
.admin-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: transparent;
}
.login-card {
    position: relative;
    z-index: 1;
    flex-direction: column;
    display: flex;
    align-items: stretch;
    justify-content: center;
    min-height: auto;
    padding: 36px;
    margin: min(12vh, 96px) auto;
    text-align: center;
    width: min(420px, calc(100% - 32px));
    max-width: 420px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(210, 210, 215, 0.7);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.12);
    -webkit-backdrop-filter: saturate(180%) blur(22px);
    backdrop-filter: saturate(180%) blur(22px);
}
.login-title {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--text);
    margin-bottom: 8px;
}
.login-subtitle {
    color: var(--text-light);
    font-size: 15px;
    margin-bottom: 24px;
}
.login-card form {
    display: grid;
    gap: 14px;
}
.login-card input {
    height: 48px;
    text-align: center;
    background: rgba(245, 245, 247, 0.82);
    border: 1px solid rgba(210, 210, 215, 0.7);
    border-radius: var(--radius);
}
.login-card input:focus {
    background: #fff;
    border-color: rgba(0, 113, 227, 0.34);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.08);
}
.login-card button {
    width: 100%;
    height: 48px;
    font-size: 15px;
    box-shadow: 0 12px 26px rgba(0, 113, 227, 0.22);
}
.login-return {
    display: inline-block;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}
.login-return:hover { color: var(--primary); }
.login-box {
    background: var(--bg-card);
    padding: 48px 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    text-align: center;
    width: 380px;
    max-width: 100%;
}
.login-box h1 {
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--text);
}
.login-box .login-subtitle {
    color: var(--text-light);
    font-size: 15px;
    margin-bottom: 32px;
}
.login-box input {
    margin-bottom: 16px;
    text-align: center;
    height: 48px;
}
.login-box button {
    width: 100%;
    height: 48px;
    justify-content: center;
    font-size: 15px;
}
.login-error {
    color: var(--danger);
    font-size: 14px;
    margin-bottom: 16px;
    background: rgba(255, 59, 48, 0.08);
    border: 1px solid rgba(255, 59, 48, 0.16);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
}
.login-box .login-return {
    display: inline-block;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}
.login-box .login-return:hover { color: var(--primary); }

.admin-body { background: var(--bg-secondary); }

/* Apply secondary bg to admin pages that use admin-layout */
body:has(.admin-layout) {
    background: #f4f5f7;
}
.admin-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* ==================== Admin Sidebar Layout ==================== */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background: #f4f5f7;
}
.admin-sidebar {
    width: var(--sidebar-width);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid rgba(210, 210, 215, 0.72);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
}
.admin-logo {
    padding: 22px 24px 18px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    border-bottom: 1px solid rgba(210, 210, 215, 0.62);
    color: var(--text);
}
.admin-nav { padding: 12px 12px; }
.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
}
.admin-nav-item:hover {
    color: var(--text);
    background: rgba(0, 113, 227, 0.06);
    text-decoration: none;
}
.admin-nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-left: none;
    padding-left: 16px;
    box-shadow: 0 10px 24px rgba(0, 113, 227, 0.22);
}
.admin-nav-item .nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}
.admin-nav-divider {
    height: 1px;
    background: var(--border-light);
    margin: 8px 12px;
}
.admin-main {
    flex: 1;
    padding: 32px clamp(24px, 4vw, 48px);
    min-width: 0;
    background: #f4f5f7;
}
.admin-page-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 28px;
    color: var(--text);
    letter-spacing: -0.015em;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}
.admin-header h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.admin-header nav { display: flex; gap: 10px; }

/* ==================== Admin Stats ==================== */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}
.stat-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(210, 210, 215, 0.58);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.045);
}
.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    letter-spacing: -0.02em;
}
.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ==================== Admin Sections ==================== */
.admin-section {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(210, 210, 215, 0.58);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.05);
}
.admin-section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(210, 210, 215, 0.62);
    color: var(--text);
    letter-spacing: -0.005em;
}
.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.admin-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
}
.admin-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 28px 0 16px;
    letter-spacing: -0.005em;
}
.admin-content h2:first-child { margin-top: 0; }

/* ==================== Quick Actions ==================== */
.admin-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}
.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(210, 210, 215, 0.58);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.04);
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}
.quick-action-btn:hover {
    color: var(--primary);
    border-color: rgba(0, 113, 227, 0.24);
    transform: translateY(-1px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.08);
    text-decoration: none;
}
.qa-icon { font-size: 18px; }

/* ==================== Admin Table ==================== */
.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(210, 210, 215, 0.58);
    border-radius: var(--radius);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--bg-card);
    border-radius: 0;
    overflow: visible;
}
.admin-table th, .admin-table td {
    padding: 13px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.admin-table th {
    font-weight: 600;
    color: var(--text-light);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: #fbfbfc;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover { background: #f9fafb; }

.post-title-link {
    color: var(--text) !important;
    font-weight: 600;
    line-height: 1.45;
}
.post-title-link:hover { color: var(--primary) !important; }

/* Badges */
.badge {
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
}
.badge.publish { background: rgba(52, 199, 89, 0.12); color: #248A3D; }
.badge.draft { background: rgba(255, 149, 0, 0.12); color: #C93400; }

.type-badge {
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
}
.type-badge.post { background: rgba(0, 122, 255, 0.1); color: #0040DD; }
.type-badge.page { background: rgba(175, 82, 222, 0.1); color: #8944AB; }

/* Action Buttons */
.action-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 188px;
    white-space: normal;
}
.action-cell form {
    display: inline-flex !important;
    margin: 0;
}
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 30px;
    padding: 0 10px;
    border: 1px solid transparent;
    background: rgba(245, 245, 247, 0.78);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    margin-right: 0;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    width: auto;
    border-radius: var(--radius-pill);
    line-height: 1;
    white-space: nowrap;
}
.action-btn:hover {
    opacity: 1;
    transform: translateY(-1px);
}
.action-edit {
    color: var(--primary);
    background: rgba(0, 113, 227, 0.08);
}
.action-edit:hover { border-color: rgba(0, 113, 227, 0.22); }
.action-pin {
    color: #b15f00;
    background: rgba(255, 149, 0, 0.1);
}
.action-pin:hover { border-color: rgba(255, 149, 0, 0.28); }
.action-delete {
    color: var(--danger);
    background: rgba(255, 59, 48, 0.08);
}
.action-delete:hover { border-color: rgba(255, 59, 48, 0.22); }
.pinned-row { background: rgba(255, 149, 0, 0.045) !important; }

/* Tag Chips */
.admin-tags-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
}
.tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-pill);
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

/* ==================== Editor ==================== */
.editor-form {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(210, 210, 215, 0.58);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.05);
    max-width: 980px;
}
.form-group { margin-bottom: 24px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.form-group textarea {
    min-height: 500px;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
}
.form-actions { display: flex; gap: 12px; margin-top: 32px; }
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Inline form */
.inline-form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.form-input {
    padding: 10px 14px;
    border: 1px solid rgba(210, 210, 215, 0.72);
    border-radius: var(--radius-sm);
    font-size: 14px;
    width: 100%;
    transition: all 0.2s ease;
    background: rgba(245, 245, 247, 0.72);
    font-family: var(--font-sans);
    height: 44px;
}
.form-input:focus {
    outline: none;
    border-color: rgba(0, 113, 227, 0.38);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.08);
}
textarea.form-input {
    height: auto;
    min-height: 500px;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
}

/* Alert */
.admin-alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
}
.admin-alert-success {
    background: rgba(52, 199, 89, 0.1);
    color: #248A3D;
    border: none;
}

/* Form hints */
.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Checkbox row */
.form-checkbox-row { margin-bottom: 24px; }
.checkbox-label {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px 14px;
    background: rgba(255, 149, 0, 0.08);
    border: 1px solid rgba(255, 149, 0, 0.18);
    border-radius: var(--radius);
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--text) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}
.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* Button variants */
.btn-primary.btn-lg { padding: 0 32px; font-size: 15px; height: 48px; }
.btn-secondary.btn-sm { padding: 0 16px; font-size: 13px; height: 36px; }
.btn-sm { padding: 0 16px; font-size: 13px; height: 36px; }

/* Comment items in admin */
.comment-item { padding: 14px 0; border-bottom: 1px solid var(--border-light); }
.comment-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.comment-item p { margin: 4px 0; color: var(--text-light); font-size: 14px; }
.comment-item small { color: var(--text-muted); font-size: 12px; }
.comment-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-top: 8px;
}
.comment-actions form {
    display: inline;
    margin: 0;
}
.comment-actions button {
    height: auto;
    padding: 0;
    background: transparent;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}
.comment-actions button:hover { opacity: 0.7; }

/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
    .post-grid { grid-template-columns: repeat(2, 1fr); }
    .widget-row { grid-template-columns: repeat(2, 1fr); }
    .admin-stats { grid-template-columns: repeat(2, 1fr); }
    .admin-sidebar { width: 200px; }
    .admin-main { padding: 24px 28px; }
    .hero-section { padding: 48px 34px; }
    .hero-title { font-size: 34px; }
    .post-detail h1 { font-size: 36px; }
    .page-header-section { padding: 42px 34px; }
    .page-header-title { font-size: 32px; }
}

@media (max-width: 768px) {
    :root { --header-height: 48px; }

    .main-content { padding: 24px 16px 56px; }
    .header-inner { gap: 12px; }
    .site-header .logo {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .header-search {
        order: 2;
        margin-left: auto;
    }
    .menu-toggle { order: 3; }

    /* Mobile nav */
    .site-header nav { display: none; }
    .site-header nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: calc(100% + 10px);
        left: 16px;
        right: 16px;
        background: rgba(255, 255, 255, 0.98);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        backdrop-filter: saturate(180%) blur(20px);
        border: 1px solid rgba(210, 210, 215, 0.78);
        border-radius: var(--radius);
        box-shadow: 0 18px 44px rgba(0, 0, 0, 0.14);
        padding: 8px;
        gap: 4px;
        z-index: 9998;
        align-items: stretch;
    }
    .site-header nav.open a {
        font-size: 16px;
        font-weight: 600;
        letter-spacing: 0;
        padding: 13px 14px;
        width: 100%;
        color: var(--text);
        border-radius: var(--radius-sm);
        line-height: 1.25;
    }
    .site-header nav.open a:hover,
    .site-header nav.open a.active {
        background: rgba(0, 113, 227, 0.08);
        color: var(--primary);
    }
    .menu-toggle { display: inline-flex; flex-shrink: 0; }

    .site-header .header-search input { width: 150px; }
    .site-header .header-search input:focus { width: min(210px, 44vw); }

    /* Post grid */
    .post-grid { grid-template-columns: 1fr; }
    .widget-row { grid-template-columns: 1fr 1fr; }

    /* Post detail */
    .post-detail .post-header,
    .post-detail .post-body,
    .post-footer { padding-left: 16px; padding-right: 16px; }
    .post-detail h1 { font-size: 28px; letter-spacing: -0.015em; }
    .prose { font-size: 16px; }
    .prose h2 { font-size: 24px; }
    .comments-section { padding: 32px 16px 0; margin-top: 56px; }

    /* Forms */
    .form-row { flex-direction: column; }
    .form-row-2 { grid-template-columns: 1fr; }

    /* Admin */
    .admin-stats { grid-template-columns: 1fr 1fr; gap: 12px; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }
    .admin-nav {
        display: flex;
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 4px;
    }
    .admin-nav-item {
        padding: 8px 14px;
        font-size: 13px;
        border-radius: var(--radius-sm);
    }
    .admin-nav-item.active {
        padding-left: 14px;
    }
    .admin-nav-divider { display: none; }
    .admin-logo { padding: 12px 16px; font-size: 16px; }
    .admin-main { padding: 20px 16px; }
    .admin-quick-actions { flex-wrap: wrap; grid-template-columns: 1fr; }
    .admin-page-title { font-size: 24px; }
    .admin-section,
    .editor-form {
        padding: 20px;
        border-radius: var(--radius);
    }
    .admin-table th,
    .admin-table td {
        padding: 11px 12px;
    }
    .action-cell {
        min-width: 164px;
        gap: 6px;
    }
    .action-btn {
        height: 28px;
        padding: 0 9px;
        font-size: 12px;
    }
    .form-actions {
        flex-wrap: wrap;
    }

    /* Hero */
    .hero-section { padding: 36px 20px; margin: -24px -16px 32px; }
    .hero-title { font-size: 28px; line-height: 1.22; }
    .hero-excerpt { font-size: 15px; }

    /* Page header */
    .page-header-section { padding: 32px 20px; margin: -24px -16px 32px; }
    .page-header-title { font-size: 28px; line-height: 1.2; }
    .page-header-breadcrumb { margin-bottom: 12px; }

    .post-nav { flex-direction: column; padding: 16px; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .header-search { display: none; }
    .site-header nav.open {
        left: 12px;
        right: 12px;
    }
    .admin-stats { grid-template-columns: 1fr; }
    .widget-row { grid-template-columns: 1fr; }
    .post-card .card-body { padding: 14px; }
    .footer-filing { flex-direction: column; gap: 8px; }
    .admin-quick-actions { grid-template-columns: 1fr; }
    .editor-form { padding: 20px; }
    .admin-section { padding: 20px; }
    .login-card {
        width: calc(100% - 28px);
        padding: 28px 22px;
        margin: 48px auto;
    }
    .login-title { font-size: 26px; }
    .form-row-2 { grid-template-columns: 1fr; gap: 0; }
}

/* ==================== Scrollbar (admin sidebar) ==================== */
.admin-sidebar::-webkit-scrollbar {
    width: 6px;
}
.admin-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

/* ==================== Editorial public-site refresh ==================== */
body.site-body {
    --primary: #1261a6;
    --primary-dark: #0c4b83;
    --bg: #fdfdfc;
    --bg-secondary: #f3f5f6;
    --bg-card: #fdfdfc;
    --text: #17191c;
    --text-light: #626870;
    --text-muted: #747b84;
    --border: #d9dde1;
    --border-light: #e6e9ec;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --max-width: 1120px;
    --prose-width: 720px;
    background: var(--bg);
}

.site-body .site-header {
    background: rgba(253, 253, 252, 0.92);
    border-bottom-color: rgba(23, 25, 28, 0.1);
    z-index: 100;
}
.site-body .header-inner { height: 64px; }
.site-body .site-header .logo {
    font-size: 19px;
    font-weight: 720;
    letter-spacing: -0.035em;
}
.site-body .site-header nav { gap: 24px; }
.site-body .site-header nav a {
    color: var(--text-muted);
    font-size: 13px;
}
.site-body .site-header nav a:hover,
.site-body .site-header nav a.active { color: var(--text); }
.site-body .site-header nav a.active { box-shadow: inset 0 -2px var(--primary); }
.site-body .main-content { padding-top: 64px; padding-bottom: 112px; }

.site-body .page-header-section {
    margin: 0 0 56px;
    padding: 10px 0 34px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.site-body .page-header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 0;
    margin: 0 0 18px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
}
.site-body .page-header-breadcrumb a { color: var(--text-muted); }
.site-body .page-header-breadcrumb a:hover { color: var(--primary-dark); }
.site-body .breadcrumb-separator { color: var(--border); font-size: 17px; line-height: 1; }
.site-body .page-header-title {
    max-width: 18ch;
    margin: 0;
    color: var(--text);
    font-size: clamp(40px, 5vw, 56px);
    font-weight: 760;
    line-height: 1.1;
    letter-spacing: -0.045em;
    text-wrap: balance;
}
.site-body .page-header-desc {
    max-width: 58ch;
    margin: 16px 0 0;
    color: var(--text-light);
    font-size: 15px;
    line-height: 1.7;
}

.site-body .home-intro {
    display: grid;
    grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
    min-height: 430px;
    margin-bottom: 72px;
    overflow: hidden;
    background: #20272d;
    border-radius: var(--radius-lg);
    color: #f5f7f8;
}
.site-body .home-intro-copy {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: clamp(36px, 5vw, 64px);
}
.site-body .home-intro-copy p {
    margin-bottom: 18px;
    color: #a9c8df;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.08em;
}
.site-body .home-intro-copy h1 {
    max-width: 9ch;
    font-size: clamp(40px, 5.4vw, 66px);
    font-weight: 760;
    line-height: 1.08;
    letter-spacing: -0.05em;
    text-wrap: balance;
}
.site-body .home-intro-media { min-width: 0; }
.site-body .home-intro-media img { width: 100%; height: 100%; object-fit: cover; }

.site-body .hero-section {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
    align-items: stretch;
    min-height: 430px;
    overflow: hidden;
    margin: 0 0 72px;
    padding: 0;
    background: #eaf0f4;
    border: 1px solid #dce3e8;
    border-radius: var(--radius-lg);
    text-align: left;
}
.site-body .hero-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(40px, 6vw, 72px);
}
.site-body .hero-label {
    height: auto;
    padding: 0;
    margin-bottom: 20px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: var(--primary-dark);
    font-size: 12px;
    letter-spacing: 0.08em;
}
.site-body .hero-title {
    max-width: 620px;
    margin-bottom: 18px;
    font-size: clamp(36px, 4.5vw, 56px);
    font-weight: 760;
    line-height: 1.12;
    letter-spacing: -0.045em;
    text-wrap: balance;
}
.site-body .hero-excerpt {
    max-width: 54ch;
    margin-bottom: 30px;
    color: #525a63;
    font-size: 16px;
    line-height: 1.75;
}
.site-body .hero-cta {
    height: 42px;
    padding: 0 18px;
    border-radius: var(--radius-sm);
    box-shadow: none;
}
.site-body .hero-cta span { margin-left: 8px; transition: transform 0.2s ease; }
.site-body .hero-cta:hover span { transform: translateX(3px); }
.site-body .hero-cta:active { transform: translateY(1px); }
.site-body .hero-media { min-height: 100%; overflow: hidden; background: #dce4ea; }
.site-body .hero-media img {
    width: 100%;
    height: 100%;
    min-height: 430px;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.site-body .hero-section:hover .hero-media img { transform: scale(1.025); }
.site-body .hero-section:not(:has(.hero-media)) { grid-template-columns: minmax(0, 760px); }

.site-body .post-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 28px;
    row-gap: 56px;
}
.site-body .post-card {
    grid-column: span 6;
    overflow: visible;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}
.site-body .post-card:nth-child(5n + 1) { grid-column: span 7; }
.site-body .post-card:nth-child(5n + 2) { grid-column: span 5; }
.site-body .post-card:hover { transform: none; box-shadow: none; }
.site-body .post-card .card-thumb:not(:has(img)) { display: none; }
.site-body .post-card:not(:has(.card-thumb img)) {
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.site-body .post-card:not(:has(.card-thumb img)) .card-body { padding-top: 0; }
.site-body .post-card:not(:has(.card-thumb img)) .card-title { font-size: clamp(25px, 3vw, 34px); }
.site-body .post-card .card-thumb {
    aspect-ratio: 16 / 10;
    border-radius: var(--radius);
    background: #e8ebed;
}
.site-body .post-card:nth-child(5n + 1) .card-thumb { aspect-ratio: 16 / 9; }
.site-body .post-card:nth-child(5n + 2) .card-thumb { aspect-ratio: 4 / 3; }
.site-body .post-card .card-thumb img { transition-duration: 0.65s; }
.site-body .post-card:hover .card-thumb img { transform: scale(1.025); }
.site-body .post-card .card-body { padding: 18px 2px 0; }
.site-body .post-card .card-category-text {
    margin-bottom: 8px;
    color: var(--primary-dark);
    font-size: 12px;
    letter-spacing: 0.05em;
}
.site-body .post-card .card-title {
    margin-bottom: 10px;
    font-size: clamp(21px, 2.4vw, 28px);
    line-height: 1.25;
    letter-spacing: -0.025em;
}
.site-body .post-card .card-excerpt {
    max-width: 60ch;
    margin-bottom: 16px;
    color: var(--text-light);
    line-height: 1.65;
    -webkit-line-clamp: 3;
}
.site-body .post-card .card-meta { gap: 0; color: var(--text-muted); }
.site-body .post-card .meta-views::before { content: "/"; margin: 0 8px; color: var(--border); }

.site-body .widget-row-section {
    margin-top: 0;
    padding: 72px 0 64px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
}
.site-body .widget-row-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border);
}
.site-body .widget-row-header h2 {
    font-size: 26px;
    line-height: 1.2;
    letter-spacing: -0.03em;
}
.site-body .widget-row-header a { font-size: 13px; font-weight: 600; }
.site-body .widget-row {
    grid-template-columns: 1.5fr 0.75fr 1.25fr;
    gap: 0;
    padding: 0;
}
.site-body .widget-row .widget {
    padding: 28px 28px 12px 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}
.site-body .widget-row .widget + .widget {
    padding-left: 28px;
    border-left: 1px solid var(--border);
}
.site-body .widget-row .widget h3 {
    margin-bottom: 14px;
    color: var(--text);
    font-size: 14px;
    text-transform: none;
    letter-spacing: 0;
}
.site-body .widget-row .widget li { padding: 8px 0; border: 0; }
.site-body .widget-row .widget li a { color: var(--text-light); line-height: 1.45; }
.site-body .widget-row .tag-cloud { gap: 7px; }
.site-body .widget-row .tag {
    padding: 5px 9px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.site-body .site-footer {
    padding: 28px 0 36px;
    background: var(--bg-secondary);
    border-top-color: var(--border-light);
}

.site-body .fade-in {
    transform: translateY(18px);
    transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1), transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.site-body .fade-in:nth-child(n) { transition-delay: 0s; }

@media (prefers-color-scheme: dark) {
    body.site-body {
        --bg: #141618;
        --bg-secondary: #1a1d20;
        --bg-card: #141618;
        --text: #f1f3f4;
        --text-light: #aeb4bb;
        --text-muted: #9299a2;
        --border: #373c42;
        --border-light: #292e33;
        --primary: #6aafe6;
        --primary-dark: #8bc4ef;
        color-scheme: dark;
    }
    .site-body .site-header { background: rgba(20, 22, 24, 0.9); border-bottom-color: var(--border-light); }
    .site-body .site-header .header-search input { background: #202429; border-color: #373c42; }
    .site-body .hero-section { background: #20272d; border-color: #303a42; }
    .site-body .hero-excerpt { color: var(--text-light); }
    .site-body .hero-media { background: #242a2f; }
    .site-body .post-card .card-thumb { background: #23272b; }
    .site-body .site-header nav.open { background: rgba(26, 29, 32, 0.98); border-color: var(--border); }
}

@media (max-width: 900px) {
    .site-body .home-intro { grid-template-columns: 1fr; }
    .site-body .home-intro-copy { min-height: 260px; }
    .site-body .home-intro-media { order: -1; max-height: 340px; }
    .site-body .home-intro-media img { aspect-ratio: 16 / 9; }
    .site-body .hero-section { grid-template-columns: 1fr; min-height: 0; }
    .site-body .hero-media { order: -1; max-height: 360px; }
    .site-body .hero-media img { min-height: 0; aspect-ratio: 16 / 9; }
    .site-body .post-card,
    .site-body .post-card:nth-child(5n + 1),
    .site-body .post-card:nth-child(5n + 2) { grid-column: span 6; }
}

@media (max-width: 768px) {
    .site-body .header-inner { height: 56px; }
    .site-body .main-content { padding-top: 28px; padding-bottom: 72px; }
    .site-body .page-header-section { margin: 0 0 40px; padding: 6px 0 24px; }
    .site-body .page-header-breadcrumb { margin-bottom: 14px; font-size: 12px; }
    .site-body .page-header-title { font-size: clamp(34px, 10vw, 44px); }
    .site-body .page-header-desc { margin-top: 12px; font-size: 14px; }
    .site-body .home-intro { min-height: 0; margin-bottom: 48px; border-radius: var(--radius); }
    .site-body .home-intro-copy { min-height: 220px; padding: 30px 24px 34px; }
    .site-body .home-intro-copy h1 { font-size: clamp(36px, 12vw, 52px); }
    .site-body .hero-section { margin: 0 0 48px; border-radius: var(--radius); }
    .site-body .hero-copy { padding: 30px 24px 34px; }
    .site-body .hero-title { font-size: clamp(30px, 9vw, 40px); }
    .site-body .post-grid { display: grid; grid-template-columns: 1fr; row-gap: 44px; }
    .site-body .post-card,
    .site-body .post-card:nth-child(5n + 1),
    .site-body .post-card:nth-child(5n + 2) { grid-column: 1; }
    .site-body .post-card .card-thumb,
    .site-body .post-card:nth-child(5n + 1) .card-thumb,
    .site-body .post-card:nth-child(5n + 2) .card-thumb { aspect-ratio: 16 / 10; }
    .site-body .widget-row-section { padding: 52px 0 40px; }
    .site-body .widget-row { grid-template-columns: 1fr; }
    .site-body .widget-row .widget,
    .site-body .widget-row .widget + .widget { padding: 24px 0; border-left: 0; border-bottom: 1px solid var(--border); }
    .site-body .widget-row .widget:last-child { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .site-body *,
    .site-body *::before,
    .site-body *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .site-body .fade-in { opacity: 1; transform: none; }
}
.admin-sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
.admin-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==================== Post list text mode (hidden) ==================== */
.post-grid.post-list-text {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.post-grid.post-list-text .post-card { display: flex; flex-direction: column; }
.post-grid.post-list-text .post-card .card-body { padding: 16px; }
.post-grid.post-list-text .post-card .card-title { font-size: 18px; margin-bottom: 8px; }
.post-grid.post-list-text .post-card .card-excerpt { -webkit-line-clamp: 2; }
