:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --text: #162033;
    --muted: #687386;
    --line: #dfe5ee;
    --primary: #246bfd;
    --primary-dark: #1550c9;
    --success: #168a53;
    --danger: #bc3040;
    --shadow: 0 18px 55px rgba(27, 39, 63, 0.10);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: radial-gradient(circle at top left, #e6efff 0, transparent 32%), var(--bg);
    color: var(--text);
}
button, input, textarea { font: inherit; }
a { color: inherit; }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 56px 0 80px; }
.container.narrow { width: min(780px, calc(100% - 32px)); }
.hero { max-width: 780px; margin-bottom: 28px; }
.eyebrow { display: inline-block; color: var(--primary); font-size: 12px; letter-spacing: .16em; font-weight: 800; }
h1 { margin: 10px 0 12px; font-size: clamp(32px, 5vw, 54px); line-height: 1.05; letter-spacing: -.035em; }
.hero p, .result-card > p { color: var(--muted); font-size: 17px; line-height: 1.7; }
.panel, .result-card { background: var(--panel); border: 1px solid rgba(223, 229, 238, .9); border-radius: 24px; box-shadow: var(--shadow); padding: 28px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.field { display: flex; flex-direction: column; gap: 9px; }
.field.full { grid-column: 1 / -1; }
label { font-weight: 750; font-size: 14px; }
label span, small { color: var(--muted); font-weight: 500; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: 13px 14px; background: #fbfcfe; color: var(--text); outline: none; transition: .2s ease; }
input:focus, textarea:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(36,107,253,.11); }
textarea { resize: vertical; min-height: 130px; }
.upload-box { position: relative; min-height: 260px; border: 1.5px dashed #aebbd0; border-radius: 18px; background: #f8faff; overflow: hidden; display: grid; place-items: center; text-align: center; }
.upload-box input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 2; }
.upload-box img { width: 100%; height: 300px; object-fit: cover; }
#uploadHint { display: grid; gap: 6px; padding: 24px; }
#uploadHint strong { font-size: 18px; }
#uploadHint span { color: var(--muted); }
.actions { margin-top: 4px; }
.btn { border: 0; border-radius: 12px; padding: 12px 17px; font-weight: 750; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.secondary { background: #eaf1ff; color: #1550c9; }
.btn.ghost { background: #f1f4f8; color: #344155; }
.alert { margin: 0 0 20px; border-radius: 12px; padding: 13px 15px; font-weight: 650; }
.alert.success { background: #e8f7ef; color: var(--success); }
.alert.error { background: #fff0f2; color: var(--danger); }
.recent { margin-top: 42px; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.section-title h2 { margin: 7px 0 0; font-size: 28px; }
.count { color: var(--muted); }
.post-list { display: grid; gap: 12px; }
.post-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.84); }
.post-row img { width: 100px; height: 78px; object-fit: cover; border-radius: 12px; }
.post-info { min-width: 0; }
.post-info h3 { margin: 0 0 5px; font-size: 17px; }
.post-info p { margin: 0 0 7px; color: var(--muted); }
.post-info a { color: var(--primary); font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-actions { display: flex; gap: 8px; }
.empty { border: 1px dashed var(--line); border-radius: 17px; padding: 30px; color: var(--muted); text-align: center; }
.result-card { margin-top: 24px; text-align: center; }
.result-card h1 { font-size: clamp(30px, 6vw, 46px); }
.success-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: #e8f7ef; color: var(--success); font-size: 28px; font-weight: 900; margin: 0 auto 16px; }
.share-preview { text-align: left; margin: 28px 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; }
.share-preview img { width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; display: block; }
.share-preview > div { padding: 15px 17px 18px; }
.share-preview small { text-transform: uppercase; letter-spacing: .08em; }
.share-preview h2 { margin: 7px 0; font-size: 22px; }
.share-preview p { margin: 0; color: var(--muted); line-height: 1.55; }
.link-label { display: block; text-align: left; margin-bottom: 8px; }
.copy-field { display: flex; gap: 9px; }
.copy-field input { min-width: 0; }
.result-actions { margin-top: 16px; display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; }
.toast { position: fixed; left: 50%; bottom: 25px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #162033; color: #fff; padding: 12px 17px; border-radius: 12px; box-shadow: var(--shadow); transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.public-page { min-height: 100vh; display: grid; place-items: center; padding: 28px 0; }
.article-wrap { width: min(880px, calc(100% - 30px)); }
.article-card { overflow: hidden; border-radius: 24px; background: #fff; box-shadow: var(--shadow); border: 1px solid var(--line); }
.article-image { width: 100%; max-height: 520px; aspect-ratio: 1.91 / 1; object-fit: cover; display: block; }
.article-content { padding: clamp(22px, 5vw, 42px); }
.site-name { color: var(--primary); font-weight: 800; letter-spacing: .12em; font-size: 12px; text-transform: uppercase; }
.article-content h1 { font-size: clamp(31px, 6vw, 52px); margin-top: 10px; }
.article-description { color: #4d596c; font-size: 18px; line-height: 1.78; }
.cta { margin-top: 8px; }
.share-bar { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.not-found { padding: 40px; text-align: center; }

@media (max-width: 720px) {
    .container { padding-top: 34px; }
    .form-grid { grid-template-columns: 1fr; }
    .field.full { grid-column: auto; }
    .post-row { grid-template-columns: 78px minmax(0, 1fr); }
    .post-row img { width: 78px; height: 68px; }
    .row-actions { grid-column: 1 / -1; }
    .row-actions .btn { flex: 1; }
    .copy-field { flex-direction: column; }
}
