:root {
    --ws-bg: #f4f6f8;
    --ws-card: #ffffff;
    --ws-text: #172033;
    --ws-muted: #6b7280;
    --ws-line: rgba(23, 32, 51, .10);
    --ws-primary: #2563eb;
    --ws-primary-soft: rgba(37, 99, 235, .10);
    --ws-green: #10b981;
    --ws-amber: #f59e0b;
    --ws-danger: #ef4444;
    --ws-shadow: 0 8px 24px rgba(15, 23, 42, .07);
    --ws-radius: 8px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--ws-bg);
    color: var(--ws-text);
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
    overflow-x: hidden;
}

[hidden] {
    display: none !important;
}

button,
input,
textarea {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

button:disabled {
    cursor: default;
    opacity: .64;
}

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

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

.ws-shell {
    width: 100%;
    max-width: 840px;
    min-height: 100vh;
    margin: 0 auto;
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
}

.ws-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
    background: rgba(244, 246, 248, .88);
    border-bottom: 1px solid var(--ws-line);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

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

.ws-brand-logo {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 10px;
    object-fit: cover;
    background: var(--ws-primary-soft);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .10);
}

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

.ws-brand-copy h1 {
    margin: 0;
    overflow: hidden;
    color: var(--ws-text);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ws-brand-copy p {
    margin: 2px 0 0;
    color: var(--ws-muted);
    font-size: 12px;
    line-height: 1.2;
}

.ws-main {
    padding: 12px 12px 0;
}

.ws-page {
    display: none;
}

.ws-page.is-active {
    display: block;
}

.ws-banner {
    position: relative;
    width: 100%;
    min-height: 118px;
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid var(--ws-line);
    border-radius: var(--ws-radius);
    background: #111827;
    box-shadow: var(--ws-shadow);
}

.ws-banner-track {
    display: flex;
    transform: translateX(0);
    transition: transform .36s ease;
}

.ws-banner-slide {
    flex: 0 0 100%;
    min-width: 100%;
    background: #111827;
}

.ws-banner-slide img {
    width: 100%;
    height: 158px;
    object-fit: cover;
}

.ws-banner-dots {
    position: absolute;
    right: 12px;
    bottom: 10px;
    display: flex;
    gap: 6px;
}

.ws-banner-dots button {
    width: 7px;
    height: 7px;
    padding: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .52);
}

.ws-banner-dots button.is-active {
    width: 18px;
    background: #fff;
}

.ws-notice,
.ws-form-panel,
.ws-help-panel,
.ws-help-list details,
.ws-app-card,
.ws-record-card,
.ws-dialog,
.ws-sheet {
    border: 1px solid var(--ws-line);
    border-radius: var(--ws-radius);
    background: var(--ws-card);
    box-shadow: var(--ws-shadow);
}

.ws-notice {
    margin-bottom: 12px;
    padding: 13px 14px;
}

.ws-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.ws-dot {
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: 50%;
    background: var(--ws-green);
}

.ws-notice-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ws-notice-list p {
    margin: 0;
    color: var(--ws-muted);
    font-size: 13px;
    line-height: 1.55;
    word-break: break-word;
}

.ws-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
    margin-bottom: 10px;
}

.ws-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--ws-line);
    border-radius: var(--ws-radius);
    background: #fff;
}

.ws-search i {
    color: var(--ws-muted);
}

.ws-search input {
    width: 100%;
    min-width: 0;
    height: 40px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ws-text);
}

.ws-primary-btn,
.ws-outline-btn,
.ws-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    border-radius: var(--ws-radius);
    font-weight: 750;
    transition: transform .12s ease, opacity .12s ease;
}

.ws-primary-btn {
    padding: 0 15px;
    background: var(--ws-primary);
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .20);
}

.ws-outline-btn {
    padding: 0 12px;
    border: 1px solid rgba(37, 99, 235, .18);
    background: var(--ws-primary-soft);
    color: var(--ws-primary);
}

.ws-icon-btn {
    width: 40px;
    min-width: 40px;
    padding: 0;
    border: 1px solid var(--ws-line);
    background: #fff;
    color: var(--ws-text);
}

.ws-refresh-mark {
    display: block;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.ws-primary-btn:active,
.ws-outline-btn:active,
.ws-icon-btn:active,
.ws-sign-btn:active {
    transform: scale(.98);
}

.ws-full {
    width: 100%;
}

.ws-chip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px -12px 8px;
    padding: 2px 12px 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.ws-chip-row::-webkit-scrollbar {
    display: none;
}

.ws-chip {
    flex: none;
    min-height: 34px;
    padding: 0 13px;
    border: 1px solid var(--ws-line);
    border-radius: 999px;
    background: #fff;
    color: #4b5563;
    font-weight: 650;
    white-space: nowrap;
}

.ws-chip.is-active {
    border-color: var(--ws-primary);
    background: var(--ws-primary);
    color: #fff;
}

.ws-list,
.ws-record-list,
.ws-help-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ws-app-card {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
}

.ws-app-icon {
    width: 62px;
    height: 62px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--ws-primary-soft);
}

