:root {
    --font-ui: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
    --bg: #efefef;
    --card: #ffffff;
    --soft: #f6f6f8;
    --line: #e7e7ec;
    --line-strong: #d7d7de;
    --text: #1f2430;
    --muted: #8a8f9c;
    --brand: #ea2d22;
    --brand-dark: #c71f17;
    --brand-soft: #fff1ee;
    --blue-start: #6f80ff;
    --blue-end: #9257ff;
    --shadow: 0 16px 40px rgba(30, 37, 48, 0.08);
    --shadow-soft: 0 8px 18px rgba(30, 37, 48, 0.05);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --tabbar-height: 84px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: var(--font-ui);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(234, 45, 34, 0.12), transparent 26%),
        radial-gradient(circle at bottom right, rgba(111, 128, 255, 0.12), transparent 30%),
        var(--bg);
}

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

img,
video,
iframe {
    display: block;
    max-width: 100%;
}

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

button {
    cursor: pointer;
}

input,
textarea,
select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: var(--soft);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: rgba(234, 45, 34, 0.28);
    box-shadow: 0 0 0 4px rgba(234, 45, 34, 0.08);
    background: #fff;
}

input[type="file"] {
    padding: 10px 12px;
}

textarea {
    min-height: 104px;
    resize: vertical;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 18px 12px calc(var(--tabbar-height) + 28px);
}

.app-frame {
    width: min(100%, 430px);
    position: relative;
}

.page-wide .app-frame {
    width: min(100%, 1120px);
}

.app-header {
    margin-bottom: 16px;
}

.brand-card,
.surface-card,
.flash,
.popup-card,
.tab-strip,
.nav-group-card,
.contact-card,
.story-card,
.thread-card,
.profile-summary,
.auth-card,
.utility-card,
.empty-card {
    border-radius: var(--radius-xl);
    background: var(--card);
    box-shadow: var(--shadow-soft);
}

.brand-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px 14px 12px;
}

