:root {
    --bg: #0f1115;
    --surface: #1a1d24;
    --border: #2a2f3a;
    --text: #e8eaed;
    --muted: #9aa0a6;
    --accent: #5b8cff;
    --accent-hover: #7aa1ff;
    --radius: 12px;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    --page-pad: 16px;
    --tab-bar-h: 52px;
    --header-h: auto;
    --touch-min: 44px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 15px;
}

body.site-front {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
}

a {
    color: var(--accent);
    text-decoration: none;
    -webkit-tap-highlight-color: rgba(91, 140, 255, 0.25);
}

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding-left: var(--page-pad);
    padding-right: var(--page-pad);
}

/* —— Header (mobile-first) —— */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(15, 17, 21, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding-top: env(safe-area-inset-top, 0px);
}

.header-shell {
    padding-top: 10px;
    padding-bottom: 10px;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--text);
    font-size: 1rem;
    min-height: var(--touch-min);
}

.logo-text {
    max-width: 55vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logo-mark {
    display: inline-flex;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border-radius: 8px;
    font-size: 0.7rem;
}

.search--bar {
    display: flex;
    gap: 8px;
    width: 100%;
}

.search--bar input {
    flex: 1;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 16px;
    min-height: var(--touch-min);
}

.search-submit {
    flex-shrink: 0;
    background: var(--accent);
    border: none;
    color: #fff;
    padding: 0 16px;
    border-radius: 10px;
    font-size: 15px;
    min-height: var(--touch-min);
    min-width: 64px;
    cursor: pointer;
    touch-action: manipulation;
}

/* —— Bottom tab bar —— */
.tab-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    height: calc(var(--tab-bar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(26, 29, 36, 0.98);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.tab-bar__item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    min-height: var(--tab-bar-h);
}

.tab-bar__item.active {
    color: var(--accent);
}

/* —— Hero —— */
.hero--compact {
    padding: 1.25rem 0 0.5rem;
    background: linear-gradient(180deg, #1a2030 0%, var(--bg) 100%);
}

.hero--compact h1 {
    font-size: 1.35rem;
    margin: 0 0 0.35rem;
    font-weight: 700;
}

.lead {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.45;
}

/* —— Sections & cards —— */
.section {
    padding: 1rem 0 1.25rem;
}

.home-recent {
    padding-top: 0.75rem;
}

.home-recent .work-card {
    border: none;
    background: transparent;
    box-shadow: none;
}

.home-recent .card-media--full {
    position: relative;
    display: block;
    width: 100%;
    min-height: 180px;
    aspect-ratio: 16 / 9;
    background: #0a0a0a;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.home-recent .card-media--full img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.home-recent .card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.home-recent .card-overlay-text {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px;
    text-align: center;
    pointer-events: none;
}

.home-recent .card-overlay-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-recent .card-overlay-category {
    color: #ffcc80;
    font-size: 0.85rem;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.section-head h2 {
    margin: 0;
    font-size: 1.05rem;
}

.section-head a {
    font-size: 0.85rem;
    white-space: nowrap;
}

.grid.works-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

/* 首页：一行一条（需写在 .grid.works-grid 之后提高优先级） */
.home-recent .grid.works-grid {
    grid-template-columns: 1fr;
    gap: 12px;
}

.works-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-left: calc(-1 * var(--page-pad));
    margin-right: calc(-1 * var(--page-pad));
    padding-left: var(--page-pad);
    padding-right: var(--page-pad);
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.works-scroll::-webkit-scrollbar {
    display: none;
}

.works-scroll .work-card {
    flex: 0 0 min(72vw, 260px);
    scroll-snap-align: start;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.duration {
    position: absolute;
    right: 6px;
    bottom: 6px;
    background: rgba(0, 0, 0, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.card-body {
    padding: 8px 10px 10px;
}

.card-body h3 {
    margin: 4px 0 0;
    font-size: 0.9rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-body h3 a {
    color: var(--text);
}

.tag {
    font-size: 11px;
    color: var(--accent);
}

.tag.muted {
    color: var(--muted);
}

.meta,
.excerpt {
    color: var(--muted);
    font-size: 11px;
    margin: 4px 0 0;
}

.excerpt {
    display: none;
}

.chip-row,
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filters--scroll,
.chip-row--scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-left: calc(-1 * var(--page-pad));
    margin-right: calc(-1 * var(--page-pad));
    padding-left: var(--page-pad);
    padding-right: var(--page-pad);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filters--scroll::-webkit-scrollbar,
.chip-row--scroll::-webkit-scrollbar {
    display: none;
}

.filters {
    margin-bottom: 0.75rem;
}

.chip {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    background: var(--surface);
    font-size: 13px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
}

.chip.active {
    color: #fff;
    border-color: var(--accent);
    background: rgba(91, 140, 255, 0.2);
}

.page-head {
    padding-top: 1rem;
}

.page-head h1 {
    margin: 0;
    font-size: 1.15rem;
}

.btn {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid #3d4658;
    background: #2a3142;
    color: var(--text);
    font-size: 14px;
    min-height: var(--touch-min);
    line-height: 1.25;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    touch-action: manipulation;
}

.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn--block {
    display: block;
    text-align: center;
    width: 100%;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    font-size: 14px;
}

.pagination a {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    min-height: var(--touch-min);
    display: inline-flex;
    align-items: center;
}

.pager {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: 1.5rem;
}

.pager-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 8px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: #fff;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
}

a.pager-btn:hover {
    color: #fff;
    border-color: #ff9a1a;
}

.pager-btn.is-current {
    border-color: #ff9a1a;
    color: #fff;
}

.pager-btn.is-disabled {
    color: #6b6b6b;
}

.pager-ellipsis {
    color: #fff;
    min-width: 24px;
    text-align: center;
    letter-spacing: 1px;
}

.pager-jump {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    color: #fff;
    font-size: 14px;
}

.pager-jump input[type="number"] {
    width: 44px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: #2a2a2a;
    color: #fff;
    text-align: center;
    font-size: 14px;
    -moz-appearance: textfield;
    appearance: textfield;
}

.pager-jump input[type="number"]::-webkit-outer-spin-button,
.pager-jump input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pager-jump button {
    height: 32px;
    padding: 0 12px;
    border: none;
    border-radius: 6px;
    background: #ff9a1a;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 2.5rem 0;
}

/* —— Detail / player —— */
.detail-layout {
    padding: 0 0 1rem;
}

.video-bleed {
    width: 100%;
    background: #000;
}

.video-bleed video {
    display: block;
    width: 100%;
    max-height: min(56vh, 420px);
    background: #000;
    vertical-align: top;
}

.site-front--detail .video-bleed video {
    border-radius: 0;
    border: none;
}

.player-panel__body {
    padding-top: 12px;
}

.video-hint {
    margin: 8px var(--page-pad) 0;
    font-size: 12px;
    line-height: 1.45;
}

.player-panel__body h1 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    line-height: 1.4;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: var(--muted);
    font-size: 12px;
    margin: 0 0 0.75rem;
}

.detail-desc {
    margin-bottom: 1rem;
    color: #c4c7cc;
    font-size: 14px;
    line-height: 1.55;
}

.related-panel h2 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

.related-scroll {
    list-style: none;
    margin: 0;
    padding: 0 var(--page-pad) 8px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.related-scroll::-webkit-scrollbar {
    display: none;
}

.related-scroll li {
    flex: 0 0 140px;
}

.related-card {
    display: block;
    color: var(--text);
}

.related-card img {
    width: 140px;
    height: 79px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--surface);
}

.related-card span {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 0;
    margin-top: 0.5rem;
    text-align: center;
}

.site-footer-inner p {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
}

.muted {
    color: var(--muted);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

/* —— Header auth —— */
.header-auth {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.header-auth--user {
    gap: 8px;
    max-width: 50%;
}

.header-user {
    font-size: 12px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-auth-btn {
    border: none;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    min-height: 36px;
    background: var(--auth-accent, #ff9900);
    color: #111;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
}

.header-auth-btn--ghost {
    background: transparent;
    color: var(--auth-accent, #ff9900);
    border: 1px solid rgba(255, 153, 0, 0.45);
}

/* —— Auth modal —— */
.auth-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 200;
    display: none;
}

.auth-modal.is-open {
    display: block;
}

body.auth-modal-open {
    overflow: hidden;
}

.auth-modal__backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    background: rgba(0, 0, 0, 0.72);
}

.auth-modal__panel {
    position: fixed;
    top: 16px;
    right: 12px;
    bottom: 16px;
    left: 12px;
    z-index: 1;
    width: auto;
    height: auto;
    margin: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: #121212;
    border-radius: 18px;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

.auth-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.auth-modal__brand {
    margin: 0 0 12px;
    text-align: center;
    color: #ff9900;
    font-size: 1.4rem;
    font-weight: 800;
}

.auth-modal__notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #0a0a0a;
    margin-bottom: 12px;
}

.auth-modal__notice-text {
    font-size: 12px;
    color: #ff9900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-modal__copy {
    flex-shrink: 0;
    background: rgba(255, 153, 0, 0.2);
    border: 1px solid rgba(255, 153, 0, 0.45);
    color: #ff9900;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}

.auth-modal__flash {
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
}

.auth-modal__flash--error {
    background: rgba(255, 100, 100, 0.15);
    color: #ffb4b0;
}

.auth-modal__flash--ok {
    background: rgba(255, 153, 0, 0.15);
    color: #ffc56d;
}

.auth-panel {
    display: none;
}

.auth-panel.active {
    display: block;
}

.auth-panel__title {
    margin: 0 0 12px;
    font-size: 1.15rem;
    color: #fff;
}

.auth-form input {
    width: 100%;
    margin-bottom: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
    background: #1b1b1b;
    color: #fff;
    font-size: 16px;
}

.auth-form input::placeholder {
    color: #888;
}

.auth-submit {
    width: 100%;
    margin-top: 4px;
    padding: 13px;
    border: none;
    border-radius: 12px;
    background: #ff9900;
    color: #111;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.auth-switch {
    margin: 14px 0 4px;
    text-align: center;
    color: #bbb;
    font-size: 13px;
}

.auth-link {
    border: none;
    background: none;
    color: #ff9900;
    font: inherit;
    cursor: pointer;
    padding: 0;
}

@media (min-width: 768px) {
    .auth-modal__panel {
        top: 50%;
        right: auto;
        bottom: auto;
        left: 50%;
        width: 420px;
        height: auto;
        max-height: 90%;
        -webkit-transform: translate(-50%, -50%);
        transform: translate(-50%, -50%);
    }
}

/* —— Desktop enhancement —— */
@media (min-width: 768px) {
    :root {
        --page-pad: 24px;
    }

    body.site-front {
        padding-bottom: 24px;
    }

    .hero--compact {
        padding: 2.5rem 0 1rem;
    }

    .hero--compact h1 {
        font-size: 2rem;
    }

    .lead {
        font-size: 1.05rem;
        max-width: 36rem;
    }

    .grid.works-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.25rem;
    }

    .home-recent .grid.works-grid {
        grid-template-columns: 1fr;
        max-width: 720px;
    }

    .works-scroll {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        margin: 0;
        padding: 0;
        overflow: visible;
    }

    .works-scroll .work-card {
        flex: none;
    }

    .excerpt {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 0.875rem;
    }

    .filters--scroll,
    .chip-row--scroll {
        flex-wrap: wrap;
        overflow: visible;
        margin: 0;
        padding: 0;
    }

    .detail-layout {
        display: grid;
        grid-template-columns: 1fr 280px;
        gap: 2rem;
        padding: 2rem var(--page-pad) 3rem;
        max-width: 1120px;
        margin: 0 auto;
    }

    .video-bleed video {
        border-radius: var(--radius);
        border: 1px solid var(--border);
        max-height: none;
    }

    .related-scroll {
        flex-direction: column;
        overflow: visible;
        padding: 0;
    }

    .related-scroll li {
        flex: none;
        width: 100%;
    }

    .related-card {
        display: flex;
        gap: 0.75rem;
        align-items: center;
    }

    .related-card img {
        width: 96px;
        height: 54px;
        flex-shrink: 0;
    }

    .related-card span {
        margin-top: 0;
        flex: 1;
    }

    .btn--block {
        display: inline-block;
        width: auto;
    }

    .search--bar {
        max-width: 420px;
        margin-left: auto;
    }

    .header-row {
        margin-bottom: 0;
    }

    .header-shell {
        display: flex;
        align-items: center;
        gap: 1.5rem;
        padding-top: 12px;
        padding-bottom: 12px;
    }
}

/* —— Admin —— */
.admin-page,
.admin-auth-page {
    min-height: 100vh;
}

.admin-auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
}

.auth-card {
    width: min(400px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.auth-card h1 {
    margin: 0 0 0.25rem;
    font-size: 1.25rem;
}

.auth-foot {
    margin-top: 1.5rem;
    text-align: center;
}

.admin-shell {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
}

.admin-sidebar {
    width: 228px;
    flex: 0 0 228px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.25rem 0.85rem 1rem;
}

.admin-content {
    flex: 1 1 auto;
    min-width: 0;
}

.admin-brand {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0 0.75rem 0.25rem;
    font-weight: 600;
    font-size: 15px;
}

.admin-brand a {
    color: var(--text);
}

.admin-side-label {
    margin: 1.25rem 0.75rem 0.4rem;
    font-size: 12px;
    color: var(--muted);
}

.admin-side-nav,
.admin-side-foot {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-side-nav a,
.admin-side-foot a,
.admin-side-foot .link-btn {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--muted);
    text-align: left;
}

.admin-side-nav a:hover,
.admin-side-foot a:hover,
.admin-side-foot .link-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.admin-side-nav a.is-active {
    background: rgba(91, 140, 255, 0.16);
    color: var(--text);
    font-weight: 600;
}

.admin-side-foot {
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
}

.admin-side-foot form {
    display: block;
    margin: 0;
}

.inline-form {
    display: inline;
    margin: 0;
}

.link-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 0;
    font: inherit;
    min-height: var(--touch-min);
}

.admin-main {
    width: 100%;
    padding: 1.5rem 1.75rem 2.5rem;
}

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sync-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.sync-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 13px;
    color: var(--muted);
}

.sync-label input {
    width: 88px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
}

.admin-toolbar h1 {
    margin: 0;
    font-size: 1.15rem;
}

.admin-form label {
    display: block;
    margin-bottom: 1rem;
}

.work-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
    margin: 0 0 0.75rem;
    padding: 0.9rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.work-filter label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 13px;
    color: var(--muted);
}

.work-filter input,
.work-filter select {
    min-height: 36px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    color-scheme: dark;
}

.work-filter select {
    min-width: 140px;
}

.work-filter input[type="search"] {
    width: 180px;
}

.work-filter .date-range {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text);
}

.work-filter-actions {
    display: flex;
    gap: 0.5rem;
}

.work-filter-actions .btn {
    margin-top: 0;
}

.member-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.member-search input {
    width: 220px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
}

.admin-form input[type="text"],
.admin-form input[type="url"],
.admin-form input[type="email"],
.admin-form input[type="tel"],
.admin-form input[type="password"],
.admin-form input[type="file"],
.admin-form textarea {
    width: 100%;
    margin-top: 0.35rem;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 16px;
}

.admin-form textarea {
    resize: vertical;
}

.admin-form input[readonly] {
    color: var(--muted);
}

.admin-form fieldset {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 0 0 1rem;
    padding: 1rem;
}

.admin-form .checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-form .checkbox input {
    width: auto;
    margin: 0;
}

.panel {
    max-width: 640px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.btn.block {
    width: 100%;
    text-align: center;
    margin-top: 0.5rem;
    border: none;
    cursor: pointer;
}

.btn.small {
    padding: 8px 12px;
    font-size: 13px;
    min-height: 40px;
}

.btn.danger {
    background: #3a2224;
    border-color: #a94442;
    color: #ffb4b0;
}

.flash {
    padding: 0.65rem 1rem;
    border-radius: 8px;
    background: #2a3140;
    margin-bottom: 1rem;
}

.flash.success {
    background: #1e3a2f;
    color: #9ddeb8;
}

.flash.error {
    background: #3a1e1e;
    color: #ffb4b0;
}

.sync-panel {
    max-width: none;
    margin-bottom: 1.5rem;
}

.sync-panel p {
    margin: 0.35rem 0;
}

.sync-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.sync-actions form {
    margin: 0;
}

.sync-log-title {
    font-size: 1rem;
    margin: 0 0 0.75rem;
}

.status-ok {
    color: #9ddeb8;
}

.status-bad {
    color: #ffb4b0;
}

.field-error {
    display: block;
    color: #ffb4b0;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.req {
    color: #ffb4b0;
}

.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    -webkit-overflow-scrolling: touch;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 640px;
}

.admin-table th,
.admin-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    background: var(--surface);
    color: var(--muted);
    font-weight: 600;
}

.admin-table .thumb {
    width: 72px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.admin-table .actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.admin-table .actions form {
    margin: 0;
}

.preview-row {
    margin-bottom: 0.75rem;
}

.preview-img {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
}