.ws-app-info {
    min-width: 0;
}

.ws-app-title-row {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
}

.ws-app-title-row h3 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ws-app-title-row span {
    flex: none;
    color: var(--ws-muted);
    font-size: 12px;
}

.ws-app-meta {
    margin-top: 4px;
    overflow: hidden;
    color: #64748b;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ws-app-info p {
    display: -webkit-box;
    margin: 5px 0 0;
    overflow: hidden;
    color: var(--ws-muted);
    font-size: 12px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.ws-sign-btn {
    min-width: 76px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    font-weight: 750;
}

.ws-empty {
    min-height: 260px;
    display: grid;
    place-items: center;
    align-content: center;
    padding: 20px;
    color: var(--ws-muted);
    text-align: center;
}

.ws-empty-icon {
    display: grid;
    width: 62px;
    height: 62px;
    margin-bottom: 12px;
    place-items: center;
    border: 1px solid var(--ws-line);
    border-radius: var(--ws-radius);
    background: #fff;
    color: #cbd5e1;
    font-size: 26px;
}

.ws-empty h2,
.ws-page-head h2,
.ws-sheet-head h2,
.ws-dialog-head h2 {
    margin: 0;
    color: var(--ws-text);
}

.ws-empty h2 {
    font-size: 18px;
}

.ws-empty p {
    margin: 6px 0 0;
}

.ws-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 12px;
}

.ws-page-head h2 {
    font-size: 22px;
    font-weight: 850;
}

.ws-form-panel,
.ws-help-panel {
    margin-bottom: 12px;
    padding: 14px;
}

.ws-field {
    display: block;
    min-width: 0;
}

.ws-field > span {
    display: block;
    margin-bottom: 7px;
    color: #4b5563;
    font-size: 13px;
    font-weight: 750;
}

.ws-field input,
.ws-field textarea {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--ws-line);
    border-radius: var(--ws-radius);
    outline: 0;
    background: #fff;
    color: var(--ws-text);
}

.ws-field + .ws-field,
.ws-field-list .ws-field + .ws-field {
    margin-top: 10px;
}

.ws-inline-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.ws-two-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.ws-rich-text {
    color: var(--ws-muted);
    line-height: 1.7;
    word-break: break-word;
}

.ws-rich-text img,
.ws-help-list img {
    max-width: 100%;
    height: auto;
    border-radius: var(--ws-radius);
}

.ws-rich-text a,
.ws-help-list a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    margin: 4px 6px 4px 0;
    padding: 0 10px;
    border-radius: var(--ws-radius);
    background: var(--ws-primary-soft);
    color: var(--ws-primary);
    font-weight: 700;
}

.ws-help-list details {
    padding: 13px 14px;
}

.ws-help-list summary {
    cursor: pointer;
    font-weight: 800;
}

.ws-help-list p {
    margin: 8px 0 0;
    color: var(--ws-muted);
    line-height: 1.7;
}

.ws-record-card {
    padding: 12px;
}

.ws-record-card h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
}

.ws-record-card p {
    margin: 5px 0 0;
    color: var(--ws-muted);
    font-size: 12px;
    word-break: break-all;
}

.ws-record-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.ws-record-actions button,
.ws-record-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 11px;
    border-radius: var(--ws-radius);
    background: var(--ws-primary-soft);
    color: var(--ws-primary);
    font-size: 13px;
    font-weight: 750;
}

.ws-record-actions .is-danger {
    background: rgba(239, 68, 68, .10);
    color: var(--ws-danger);
}

