:root {
    --bg: #f4efe6;
    --surface: rgba(255, 255, 255, 0.84);
    --surface-solid: #ffffff;
    --border: rgba(25, 51, 45, 0.12);
    --text: #18332d;
    --muted: #667b74;
    --accent: #d96f32;
    --accent-dark: #b3531f;
    --accent-soft: #ffe1ce;
    --success: #2f855a;
    --warning: #c77700;
    --danger: #c2413b;
    --shadow: 0 18px 60px rgba(24, 51, 45, 0.12);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(217, 111, 50, 0.18), transparent 35%),
        radial-gradient(circle at top right, rgba(78, 125, 98, 0.2), transparent 30%),
        linear-gradient(180deg, #f8f4ee 0%, #f1eadf 100%);
    min-height: 100vh;
}

button,
input,
textarea,
video {
    font: inherit;
}

button {
    cursor: pointer;
}

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.auth-shell {
    width: min(1180px, 100%);
    display: grid;
    grid-template-columns: 1.2fr 0.9fr;
    gap: 28px;
}

.brand-panel,
.auth-card,
.hero-card,
.panel-card,
.stat-card,
.modal-card {
    backdrop-filter: blur(18px);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.brand-panel {
    border-radius: var(--radius-xl);
    padding: 44px;
    min-height: 720px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.brand-panel h1,
.auth-card h2,
.page-title,
.hero-card h2,
.panel-head h3 {
    margin: 0;
    line-height: 1.1;
}

.brand-panel h1 {
    font-size: clamp(42px, 5vw, 68px);
    max-width: 8.5em;
}

.lead,
.hero-copy,
.muted-note,
.review-meta,
.mini-card-count,
.feed-meta,
.comment-time,
.review-time,
.muted {
    color: var(--muted);
}

.lead {
    margin: 18px 0 0;
    max-width: 34em;
    font-size: 16px;
    line-height: 1.8;
}

.eyebrow {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-dark);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.72);
    border-radius: var(--radius-lg);
    padding: 18px;
    border: 1px solid rgba(25, 51, 45, 0.08);
}

.feature-card h2 {
    margin: 0 0 10px;
    font-size: 18px;
}

.feature-card p {
    margin: 0;
    line-height: 1.7;
    color: var(--muted);
    font-size: 14px;
}

.auth-card {
    border-radius: var(--radius-xl);
    padding: 32px;
    align-self: center;
}

.auth-card-top,
.panel-head,
.topbar,
.topbar-actions,
.hero-card,
.hero-stats,
.feed-card-header,
.feed-actions,
.mini-card-head,
.review-card-head,
.review-actions,
.comment-item,
.comment-form {
    display: flex;
    align-items: center;
}

