html.psd-desk-html,
html.psd-desk-html body.psd-desk-screen,
body.psd-desk-screen {
    --psd-bg: #f4f1ec;
    --psd-surface: #ffffff;
    --psd-input: #f7f4ef;
    --psd-header: rgba(244, 241, 236, 0.86);
    --psd-ink: #1a1a1a;
    --psd-ink-hover: #2a2a2a;
    --psd-muted: #8a8a8a;
    --psd-faint: #a8a8a8;
    --psd-line: #d8d4ce;
    --psd-accent: #f26522;
    --psd-dark: #242424;
    --psd-font: 'Noto Sans TC', 'Archivo', system-ui, sans-serif;
    --psd-latin: 'Archivo', 'Noto Sans TC', system-ui, sans-serif;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: var(--psd-bg);
    overflow: hidden;
    font-family: var(--psd-font);
    color: var(--psd-ink);
}

body.psd-desk-screen #header,
body.psd-desk-screen header#header,
body.psd-desk-screen header.ct-header,
body.psd-desk-screen [data-header],
body.psd-desk-screen #footer,
body.psd-desk-screen footer.ct-footer,
body.psd-desk-screen .ct-footer,
body.psd-desk-screen .custom-global-footer,
body.psd-desk-screen .ct-drawer,
body.psd-desk-screen #account-modal,
body.psd-desk-screen .ct-panel#account-modal,
body.psd-desk-screen .hero-section,
body.psd-desk-screen .entry-header,
body.psd-desk-screen .ct-title,
body.psd-desk-screen .page-title,
body.psd-desk-screen .ct-breadcrumbs,
body.psd-desk-screen .ct-sidebar,
body.psd-desk-screen aside.ct-sidebar,
body.psd-desk-screen .widget-area,
body.psd-desk-screen .store-sidebar,
body.psd-desk-screen .woo-listing-top,
body.psd-desk-screen .ct-woo-filters {
    display: none !important;
}

body.psd-desk-screen #main-container,
body.psd-desk-screen main#main,
body.psd-desk-screen #main,
body.psd-desk-screen #content,
body.psd-desk-screen .site-main,
body.psd-desk-screen article,
body.psd-desk-screen .entry-content,
body.psd-desk-screen .ct-container,
body.psd-desk-screen .ct-container-full,
body.psd-desk-screen [class*="ct-container"] {
    max-width: none !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

@keyframes psd-rise-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes psd-slow-zoom {
    from { transform: scale(1.06); }
    to { transform: scale(1); }
}

.psd-app {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100dvh;
    background: var(--psd-bg);
    box-sizing: border-box;
    animation: psd-rise-in 0.45s cubic-bezier(0.2, 0.7, 0.3, 1);
}

body.admin-bar .psd-app {
    top: var(--wp-admin--admin-bar--height, 32px);
    height: calc(100dvh - var(--wp-admin--admin-bar--height, 32px));
}

.psd-app *,
.psd-app *::before,
.psd-app *::after {
    box-sizing: border-box;
}

.psd-app button,
.psd-app input,
.psd-app textarea,
.psd-app a {
    font: inherit;
}

/* Login */

.psd-app--login {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    padding: 0;
}

.psd-login-visual {
    position: relative;
    overflow: hidden;
    background: #5c5c5c;
}

.psd-login-visual__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(0.35) contrast(1.05);
    animation: psd-slow-zoom 1.6s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.psd-login-visual__fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.12), transparent 42%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 22px),
        linear-gradient(165deg, #7a7a7a 0%, #4e4e4e 70%);
}

.psd-login-placeholder__icon {
    width: min(42vw, 240px);
    height: auto;
    display: block;
    filter: drop-shadow(0 16px 36px rgba(0, 0, 0, 0.4));
}

.psd-login-placeholder__ring {
    width: min(38vw, 260px);
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.32);
    font-size: clamp(3.5rem, 8vw, 5.5rem);
    font-weight: 700;
}

.psd-login-visual__scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(26, 26, 26, 0.45) 0%, rgba(26, 26, 26, 0.12) 38%, rgba(26, 26, 26, 0.72) 100%);
    pointer-events: none;
}

.psd-app--login:not(.has-image) .psd-login-visual__scrim {
    background: transparent;
}

.psd-login-panel {
    display: flex;
    flex-direction: column;
    padding: 40px 56px 56px;
    background: var(--psd-bg);
    min-width: 0;
}

.psd-login-body {
    margin: auto 0;
    max-width: 420px;
    width: 100%;
}

