body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    background: #f3f4f6;
    color: #1e1f24;
}

.wrap {
    width: min(980px, 92%);
    margin: 0 auto;
}

.site-header, .site-footer {
    background: #111827;
    color: #fff;
    padding: 14px 0;
}

.site-header .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
}

nav a {
    color: #e5e7eb;
    margin-left: 12px;
    text-decoration: none;
    font-size: 15px;
}

main {
    padding: 24px 0 40px;
}

.hero, .card {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

input, textarea, select, button {
    width: 100%;
    margin-top: 6px;
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
}

button, .btn {
    background: #2563eb;
    color: #fff;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    width: auto;
    padding: 10px 14px;
    border-radius: 6px;
    margin-right: 8px;
    margin-top: 6px;
}

.muted {
    color: #6b7280;
    font-size: 14px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-block;
    background: #e0e7ff;
    color: #1e3a8a;
    padding: 6px 10px;
    border-radius: 20px;
    text-decoration: none;
}

.footer-links {
    margin: 0 0 8px;
}

.footer-links a {
    color: #d1d5db;
    text-decoration: none;
    margin-right: 12px;
}

.footer-links a:hover {
    color: #fff;
}

.admin-nav a {
    margin-right: 10px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.stat-card span {
    display: block;
    margin-top: 8px;
    font-size: 30px;
    font-weight: 700;
    color: #1d4ed8;
}

.success {
    color: #166534;
    font-weight: 600;
}

.error {
    color: #b91c1c;
    font-weight: 600;
}

.ad-wrap {
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    margin: 12px auto;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.download-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.download-btn.alt {
    background: #7c3aed;
}

.site-logo-image {
    height: 34px;
    width: auto;
    display: block;
}

.admin-body {
    background: #f0f0f1;
}

.admin-shell {
    min-height: calc(100vh - 32px);
    display: grid;
    grid-template-columns: 200px 1fr;
}

.admin-globalbar {
    height: 32px;
    background: #1d2327;
    color: #f0f0f1;
    border-bottom: 1px solid #101517;
}

.admin-globalbar-inner {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    height: 100%;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    font-size: 12px;
}

.admin-globalbar a {
    color: #72aee6;
    text-decoration: none;
}

.admin-sidebar {
    background: #1d2327;
    color: #fff;
    padding: 12px 0;
}

.admin-brand {
    color: #f0f0f1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    padding: 8px 12px 10px;
    border-bottom: 1px solid #2c3338;
}

.admin-menu {
    display: grid;
    gap: 0;
}

.admin-menu a {
    color: #c3c4c7;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 0;
    font-size: 13px;
    border-left: 3px solid transparent;
    line-height: 1.4;
}

.admin-menu a.active,
.admin-menu a:hover {
    background: #2c3338;
    color: #fff;
    border-left-color: #72aee6;
}

.admin-main {
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    background: #f6f7f7;
    border-bottom: 1px solid #dcdcde;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 20px;
}

.admin-topbar h1 {
    margin: 0;
    font-size: 23px;
    font-weight: 400;
    color: #1d2327;
}

.admin-content {
    padding: 20px;
}

.admin-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.admin-content .card {
    border: 1px solid #dcdcde;
    border-radius: 2px;
    box-shadow: none;
    padding: 14px;
    margin-bottom: 14px;
}

.admin-content .card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
}

.admin-content .btn {
    background: #2271b1;
    border: 1px solid #2271b1;
    border-radius: 3px;
    font-size: 13px;
    padding: 7px 12px;
}

.admin-content input,
.admin-content textarea,
.admin-content select {
    border: 1px solid #8c8f94;
    border-radius: 3px;
    font-size: 13px;
}

.admin-content label {
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
}

.quill-editor {
    min-height: 560px;
    margin-bottom: 12px;
    background: #fff;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 14px;
}

.post-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.post-card h3 {
    margin: 0 0 4px;
    line-height: 1.3;
    font-size: 18px;
}

.post-card h3 a {
    color: #0f172a;
    text-decoration: none;
}

.post-card h3 a:hover {
    color: #1d4ed8;
}

.app-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid #dbe2ea;
}

.card-desc {
    color: #374151;
    font-size: 14px;
    line-height: 1.65;
    margin: 8px 0 0;
}

.post-hero-icon {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid #dbe2ea;
    margin-bottom: 10px;
}

.list-links {
    display: grid;
    gap: 10px;
}

.list-links a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
    color: #111827;
    text-decoration: none;
}

.list-links a span {
    color: #6b7280;
    font-size: 13px;
}

.social-share {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.social-share a {
    background: #eef2ff;
    color: #1e3a8a;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
}

.hero-search {
    margin-top: 14px;
    display: flex;
    gap: 8px;
}

.hero-search input {
    margin: 0;
}

.hero-search button {
    margin: 0;
    white-space: nowrap;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.inline-form {
    display: inline;
}

.inline-form input[type="hidden"] {
    display: none;
}

.inline-form .btn {
    margin: 0;
    padding: 5px 10px;
}

.btn-danger {
    background: #b32d2e !important;
    border-color: #b32d2e !important;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
}

.related-item {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #111827;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    background: #fff;
}

.related-item strong {
    display: block;
    margin-bottom: 4px;
}

.app-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin: 10px 0 14px;
}

.app-summary-card h1 {
    margin: 0 0 6px;
}

.app-summary-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.app-meta-grid div {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
}

.app-meta-grid strong {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.app-meta-grid span {
    font-size: 14px;
    color: #111827;
    font-weight: 600;
}

.rich-content h1,
.rich-content h2,
.rich-content h3 {
    margin-top: 16px;
    margin-bottom: 8px;
}

.rich-content p {
    line-height: 1.75;
}

.rich-content ul,
.rich-content ol {
    padding-left: 20px;
}

.rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.rich-content th,
.rich-content td {
    border: 1px solid #e5e7eb;
    padding: 8px;
    text-align: left;
}

@media (max-width: 768px) {
    .site-header .wrap {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    nav {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    nav a {
        margin-left: 0;
    }

    .card,
    .hero {
        padding: 14px;
    }

    .download-actions .btn,
    .download-actions .download-btn {
        width: 100%;
        text-align: center;
    }

    .hero-search {
        flex-direction: column;
    }

    .app-summary-top {
        align-items: flex-start;
    }

    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        padding-bottom: 0;
    }

    .admin-topbar {
        padding: 12px 14px;
    }

    .admin-content {
        padding: 14px;
    }

    .admin-grid-2 {
        grid-template-columns: 1fr;
    }
}
