:root {
    --ink: #14212b;
    --muted: #65727d;
    --line: #dbe4e1;
    --paper: #f6f7f2;
    --panel: #ffffff;
    --teal: #1b8a86;
    --teal-dark: #11615f;
    --amber: #d78a2d;
    --red: #b94a48;
    --shadow: 0 18px 46px rgba(20, 33, 43, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.6;
}

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

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

button,
input,
textarea,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px clamp(20px, 5vw, 70px);
    background: rgba(246, 247, 242, 0.88);
    border-bottom: 1px solid rgba(219, 228, 225, 0.9);
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--ink);
    color: #fff7e6;
    font-weight: 800;
    letter-spacing: 0;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.2;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}

.site-nav a {
    padding: 8px 12px;
    border-radius: 8px;
}

.site-nav a:hover {
    background: #e9efeb;
    color: var(--ink);
}

.hero {
    position: relative;
    min-height: 72vh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: #102531;
}

.hero img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(12, 25, 32, 0.88), rgba(12, 25, 32, 0.45) 48%, rgba(12, 25, 32, 0.16)),
        linear-gradient(0deg, rgba(12, 25, 32, 0.72), transparent 55%);
}

.hero-content {
    position: relative;
    width: min(760px, calc(100% - 40px));
    margin: 0 clamp(20px, 7vw, 90px) clamp(36px, 8vw, 92px);
    color: white;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--amber);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero h1,
.page-hero h1,
.article-header h1 {
    margin: 0;
    font-size: clamp(40px, 7vw, 82px);
    line-height: 1.04;
    letter-spacing: 0;
}

.hero p:not(.eyebrow) {
    max-width: 630px;
    margin: 20px 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 18px;
}

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

.button.primary {
    background: var(--teal);
    color: white;
}

.button.primary:hover {
    background: var(--teal-dark);
}

.button.ghost {
    border-color: rgba(255, 255, 255, 0.38);
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

.button.ghost.dark {
    color: var(--ink);
    border-color: var(--line);
    background: white;
}

.button.danger {
    background: #fff;
    color: var(--red);
    border-color: #e9c7c5;
}

.button.wide {
    width: 100%;
}

.stats-band {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--line);
    border-block: 1px solid var(--line);
}

.stats-band div {
    padding: 24px clamp(18px, 4vw, 54px);
    background: #fff;
}

.stats-band span {
    display: block;
    color: var(--teal-dark);
    font-size: 30px;
    font-weight: 900;
}

.stats-band p {
    margin: 4px 0 0;
    color: var(--muted);
}

.featured-section,
.review-grid-section,
.review-list {
    width: min(1180px, calc(100% - 40px));
    margin: 70px auto;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.12;
}

.compact-heading {
    align-items: center;
}

.text-link {
    color: var(--teal-dark);
    font-weight: 900;
}

.home-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    width: min(1180px, calc(100% - 40px));
    margin: 70px auto;
}

.home-main {
    min-width: 0;
}

.home-article-list {
    display: grid;
    gap: 12px;
}

.home-article-item {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.home-article-item:hover {
    border-color: #b8cbc5;
    box-shadow: 0 10px 26px rgba(20, 33, 43, 0.06);
}

.home-article-item img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 6px;
}

.home-article-item h3 {
    margin: 8px 0 6px;
    font-size: 21px;
    line-height: 1.28;
}

.home-article-item p {
    margin: 0;
    color: var(--muted);
}

.home-article-item > strong {
    display: inline-grid;
    place-items: center;
    min-width: 52px;
    height: 40px;
    border-radius: 8px;
    background: #fff4df;
    color: #98601d;
    font-size: 20px;
    font-weight: 900;
}

.home-sidebar {
    display: grid;
    align-content: start;
    gap: 16px;
}

.sidebar-panel {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.sidebar-panel h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.sidebar-panel p {
    margin: 0 0 14px;
    color: var(--muted);
}

.sidebar-categories {
    display: grid;
    gap: 6px;
}

.sidebar-categories a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 36px;
    padding: 8px 10px;
    border-radius: 7px;
    color: #34444d;
    font-weight: 800;
}

.sidebar-categories a:hover {
    background: #edf2ee;
    color: var(--teal-dark);
}

.submit-panel {
    background: #fffaf0;
    border-color: #ead7b7;
}