.ws-bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 8px;
    z-index: 30;
    display: grid;
    width: calc(100% - 24px);
    max-width: 816px;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 6px;
    transform: translateX(-50%);
    border: 1px solid var(--ws-line);
    border-radius: var(--ws-radius);
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 14px 36px rgba(15, 23, 42, .12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.ws-bottom-nav button {
    display: flex;
    min-width: 0;
    min-height: 52px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-radius: var(--ws-radius);
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.ws-bottom-nav button i {
    font-size: 18px;
}

.ws-bottom-nav button.is-active {
    background: var(--ws-primary-soft);
    color: var(--ws-primary);
}

.ws-mask {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ws-sheet {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 50;
    width: 100%;
    max-width: 840px;
    max-height: min(88vh, 760px);
    padding: 8px 14px calc(16px + env(safe-area-inset-bottom));
    overflow-y: auto;
    transform: translate(-50%, 106%);
    transition: transform .22s ease;
    border-radius: 8px 8px 0 0;
}

.ws-sheet.is-open {
    transform: translate(-50%, 0);
}

.ws-sheet-handle {
    width: 40px;
    height: 4px;
    margin: 0 auto 12px;
    border-radius: 999px;
    background: #d1d5db;
}

.ws-sheet-head,
.ws-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.ws-sheet-head {
    margin-bottom: 12px;
}

.ws-sheet-head h2,
.ws-dialog-head h2 {
    font-size: 20px;
    font-weight: 850;
}

.ws-sheet-head p {
    margin: 3px 0 0;
    color: var(--ws-muted);
    font-size: 12px;
}

.ws-app-preview {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.ws-app-preview img {
    width: 66px;
    height: 66px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--ws-primary-soft);
}

.ws-app-preview h3 {
    margin: 0;
    overflow: hidden;
    font-size: 18px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ws-app-preview p,
.ws-app-desc {
    margin: 5px 0 0;
    color: var(--ws-muted);
    font-size: 12px;
    word-break: break-all;
}

.ws-app-desc {
    margin: 0 0 12px;
    line-height: 1.55;
}

.ws-upload-row {
    display: grid;
    width: 100%;
    grid-template-columns: 46px minmax(0, auto) 1fr;
    gap: 10px;
    align-items: center;
    min-height: 56px;
    padding: 8px 10px;
    border: 1px dashed rgba(37, 99, 235, .35);
    border-radius: var(--ws-radius);
    background: var(--ws-primary-soft);
    color: var(--ws-text);
    text-align: left;
}

.ws-upload-row img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    background: #fff;
}

.ws-upload-row strong {
    min-width: 88px;
}

.ws-upload-row em {
    overflow: hidden;
    color: var(--ws-muted);
    font-size: 12px;
    font-style: normal;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ws-submit {
    margin-top: 14px;
    min-height: 46px;
    font-size: 15px;
}

.ws-dialog {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 55;
    width: min(92vw, 520px);
    max-height: min(78vh, 640px);
    overflow: hidden;
    transform: translate(-50%, -50%);
}

.ws-dialog-head {
    padding: 14px;
    border-bottom: 1px solid var(--ws-line);
}

.ws-dialog-body {
    max-height: calc(min(78vh, 640px) - 66px);
    overflow: auto;
    padding: 14px;
}

.ws-result-title {
    margin: 0 0 8px;
    font-weight: 800;
}

.ws-result-actions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.ws-result-actions a,
.ws-result-actions button {
    width: 100%;
}

.ws-toast {
    position: fixed;
    left: 50%;
    bottom: calc(88px + env(safe-area-inset-bottom));
    z-index: 80;
    max-width: min(88vw, 520px);
    padding: 10px 14px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(17, 24, 39, .92);
    color: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .20);
    font-size: 14px;
    text-align: center;
}

.ws-loading-layer {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, .36);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.ws-loading-card {
    width: min(88vw, 360px);
    padding: 22px 18px 18px;
    border: 1px solid var(--ws-line);
    border-radius: var(--ws-radius);
    background: #fff;
    box-shadow: 0 20px 48px rgba(15, 23, 42, .20);
    text-align: center;
}

.ws-loading-spinner {
    width: 34px;
    height: 34px;
    margin: 0 auto 12px;
    border: 3px solid rgba(37, 99, 235, .18);
    border-top-color: var(--ws-primary);
    border-radius: 50%;
    animation: ws-spin .9s linear infinite;
}

.ws-loading-card h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 850;
}

.ws-loading-card p {
    margin: 8px 0 16px;
    color: var(--ws-muted);
    line-height: 1.7;
}

.ws-loading-close {
    width: 100%;
}

@keyframes ws-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 560px) {
    .ws-main {
        padding-left: 10px;
        padding-right: 10px;
    }

    .ws-chip-row {
        margin-left: -10px;
        margin-right: -10px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .ws-banner-slide img {
        height: 138px;
    }

    .ws-toolbar {
        grid-template-columns: minmax(0, 1fr) 84px;
    }

    .ws-app-card {
        grid-template-columns: 56px minmax(0, 1fr) auto;
        gap: 10px;
        padding: 10px;
    }

    .ws-app-icon {
        width: 56px;
        height: 56px;
    }

    .ws-sign-btn {
        min-width: 66px;
        padding: 0 9px;
        font-size: 13px;
    }

    .ws-two-grid {
        grid-template-columns: 1fr;
    }

    .ws-upload-row {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .ws-upload-row em {
        grid-column: 2;
        text-align: left;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --ws-bg: #0f172a;
        --ws-card: #111827;
        --ws-text: #f8fafc;
        --ws-muted: #94a3b8;
        --ws-line: rgba(255, 255, 255, .12);
        --ws-primary-soft: rgba(59, 130, 246, .18);
    }

    .ws-header {
        background: rgba(15, 23, 42, .86);
    }

    .ws-search,
    .ws-field input,
    .ws-field textarea,
    .ws-icon-btn,
    .ws-chip,
    .ws-bottom-nav,
    .ws-empty-icon {
        background: #111827;
    }

    .ws-upload-row img {
        background: #0f172a;
    }
}
