:root {
    --ink: #111827;
    --muted: #64748b;
    --line: rgba(15, 23, 42, .1);
    --bg: #f8fbff;
    --card: rgba(255, 255, 255, .9);
    --pink: #ff3d9a;
    --blue: #1aa7ff;
    --green: #21d87a;
    --orange: #ff8a18;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 10%, rgba(255, 61, 154, .20), transparent 32%),
        radial-gradient(circle at 82% 4%, rgba(33, 216, 122, .18), transparent 28%),
        linear-gradient(180deg, #fff7fb 0%, #f7fcff 44%, #fff 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    width: 100%;
}

.page {
    width: min(100%, 720px);
    min-height: 100vh;
    margin: 0 auto;
    padding-bottom: 36px;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 24px 18px 22px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(12, 18, 37, .86), rgba(23, 35, 89, .56)),
        linear-gradient(135deg, #ff3d9a 0%, #5b4dff 48%, #00c2ff 100%);
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
    box-shadow: 0 18px 38px rgba(20, 31, 78, .18);
}

.hero::after {
    display: none;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 20px;
    pointer-events: none;
}

.hero__glow {
    position: absolute;
    pointer-events: none;
}

.hero__glow--one {
    inset: 0 auto auto 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, .22), transparent 34%),
        linear-gradient(0deg, rgba(255, 255, 255, .08), transparent 58%);
}

.hero__glow--two {
    right: 0;
    bottom: 0;
    width: 58%;
    height: 76%;
    background: linear-gradient(135deg, rgba(33, 216, 122, .18), rgba(255, 255, 255, .10));
    clip-path: polygon(26% 0, 100% 0, 100% 100%, 0 100%);
}

.hero__content {
    position: relative;
    z-index: 1;
}

.hero__badge {
    position: relative;
    z-index: 1;
    display: inline-flex;
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    font-size: 12px;
    font-weight: 700;
}

.hero h1 {
    position: relative;
    z-index: 1;
    margin: 16px 0 8px;
    font-size: 32px;
    line-height: 1.08;
    letter-spacing: 0;
}

.hero p {
    position: relative;
    z-index: 1;
    max-width: 420px;
    margin: 0;
    color: rgba(255, 255, 255, .88);
    font-size: 15px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.contact-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 999px;
    padding: 8px 13px;
    color: #fff;
    background: rgba(255, 255, 255, .16);
    box-shadow: 0 12px 24px rgba(15, 23, 42, .18), inset 0 1px 0 rgba(255, 255, 255, .28);
    backdrop-filter: blur(16px);
    cursor: pointer;
    font: inherit;
}

.contact-pill span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 24px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .22);
    font-size: 12px;
    font-weight: 900;
}

.contact-pill strong {
    font-size: 14px;
    white-space: nowrap;
}

.contact-pill--wechat {
    background: linear-gradient(135deg, rgba(34, 197, 94, .54), rgba(255, 255, 255, .14));
}

.contact-pill--tg {
    background: linear-gradient(135deg, rgba(14, 165, 233, .62), rgba(255, 255, 255, .14));
}

.copy-toast {
    position: absolute;
    left: 18px;
    bottom: 12px;
    transform: translateY(16px);
    opacity: 0;
    border-radius: 999px;
    padding: 8px 12px;
    color: #063d2a;
    background: rgba(220, 252, 231, .95);
    box-shadow: 0 12px 24px rgba(15, 23, 42, .18);
    font-size: 13px;
    font-weight: 900;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

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

.product-list {
    display: grid;
    gap: 22px;
    padding: 18px 0 0;
}

.promo-card {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 148px;
    gap: 16px;
    align-items: center;
    margin: 14px 0 0;
    padding: 18px;
    color: #0f172a;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(236, 253, 245, .9) 46%, rgba(239, 246, 255, .94)),
        linear-gradient(135deg, rgba(34, 197, 94, .22), rgba(14, 165, 233, .18));
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: 8px;
    box-shadow: 0 16px 32px rgba(15, 23, 42, .1);
    text-align: center;
}

.promo-card::after {
    content: "";
    position: absolute;
    inset: 0 0 auto auto;
    width: 42%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, .28), rgba(26, 167, 255, .08));
    clip-path: polygon(32% 0, 100% 0, 100% 100%, 0 100%);
    pointer-events: none;
}