.auth-card-top {
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.admin-tip {
    padding: 10px 14px;
    background: var(--accent-soft);
    border-radius: 999px;
    color: var(--accent-dark);
    font-size: 13px;
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 24px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(24, 51, 45, 0.06);
}

.auth-tab,
.ghost-button,
.upload-button,
.text-button,
.tiny-button {
    border: none;
    background: transparent;
}

.auth-tab {
    border-radius: 999px;
    padding: 12px 18px;
    color: var(--muted);
    font-weight: 700;
}

.auth-tab.active {
    background: var(--surface-solid);
    color: var(--text);
    box-shadow: 0 10px 25px rgba(24, 51, 45, 0.08);
}

.auth-form {
    display: none;
    gap: 16px;
}

.auth-form.active,
.post-form,
.content-grid,
.dashboard,
.mini-card-list,
.feed-list,
.review-list,
.comment-list,
.admin-grid {
    display: grid;
}

.auth-form.active {
    display: grid;
}

.field {
    display: grid;
    gap: 8px;
}

.toggle-line {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.toggle-line input {
    width: 18px;
    height: 18px;
}

.field span {
    font-size: 14px;
    font-weight: 700;
}

.field input,
.field textarea,
.comment-form input {
    width: 100%;
    border: 1px solid rgba(24, 51, 45, 0.14);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field textarea:focus,
.comment-form input:focus {
    border-color: rgba(217, 111, 50, 0.55);
    box-shadow: 0 0 0 4px rgba(217, 111, 50, 0.12);
}

.field textarea {
    resize: vertical;
    min-height: 140px;
}

.primary-button,
.ghost-button,
.upload-button,
.tiny-button {
    border-radius: 999px;
    padding: 13px 22px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button {
    border: none;
    background: linear-gradient(135deg, var(--accent) 0%, #e68e3b 100%);
    color: #fffdf8;
    box-shadow: 0 16px 34px rgba(217, 111, 50, 0.25);
}

.primary-button:hover,
.ghost-button:hover,
.upload-button:hover,
.tiny-button:hover {
    transform: translateY(-1px);
}

.primary-button.compact {
    padding-inline: 18px;
}

.primary-button:disabled {
    opacity: 0.75;
    cursor: wait;
}

.ghost-button,
.upload-button {
    background: rgba(24, 51, 45, 0.06);
    color: var(--text);
}

.dashboard {
    gap: 24px;
    padding: 24px;
}

.topbar {
    justify-content: space-between;
    padding: 20px 24px 0;
    gap: 20px;
}

.topbar-actions {
    gap: 14px;
}

.profile-menu-wrap {
    position: relative;
}

.page-title {
    font-size: clamp(28px, 3vw, 40px);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(25, 51, 45, 0.08);
    min-width: 160px;
}

.user-chip.interactive {
    cursor: pointer;
}

.user-chip-text {
    display: grid;
    gap: 2px;
    text-align: left;
}

.user-chip span {
    color: var(--muted);
    font-size: 13px;
}

.mini-avatar,
.profile-avatar-preview {
    display: inline-grid;
}

.mini-avatar {
    width: 42px;
    height: 42px;
}

.profile-avatar-preview {
    width: 84px;
    height: 84px;
}

.profile-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 180px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(25, 51, 45, 0.08);
    box-shadow: 0 18px 40px rgba(24, 51, 45, 0.14);
    display: none;
    z-index: 1000;
}

.profile-menu.open {
    display: grid;
    gap: 6px;
}

.profile-menu-item {
    border: none;
    text-align: left;
    padding: 12px 14px;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    font-weight: 700;
}

.profile-menu-item:hover {
    background: rgba(24, 51, 45, 0.06);
}

.hero-card {
    border-radius: var(--radius-xl);
    padding: 26px;
    justify-content: space-between;
    gap: 24px;
}

.hero-copy {
    margin: 12px 0 0;
    max-width: 44em;
    line-height: 1.7;
}

.hero-stats,
.stats-grid {
    gap: 16px;
}

.hero-stats {
    min-width: 280px;
}

.metric-card,
.stat-card {
    border-radius: var(--radius-lg);
    padding: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(25, 51, 45, 0.08);
}

.metric-card span,
.stat-card span {
    color: var(--muted);
    display: block;
    margin-bottom: 8px;
}

.metric-card strong,
.stat-card strong {
    font-size: 32px;
}

.content-grid {
    grid-template-columns: minmax(0, 2fr) minmax(300px, 0.95fr);
    gap: 24px;
}

.main-column,
.side-column {
    display: grid;
    gap: 24px;
    align-self: start;
}

.panel-card,
.modal-card {
    border-radius: var(--radius-xl);
    padding: 24px;
}

.panel-head {
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.panel-head h3 {
    font-size: 24px;
}

.post-form,
.review-list,
.mini-card-list,
.feed-list,
.comment-list {
    gap: 16px;
}

.compact-form {
    gap: 14px;
}

.disabled-panel {
    opacity: 0.58;
}

.disabled-panel textarea,
.disabled-panel input,
.disabled-panel .upload-button {
    pointer-events: none;
}

.upload-block {
    display: grid;
    gap: 10px;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 10px;
}

.preview-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(24, 51, 45, 0.06);
}

.preview-thumb img,
.review-gallery img,
.image-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-thumb video,
.review-video-gallery video,
.video-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-thumb.video {
    background: rgba(24, 51, 45, 0.1);
}

.preview-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: white;
    font-size: 18px;
}

.feed-card,
.mini-card,
.review-card {
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(25, 51, 45, 0.08);
}

.feed-card,
.review-card {
    padding: 20px;
}

.mini-card {
    padding: 16px;
}

.feed-card-header,
.mini-card-head,
.review-card-head,
.review-actions,
.comment-item,
.comment-form {
    justify-content: space-between;
    gap: 12px;
}

.avatar,
.comment-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e2f1e8 0%, #b0d0be 100%);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 18px;
}

.avatar.has-image,
.comment-avatar.has-image,
.mini-avatar.has-image,
.profile-avatar-preview.has-image {
    overflow: hidden;
    padding: 0;
    background: rgba(24, 51, 45, 0.08);
}

.avatar img,
.comment-avatar img,
.mini-avatar img,
.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    font-size: 15px;
    flex-shrink: 0;
}

.feed-author,
.comment-name,
.review-title {
    font-weight: 800;
}

.feed-content,
.review-text,
.comment-text,
.mini-card-text {
    line-height: 1.8;
    word-break: break-word;
}

.feed-content {
    margin: 16px 0;
}

.feed-content.compact {
    margin-bottom: 0;
}

.feed-media-stack,
.review-media-stack {
    display: grid;
    gap: 12px;
}

.feed-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.feed-gallery.single {
    grid-template-columns: 1fr;
}

.image-button {
    padding: 0;
    border: none;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: rgba(24, 51, 45, 0.06);
}

.feed-gallery.single .image-button {
    aspect-ratio: 16 / 10;
}

.video-gallery,
.review-video-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.video-card,
.review-video-gallery video {
    overflow: hidden;
    border-radius: var(--radius-md);
    background: rgba(24, 51, 45, 0.08);
}

.video-card video,
.review-video-gallery video {
    aspect-ratio: 16 / 10;
}

.text-button {
    padding: 0;
    color: var(--muted);
    font-weight: 700;
}

.text-button.liked {
    color: var(--accent-dark);
}

.inline-panel {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    background: rgba(24, 51, 45, 0.04);
}

.inline-panel-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.likes-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.name-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(25, 51, 45, 0.08);
    font-size: 13px;
}