.featured-card {
    display: grid;
    grid-template-columns: minmax(280px, 46%) 1fr;
    overflow: hidden;
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.featured-card img {
    width: 100%;
    height: 100%;
    min-height: 360px;
    object-fit: cover;
}

.featured-card > div {
    padding: clamp(28px, 5vw, 56px);
}

.score {
    display: inline-grid;
    place-items: center;
    min-width: 58px;
    height: 44px;
    padding: 0 10px;
    border-radius: 8px;
    background: #fff4df;
    color: #98601d;
    font-size: 22px;
    font-weight: 900;
}

.featured-card h3 {
    margin: 20px 0 12px;
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.12;
}

.featured-card p,
.review-card p,
.list-item p,
.page-hero p,
.article-header p {
    color: var(--muted);
}

.meta-row,
.article-kicker,
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 14px;
}

.meta-row span,
.article-kicker span {
    padding: 4px 8px;
    border-radius: 7px;
    background: #edf2ee;
}

.category-filter {
    width: min(1180px, calc(100% - 40px));
    margin: 28px auto 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.category-filter a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #cdd8d4;
    border-radius: 999px;
    background: #f8faf7;
    color: #34444d;
    font-size: 14px;
    font-weight: 800;
}

.category-filter a:hover,
.category-filter a.active {
    border-color: var(--teal);
    background: #dff1ed;
    color: var(--teal-dark);
}

.category-filter {
    margin-top: 18px;
    margin-bottom: 28px;
}

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

.review-card {
    overflow: hidden;
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.review-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.review-card-body {
    padding: 18px;
}

.card-topline {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
}

.card-topline span {
    max-width: 72%;
    overflow: hidden;
    padding: 3px 8px;
    border-radius: 999px;
    background: #dff1ed;
    color: var(--teal-dark);
    font-size: 13px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-topline strong {
    color: var(--teal-dark);
}

.review-card h3 {
    min-height: 64px;
    margin: 10px 0;
    font-size: 20px;
    line-height: 1.32;
}

.page-hero {
    width: min(1050px, calc(100% - 40px));
    margin: 58px auto 26px;
}

.submit-hero {
    margin-bottom: 18px;
}

.submit-card {
    width: min(520px, calc(100% - 40px));
    margin: 0 auto 84px;
}

.page-hero.compact h1 {
    font-size: clamp(36px, 6vw, 70px);
}

.page-hero.compact p:not(.eyebrow) {
    max-width: 680px;
    font-size: 18px;
}

.review-list {
    display: grid;
    gap: 14px;
}

.list-item {
    display: grid;
    grid-template-columns: 220px 1fr auto;
    gap: 22px;
    align-items: center;
    padding: 16px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.list-item img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 6px;
}

.list-item h2 {
    margin: 8px 0;
    font-size: 24px;
    line-height: 1.22;
}

.article {
    width: min(1060px, calc(100% - 40px));
    margin: 48px auto 84px;
}

.article-header {
    max-width: 880px;
}

.article-header h1 {
    margin-top: 14px;
    color: #101b22;
}

.article-header p {
    max-width: 760px;
    font-size: 18px;
}

.article-meta {
    margin-top: 20px;
}

.article-meta strong {
    color: var(--teal-dark);
    font-size: 34px;
    line-height: 1;
}

.article-cover {
    width: 100%;
    max-height: 560px;
    margin: 34px 0;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: var(--shadow);
}

.score-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    overflow: hidden;
    margin-bottom: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.score-panel div {
    padding: 18px;
    background: white;
}

.score-panel span,
.score-panel strong {
    display: block;
}

.score-panel meter {
    width: 100%;
    height: 12px;
    margin: 10px 0;
}

.article-body {
    width: min(760px, 100%);
    margin: 0 auto;
    color: #24323c;
    font-size: 18px;
}

.article-body h2 {
    margin: 38px 0 12px;
    color: var(--ink);
    font-size: 30px;
    line-height: 1.2;
}

.article-body img {
    width: 100%;
    margin: 24px 0;
    border-radius: 8px;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 34px clamp(20px, 5vw, 70px);
    border-top: 1px solid var(--line);
    background: #fff;
}

.site-footer p {
    margin: 4px 0 0;
    color: var(--muted);
}

.admin-shell {
    display: grid;
    grid-template-columns: 248px 1fr;
    min-height: 100vh;
    background: #eef3ef;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px;
    background: #101b22;
    color: white;
}

.admin-sidebar .brand-mark {
    background: #fff4df;
    color: #101b22;
}

.admin-sidebar .brand small {
    color: rgba(255, 255, 255, 0.62);
}

.admin-sidebar nav {
    display: grid;
    gap: 6px;
    margin-top: 34px;
}

.admin-sidebar nav a {
    padding: 10px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.76);
}

.admin-sidebar nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.admin-main {
    padding: 34px;
}

.admin-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.admin-heading h1,
.login-panel h1 {
    margin: 0;
    font-size: 38px;
    line-height: 1.1;
}

.table-panel,
.login-panel,
.side-panel,
.editor-main {
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(20, 33, 43, 0.06);
}

.table-panel {
    overflow: auto;
}

.post-table {
    width: 100%;
    min-width: 820px;
    border-collapse: collapse;
}

.post-table th,
.post-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.post-table th {
    color: var(--muted);
    font-size: 13px;
}

.post-table small {
    display: block;
    color: var(--muted);
}

.private-cell {
    max-width: 260px;
    color: #34444d;
    font-size: 13px;
    word-break: break-word;
}

.table-actions {
    white-space: nowrap;
}

.table-actions a {
    margin-right: 10px;
    color: var(--teal-dark);
    font-weight: 700;
}

.status {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
}

.status.published {
    color: var(--teal-dark);
    background: #dff1ed;
}

.status.draft {
    color: #8a661b;
    background: #fff4df;
}

.login-panel {
    width: min(460px, calc(100% - 40px));
    margin: 10vh auto;
    padding: 28px;
}

.admin-form,
.editor-main,
.side-panel {
    display: grid;
    gap: 16px;
}

.admin-form {
    margin-top: 22px;
}

label span {
    display: block;
    margin-bottom: 6px;
    color: #40505a;
    font-size: 13px;
    font-weight: 800;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid #cdd8d4;
    border-radius: 8px;
    background: #fbfcfa;
    color: var(--ink);
    outline: none;
}

input,
select {
    min-height: 42px;
    padding: 8px 10px;
}

textarea {
    padding: 10px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus,
.editor-box:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(27, 138, 134, 0.12);
}

.alert {
    margin-top: 18px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff0ef;
    color: var(--red);
}

.editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 22px;
    align-items: start;
}