.brand-anchor {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-avatar {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    flex-shrink: 0;
    overflow: hidden;
    background: linear-gradient(135deg, var(--blue-start), var(--blue-end));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
}

.brand-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-copy {
    min-width: 0;
}

.brand-copy strong,
.brand-copy small {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-copy strong {
    font-size: 24px;
    line-height: 1.15;
    font-family: var(--font-display);
}

.brand-copy small {
    margin-top: 6px;
    color: #a25d50;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.header-cta {
    flex-shrink: 0;
}

.app-main {
    display: grid;
    gap: 14px;
}

.surface-card,
.nav-group-card,
.contact-card,
.thread-card,
.auth-card,
.utility-card,
.empty-card {
    padding: 16px;
}

.hero-banner {
    overflow: hidden;
    padding: 0;
}

.banner-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.banner-fallback {
    position: relative;
    overflow: hidden;
    padding: 24px 20px;
    min-height: 184px;
    color: #fff;
    background:
        radial-gradient(circle at 15% 25%, rgba(255, 255, 255, 0.35), transparent 20%),
        linear-gradient(135deg, #ffb63f 0%, #ffc755 34%, #fcb528 100%);
}

.banner-fallback::after {
    content: "";
    position: absolute;
    right: -20px;
    bottom: -20px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
}

.banner-fallback h1,
.banner-fallback h2,
.section-heading h1,
.section-heading h2,
.section-heading h3,
.auth-card h1,
.profile-summary h1 {
    margin: 0;
    font-family: var(--font-display);
}

.banner-kicker {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.banner-fallback p {
    width: min(240px, 100%);
    margin: 10px 0 0;
    line-height: 1.7;
}

.primary-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(234, 45, 34, 0.24);
}

.primary-strip small {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    font-weight: 500;
    opacity: 0.85;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-heading p,
.card-note,
.muted {
    color: var(--muted);
}

.section-heading p,
.card-note {
    margin: 4px 0 0;
    line-height: 1.6;
}

.section-tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
}

.tab-strip {
    display: flex;
    gap: 10px;
    padding: 14px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tab-strip::-webkit-scrollbar {
    display: none;
}

.segment-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: max-content;
    padding: 11px 18px;
    border-radius: 14px;
    background: #f1f1f5;
    color: #737887;
    font-size: 14px;
    font-weight: 700;
}

.segment-pill.is-active {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    box-shadow: 0 8px 18px rgba(234, 45, 34, 0.2);
}

.nav-group-card {
    display: grid;
    gap: 14px;
}

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

.nav-tile {
    display: grid;
    overflow: hidden;
    border-radius: 18px;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.nav-tile-visual {
    min-height: 92px;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, var(--blue-start), var(--blue-end));
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
}

.nav-tile-visual img {
    width: 100%;
    height: 100%;
    min-height: 92px;
    object-fit: cover;
    margin: -14px;
}

.nav-tile-body {
    display: grid;
    gap: 6px;
    padding: 12px 12px 14px;
}

.nav-tile-body strong {
    font-size: 24px;
    font-family: var(--font-display);
    line-height: 1.15;
}

.nav-tile-body small {
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
}

.nav-tile-body p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.story-list,
.contact-list,
.compact-list,
.thread-list {
    display: grid;
    gap: 14px;
}

.story-card {
    padding: 16px;
}

.story-head,
.story-foot,
.inline-row,
.contact-card-head,
.copy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.story-head {
    align-items: flex-start;
    margin-bottom: 12px;
}

.story-head-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.story-avatar,
.profile-avatar,
.contact-icon,
.utility-icon {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.story-avatar,
.profile-avatar {
    background: linear-gradient(135deg, var(--blue-start), var(--blue-end));
    color: #fff;
}

.contact-icon {
    background: #f4f6ff;
    color: var(--brand);
}

.utility-icon {
    background: var(--brand-soft);
    color: var(--brand);
}

.story-head strong,
.contact-card-head strong,
.profile-summary strong {
    display: block;
    line-height: 1.35;
}

.story-head small,
.contact-card-head small,
.profile-summary small,
.copy-row small,
.compact-list small {
    color: var(--muted);
    font-size: 12px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
}

.story-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-family: var(--font-display);
}

.story-content,
.thread-text,
.copy-text,
.notice-text {
    margin: 0;
    line-height: 1.75;
    word-break: break-word;
}

.story-media,
.predict-frame-shell {
    margin-top: 12px;
    overflow: hidden;
    border-radius: 18px;
    background: #f7f7fb;
}

.story-media img,
.story-media video {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
}

.story-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.comment-block {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.comment-list {
    display: grid;
    gap: 8px;
    padding: 0;
    margin: 0 0 12px;
    list-style: none;
}

.comment-item {
    padding: 10px 12px;
    border-radius: 14px;
    background: #f7f7fa;
    font-size: 14px;
    line-height: 1.6;
}

.inline-form,
.form-stack,
.stack-md {
    display: grid;
    gap: 12px;
}

.inline-form {
    grid-template-columns: 1fr auto;
    align-items: end;
}

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

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    font-weight: 800;
    box-shadow: 0 10px 18px rgba(234, 45, 34, 0.18);
}

.button.secondary {
    background: #fff;
    color: var(--brand);
    border: 1px solid rgba(234, 45, 34, 0.28);
    box-shadow: none;
}

.button.ghost {
    background: #f3f3f7;
    color: #5a5f6d;
    box-shadow: none;
}

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

.button.full {
    width: 100%;
}

.button.is-disabled {
    pointer-events: none;
    opacity: 0.55;
}

.flash-stack {
    display: grid;
    gap: 10px;
}

.flash {
    padding: 14px 16px;
    font-size: 14px;
}

.flash-success,
.flash-info {
    background: #fff;
    border-left: 4px solid var(--brand);
}

.flash-error {
    background: #fff4f2;
    border-left: 4px solid var(--brand);
}

.error-text {
    margin: 2px 0 0;
    color: var(--brand);
    font-size: 13px;
}

.notice-panel {
    display: grid;
    gap: 10px;
}

.notice-item,
.utility-item {
    display: grid;
    gap: 6px;
    padding: 14px;
    border-radius: 18px;
    background: #f8f8fb;
}

.utility-grid {
    display: grid;
    gap: 12px;
}

.utility-item {
    grid-template-columns: 44px 1fr;
    align-items: start;
}

.utility-item h3,
.utility-item p,
.notice-item p {
    margin: 0;
}

.contact-card {
    display: grid;
    gap: 14px;
}

.contact-copy-box {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    background: #f4f5f8;
}

.copy-text {
    color: #6b707d;
}

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

.thread-card {
    display: grid;
    gap: 14px;
}

.thread-list {
    max-height: 360px;
    overflow-y: auto;
    padding-right: 2px;
}

.thread-bubble {
    display: grid;
    gap: 8px;
    padding: 14px;
    border-radius: 18px;
    background: #f8f8fb;
}

.thread-bubble.is-staff {
    background: var(--brand-soft);
}

.thread-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
}

.predict-frame-shell {
    padding: 0;
}

.predict-frame {
    width: 100%;
    min-height: 68vh;
    border: none;
    background: #fff;
}

.auth-shell {
    display: grid;
    gap: 14px;
}

.auth-card {
    display: grid;
    gap: 14px;
}

.auth-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--blue-start), var(--blue-end));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
}