.promo-card__content,
.promo-card__image {
    position: relative;
    z-index: 1;
}

.promo-card__content {
    display: grid;
    justify-items: center;
}

.promo-card__badge {
    display: inline-flex;
    margin-bottom: 9px;
    border-radius: 999px;
    padding: 6px 10px;
    color: #047857;
    background: rgba(209, 250, 229, .92);
    font-size: 12px;
    font-weight: 900;
}

.promo-card h2 {
    margin: 0 0 8px;
    font-size: 23px;
    line-height: 1.18;
    text-align: center;
}

.promo-card p {
    max-width: 640px;
    margin: 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.7;
    text-align: center;
}

.promo-card__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin-top: 13px;
    border-radius: 999px;
    padding: 0 16px;
    color: #fff;
    background: linear-gradient(135deg, #16a34a, #0ea5e9);
    box-shadow: 0 12px 24px rgba(14, 165, 233, .18);
    font-size: 14px;
    font-weight: 900;
}

.promo-card__image {
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255, 255, 255, .64);
}

.promo-card__image img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.product-card {
    overflow: hidden;
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .72);
    box-shadow: 0 16px 36px rgba(39, 53, 92, .13);
    backdrop-filter: blur(18px);
}

.product-card__media {
    display: block;
    background: #eef4fb;
}

.product-card__media img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.product-card__body {
    position: relative;
    padding: 16px 18px 20px;
    background:
        linear-gradient(135deg, rgba(236, 253, 245, .94) 0%, rgba(239, 246, 255, .96) 52%, rgba(250, 245, 255, .9) 100%);
    border-top: 1px solid rgba(255, 255, 255, .78);
}

.product-card h2 {
    margin: 0 0 8px;
    font-size: 21px;
    line-height: 1.28;
}

.product-card p,
.lead,
.empty-state p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.75;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    background: rgba(255, 255, 255, .82);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
    font-weight: 700;
}

.back-link {
    position: absolute;
    left: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid rgba(26, 167, 255, .24);
    border-radius: 999px;
    color: #0369a1;
    background: linear-gradient(135deg, rgba(255, 255, 255, .78), rgba(232, 246, 255, .46));
    box-shadow: 0 10px 24px rgba(14, 116, 144, .14), inset 0 1px 0 rgba(255, 255, 255, .82);
    backdrop-filter: blur(14px);
    font-size: 14px;
    font-weight: 900;
}

.detail__image {
    overflow: hidden;
    background: #eef4fb;
}

.detail__image img {
    width: 100%;
    height: auto;
}

.detail__content {
    padding: 22px 18px 34px;
}

.detail h1 {
    margin: 0 0 10px;
    font-size: 30px;
    line-height: 1.15;
}

.rich-text {
    margin-top: 20px;
    color: #243047;
    font-size: 15px;
    line-height: 1.9;
}

.rich-text a {
    color: #16a34a;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
    word-break: break-all;
}

.rich-text ul,
.rich-text ol {
    margin: 18px 0;
    padding-left: 20px;
}

.rich-text li {
    padding-left: 2px;
}

.rich-text img {
    border-radius: 8px;
    margin: 14px 0;
}

.primary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    margin-top: 22px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--pink), var(--orange));
    box-shadow: 0 14px 28px rgba(255, 61, 154, .24);
    font-weight: 800;
}

.empty-state {
    padding: 80px 20px;
    text-align: center;
}

.admin-body {
    background: #eef3f8;
}