.editor-main,
.side-panel {
    padding: 20px;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f6f7f2;
}

.editor-toolbar button,
.upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: white;
    cursor: pointer;
    font-weight: 800;
}

.upload-status {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.upload-button input {
    display: none;
}

.editor-box {
    min-height: 520px;
    padding: 18px;
    border: 1px solid #cdd8d4;
    border-radius: 8px;
    background: #fbfcfa;
    outline: none;
    font-size: 17px;
}

.editor-box:empty::before {
    content: attr(data-placeholder);
    color: #8b989f;
}

.editor-box img {
    max-width: 100%;
    margin: 16px 0;
    border-radius: 8px;
}

.editor-box.drag-over {
    border-color: var(--amber);
    background: #fffaf0;
}

.upload-placeholder {
    padding: 12px;
    border: 1px dashed #cdd8d4;
    border-radius: 8px;
    color: var(--muted);
    background: #f6f7f2;
}

.upload-placeholder.failed {
    color: var(--red);
    background: #fff0ef;
    border-color: #e9c7c5;
}

.editor-side {
    display: grid;
    gap: 16px;
}

.side-panel h2 {
    margin: 0;
    font-size: 18px;
}

.private-submit-panel {
    border-color: #ead7b7;
    background: #fffaf0;
}

.private-submit-panel h2 {
    color: #8a661b;
}

.score-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.empty-state {
    padding: 30px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
}

@media (max-width: 960px) {
    .review-grid,
    .score-panel,
    .stats-band {
        grid-template-columns: repeat(2, 1fr);
    }

    .featured-card,
    .list-item,
    .home-content,
    .editor-layout,
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .home-article-item {
        grid-template-columns: 140px minmax(0, 1fr) auto;
    }

    .admin-sidebar {
        position: static;
        height: auto;
    }
}

@media (max-width: 640px) {
    .site-header,
    .site-footer,
    .admin-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-nav {
        width: 100%;
        justify-content: space-between;
    }

    .hero {
        min-height: 78vh;
    }

    .review-grid,
    .score-panel,
    .stats-band,
    .score-fields {
        grid-template-columns: 1fr;
    }

    .admin-main {
        padding: 20px;
    }

    .home-article-item {
        grid-template-columns: 1fr auto;
    }

    .home-article-item img {
        grid-column: 1 / -1;
    }
}
