@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700&display=swap');

:root {
    --bg: #f6f7fb;
    --card: #ffffff;
    --primary: #2f80ed;
    --accent: #f2994a;
    --text: #1f2933;
    --muted: #6b7280;
    --radius: 14px;
    --shadow: 0 10px 40px rgba(26, 26, 67, 0.08);
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
    margin: 0;
    height: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    font-family: 'Manrope', 'Segoe UI', 'PingFang SC', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #f8fbff 0%, #f1f4ff 50%, #fef6f0 100%);
    color: var(--text);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell {
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px 20px 48px;
    -webkit-box-flex: 1;
    -ms-flex: 1 0 auto;
    flex: 1 0 auto;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    min-height: 0;
}

header.site {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 18px 20px;
}

.brand {
    font-weight: 700;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 6px 20px rgba(47, 128, 237, 0.35);
}

nav a {
    margin-left: 16px;
    font-weight: 600;
    color: var(--muted);
}
nav a.primary {
    color: #fff;
    background: var(--primary);
    padding: 10px 14px;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(47, 128, 237, 0.25);
}
nav a.primary:hover { text-decoration: none; opacity: 0.94; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-top: 18px;
}
.grid.landscape { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.portrait { grid-template-columns: repeat(1, minmax(0, 1fr)); }

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 320px;
}

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

.card .content {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.counts { color: var(--muted); font-size: 13px; display: flex; gap: 10px; align-items: center; }
.counts span { display: inline-flex; align-items: center; gap: 6px; }

.tag {
    font-size: 12px;
    color: var(--muted);
    padding: 6px 10px;
    background: #f4f6fb;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary), #5aa0ff);
    color: #fff;
    box-shadow: 0 10px 24px rgba(47, 128, 237, 0.28);
}

.btn.ghost {
    background: #eef2f7;
    color: var(--text);
}

.btn:hover { transform: translateY(-1px); }

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 18px 0 6px;
    flex-wrap: nowrap;
}

.pager .pager-status {
    color: var(--muted);
    font-weight: 600;
    text-align: center;
}

.pager .btn { min-width: 96px; }

form.box, .box {
    background: var(--card);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}

label { font-weight: 600; display: block; margin-bottom: 8px; }
input[type="text"], input[type="password"], input[type="tel"], textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
}

textarea { min-height: 120px; resize: vertical; }

.comment {
    padding: 12px 0;
    border-bottom: 1px solid #eef1f6;
}

.comment .meta { font-size: 13px; color: var(--muted); display: flex; gap: 8px; }

.alert { padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
.alert.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecdd3; }
.alert.success { background: #ecfdf3; color: #15803d; border: 1px solid #bbf7d0; }

@media (max-width: 720px) {
    header.site { flex-direction: column; gap: 12px; align-items: flex-start; }
    nav a { margin-left: 0; margin-right: 12px; }
    .shell { padding: 24px 16px 36px; }
}

.masonry {
    flex: 1 1 360px;
    min-width: 320px;
    column-count: 2;
    column-gap: 12px;
}

.masonry img {
    width: 100%;
    display: block;
    margin-bottom: 12px;
    break-inside: avoid;
    border-radius: 14px;
    box-shadow: var(--shadow);
}

@media (max-width: 600px) {
    .masonry {
        column-count: 1;
    }
}

.footer-note {
    margin-top: auto;
    color: #6b7280;
    font-size: 13px;
    text-align: center;
    padding: 8px 0 4px;
}

.footer-note + .footer-note {
    padding-top: 4px;
}