.admin-shell {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 18px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.admin-header h1 {
    margin: 0;
    font-size: 25px;
}

.admin-shell--desktop {
    width: min(100% - 36px, 1280px);
    padding: 24px 0 36px;
}

.admin-header--desktop {
    padding: 22px 24px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 14px 28px rgba(15, 23, 42, .06);
}

.admin-kicker {
    margin: 0 0 8px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 900;
}

.admin-subtitle {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.admin-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.admin-sidebar {
    position: sticky;
    top: 18px;
    overflow: hidden;
}

.sidebar-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
}

.sidebar-block strong {
    font-size: 16px;
}

.sidebar-block p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.sidebar-block--stack {
    display: block;
}

.sidebar-block--products {
    border-top: 1px solid var(--line);
}

.settings-menu {
    display: grid;
    gap: 8px;
    padding: 12px;
}

.settings-tab {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 12px 13px;
    color: #334155;
    background: #f8fafc;
    font: inherit;
    font-size: 14px;
    font-weight: 900;
    text-align: left;
    cursor: pointer;
}

.settings-tab:hover {
    color: #0369a1;
    background: #eef6ff;
}

.settings-tab.active {
    color: #fff;
    background: linear-gradient(135deg, #7247ff, #1aa7ff);
    box-shadow: 0 12px 22px rgba(26, 167, 255, .18);
}

.sidebar-add {
    color: var(--blue);
    font-size: 13px;
    font-weight: 900;
}

.admin-editor {
    display: grid;
    gap: 16px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 16px;
}

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, .06);
}

.product-menu {
    overflow: auto;
    max-height: calc(100vh - 170px);
}

.product-menu a {
    display: block;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    color: #334155;
    font-size: 14px;
}

.product-menu--sortable a {
    min-width: 0;
    flex: 1;
    border-bottom: 0;
}

.product-sort-main {
    min-width: 0;
    flex: 1;
}

.product-sort-main > a {
    display: block;
}

.product-sort-item {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--line);
}

.product-subtabs {
    display: grid;
    gap: 7px;
    padding: 0 12px 12px;
}

.product-subtabs .settings-tab {
    padding: 9px 11px;
    background: rgba(255, 255, 255, .14);
    color: rgba(255, 255, 255, .94);
    border-color: rgba(255, 255, 255, .2);
    font-size: 13px;
}

.product-subtabs .settings-tab:hover,
.product-subtabs .settings-tab.active {
    background: rgba(255, 255, 255, .92);
    color: #1d4ed8;
    box-shadow: none;
}