.profile-summary {
    display: grid;
    gap: 14px;
    padding: 16px;
}

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

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    overflow: hidden;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.stat-item {
    padding: 12px 10px;
    border-radius: 16px;
    background: #f6f6fa;
    text-align: center;
}

.stat-item strong {
    display: block;
    font-size: 20px;
}

.float-service {
    position: fixed;
    right: max(18px, calc((100vw - min(100vw, 430px)) / 2 + 18px));
    bottom: calc(var(--tabbar-height) + 18px);
    z-index: 18;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 64px;
    padding: 12px 10px 10px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    box-shadow: 0 18px 32px rgba(234, 45, 34, 0.28);
}

.float-service::before {
    content: "客";
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.tabbar {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 16;
    width: min(100%, 430px);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 10px 14px 16px;
    background: rgba(255, 255, 255, 0.94);
    border-top: 1px solid rgba(215, 215, 222, 0.9);
    backdrop-filter: blur(10px);
}

.page-wide .tabbar {
    width: min(100%, 640px);
}

.tabbar-item {
    display: grid;
    justify-items: center;
    gap: 6px;
    color: #9095a3;
    font-size: 12px;
    font-weight: 700;
}

.tabbar-icon {
    width: 26px;
    height: 26px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f3f3f7;
    color: inherit;
    font-size: 13px;
}

.tabbar-item.is-active {
    color: var(--brand);
}

.tabbar-item.is-active .tabbar-icon {
    background: var(--brand-soft);
}

.popup-mask {
    position: fixed;
    inset: 0;
    z-index: 22;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: rgba(31, 36, 48, 0.42);
}

.popup-card {
    width: min(100%, 420px);
    padding: 20px;
}

.popup-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.popup-head strong {
    display: block;
    font-size: 20px;
    font-family: var(--font-display);
}

.popup-head small {
    color: var(--muted);
}

.popup-card p {
    margin: 0;
    line-height: 1.75;
}

.mt-12 {
    margin-top: 12px;
}

.mt-16 {
    margin-top: 16px;
}

.mt-20 {
    margin-top: 20px;
}

@media (min-width: 720px) {
    .app-shell {
        padding-top: 28px;
        padding-bottom: calc(var(--tabbar-height) + 32px);
    }

    .app-frame {
        padding: 18px;
        border-radius: 34px;
        background: rgba(255, 255, 255, 0.54);
        box-shadow: var(--shadow);
    }

    .page-wide .app-frame {
        padding: 20px;
    }

    .page-wide .float-service {
        right: 34px;
        bottom: 26px;
    }
}

@media (max-width: 420px) {
    .brand-copy strong {
        font-size: 21px;
    }

    .contact-actions,
    .inline-form {
        grid-template-columns: 1fr;
    }

    .nav-grid {
        gap: 10px;
    }
}