.psd-access {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    color: var(--psd-muted);
    font-family: var(--psd-latin);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.28em;
}

.psd-access::before {
    content: "";
    width: 22px;
    height: 3px;
    background: var(--psd-accent);
}

.psd-login-body h1 {
    margin: 0 0 14px;
    font-size: 44px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.psd-lead {
    margin: 0;
    color: var(--psd-muted);
    font-size: 15px;
    line-height: 1.6;
}

.psd-alert {
    margin-top: 22px;
    padding: 12px 14px;
    background: #fff4f4;
    color: #9b1c1c;
    border-radius: 8px;
    font-size: 14px;
}

.psd-login-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin-top: 40px;
}

.psd-login-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--psd-muted);
}

.psd-login-form input[type="text"],
.psd-login-form input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    color: var(--psd-ink);
    background: var(--psd-input);
    border: 1px solid var(--psd-line);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.psd-password-wrap input[type="password"],
.psd-password-wrap input[type="text"] {
    padding-right: 74px;
}

.psd-login-form input:focus {
    border-color: var(--psd-ink);
    background: var(--psd-surface);
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.07);
}

.psd-password-wrap {
    position: relative;
    display: block;
}

.psd-show-pass {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    min-height: 44px;
    border: 0;
    background: none;
    color: var(--psd-muted);
    padding: 0 4px;
    cursor: pointer;
}

.psd-login-form button[type="submit"] {
    width: 100%;
    padding: 17px;
    border: 0;
    border-radius: 8px;
    background: var(--psd-ink);
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.12s ease;
}

.psd-login-form button[type="submit"]:hover {
    background: var(--psd-ink-hover);
}

.psd-login-form button[type="submit"]:active {
    transform: translateY(1px);
}

.psd-back {
    align-self: flex-start;
    color: var(--psd-muted);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.18s ease;
}

.psd-back:hover {
    color: var(--psd-ink);
}

/* Hub + thread chrome */

.psd-topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--psd-header);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--psd-line);
}

.psd-topbar__inner {
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: 1040px;
    margin: 0 auto;
    padding: 18px 32px;
}

.psd-topbar--thread .psd-topbar__inner--thread {
    max-width: 860px;
    padding: 14px 32px 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.psd-topbar__row {
    display: flex;
    align-items: center;
    gap: 18px;
}

.psd-topbar__who {
    min-width: 0;
}

.psd-topbar__spacer {
    flex: 1;
}

.psd-eyebrow {
    margin: 0;
    font-family: var(--psd-latin);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--psd-muted);
}

.psd-topbar__email {
    margin: 4px 0 0;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.psd-topbar__email--quiet {
    margin: 0 0 2px;
    font-size: 12px;
    font-weight: 400;
    color: var(--psd-muted);
}

.psd-topbar--thread h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.psd-mark {
    width: 44px;
    height: 44px;
    object-fit: cover;
    background: var(--psd-surface);
    border: 1px solid var(--psd-line);
    border-radius: 10px;
    flex: 0 0 auto;
}

.psd-mark--sm {
    width: 40px;
    height: 40px;
}

.psd-mark--fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--psd-ink);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
}

.psd-liaison {
    margin: 0;
    color: var(--psd-muted);
    font-size: 13.5px;
    white-space: nowrap;
}

.psd-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 18px;
    border: 1px solid var(--psd-line);
    border-radius: 999px;
    background: transparent;
    color: var(--psd-ink);
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.psd-logout:hover {
    background: var(--psd-ink);
    border-color: var(--psd-ink);
    color: #fff;
}

.psd-hub {
    flex: 1;
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    padding: 44px 32px 72px;
    overflow-y: auto;
}

.psd-notice {
    display: flex;
    gap: 18px;
    padding: 22px 26px;
    background: var(--psd-surface);
    border: 1px solid var(--psd-line);
    border-radius: 12px;
}

.psd-notice__rule {
    width: 3px;
    flex: 0 0 3px;
    background: var(--psd-accent);
    border-radius: 99px;
}

.psd-notice__label {
    margin: 0 0 6px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.16em;
    color: var(--psd-muted);
}

.psd-notice__text {
    margin: 0;
    font-size: 16px;
    line-height: 1.7;
    white-space: pre-wrap;
}

.psd-section-rule {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 40px 0 16px;
}

.psd-section-rule h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.psd-section-rule span {
    flex: 1;
    height: 1px;
    background: var(--psd-line);
}

.psd-topic-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.psd-topic-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 148px;
    padding: 26px 28px 28px;
    background: var(--psd-surface);
    border: 1px solid var(--psd-line);
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.psd-topic-card:hover {
    border-color: var(--psd-ink);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -18px rgba(26, 26, 26, 0.55);
}