.name-pill.admin {
    background: rgba(255, 244, 233, 0.85);
}

.inline-empty {
    color: var(--muted);
    font-size: 14px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.status-badge.pending {
    background: rgba(199, 119, 0, 0.12);
    color: var(--warning);
}

.status-badge.approved {
    background: rgba(47, 133, 90, 0.12);
    color: var(--success);
}

.status-badge.rejected {
    background: rgba(194, 65, 59, 0.12);
    color: var(--danger);
}

.panel-empty,
.table-empty {
    padding: 22px 0;
    text-align: center;
    color: var(--muted);
}

.error-text {
    color: var(--danger);
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(24, 51, 45, 0.38);
}

.modal.open {
    display: flex;
}

.modal-card {
    width: min(720px, 100%);
    max-height: 90vh;
    overflow: auto;
}

.modal-post {
    margin-bottom: 18px;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: rgba(24, 51, 45, 0.04);
}

.comment-body {
    flex: 1;
}

.comment-item.compact {
    align-items: flex-start;
}

.comment-list.embedded {
    gap: 12px;
}

.inline-comment-form {
    margin-top: 14px;
}

.comment-form {
    margin-top: 16px;
}

.comment-form input {
    flex: 1;
}

.profile-modal-grid {
    display: grid;
    gap: 16px;
}

.profile-avatar-block {
    display: grid;
    gap: 16px;
}

.stats-grid,
.admin-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card.accent {
    background: linear-gradient(135deg, rgba(255, 225, 206, 0.9), rgba(255, 244, 233, 0.95));
}

.admin-dashboard {
    padding-top: 16px;
}

.table-wrap {
    overflow: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.data-table th,
.data-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(25, 51, 45, 0.08);
    vertical-align: middle;
}

.data-table th {
    color: var(--muted);
    font-size: 13px;
}

.action-cell {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.password-note {
    display: grid;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
}

.password-note span {
    color: var(--muted);
    font-weight: 500;
    line-height: 1.5;
}

.review-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.review-gallery img {
    border-radius: var(--radius-md);
    aspect-ratio: 1;
}

.review-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 16px;
}

.admin-inline-panel {
    margin-top: 14px;
}

.admin-comment .comment-name {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.review-head-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tiny-button {
    padding: 10px 14px;
    font-size: 13px;
}

.tiny-button.approve {
    background: rgba(47, 133, 90, 0.12);
    color: var(--success);
}

.tiny-button.reject {
    background: rgba(194, 65, 59, 0.12);
    color: var(--danger);
}

.tiny-button.warn {
    background: rgba(199, 119, 0, 0.12);
    color: var(--warning);
}

.tiny-button.ghost {
    background: rgba(24, 51, 45, 0.06);
    color: var(--text);
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    min-width: 240px;
    max-width: 380px;
    padding: 14px 18px;
    border-radius: 18px;
    color: #fffdf8;
    box-shadow: 0 18px 40px rgba(24, 51, 45, 0.18);
    background: rgba(24, 51, 45, 0.9);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1200;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: rgba(47, 133, 90, 0.95);
}

.toast.error {
    background: rgba(194, 65, 59, 0.95);
}

@media (max-width: 1100px) {
    .auth-shell,
    .content-grid,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        min-height: auto;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .auth-page,
    .dashboard,
    .topbar,
    .modal {
        padding: 16px;
    }

    .auth-card,
    .brand-panel,
    .hero-card,
    .panel-card,
    .modal-card {
        padding: 20px;
    }

    .feature-grid,
    .hero-stats,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .topbar,
    .topbar-actions,
    .hero-card,
    .auth-card-top,
    .panel-head,
    .comment-form {
        flex-direction: column;
        align-items: stretch;
    }

    .user-chip {
        min-width: unset;
    }

    .feed-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .toast {
        left: 16px;
        right: 16px;
        min-width: 0;
    }
}
