:root {
    --primary: #6558f5;
    --primary-dark: #4c40d9;
    --primary-soft: #efedff;
    --cyan: #27b9e9;
    --ink: #202944;
    --muted: #717b96;
    --line: rgba(99, 105, 145, 0.14);
    --surface: rgba(255, 255, 255, 0.88);
    --success: #138a66;
    --danger: #d34e64;
    --shadow: 0 18px 50px rgba(65, 70, 130, 0.11);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: #f5f7ff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

button,
a {
    -webkit-tap-highlight-color: transparent;
}

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

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

[hidden] {
    display: none !important;
}

.ambient {
    position: fixed;
    z-index: -1;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(16px);
    pointer-events: none;
}

.ambient-one {
    top: -180px;
    right: -120px;
    background: radial-gradient(circle, rgba(112, 96, 255, 0.22), rgba(112, 96, 255, 0));
}

.ambient-two {
    bottom: -180px;
    left: -140px;
    background: radial-gradient(circle, rgba(39, 185, 233, 0.18), rgba(39, 185, 233, 0));
}

.glass-card {
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: inline-grid;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(145deg, #786cff, #4e43df);
    box-shadow: 0 8px 22px rgba(101, 88, 245, 0.28);
    font-size: 21px;
    font-weight: 750;
}

.brand strong,
.public-brand strong {
    display: block;
    font-size: 17px;
    letter-spacing: 0.02em;
}

.brand small,
.public-brand small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
}

.button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: 14px;
    outline: none;
    font-weight: 650;
    line-height: 1.35;
    text-align: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(101, 88, 245, 0.23);
    outline-offset: 2px;
}