.psd-topic-card__top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.psd-topic-card__label {
    flex: 1;
    font-size: 21px;
    font-weight: 700;
}

.psd-topic-card__arrow {
    font-family: var(--psd-latin);
    font-size: 17px;
    color: var(--psd-faint);
}

.psd-topic-card__desc {
    color: var(--psd-muted);
    font-size: 14px;
    line-height: 1.6;
}

.psd-topic-card__meta {
    margin-top: auto;
    color: var(--psd-muted);
    font-size: 12.5px;
}

.psd-topic-card__unread {
    position: absolute;
    top: 18px;
    right: 48px;
    min-width: 1.4em;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--psd-ink);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
}

body.psd-desk-screen.psd-desk-home {
    overflow: auto;
}

body.psd-desk-screen.psd-desk-home .psd-app {
    position: relative;
    height: auto;
    min-height: 100dvh;
}

/* Thread */

.psd-app--thread {
    background: var(--psd-bg);
}

.psd-thread-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    padding: 32px 32px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.psd-bubble {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: fit-content;
    max-width: 76%;
    align-self: flex-start;
    padding: 14px 18px;
    border-radius: 14px 14px 14px 4px;
    background: var(--psd-surface);
    border: 1px solid var(--psd-line);
}

.psd-bubble.mine {
    align-self: flex-end;
    background: var(--psd-ink);
    color: #fff;
    border: 0;
    border-radius: 14px 14px 4px 14px;
}

.psd-bubble-meta {
    font-size: 11.5px;
    color: var(--psd-muted);
}

.psd-bubble.mine .psd-bubble-meta,
.psd-bubble.mine .psd-files a {
    color: rgba(255, 255, 255, 0.62);
}

.psd-bubble-text {
    font-size: 15.5px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.psd-files {
    margin: 0;
    padding: 0;
    list-style: none;
}

.psd-files a {
    color: inherit;
}

.psd-files img {
    display: block;
    max-width: 220px;
    max-height: 180px;
    border-radius: 8px;
    margin-top: 4px;
}

.psd-composer {
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: rgba(244, 241, 236, 0.92);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--psd-line);
}

.psd-composer__inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 860px;
    margin: 0 auto;
    padding: 16px 32px 22px;
}

.psd-composer textarea {
    width: 100%;
    resize: none;
    padding: 14px 16px;
    background: var(--psd-surface);
    border: 1px solid var(--psd-line);
    border-radius: 10px;
    color: var(--psd-ink);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.psd-composer textarea:focus {
    border-color: var(--psd-ink);
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.07);
}

.psd-composer-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.psd-file-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 16px;
    border: 1px solid var(--psd-line);
    border-radius: 8px;
    background: var(--psd-surface);
    color: var(--psd-ink);
    cursor: pointer;
}

.psd-file-btn input {
    display: none;
}

.psd-file-names {
    font-size: 12px;
    color: var(--psd-muted);
}

.psd-composer-hint {
    margin-left: auto;
    font-size: 12px;
    color: var(--psd-faint);
}

.psd-composer button[type="submit"] {
    min-height: 44px;
    padding: 12px 32px;
    border: 0;
    border-radius: 8px;
    background: var(--psd-ink);
    color: #fff;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.12s ease;
}

.psd-composer button[type="submit"]:hover {
    background: var(--psd-ink-hover);
}

.psd-composer button[type="submit"]:active {
    transform: translateY(1px);
}

.psd-empty {
    margin: 24px 0;
    color: var(--psd-muted);
    text-align: center;
}

.psd-entry-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    background: var(--psd-ink);
    color: #fff;
    text-decoration: none;
}

@media (max-width: 900px) {
    .psd-app--login {
        grid-template-columns: 1fr;
        grid-template-rows: 30vh 1fr;
    }

    .psd-login-panel {
        padding: 24px 20px 32px;
    }

    .psd-login-body h1 {
        font-size: 32px;
    }

    .psd-topic-grid {
        grid-template-columns: 1fr;
    }

    .psd-topbar__inner,
    .psd-hub,
    .psd-thread-messages,
    .psd-composer__inner,
    .psd-topbar--thread .psd-topbar__inner--thread {
        padding-left: 20px;
        padding-right: 20px;
    }

    .psd-liaison {
        white-space: normal;
    }

    .psd-topbar__row {
        flex-wrap: wrap;
    }

    .psd-composer-hint {
        display: none;
    }
}