.product-sort-item.active {
    color: #fff;
    background: linear-gradient(135deg, #7247ff, #1aa7ff);
}

.product-sort-item.active a,
.product-sort-item.active small {
    color: inherit;
}

.sort-controls {
    display: grid;
    grid-template-rows: 1fr 1fr;
    width: 46px;
    border-left: 1px solid rgba(15, 23, 42, .08);
}

.sort-controls button {
    border: 0;
    background: rgba(15, 23, 42, .04);
    color: #334155;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
}

.sort-controls button + button {
    border-top: 1px solid rgba(15, 23, 42, .08);
}

.sort-controls button:hover:not(:disabled) {
    background: rgba(26, 167, 255, .16);
    color: #0369a1;
}

.sort-controls button:disabled {
    color: #cbd5e1;
    cursor: not-allowed;
}

.product-sort-item.active .sort-controls {
    border-left-color: rgba(255, 255, 255, .22);
}

.product-sort-item.active .sort-controls button {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.product-sort-item.active .sort-controls button:disabled {
    color: rgba(255, 255, 255, .42);
}

.product-menu span {
    display: block;
    overflow: hidden;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-menu small {
    display: block;
    overflow: hidden;
    margin-top: 5px;
    color: #8090a5;
    font-size: 12px;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-menu a.active {
    color: #fff;
    background: linear-gradient(135deg, #7247ff, #1aa7ff);
    font-weight: 800;
}

.product-menu a.active small {
    color: rgba(255, 255, 255, .82);
}

.editor {
    padding: 16px;
}

.editor-title {
    margin: 8px 0 14px;
    padding-top: 6px;
    color: #0f172a;
    font-size: 18px;
    line-height: 1.25;
}

.editor-title:not(:first-of-type) {
    margin-top: 24px;
    border-top: 1px solid var(--line);
}

.field {
    display: grid;
    gap: 7px;
    margin-bottom: 14px;
}

.admin-section {
    padding: 20px;
}

.settings-panel {
    display: none;
}

.settings-panel.active {
    display: block;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.section-heading div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-heading span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--pink), var(--blue));
    font-size: 13px;
    font-weight: 900;
}

.section-heading h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.25;
}

.section-heading p {
    max-width: 360px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
    text-align: right;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.field--full {
    grid-column: 1 / -1;
}

.field span {
    color: #475569;
    font-size: 13px;
    font-weight: 800;
}

.field input,
.field textarea {
    width: 100%;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    padding: 12px;
    color: var(--ink);
    background: #fff;
    font: inherit;
}

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

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 10px;
}

.tool-btn,
.ghost-btn,
.danger-btn {
    border: 0;
    border-radius: 8px;
    padding: 10px 12px;
    background: #edf2ff;
    color: #3451c9;
    font-weight: 800;
    cursor: pointer;
}

.ghost-btn {
    background: #eef6ff;
    color: #0876bd;
}

.danger-btn {
    background: #fff1f2;
    color: #e11d48;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.save-btn {
    border: 0;
    border-radius: 8px;
    padding: 13px 20px;
    color: #fff;
    background: linear-gradient(135deg, var(--green), var(--blue));
    font-weight: 900;
    cursor: pointer;
}

.preview-img {
    width: 104px;
    height: 104px;
    border-radius: 8px;
    object-fit: cover;
    background: #e5e7eb;
}

.image-uploader {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 18px;
    align-items: center;
}

.image-uploader--compact {
    grid-template-columns: 220px 1fr;
    margin-top: 16px;
}

.admin-cover-preview {
    width: 100%;
    min-height: 180px;
    max-height: 260px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #eef4fb;
    object-fit: contain;
}

.switch-field {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 16px;
    color: #334155;
    font-weight: 900;
}

.switch-field input {
    width: 18px;
    height: 18px;
    accent-color: var(--blue);
}

.upload-controls {
    display: grid;
    gap: 12px;
    justify-items: start;
}

.upload-controls p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
}

.editor-toolbar {
    margin: 0 0 12px;
}

.rich-editor {
    min-height: 360px;
    max-height: 680px;
    overflow: auto;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    padding: 16px;
    background: #fff;
    color: #1f2937;
    font-size: 15px;
    line-height: 1.85;
    outline: none;
}

.rich-editor:focus {
    border-color: rgba(26, 167, 255, .72);
    box-shadow: 0 0 0 3px rgba(26, 167, 255, .12);
}

.rich-editor:empty::before {
    content: attr(data-placeholder);
    color: #94a3b8;
}

.rich-editor img {
    max-width: 100%;
    height: auto;
    margin: 12px 0;
    border-radius: 8px;
}

.admin-footer {
    position: sticky;
    bottom: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
}

.admin-footer strong {
    color: #16a34a;
}

.login-card {
    width: min(100% - 32px, 420px);
    margin: 15vh auto 0;
    padding: 24px;
}

.login-card h1 {
    margin: 0 0 16px;
}

@media (max-width: 760px) {
    .hero-actions {
        flex-wrap: wrap;
    }

    .contact-pill {
        max-width: 100%;
    }

    .contact-pill strong {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .admin-shell--desktop {
        width: min(100% - 20px, 1280px);
        padding-top: 12px;
    }

    .admin-layout,
    .form-grid,
    .image-uploader,
    .promo-card {
        grid-template-columns: 1fr;
    }

    .admin-sidebar,
    .admin-footer {
        position: static;
    }

    .section-heading {
        display: grid;
    }

    .section-heading p {
        text-align: left;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .admin-header {
        align-items: flex-start;
        flex-direction: column;
    }
}
