:root {
  --bg: #f6f6f3;
  --ink: #161616;
  --muted: #686868;
  --line: #deded8;
  --green: #2f7d4b;
  --accent: #c28b3b;
  --panel: #ffffff;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, textarea, select, button { font: inherit; }
.site-header { height: 72px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(12px); }
.site-logo, .admin-logo { display: flex; gap: 10px; align-items: center; font-weight: 800; }
.site-header nav { display: flex; gap: 22px; color: var(--muted); }
.flash, .alert { margin: 18px auto; max-width: 1100px; padding: 14px 16px; border-radius: 8px; background: #e8f5ed; color: #16552f; }
.alert.danger { background: #fff0f0; color: #8a1f1f; }
.button { border: 0; border-radius: 8px; min-height: 42px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-weight: 700; }
.button.primary { background: var(--green); color: #fff; }
.button.light { background: #fff; color: #111; }
.button.ghost { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.section { padding: 64px 5vw; max-width: 1280px; margin: 0 auto; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 26px; }
.section h2, .section-head h2 { font-size: clamp(28px, 4vw, 46px); margin: 0 0 18px; }
.eyebrow { display: inline-block; text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 800; color: var(--accent); margin-bottom: 18px; }
.portfolio-hero { min-height: calc(100vh - 72px); display: flex; align-items: center; padding: 8vw 5vw; color: #fff; background: linear-gradient(90deg, rgba(0,0,0,.72), rgba(0,0,0,.15)), url("https://images.unsplash.com/photo-1492691527719-9d1e07e534b4?q=80&w=2071&auto=format&fit=crop") center/cover; }
.portfolio-hero div { max-width: 760px; }
.portfolio-hero h1 { font-family: Georgia, serif; font-size: clamp(46px, 8vw, 92px); line-height: .95; margin: 0 0 24px; }
.portfolio-hero p, .wallpaper-top p { font-size: 19px; line-height: 1.7; max-width: 680px; color: rgba(255,255,255,.82); }
.portfolio-grid, .wallpaper-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.portfolio-card, .wallpaper-card { border: 0; text-align: left; background: var(--panel); border-radius: 8px; overflow: hidden; box-shadow: 0 10px 26px rgba(0,0,0,.08); cursor: pointer; }
.portfolio-card img, .wallpaper-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; transition: transform .35s; }
.portfolio-card:hover img, .wallpaper-card:hover img { transform: scale(1.04); }
.portfolio-card span, .portfolio-card strong, .wallpaper-card span, .wallpaper-card strong, .wallpaper-card small { display: block; padding: 0 16px; }
.portfolio-card span, .wallpaper-card span { padding-top: 14px; color: var(--accent); font-size: 13px; font-weight: 800; }
.portfolio-card strong, .wallpaper-card strong { padding-bottom: 16px; font-size: 18px; }
.wallpaper-card small { padding-bottom: 16px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.split-section { display: grid; grid-template-columns: 1fr 1.2fr; gap: 36px; align-items: start; }
.service-list { display: grid; gap: 14px; }
.service-list div { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center; }
.contact-form, .comment-form, .stack-form, .auth-card, .panel-form { display: grid; gap: 14px; }
.contact-form input, .contact-form textarea, .comment-form input, .comment-form textarea, .stack-form input, .auth-card input, .panel-form input, .panel-form textarea, .panel-form select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 13px 14px; background: #fff; }
textarea { min-height: 110px; resize: vertical; }
.wallpaper-top { padding: 72px 5vw; display: flex; align-items: end; justify-content: space-between; gap: 32px; color: #fff; background: linear-gradient(90deg, rgba(16,16,16,.86), rgba(16,16,16,.45)), url("https://images.unsplash.com/photo-1518770660439-4636190af475?w=1800&q=80") center/cover; }
.wallpaper-top h1 { font-size: clamp(42px, 7vw, 76px); margin: 0 0 18px; }
.wallpaper-template-header { min-height: 76px; padding: 14px 5vw; background: #fff; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 240px 1fr minmax(260px, 420px); gap: 24px; align-items: center; }
.logo-area .logo { font-size: 24px; font-weight: 900; letter-spacing: -.02em; }
.logo-area .logo span { color: var(--green); }
.slogan { font-size: 12px; color: var(--muted); margin-top: 2px; }
.template-nav { display: flex; justify-content: center; gap: 24px; color: #343434; font-weight: 700; }
.search-box { display: flex; background: #fff; border-radius: 8px; overflow: hidden; min-width: min(420px, 100%); }
.search-box input { border: 0; padding: 14px; flex: 1; }
.search-box button { width: 54px; border: 0; background: var(--green); color: #fff; }
.entry-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; padding: 42px 5vw; max-width: 1320px; margin: 0 auto; }
.entry-main, .download-panel, .comments article { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 22px; }
.entry-main h1 { font-size: clamp(30px, 5vw, 52px); margin: 14px 0 22px; }
.entry-image { width: 100%; border-radius: 8px; aspect-ratio: 16/9; object-fit: cover; }
.entry-meta, .tags { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; color: var(--muted); }
.tags span { background: #f1f1ec; border-radius: 999px; padding: 7px 11px; color: #555; }
.download-panel { position: sticky; top: 94px; align-self: start; display: grid; gap: 14px; }
.comments { display: grid; gap: 14px; margin-top: 18px; }
.comments time { color: var(--muted); margin-left: 10px; font-size: 13px; }
.auth-page, .plain-page, .install-body { min-height: calc(100vh - 72px); display: grid; place-items: center; padding: 32px; }
.auth-card, .install-card { width: min(460px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 28px; box-shadow: 0 18px 44px rgba(0,0,0,.08); }
.brand-mark { width: 58px; height: 58px; border-radius: 8px; display: grid; place-items: center; background: var(--green); color: #fff; font-size: 24px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); display: none; align-items: center; justify-content: center; padding: 5vw; z-index: 20; }
.lightbox.active { display: flex; }
.lightbox img { max-height: 88vh; border-radius: 8px; }
.lightbox button { position: absolute; top: 24px; right: 30px; border: 0; background: transparent; color: #fff; font-size: 44px; cursor: pointer; }
.admin-body { background: #eff1f4; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.admin-sidebar { background: #15191f; color: #fff; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.admin-sidebar button, .admin-sidebar a { border: 0; color: #d7dce3; background: transparent; padding: 13px; border-radius: 8px; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.admin-sidebar button.active, .admin-sidebar button:hover, .admin-sidebar a:hover { background: #242b35; color: #fff; }
.admin-layout .admin-sidebar > .admin-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 14px 12px; color: var(--text-main, #f5f7fb); font-size: 16px; font-weight: 800; border-bottom: 1px solid var(--glass-border, rgba(255,255,255,.12)); }
.admin-layout .admin-sidebar > button { width: 100%; min-height: 42px; border: 0; border-radius: var(--radius-sm, 8px); background: transparent; color: var(--text-muted, #9aa4b2); display: flex; align-items: center; gap: 12px; padding: 11px 12px; cursor: pointer; text-align: left; font-weight: 600; transition: all .2s; }
.admin-layout .admin-sidebar > button.active, .admin-layout .admin-sidebar > button:hover { background: var(--btn-secondary, rgba(255,255,255,.08)); color: var(--accent-color, #8b5cf6); }
.admin-layout .admin-sidebar > a[target="_blank"] { margin-top: auto; border-top: 1px solid var(--glass-border, rgba(255,255,255,.12)); padding-top: 16px; }
.admin-layout .content-body > .admin-top { background: var(--bg-panel, #fff); border: 1px solid var(--glass-border, #deded8); border-radius: var(--radius-md, 12px); padding: 18px 20px; box-shadow: var(--glass-shadow, 0 10px 30px rgba(0,0,0,.06)); }
.admin-main { padding: 28px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.admin-tab { display: none; }
.admin-tab.active { display: block; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stats-grid div, .note, .module-list label, .admin-table, .panel-form { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.stats-grid span { display: block; color: var(--muted); margin-bottom: 8px; }
.stats-grid strong { font-size: 34px; }
.note { margin-top: 18px; color: var(--muted); }
.note code { background: #f1f1ec; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; color: var(--ink); }
.mysql-note { border-left: 4px solid var(--accent); }
.mysql-note strong { color: var(--ink); }
.module-list { display: grid; gap: 12px; }
.module-list label { display: flex; gap: 14px; align-items: flex-start; }
.module-list small { display: block; color: var(--muted); margin-top: 5px; }
.module-list em { color: var(--accent); font-style: normal; margin-left: 8px; }
.grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 18px; }
.grid-form button { grid-column: 1 / -1; }
.compact-form { margin-bottom: 18px; }
.section-actions { margin-bottom: 16px; display: flex; justify-content: flex-end; }
.admin-table { display: grid; gap: 10px; }
.admin-table a, .admin-table span { display: flex; justify-content: space-between; border-bottom: 1px solid #eee; padding-bottom: 8px; }
.card-image-wrapper { overflow: hidden; background: #e9ecef; }
.card-info { padding: 12px 16px 4px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
.downloads { white-space: nowrap; }
.maintenance-page { min-height: calc(100vh - 72px); display: grid; place-items: center; padding: 32px; background: linear-gradient(135deg, #101418, #26302b); color: #fff; }
.maintenance-card { width: min(680px, 100%); text-align: center; }
.maintenance-card h1 { font-size: clamp(34px, 6vw, 68px); margin: 0 0 18px; }
.maintenance-card p { color: rgba(255,255,255,.76); font-size: 18px; line-height: 1.7; margin-bottom: 24px; }
.entry-editor-shell { min-height: 100vh; display: grid; grid-template-columns: 300px 1fr; background: #eff1f4; }
.entry-editor-side { background: #15191f; color: #fff; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.entry-editor-side .note { background: #202833; color: #c8d0dc; border-color: #303946; }
.entry-editor-main { padding: 30px; overflow: auto; }
.entry-editor-form { display: grid; gap: 22px; }
.editor-header { display: flex; justify-content: space-between; align-items: end; gap: 18px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 22px; }
.editor-header h1 { margin: 0; font-size: clamp(28px, 5vw, 48px); }
.editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.editor-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px; display: grid; gap: 14px; align-content: start; }
.editor-card h2 { margin: 0 0 4px; font-size: 20px; }
.editor-card label { display: grid; gap: 7px; color: #4b4b4b; font-weight: 700; }
.editor-card input, .editor-card textarea, .editor-card select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 12px 13px; background: #fff; color: var(--ink); }
.image-preview { min-height: 220px; border: 1px dashed #bbc3cc; border-radius: 8px; display: grid; place-items: center; overflow: hidden; background: #f7f8f9; color: #98a2ad; font-size: 42px; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) {
  .site-header, .wallpaper-top, .section-head, .admin-top { align-items: flex-start; flex-direction: column; height: auto; }
  .wallpaper-template-header, .split-section, .entry-layout, .admin-shell, .entry-editor-shell, .editor-grid { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; }
  .stats-grid, .grid-form { grid-template-columns: 1fr; }
  .template-nav { justify-content: flex-start; flex-wrap: wrap; }
}
