:root {
    --bg: #0d0d0f;
    --bg-elevated: #1a1a1e;
    --bg-card: #17171a;
    --border: #2a2a2e;
    --text: #f2f2f4;
    --text-secondary: #9a9aa2;
    --accent: #6c5ce7;
    --accent-hover: #7d6ef0;
    --radius: 16px;
    --radius-sm: 10px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    min-height: 100vh;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px 60px;
}

@media (min-width: 900px) {
    .container { max-width: 640px; padding-top: 40px; }
}

h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 16px 0 8px;
    letter-spacing: -0.3px;
}

h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 28px 0 12px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.article-badge {
    display: inline-block;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    margin-bottom: 8px;
}

.description-text {
    margin: 0;
    line-height: 1.6;
    font-size: 15px;
    color: var(--text);
}

/* Фото галерея */
.photo-gallery {
    margin: -20px -16px 0;
}

.photo-main {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-elevated);
    overflow: hidden;
}
.photo-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-thumbs {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.photo-thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: opacity .15s, border-color .15s;
    cursor: pointer;
}
.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.photo-thumb.active {
    opacity: 1;
    border-color: var(--accent);
}

/* Таблица характеристик */
.char-table {
    width: 100%;
    border-collapse: collapse;
}
.char-table tr {
    border-bottom: 1px solid var(--border);
}
.char-table tr:last-child {
    border-bottom: none;
}
.char-table td {
    padding: 10px 0;
    font-size: 14px;
    vertical-align: top;
}
.char-key {
    color: var(--text-secondary);
    width: 40%;
    padding-right: 12px;
}
.char-value {
    color: var(--text);
    font-weight: 500;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }

.admin-notice {
    background: rgba(108, 92, 231, 0.12);
    border: 1px solid rgba(108, 92, 231, 0.3);
    color: var(--accent);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin: 12px 0 20px;
}

.thumb-admin-badge, .char-admin-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--danger);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 4px;
    margin-left: 4px;
}
.thumb-admin-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    margin: 0;
}
.photo-thumb { position: relative; }


.serial-badge {
    display: inline-block;
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 16px;
}