.button-primary {
    color: #fff;
    background: linear-gradient(135deg, #7568ff, #5749e8);
    box-shadow: 0 10px 24px rgba(91, 76, 232, 0.23);
}

.button-primary:hover {
    box-shadow: 0 13px 28px rgba(91, 76, 232, 0.3);
}

.button-secondary {
    border-color: rgba(101, 88, 245, 0.16);
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.button-quiet {
    border-color: var(--line);
    color: #626d87;
    background: rgba(255, 255, 255, 0.64);
}

.button-small {
    min-height: 40px;
    padding: 9px 14px;
    border-radius: 12px;
    font-size: 13px;
}

.button-large {
    min-height: 52px;
    padding: 14px 22px;
    font-size: 16px;
}

.button-block {
    width: 100%;
}

.text-link,
.official-link {
    color: var(--primary-dark);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
}

.text-link:hover,
.official-link:hover {
    text-decoration: underline;
}

.eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.12em;
}

.alert {
    margin-bottom: 20px;
    padding: 13px 16px;
    border-radius: 14px;
    font-size: 14px;
}

.alert-error {
    border: 1px solid rgba(211, 78, 100, 0.16);
    color: #b63c53;
    background: #fff0f3;
}

.alert-success {
    border: 1px solid rgba(19, 138, 102, 0.15);
    color: #0c7858;
    background: #ebfaf5;
}

/* 后台 */
.admin-topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.8);
    background: rgba(248, 249, 255, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.admin-topbar-inner {
    display: flex;
    width: min(1180px, calc(100% - 40px));
    min-height: 78px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 auto;
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #606b86;
    font-size: 14px;
}

.admin-nav form,
.task-actions form {
    margin: 0;
}

.admin-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 42px 0 64px;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.page-heading h1 {
    margin: 0 0 6px;
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.25;
    letter-spacing: -0.03em;
}

.page-heading p {
    margin: 0;
    color: var(--muted);
}

.compact-heading {
    align-items: flex-start;
}

.auth-wrap {
    display: grid;
    min-height: calc(100vh - 210px);
    place-items: center;
}

.auth-card {
    width: min(100%, 440px);
    padding: 36px;
}

.auth-heading {
    margin-bottom: 26px;
}

.auth-heading h1 {
    margin: 0 0 8px;
    font-size: 30px;
}

.auth-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.form-stack {
    display: grid;
    gap: 22px;
}

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

.field-label {
    color: #303a56;
    font-size: 14px;
    font-weight: 700;
}

.field-label em {
    color: var(--danger);
    font-size: 12px;
    font-style: normal;
    font-weight: 500;
}

.optional {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.field input,
.field textarea,
.field select,
.copy-field input {
    width: 100%;
    border: 1px solid rgba(103, 111, 153, 0.18);
    border-radius: 13px;
    outline: none;
    color: var(--ink);
    background: rgba(250, 251, 255, 0.9);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field input,
.field select {
    min-height: 48px;
    padding: 11px 14px;
}

.field textarea {
    min-height: 150px;
    padding: 14px;
    line-height: 1.8;
    resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.copy-field input:focus {
    border-color: rgba(101, 88, 245, 0.65);
    box-shadow: 0 0 0 4px rgba(101, 88, 245, 0.08);
}

.field-help {
    color: var(--muted);
    font-size: 12px;
}

.field-error {
    color: var(--danger);
    font-size: 12px;
}

.form-card {
    width: min(100%, 820px);
    margin: 0 auto;
    padding: 32px;
}

.form-notice {
    padding: 14px 16px;
    border-radius: 14px;
    color: #5d6681;
    background: #f3f5fc;
    font-size: 13px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.empty-state {
    padding: 64px 24px;
    text-align: center;
}

.empty-icon {
    display: grid;
    width: 66px;
    height: 66px;
    place-items: center;
    margin: 0 auto 20px;
    border-radius: 22px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 28px;
    font-weight: 750;
}

.empty-state h2 {
    margin: 0 0 8px;
}

.empty-state p {
    margin: 0 auto 24px;
    color: var(--muted);
}

.task-admin-list {
    display: grid;
    gap: 24px;
}

.task-admin-card {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 28px;
    padding: 26px;
}

.qr-column {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.qr-preview {
    display: grid;
    width: 184px;
    height: 184px;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.qr-preview img {
    display: block;
    width: 176px;
    height: 176px;
}

.task-admin-content {
    min-width: 0;
}

.task-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.platform-badge,
.status-badge {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.platform-dianping {
    color: #b75d16;
    background: #fff0df;
}

.platform-douyin {
    color: #b93d72;
    background: #ffedf5;
}

.status-badge.is-active {
    color: #137a5e;
    background: #eaf8f3;
}

.status-badge.is-disabled {
    color: #7b8294;
    background: #eff1f5;
}

.task-admin-content h2 {
    margin: 0 0 10px;
    font-size: 22px;
    line-height: 1.4;
}

.task-copy-preview {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
    white-space: normal;
}

.copy-field {
    display: grid;
    gap: 7px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 12px;
}

.copy-input-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.copy-field input {
    min-width: 0;
    height: 42px;
    padding: 8px 12px;
    color: #68728c;
    font-size: 12px;
}

.task-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nfc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 24px;
}

.nfc-card,
.guide-card {
    padding: 30px;
}

.nfc-card h2,
.guide-card h2 {
    margin: 0 0 10px;
}

.nfc-card > p {
    color: var(--muted);
}

.nfc-symbol {
    position: relative;
    width: 72px;
    height: 72px;
    margin-bottom: 20px;
    border-radius: 22px;
    background: var(--primary-soft);
}

.nfc-symbol span {
    position: absolute;
    top: 50%;
    left: 16px;
    border: 3px solid var(--primary);
    border-top-color: transparent;
    border-bottom-color: transparent;
    border-left-color: transparent;
    border-radius: 50%;
    transform: translateY(-50%);
}

.nfc-symbol span:nth-child(1) { width: 12px; height: 20px; }
.nfc-symbol span:nth-child(2) { width: 24px; height: 34px; }
.nfc-symbol span:nth-child(3) { width: 36px; height: 48px; }

.support-message {
    min-height: 44px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.step-list {
    display: grid;
    gap: 20px;
    margin: 24px 0;
    padding: 0;
    list-style: none;
}

.step-list li {
    display: flex;
    gap: 13px;
}

.step-list li > span {
    display: grid;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 9px;
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-size: 13px;
    font-weight: 750;
}

.step-list strong {
    font-size: 14px;
}

.step-list p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.toast {
    position: fixed;
    z-index: 100;
    right: 24px;
    bottom: 24px;
    max-width: calc(100% - 48px);
    padding: 13px 18px;
    border-radius: 14px;
    color: #fff;
    background: #277d68;
    box-shadow: 0 12px 32px rgba(29, 63, 56, 0.2);
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-size: 14px;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.toast.toast-error {
    background: #bf4c62;
}

/* 手机前台 */
.public-shell {
    width: min(560px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 calc(30px + env(safe-area-inset-bottom));
}

.public-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding: 0 4px;
}

.public-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 18px;
    padding: 26px;
    border-radius: 26px;
    color: #fff;
    background: linear-gradient(135deg, #786aff 0%, #5d50e9 52%, #3ea9e9 140%);
    box-shadow: 0 18px 40px rgba(86, 72, 218, 0.25);
}

.public-hero::after {
    position: absolute;
    top: -70px;
    right: -55px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    content: "";
}

.hero-topline {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.hero-platform {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
}

.hero-platform > span {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 10px;
    color: #5d50df;
    background: #fff;
}

.hero-status {
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    font-size: 11px;
}

.public-hero h1 {
    position: relative;
    z-index: 1;
    margin: 0 0 12px;
    font-size: clamp(25px, 7vw, 34px);
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.public-hero > p {
    position: relative;
    z-index: 1;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
}

.hero-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
    font-weight: 650;
}

.hero-progress i {
    width: 34px;
    height: 1px;
    background: rgba(255, 255, 255, 0.26);
}

.hero-progress .is-current {
    color: #fff;
}

.review-card,
.action-card {
    margin-bottom: 18px;
    padding: 22px;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.step-number {
    display: grid;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 11px;
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-size: 14px;
    font-weight: 750;
}

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

.section-heading p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.review-text-wrap {
    display: block;
    margin-bottom: 14px;
}

#review-text {
    display: block;
    width: 100%;
    min-height: 190px;
    padding: 17px;
    border: 1px solid rgba(101, 88, 245, 0.12);
    border-radius: 16px;
    outline: none;
    color: #414b65;
    background: #f8f8ff;
    font-size: 15px;
    line-height: 1.9;
    resize: none;
    -webkit-user-select: text;
    user-select: text;
}

#copy-review.is-success {
    color: #0e7658;
    background: #e5f8f1;
    box-shadow: none;
}

.button-platform {
    border-color: rgba(101, 88, 245, 0.17);
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.button-platform.is-ready {
    color: #fff;
    background: linear-gradient(135deg, #27b9e9, #6558f5);
    box-shadow: 0 10px 24px rgba(77, 111, 230, 0.22);
}

.action-status {
    min-height: 20px;
    margin: 10px 2px 0;
    font-size: 12px;
    text-align: center;
}

.action-status.is-success {
    color: var(--success);
}

.action-status.is-error {
    color: var(--danger);
}

.browser-guide {
    margin-top: 14px;
    padding: 13px 14px;
    border: 1px solid rgba(224, 152, 49, 0.16);
    border-radius: 13px;
    color: #8b6227;
    background: #fff8e9;
    font-size: 12px;
}

.action-tip {
    margin: 14px 4px 8px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.official-link {
    display: block;
    padding: 5px;
    text-align: center;
}

.public-footer {
    padding: 2px 18px 0;
    color: #8a92a8;
    font-size: 11px;
    line-height: 1.8;
    text-align: center;
}

.unavailable-card {
    padding: 52px 26px;
    text-align: center;
}

.unavailable-icon {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    margin: 0 auto 18px;
    border-radius: 19px;
    color: #9a6a25;
    background: #fff3da;
    font-size: 26px;
    font-weight: 750;
}

.unavailable-card h1 {
    margin: 0 0 10px;
    font-size: 24px;
}

.unavailable-card p {
    margin: 0;
    color: var(--muted);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 760px) {
    .admin-shell,
    .admin-topbar-inner {
        width: min(100% - 28px, 1180px);
    }

    .admin-shell {
        padding-top: 28px;
    }

    .admin-topbar-inner {
        min-height: 70px;
    }

    .admin-nav {
        gap: 8px;
    }

    .admin-nav > a:first-child {
        display: none;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .task-admin-card,
    .nfc-layout {
        grid-template-columns: 1fr;
    }

    .task-admin-card {
        gap: 22px;
    }

    .qr-column {
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .brand small {
        display: none;
    }

    .brand-mark {
        width: 40px;
        height: 40px;
        border-radius: 13px;
    }

    .admin-topbar-inner {
        gap: 10px;
    }

    .admin-nav .button {
        padding-right: 11px;
        padding-left: 11px;
    }

    .auth-card,
    .form-card,
    .nfc-card,
    .guide-card {
        padding: 24px 20px;
    }

    .task-admin-card {
        padding: 20px;
    }

    .copy-input-row {
        align-items: stretch;
        flex-direction: column;
    }

    .copy-input-row .button {
        width: 100%;
    }

    .task-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .task-actions .button,
    .task-actions form,
    .task-actions form .button {
        width: 100%;
    }

    .public-shell {
        width: calc(100% - 24px);
        padding-top: 18px;
    }

    .public-brand {
        margin-bottom: 16px;
    }

    .public-hero {
        padding: 22px 20px;
        border-radius: 23px;
    }

    .review-card,
    .action-card {
        padding: 20px;
        border-radius: 22px;
    }

    .hero-topline {
        margin-bottom: 20px;
    }

    .form-actions {
        display: grid;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
