* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f5f7;
    color: #222;
    line-height: 1.7;
}

a {
    color: #222;
    text-decoration: none;
}

a:hover {
    opacity: 0.75;
}

.container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 24px;
}

.site-header {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.site-logo {
    margin: 0;
    font-size: 22px;
    white-space: nowrap;
}

.site-logo a {
    font-weight: 700;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 16px;
}

.site-nav a {
    font-size: 14px;
    color: #333;
}

.site-footer {
    margin-top: 64px;
    padding: 24px 0;
    background: #fff;
    border-top: 1px solid #e5e5e5;
    text-align: center;
    color: #777;
}

.card {
    background: #fff;
    padding: 24px;
    border-radius: 14px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.card + .card {
    margin-top: 24px;
}

h2,
h3,
h4 {
    line-height: 1.35;
}

h2 {
    margin-top: 0;
    font-size: 26px;
}

h3 {
    font-size: 21px;
}

h4 {
    font-size: 17px;
}

hr {
    border: none;
    border-top: 1px solid #e5e5e5;
    margin: 28px 0;
}

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #222;
}

button,
.btn {
    display: inline-block;
    margin: 4px 4px 4px 0;
    padding: 10px 18px;
    background: #222;
    color: #fff;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

button:hover,
.btn:hover {
    opacity: 0.85;
}

.error {
    padding: 12px 14px;
    margin-bottom: 16px;
    background: #ffeaea;
    color: #9f1111;
    border-radius: 8px;
    border: 1px solid #ffd1d1;
}

.success {
    padding: 12px 14px;
    margin-bottom: 16px;
    background: #e9ffef;
    color: #0b6b25;
    border-radius: 8px;
    border: 1px solid #c9f2d4;
}

img {
    max-width: 100%;
}

.post-image,
.thumbnail {
    max-width: 240px;
    height: auto;
    border-radius: 10px;
}

.meta {
    color: #666;
    font-size: 14px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f0f0f0;
    font-size: 13px;
    color: #444;
}

.badge-public {
    background: #e9f5ff;
    color: #005c99;
}

.badge-limited {
    background: #fff4df;
    color: #8a5500;
}

.badge-draft {
    background: #eeeeee;
    color: #555;
}

.badge-published {
    background: #e9ffef;
    color: #0b6b25;
}

@media (max-width: 700px) {
    .container {
        padding: 16px;
    }

    .header-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-nav {
        justify-content: flex-start;
    }

    .card {
        padding: 18px;
        border-radius: 12px;
    }

    h2 {
        font-size: 23px;
    }

    .btn,
    button {
        width: 100%;
        text-align: center;
        margin-right: 0;
    }
}

.menu-toggle {
    display: none;
}

@media (max-width: 700px) {
    .header-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .site-logo {
        font-size: 20px;
    }

    .menu-toggle {
        display: inline-block;
        width: auto;
        padding: 8px 12px;
        border-radius: 8px;
        font-size: 20px;
        line-height: 1;
    }

    .site-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #e5e5e5;
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav a {
        display: block;
        padding: 10px 0;
        font-size: 15px;
    }

    .header-inner {
        flex-wrap: wrap;
    }
}

.sortable-images {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sortable-image-item {
    padding: 14px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    background: #fff;
}

.sortable-image-item.dragging {
    opacity: 0.5;
}

.drag-handle {
    display: inline-block;
    margin-bottom: 10px;
    padding: 6px 10px;
    background: #f2f2f2;
    border-radius: 999px;
    font-size: 13px;
    color: #555;
    cursor: grab;
}

.drag-handle:active {
    cursor: grabbing;
}

.selected-files {
    margin-top: 10px;
    padding: 12px;
    background: #fafafa;
    border: 1px dashed #ccc;
    border-radius: 10px;
    font-size: 14px;
}

.selected-files ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.selected-files li {
    margin-bottom: 4px;
}

.selected-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    list-style: none;
}

.selected-file-preview {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.selected-file-remove {
    width: auto;
    margin-left: auto;
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 999px;
}

@media (max-width: 700px) {
    .selected-file-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .selected-file-remove {
        width: 100%;
        margin-left: 0;
    }
}

.upload-drop-area {
    padding: 28px;
    border: 2px dashed #ccc;
    border-radius: 14px;
    background: #fafafa;
    text-align: center;
    transition: 0.2s;
}

.upload-drop-area.dragover {
    border-color: #222;
    background: #f0f0f0;
}

.upload-drop-area input[type="file"] {
    margin: 16px auto;
}

button:disabled,
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.upload-loading-text {
    margin-top: 12px;
    color: #666;
    font-size: 14px;
}