:root {
    --bg: #f7f7f5;
    --panel: #ffffff;
    --text: #1f2328;
    --muted: #6f7782;
    --line: #e8e6e2;
    --accent: #a00000;
    --accent-deep: #780000;
    --accent-warm: #d86b3d;
    --accent-soft: #fff2ed;
    --surface: #ffffff;
    --surface-muted: #faf9f7;
    --sidebar-bg: rgba(247, 247, 245, 0.96);
    --category-bg: rgba(247, 247, 245, 0.92);
    --icon-bg: #f0efeb;
    --icon-color: #3b4048;
    --theme-track: rgba(255, 255, 255, 0.72);
    --theme-active: #ffffff;
    --theme-active-shadow: 0 4px 12px rgba(31, 35, 40, 0.12);
    --ghost-bg: #f1efec;
    --ghost-hover: #e8e4df;
    --shadow: 0 10px 30px rgba(31, 35, 40, 0.08);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #171a20;
        --panel: #12151b;
        --surface: #1a1e25;
        --surface-muted: #20252d;
        --text: #eef1f5;
        --muted: #9da6b3;
        --line: #2b313b;
        --accent: #d94b4b;
        --accent-deep: #ff7777;
        --accent-soft: rgba(217, 75, 75, 0.16);
        --sidebar-bg: rgba(28, 32, 38, 0.96);
        --category-bg: rgba(18, 21, 27, 0.88);
        --icon-bg: #252b34;
        --icon-color: #d7dde6;
        --theme-track: rgba(37, 43, 52, 0.86);
        --theme-active: #12151b;
        --theme-active-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
        --ghost-bg: #252b34;
        --ghost-hover: #303743;
        --shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #171a20;
    --panel: #12151b;
    --surface: #1a1e25;
    --surface-muted: #20252d;
    --text: #eef1f5;
    --muted: #9da6b3;
    --line: #2b313b;
    --accent: #d94b4b;
    --accent-deep: #ff7777;
    --accent-soft: rgba(217, 75, 75, 0.16);
    --sidebar-bg: rgba(28, 32, 38, 0.96);
    --category-bg: rgba(18, 21, 27, 0.88);
    --icon-bg: #252b34;
    --icon-color: #d7dde6;
    --theme-track: rgba(37, 43, 52, 0.86);
    --theme-active: #12151b;
    --theme-active-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
    --ghost-bg: #252b34;
    --ghost-hover: #303743;
    --shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--panel);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    letter-spacing: 0;
}

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

button,
input,
textarea {
    font: inherit;
}

button {
    border: 0;
    background: none;
    cursor: pointer;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.side-nav {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
    display: flex;
    width: 216px;
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: var(--sidebar-bg);
    padding: 26px 18px;
    backdrop-filter: blur(16px);
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    width: 100%;
}

.nav-icon,
.tab-item span {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
}

.nav-icon svg,
.tab-item svg,
.footer-icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand-logo {
    width: min(168px, 100%);
    height: auto;
    max-height: 58px;
    flex: 0 0 auto;
    border-radius: 0;
    object-fit: contain;
    background: transparent;
}

.side-menu {
    display: grid;
    gap: 8px;
    margin-top: 34px;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    width: 100%;
    border-radius: 8px;
    padding: 0 14px;
    color: var(--text);
    font-weight: 700;
    text-align: left;
    transition: background 0.2s ease, color 0.2s ease;
}

.side-link:hover,
.side-link.is-active {
    background: var(--accent-soft);
    color: var(--accent);
}

.nav-icon {
    width: 28px;
    height: 28px;
    background: var(--icon-bg);
    color: var(--icon-color);
    font-size: 13px;
    font-weight: 800;
}

.side-link.is-active .nav-icon,
.side-link:hover .nav-icon {
    background: var(--accent);
    color: #fff;
}

.side-footer {
    display: grid;
    gap: 12px;
    margin-top: auto;
    color: var(--muted);
    font-size: 13px;
}

.theme-switcher {
    display: grid;
    gap: 6px;
    margin-top: 4px;
}

.theme-switcher-title {
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
}

.theme-options {
    display: inline-grid;
    width: max-content;
    grid-template-columns: repeat(3, 28px);
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--theme-track);
    padding: 3px;
}

.theme-option {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    color: var(--muted);
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.theme-option:hover,
.theme-option.is-active {
    background: var(--theme-active);
    color: var(--text);
    box-shadow: var(--theme-active-shadow);
}

.theme-option svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icp-link {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.icp-link:hover {
    color: var(--accent);
}

.side-footer a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
}

.footer-icon {
    display: inline-grid;
    width: 22px;
    height: 22px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--icon-bg);
    color: var(--icon-color);
}

.side-footer a:hover {
    color: var(--accent);
}

.side-footer a:hover .footer-icon {
    background: var(--accent);
    color: #fff;
}

.content {
    width: 100%;
    min-height: 100vh;
    margin-left: 216px;
    background: var(--panel);
    padding: 28px 34px 46px;
}

.content-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    max-width: 1320px;
    margin: 0 auto 20px;
}

.view-switch {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 3px;
    box-shadow: 0 2px 10px rgba(31, 35, 40, 0.04);
}

.content-actions {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
}

.publish-note-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    padding: 0 16px;
    box-shadow: 0 6px 16px rgba(160, 0, 0, 0.14);
}

.publish-note-button:hover {
    background: var(--accent-deep);
}

.publish-note-button svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
}

.view-switch::before {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc(50% - 3px);
    border-radius: 6px;
    background: var(--accent);
    content: "";
    transform: translateX(0);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.view-switch[data-active-view="list"]::before {
    transform: translateX(100%);
}

.view-switch-button {
    position: relative;
    z-index: 1;
    min-width: 68px;
    min-height: 34px;
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    transition: color 0.2s ease;
}

.view-switch-button.is-active {
    color: #fff;
}

.view-switch-button:not(.is-active):hover {
    color: var(--accent);
}

.content-head h1,
.info-panel h1 {
    margin: 4px 0 8px;
    font-size: 30px;
    line-height: 1.18;
}

.content-head p,
.info-panel p {
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
}

.eyebrow {
    color: var(--accent) !important;
    font-size: 13px;
    font-weight: 800;
}

.category-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    gap: 10px;
    max-width: 1320px;
    margin: 0 auto 18px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    padding: 10px 0 14px;
    backdrop-filter: blur(12px);
}

.category-pill {
    flex: 0 0 auto;
    min-width: 64px;
    min-height: 36px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    padding: 0 16px;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(31, 35, 40, 0.04);
}

.category-pill:hover,
.category-pill.is-active {
    border-color: rgba(160, 0, 0, 0.3);
    background: var(--accent);
    color: #fff;
}

.feed-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: 8px;
    align-items: start;
    gap: 18px;
    max-width: 1320px;
    margin: 0 auto;
}

.feed-card {
    grid-row-end: span var(--masonry-span, 1);
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 4px 18px rgba(31, 35, 40, 0.05);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feed-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.feed-card.is-hidden {
    display: none;
}

.my-notes-view {
    display: none;
}

.my-notes-view.is-active {
    display: block;
}

.note-table-wrap {
    max-width: 1320px;
    margin: 0 auto;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 4px 18px rgba(31, 35, 40, 0.05);
}

.note-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}

.note-table th,
.note-table td {
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
    color: var(--text);
    font-size: 14px;
    text-align: left;
    vertical-align: middle;
}

.note-table th {
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.note-table-row:last-child td {
    border-bottom: 0;
}

.note-table-row:hover td {
    background: rgba(160, 0, 0, 0.035);
}

.note-table-row.is-hidden {
    display: none;
}

.category-stack {
    display: grid;
    gap: 4px;
    min-width: 96px;
}

.category-stack strong {
    color: var(--text);
    font-size: 14px;
    line-height: 1.35;
}

.category-stack span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.note-thumb {
    display: grid;
    width: 100%;
    grid-template-columns: 58px minmax(160px, 1fr);
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-align: left;
}

.product-thumb-button {
    background: transparent;
    padding: 0;
}

.note-thumb span:last-child {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.35;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.note-thumb-media {
    position: relative;
    display: block;
    width: 58px;
    height: 58px;
    overflow: hidden;
    border-radius: 6px;
    background: var(--surface-muted);
}

.note-thumb-media img,
.note-thumb-media video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.note-thumb-media .play-button {
    width: 26px;
    height: 26px;
}

.note-thumb-media .play-button::before {
    margin-left: 3px;
    border-top-width: 6px;
    border-bottom-width: 6px;
    border-left-width: 9px;
}

.note-status-badge {
    display: inline-flex;
    width: fit-content;
    min-height: 24px;
    align-items: center;
    border-radius: 999px;
    background: var(--ghost-bg);
    color: #5f6874;
    font-size: 12px;
    font-weight: 800;
    padding: 3px 9px;
}

.note-status-badge.is-draft {
    background: var(--accent-soft);
    color: var(--accent);
}

.card-status-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(31, 35, 40, 0.12);
}

.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.table-action {
    display: inline-flex;
    min-width: 56px;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.table-action.is-danger {
    background: var(--ghost-bg);
    color: #7a2222;
}

.table-action.is-danger:hover {
    background: rgba(160, 0, 0, 0.1);
    color: var(--accent);
}

.table-action:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.note-pagination {
    display: flex;
    max-width: 1320px;
    justify-content: flex-end;
    gap: 8px;
    margin: 14px auto 0;
}

.note-pagination button {
    min-width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    padding: 0 10px;
}

.note-pagination button.is-active,
.note-pagination button:hover:not(:disabled) {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.note-pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.empty-state {
    display: none;
    padding: 42px 20px;
    color: var(--muted);
    text-align: center;
}

.empty-state.is-visible {
    display: block;
}

.card-media {
    position: relative;
    overflow: hidden;
    background: var(--surface-muted);
}

.card-image {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    background: var(--surface-muted);
}

.card-video {
    height: auto;
    border: 0;
    outline: 0;
    background: #111;
    object-fit: cover;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.58);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
    transform: translate(-50%, -50%);
}

.play-button::before {
    display: block;
    width: 0;
    height: 0;
    margin-left: 4px;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 15px solid #fff;
    content: "";
}

.feed-card:nth-child(2n) .card-image {
    aspect-ratio: 1 / 1;
}

.feed-card:nth-child(3n) .card-image {
    aspect-ratio: 5 / 6;
}

.card-body {
    padding: 12px 12px 13px;
}

.card-body h2 {
    display: -webkit-box;
    min-height: 42px;
    margin: 0 0 12px;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.42;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.card-info-row {
    display: flex;
    min-height: 20px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.card-publish-time {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.my-note-card .card-meta {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.my-note-card-meta {
    flex: 0 0 auto;
    justify-content: flex-end;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.card-edit-link,
.card-delete-button {
    display: inline-flex;
    min-width: 62px;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 800;
}

.card-edit-link {
    background: var(--accent);
    color: #fff;
}

.card-delete-button {
    background: var(--ghost-bg);
    color: #7a2222;
}

.card-delete-button:hover {
    background: rgba(160, 0, 0, 0.1);
    color: var(--accent);
}

.card-delete-button:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.author {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
}

.author img {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: cover;
}

.author span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.likes {
    flex: 0 0 auto;
    color: var(--accent-deep);
    font-weight: 700;
}

.mobile-tabbar {
    display: none;
}

.mobile-topbar,
.mobile-menu-close,
.mobile-menu-mask {
    display: none;
}

.modal-mask {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(17, 19, 22, 0.42);
    padding: 20px;
}

.modal-mask.is-open {
    display: flex;
}

.app-dialog-mask {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(17, 19, 22, 0.42);
    padding: 20px;
}

.app-dialog-mask.is-open {
    display: flex;
}

.app-dialog-panel {
    position: relative;
    width: min(360px, 100%);
    border-radius: 8px;
    background: var(--surface);
    padding: 26px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

.app-dialog-panel h2 {
    margin: 0 34px 10px 0;
    color: var(--text);
    font-size: 20px;
    line-height: 1.35;
}

.app-dialog-panel p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.75;
}

.app-dialog-close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    color: var(--muted);
    font-size: 0;
    line-height: 1;
}

.app-dialog-close::before,
.app-dialog-close::after {
    position: absolute;
    width: 14px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    content: "";
}

.app-dialog-close::before {
    transform: rotate(45deg);
}

.app-dialog-close::after {
    transform: rotate(-45deg);
}

.app-dialog-close:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.app-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.app-dialog-button {
    min-width: 76px;
    min-height: 38px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
}

.app-dialog-button.is-ghost {
    background: var(--ghost-bg);
    color: var(--text);
}

.app-dialog-button.is-ghost:hover {
    background: var(--ghost-hover);
}

.app-dialog-button.is-primary {
    background: var(--accent);
    color: #fff;
}

.app-dialog-button.is-primary:hover {
    background: var(--accent-deep);
}

.modal-panel {
    position: relative;
    width: min(420px, 100%);
    border-radius: 8px;
    background: var(--surface);
    padding: 28px;
    box-shadow: var(--shadow);
}

.login-panel {
    width: min(760px, calc(100vw - 32px));
    padding: 0;
    overflow: hidden;
}

.login-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    min-height: 430px;
}

.login-code-card {
    display: grid;
    place-items: center;
    border-right: 1px solid var(--line);
    background: var(--surface-muted);
    padding: 34px;
}

.login-code-card img {
    display: block;
    width: min(228px, 100%);
    aspect-ratio: 1;
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
}

.login-method-card {
    min-width: 0;
    padding: 34px;
}

.modal-panel h2 {
    margin: 4px 0 10px;
    font-size: 22px;
}

.modal-panel p {
    color: var(--muted);
    line-height: 1.7;
}

.login-tabs {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.login-tabs > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.login-tab-labels {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
    padding: 4px;
}

.login-tab-labels::before {
    content: "";
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc((100% - 14px) / 2);
    border-radius: 6px;
    background: var(--accent);
    transition: transform 0.24s ease;
}

.login-tab-labels label {
    position: relative;
    z-index: 1;
    display: grid;
    min-height: 38px;
    place-items: center;
    border-radius: 6px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: color 0.2s ease;
}

#login-tab-wechat:checked ~ .login-tab-labels::before {
    transform: translateX(0);
}

#login-tab-sms:checked ~ .login-tab-labels::before {
    transform: translateX(calc(100% + 6px));
}

#login-tab-wechat:checked ~ .login-tab-labels label[for="login-tab-wechat"],
#login-tab-sms:checked ~ .login-tab-labels label[for="login-tab-sms"] {
    color: #fff;
}

.login-tab-panels {
    min-height: 330px;
}

.login-tab-panel {
    display: none;
}

#login-tab-wechat:checked ~ .login-tab-panels .is-wechat,
#login-tab-sms:checked ~ .login-tab-panels .is-sms {
    display: grid;
}

.login-tab-panel.is-wechat {
    justify-items: center;
    gap: 12px;
    padding-top: 8px;
    text-align: center;
}

.login-wechat-frame {
    display: block;
    width: min(300px, 100%);
    height: 300px;
    border: 0;
    border-radius: 8px;
    background: #fff;
}

.login-form {
    display: grid;
    gap: 14px;
}

.login-tab-panels .login-form.login-tab-panel {
    display: none;
}

#login-tab-sms:checked ~ .login-tab-panels .login-form.is-sms {
    display: grid;
}

.login-field {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.login-field input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    outline: none;
    padding: 0 12px;
}

.login-field input:focus {
    border-color: rgba(160, 0, 0, 0.45);
    box-shadow: 0 0 0 3px rgba(160, 0, 0, 0.08);
}

.code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 10px;
}

.code-button {
    height: 44px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 14px;
    font-weight: 800;
}

.code-button:disabled {
    cursor: not-allowed;
    background: var(--ghost-bg);
    color: var(--muted);
}

.login-tip {
    min-height: 20px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    color: var(--muted);
    font-size: 0;
}

.modal-close::before,
.modal-close::after {
    position: absolute;
    width: 15px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    content: "";
}

.modal-close::before {
    transform: rotate(45deg);
}

.modal-close::after {
    transform: rotate(-45deg);
}

.modal-close:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.primary-action,
.primary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
}

.primary-action {
    width: 100%;
    margin-top: 12px;
}

.primary-link {
    margin-top: 24px;
    padding: 0 18px;
}

.info-content {
    display: flex;
    align-items: center;
    min-height: 100vh;
}

.info-panel {
    width: min(720px, 100%);
    margin: 0 auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 40px;
    box-shadow: 0 8px 28px rgba(31, 35, 40, 0.06);
}

.info-panel .lead {
    margin-bottom: 22px;
    color: #3a4048;
    font-size: 17px;
}

.info-panel p + p {
    margin-top: 10px;
}

.rich-content {
    color: #3a4048;
    line-height: 1.8;
}

.rich-content p {
    margin: 0 0 12px;
}

.rich-content img,
.rich-content video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.has-overlay {
    overflow: hidden;
}

.note-detail-mask,
.image-preview-mask {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(20, 20, 22, 0.52);
    padding: 16px;
}

.note-detail-mask.is-open,
.image-preview-mask.is-open {
    display: flex;
}

.note-detail-panel {
    position: relative;
    display: grid;
    width: min(1280px, calc(100vw - 32px));
    height: min(780px, calc(100vh - 32px));
    grid-template-columns: minmax(0, 1fr) 420px;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
    color: #2d333b;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.22);
}

.note-detail-panel.is-image-detail {
    width: min(1180px, calc(100vw - 32px));
}

.note-detail-close,
.image-preview-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 4;
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.86);
    color: #2d333b;
    font-size: 0;
    line-height: 1;
}

.note-detail-close::before,
.note-detail-close::after,
.image-preview-close::before,
.image-preview-close::after {
    position: absolute;
    width: 15px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    content: "";
}

.note-detail-close::before,
.image-preview-close::before {
    transform: rotate(45deg);
}

.note-detail-close::after,
.image-preview-close::after {
    transform: rotate(-45deg);
}

.note-detail-close:hover,
.image-preview-close:hover {
    background: #fff;
    color: var(--accent);
}

.note-detail-media {
    position: relative;
    min-width: 0;
    min-height: 0;
    background: #111;
}

.detail-video {
    display: block;
    width: 100%;
    height: 100%;
    background: #000;
    object-fit: contain;
}

.detail-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.detail-carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.28s ease;
    will-change: transform;
}

.detail-slide {
    display: flex;
    min-width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #111;
    cursor: zoom-in;
}

.detail-slide img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.detail-counter {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.52);
    color: #fff;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.detail-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.48);
    color: #1f2328;
    opacity: 0;
    transform: translateY(-50%);
    transition: opacity 0.2s ease, background 0.2s ease;
}

.detail-nav::before,
.image-preview-nav::before {
    display: block;
    width: 11px;
    height: 11px;
    border-top: 3px solid currentColor;
    border-right: 3px solid currentColor;
    content: "";
}

.detail-prev::before,
.image-preview-prev::before {
    margin-left: 4px;
    transform: rotate(-135deg);
}

.detail-next::before,
.image-preview-next::before {
    margin-right: 4px;
    transform: rotate(45deg);
}

.detail-carousel:hover .detail-nav {
    opacity: 1;
}

.detail-carousel:hover .detail-counter {
    opacity: 1;
}

.detail-prev {
    left: 18px;
}

.detail-next {
    right: 18px;
}

.detail-nav:hover {
    background: rgba(255, 255, 255, 0.68);
}

.detail-dots {
    position: absolute;
    right: 0;
    bottom: 18px;
    left: 0;
    z-index: 2;
    display: flex;
    justify-content: center;
    gap: 7px;
}

.detail-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.48);
    padding: 0;
}

.detail-dot.is-active {
    background: #fff;
}

.note-detail-side {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-width: 0;
    border-left: 1px solid #e5e7eb;
    background: #fff;
}

.note-detail-author {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #e5e7eb;
    padding: 26px 28px 20px;
}

.note-detail-author img {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: cover;
}

.note-detail-author strong,
.note-detail-author span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-detail-author strong {
    color: #2d333b;
    font-size: 16px;
}

.note-detail-author span {
    margin-top: 4px;
    color: #8a94a3;
    font-size: 13px;
}

.note-detail-content {
    min-height: 0;
    overflow-y: auto;
    padding: 24px 28px;
}

.note-detail-content h2 {
    margin: 0 0 14px;
    color: #2d333b;
    font-size: 20px;
    line-height: 1.38;
}

.note-detail-text {
    margin: 0 0 18px;
    color: #3a4048;
    line-height: 1.75;
    white-space: pre-wrap;
}

.note-detail-content time {
    color: #8a94a3;
    font-size: 13px;
}

.note-detail-params {
    display: grid;
    gap: 10px;
    margin: 0 0 18px;
}

.note-detail-params[hidden] {
    display: none;
}

.note-detail-params h3 {
    margin: 0;
    color: #2d333b;
    font-size: 15px;
    font-weight: 900;
}

.note-detail-params dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.note-detail-params div {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border-radius: 8px;
    background: rgba(246, 247, 249, 0.82);
    padding: 8px 10px;
}

.note-detail-params dt,
.note-detail-params dd {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.note-detail-params dt {
    color: #8a94a3;
}

.note-detail-params dd {
    color: #2d333b;
    font-weight: 700;
}

.note-detail-stats {
    display: flex;
    justify-content: flex-end;
    gap: 22px;
    border-top: 1px solid #e5e7eb;
    padding: 18px 28px;
    color: #31363d;
    font-size: 16px;
}

.note-detail-stats span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.image-preview-mask {
    z-index: 50;
    background: rgba(0, 0, 0, 0.82);
}

.image-preview-mask img {
    display: block;
    max-width: min(96vw, 1440px);
    max-height: 92vh;
    object-fit: contain;
}

.image-preview-counter {
    position: absolute;
    top: 18px;
    left: 50%;
    z-index: 2;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    padding: 6px 13px;
    font-size: 14px;
    font-weight: 700;
    transform: translateX(-50%);
}

.image-preview-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    transform: translateY(-50%);
}

.image-preview-nav:hover {
    background: rgba(255, 255, 255, 0.24);
}

.image-preview-prev {
    left: 24px;
}

.image-preview-next {
    right: 24px;
}

.note-editor-content {
    padding: 32px 34px 56px;
}

.note-editor {
    display: grid;
    width: min(1180px, 100%);
    min-height: calc(100vh - 88px);
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    margin: 0 auto;
    color: var(--text);
}

.note-editor-head,
.note-editor-main,
.note-choice-section,
.note-topic-section,
.note-editor-actions {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 8px 26px rgba(31, 35, 40, 0.05);
}

.note-editor-head {
    grid-column: 1 / -1;
    display: grid;
    min-height: 74px;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
    padding: 14px 22px;
}

.note-editor-head h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 900;
    text-align: center;
}

.note-editor-back {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    color: var(--text);
}

.note-editor-back:hover {
    background: var(--surface-muted);
}

.note-editor-back svg,
.note-topic-section header svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.note-editor-main {
    grid-row: 2 / span 2;
    min-height: 640px;
    padding: 28px;
}

.upload-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 34px;
}

.upload-tile,
.upload-preview {
    position: relative;
    width: 112px;
    height: 112px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--surface-muted);
}

.upload-tile {
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    cursor: pointer;
}

.upload-tile:hover {
    border-color: rgba(160, 0, 0, 0.26);
    background: var(--accent-soft);
}

.upload-tile.is-hidden {
    display: none;
}

.upload-tile input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-tile span::before,
.upload-tile span::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 2px;
    border-radius: 999px;
    background: #d7d7d7;
    content: "";
    transform: translate(-50%, -50%);
}

.upload-tile span::after {
    width: 2px;
    height: 34px;
}

.upload-preview img,
.upload-preview video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.upload-preview.is-draggable {
    cursor: grab;
}

.upload-preview.is-draggable:active {
    cursor: grabbing;
}

.upload-preview.is-dragging {
    opacity: 0.58;
}

.upload-preview.is-drop-target {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.upload-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.58);
    color: #fff;
    font-size: 0;
    line-height: 1;
    padding: 0;
}

.upload-remove:hover {
    background: var(--accent);
}

.upload-remove::before,
.upload-remove::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 11px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    content: "";
}

.upload-remove::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.upload-remove::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.upload-type-badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    pointer-events: none;
}

.upload-status {
    position: absolute;
    left: 8px;
    bottom: 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.42);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    pointer-events: none;
}

.note-title-input,
.note-topic-input,
.note-body-input {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    outline: none;
    padding: 0;
}

.note-title-input,
.note-topic-input {
    height: 58px;
    border-bottom: 1px solid var(--line);
    font-size: 20px;
}

.note-body-input {
    min-height: 320px;
    margin: 22px 0 4px;
    resize: vertical;
    font-size: 18px;
    line-height: 1.75;
}

.note-title-input::placeholder,
.note-topic-input::placeholder,
.note-body-input::placeholder {
    color: #9b9b9b;
}

.note-choice-section,
.note-topic-section {
    padding: 24px;
}

.note-choice-section h2,
.note-topic-section h2 {
    margin: 0;
    color: var(--text);
    font-size: 20px;
    font-weight: 900;
}

.circle-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.circle-tab {
    position: relative;
    flex: 0 0 auto;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

.circle-tab span {
    display: block;
    overflow: hidden;
    max-width: 150px;
    min-height: 38px;
    padding: 9px 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.circle-tab input,
.topic-row input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.circle-tab:hover {
    border-color: rgba(160, 0, 0, 0.26);
    color: var(--accent);
}

.circle-tab.is-active,
.circle-tab:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.note-topic-section header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.note-topic-section header button {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    color: var(--text);
}

.note-topic-section header button:hover {
    background: var(--surface-muted);
    color: var(--accent);
}

.topic-list {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.topic-row {
    position: relative;
    display: grid;
    min-height: 48px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    padding: 0 12px;
    cursor: pointer;
}

.topic-row:hover {
    border-color: rgba(160, 0, 0, 0.22);
    background: var(--accent-soft);
}

.topic-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topic-row em {
    color: #a5a5a5;
    font-style: normal;
    font-size: 13px;
}

.topic-row:has(input:checked) {
    border-color: rgba(160, 0, 0, 0.36);
    background: var(--accent-soft);
}

.topic-row:has(input:checked) span {
    color: var(--accent);
    font-weight: 800;
}

.note-editor-actions {
    position: sticky;
    bottom: 18px;
    z-index: 12;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    padding: 18px;
}

.note-action-tools {
    display: none;
    align-items: center;
    gap: 14px;
}

.note-action-buttons {
    display: flex;
    align-items: center;
    gap: 14px;
}

.voice-input-button {
    display: inline-flex;
    min-width: 150px;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid rgba(160, 0, 0, 0.18);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 242, 237, 0.86));
    color: var(--accent);
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(160, 0, 0, 0.08);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.voice-input-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.voice-input-button:hover {
    border-color: rgba(160, 0, 0, 0.32);
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.voice-input-button.is-recording {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 5px rgba(160, 0, 0, 0.1);
    animation: voiceRecordingPulse 1.2s ease-in-out infinite;
}

.voice-input-button.is-processing {
    opacity: 0.78;
    pointer-events: none;
}

.product-voice-layer {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(17, 19, 22, 0.42);
    padding: 20px;
}

.product-voice-layer.is-open {
    display: flex;
}

.product-voice-panel {
    display: grid;
    width: min(320px, 100%);
    justify-items: center;
    gap: 12px;
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

.product-voice-panel span {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(160, 0, 0, 0.16);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: productVoiceSpin 0.8s linear infinite;
}

.product-voice-panel strong {
    font-size: 18px;
    font-weight: 900;
}

.product-voice-panel p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

@keyframes voiceRecordingPulse {
    0%,
    100% {
        box-shadow: 0 0 0 4px rgba(160, 0, 0, 0.08);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(160, 0, 0, 0.16);
    }
}

@keyframes productVoiceSpin {
    to {
        transform: rotate(360deg);
    }
}

.draft-button,
.publish-button {
    min-width: 150px;
    min-height: 46px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 800;
}

.draft-button {
    background: var(--ghost-bg);
    color: var(--muted);
}

.publish-button {
    background: var(--accent);
    color: #fff;
}

.publish-button:hover {
    background: var(--accent-deep);
}

.product-editor-page .note-editor-actions > .publish-button {
    width: 180px;
}

.product-editor {
    grid-template-columns: minmax(0, 1fr) 420px;
}

.product-editor-main {
    display: grid;
    gap: 24px;
}

.product-block {
    display: grid;
    gap: 14px;
}

.product-block-head,
.product-param-section header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.product-block-head h2,
.product-price-card h2 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    font-weight: 900;
}

.product-block-head span,
.product-param-section header span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.product-upload-grid {
    margin-bottom: 0;
}

.product-video-tile {
    width: 180px;
    height: 112px;
}

.product-body-input {
    min-height: 220px;
}

.product-price-card {
    display: grid;
    gap: 18px;
    border-top: 1px solid var(--line);
    padding-top: 24px;
}

.sale-type-tabs > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sale-type-labels {
    position: relative;
    display: inline-grid;
    grid-template-columns: repeat(2, 86px);
    gap: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
    padding: 3px;
}

.sale-type-labels label {
    display: grid;
    min-height: 36px;
    place-items: center;
    border-radius: 6px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

#sale-type-auction:checked ~ .sale-type-labels label[for="sale-type-auction"],
#sale-type-bargain:checked ~ .sale-type-labels label[for="sale-type-bargain"] {
    background: var(--accent);
    color: #fff;
}

.sale-type-panels {
    margin-top: 16px;
}

.sale-type-panel {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

#sale-type-auction:checked ~ .sale-type-panels .is-auction,
#sale-type-bargain:checked ~ .sale-type-panels .is-bargain {
    display: grid;
}

.product-field,
.product-param-row {
    display: grid;
    gap: 8px;
}

.product-field span,
.product-param-row strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
}

.product-field input,
.product-param-row > input,
.product-param-values > input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    outline: none;
    padding: 0 12px;
}

.product-field input:focus,
.product-param-row > input:focus,
.product-param-values > input:focus {
    border-color: rgba(160, 0, 0, 0.42);
}

.product-field input[type="number"],
.product-param-row > input[type="number"],
.product-param-values > input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

.product-field input[type="number"]::-webkit-outer-spin-button,
.product-field input[type="number"]::-webkit-inner-spin-button,
.product-param-row > input[type="number"]::-webkit-outer-spin-button,
.product-param-row > input[type="number"]::-webkit-inner-spin-button,
.product-param-values > input[type="number"]::-webkit-outer-spin-button,
.product-param-values > input[type="number"]::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.product-category-section,
.product-param-section {
    align-self: start;
}

.product-category-board {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.product-category-column {
    display: grid;
    max-height: 260px;
    gap: 8px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
    padding: 12px;
}

.product-category-list {
    display: grid;
    gap: 8px;
}

.product-empty-hint {
    margin: 0;
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.6;
    padding: 12px;
}

.product-category-column h3,
.product-param-group h3 {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
}

.product-option-row {
    display: grid;
    min-height: 40px;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    border-radius: 7px;
    background: var(--surface);
    color: var(--text);
    padding: 8px 10px;
    cursor: pointer;
}

.product-option-row input,
.product-param-values input[type="radio"] {
    accent-color: var(--accent);
}

.product-option-row span {
    overflow: hidden;
    font-size: 14px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-option-row em {
    grid-column: 2;
    overflow: hidden;
    color: var(--muted);
    font-style: normal;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-option-row:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.product-option-row.is-voice-selected,
.product-option-row:has(input:checked) {
    background: var(--accent-soft);
    color: var(--accent);
}

.product-option-row.is-voice-selected span,
.product-option-row:has(input:checked) span {
    font-weight: 900;
}

.product-param-list {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.product-param-group {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
    padding: 14px;
}

.product-param-values {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.product-param-values label {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    padding: 0 12px;
    cursor: pointer;
}

.product-param-values label:hover {
    border-color: rgba(160, 0, 0, 0.32);
    color: var(--accent);
}

@media (max-width: 1180px) {
    .feed-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .note-detail-panel {
        grid-template-columns: minmax(0, 1fr) 360px;
    }

    .note-detail-panel.is-image-detail {
        width: min(1080px, calc(100vw - 32px));
    }
}

@media (max-width: 860px) {
    .mobile-topbar {
        position: fixed;
        inset: 0 0 auto;
        z-index: 45;
        display: grid;
        min-height: 58px;
        grid-template-columns: 48px minmax(0, 1fr) 48px;
        align-items: center;
        border-bottom: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.94);
        padding: env(safe-area-inset-top) 14px 0;
        backdrop-filter: blur(14px);
    }

    :root[data-theme="dark"] .mobile-topbar {
        background: rgba(18, 21, 27, 0.94);
    }

    @media (prefers-color-scheme: dark) {
        :root:not([data-theme="light"]) .mobile-topbar {
            background: rgba(18, 21, 27, 0.94);
        }
    }

    .mobile-menu-toggle {
        display: inline-flex;
        width: 42px;
        height: 42px;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 5px;
        border-radius: 8px;
        color: var(--text);
    }

    .mobile-menu-toggle span {
        display: block;
        width: 22px;
        height: 2px;
        border-radius: 999px;
        background: currentColor;
    }

    .mobile-menu-toggle:hover {
        background: var(--surface-muted);
        color: var(--accent);
    }

    .mobile-topbar-brand {
        display: flex;
        min-width: 0;
        justify-content: center;
    }

    .mobile-topbar-brand img {
        width: 118px;
        height: 40px;
        object-fit: contain;
    }

    .side-nav {
        z-index: 60;
        display: flex;
        width: clamp(220px, 60vw, 286px);
        transform: translateX(-105%);
        box-shadow: 18px 0 42px rgba(31, 35, 40, 0.16);
        transition: transform 0.24s ease;
        will-change: transform;
        overflow-y: auto;
        padding: calc(18px + env(safe-area-inset-top)) 18px 20px;
    }

    .side-nav.is-open {
        transform: translateX(0);
    }

    .mobile-menu-close {
        position: absolute;
        top: calc(14px + env(safe-area-inset-top));
        right: 14px;
        display: inline-flex;
        width: 34px;
        height: 34px;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        color: var(--muted);
    }

    .mobile-menu-close::before,
    .mobile-menu-close::after {
        position: absolute;
        width: 15px;
        height: 2px;
        border-radius: 999px;
        background: currentColor;
        content: "";
    }

    .mobile-menu-close::before {
        transform: rotate(45deg);
    }

    .mobile-menu-close::after {
        transform: rotate(-45deg);
    }

    .mobile-menu-close:hover {
        background: var(--surface-muted);
        color: var(--accent);
    }

    .mobile-menu-mask {
        position: fixed;
        inset: 0;
        z-index: 55;
        display: block;
        background: rgba(17, 19, 22, 0.42);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .side-nav.is-open + .mobile-menu-mask {
        opacity: 1;
        pointer-events: auto;
    }

    body.has-mobile-menu {
        overflow: hidden;
    }

    .app-shell {
        display: block;
    }

    .content {
        margin-left: 0;
        padding: calc(74px + env(safe-area-inset-top)) 14px 28px;
    }

    html,
    body {
        min-width: 0;
        overflow-x: hidden;
    }

    .content-head {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 12px;
    }

    .view-switch {
        display: none;
    }

    .content-actions {
        width: 100%;
    }

    .publish-note-button {
        width: 100%;
    }

    .login-panel {
        width: min(100%, calc(100vw - 24px));
        max-height: calc(100vh - 24px);
        overflow-y: auto;
    }

    .login-layout {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .login-code-card {
        display: none;
    }

    .login-tab-labels,
    .login-tab-panel.is-wechat {
        display: none;
    }

    .login-method-card {
        padding: 24px;
    }

    .login-tab-panels {
        min-height: 0;
    }

    .login-tab-panel.is-sms {
        display: grid !important;
    }

    .my-notes-view[data-note-view="card"] {
        display: block !important;
    }

    .my-notes-view[data-note-view="list"] {
        display: none !important;
    }

    .content-head h1,
    .info-panel h1 {
        font-size: 24px;
    }

    .category-bar {
        width: auto;
        max-width: none;
        margin-left: -14px;
        margin-right: -14px;
        margin-bottom: 14px;
        padding: 10px 14px 12px;
        scroll-padding-inline: 14px;
    }

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

    .card-body {
        padding: 10px;
    }

    .card-body h2 {
        min-height: 38px;
        font-size: 14px;
    }

    .card-meta {
        font-size: 12px;
    }

    .mobile-tabbar {
        display: none;
    }

    .tab-item {
        display: grid;
        min-height: 52px;
        place-items: center;
        gap: 3px;
        color: var(--muted);
        font-size: 12px;
        font-weight: 700;
    }

    .tab-item span {
        width: 26px;
        height: 26px;
        background: #f0efeb;
        color: #3b4048;
        font-size: 12px;
    }

    .tab-item strong {
        font-size: 12px;
    }

    .tab-item.is-active {
        color: var(--accent);
    }

    .tab-item.is-active span {
        background: var(--accent);
        color: #fff;
    }

    .info-content {
        align-items: flex-start;
        min-height: auto;
    }

    .info-panel {
        padding: 28px 20px;
    }

    .note-detail-mask {
        padding: 0;
    }

    .note-detail-panel {
        width: 100vw;
        height: 100vh;
        grid-template-columns: 1fr;
        grid-template-rows: minmax(300px, 56vh) minmax(0, 1fr);
        border-radius: 0;
    }

    .note-detail-panel.is-image-detail {
        width: 100vw;
    }

    .note-detail-side {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .note-detail-author {
        padding: 18px 18px 14px;
    }

    .note-detail-content {
        padding: 18px;
    }

    .note-detail-stats {
        padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
    }

    .detail-nav {
        opacity: 1;
    }

    .note-editor-page .mobile-tabbar {
        display: none;
    }

    .note-editor-page .mobile-topbar {
        display: none;
    }

    .content.note-editor-content {
        overflow-x: hidden;
        padding: 0;
    }

    .note-editor {
        display: grid;
        width: 100%;
        max-width: 100vw;
        min-height: 100vh;
        grid-template-columns: 1fr;
        gap: 0;
        box-shadow: none;
    }

    .note-editor-head {
        position: sticky;
        top: 0;
        z-index: 12;
        border-width: 0 0 1px;
        border-radius: 0;
        box-shadow: none;
        padding: 0 18px;
    }

    .note-editor-head h1 {
        font-size: 20px;
    }

    .note-editor-main {
        grid-row: auto;
        min-height: 560px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 20px 20px 24px;
    }

    .product-editor {
        grid-template-columns: 1fr;
    }

    .product-editor-main {
        gap: 20px;
    }

    .product-editor-page .content.note-editor-content {
        padding-bottom: calc(92px + env(safe-area-inset-bottom));
    }

    .product-video-tile {
        width: 132px;
        height: 82px;
    }

    .sale-type-panel {
        grid-template-columns: 1fr;
    }

    .product-category-column {
        max-height: 220px;
    }

    .upload-grid {
        gap: 10px;
    }

    .upload-tile,
    .upload-preview {
        width: 82px;
        height: 82px;
        border-radius: 12px;
    }

    .note-title-input,
    .note-topic-input {
        height: 52px;
        border-bottom: 0;
        font-size: 19px;
    }

    .note-body-input {
        min-height: 260px;
        margin: 0;
        font-size: 19px;
    }

    .note-choice-section,
    .note-topic-section {
        min-width: 0;
        overflow: hidden;
        border-width: 8px 0 0;
        border-color: #f7f7f7;
        border-radius: 0;
        box-shadow: none;
        padding: 22px 20px;
    }

    .note-choice-section h2,
    .note-topic-section h2 {
        font-size: 21px;
    }

    .circle-tabs {
        flex-wrap: nowrap;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        gap: 28px;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin-top: 26px;
        padding-bottom: 2px;
    }

    .circle-tabs::-webkit-scrollbar {
        display: none;
    }

    .circle-tab {
        flex: 0 0 auto;
        border: 0;
        background: transparent;
        color: #111;
        font-size: 18px;
    }

    .circle-tab span {
        max-width: 46vw;
        min-height: auto;
        padding: 0;
        white-space: nowrap;
    }

    .circle-tab.is-active,
    .circle-tab:has(input:checked) {
        background: transparent;
        color: var(--accent);
    }

    .topic-list {
        gap: 0;
    }

    .topic-row {
        min-height: 46px;
        border-width: 0 0 1px;
        border-radius: 0;
        padding: 0;
        font-size: 16px;
    }

    .topic-row:hover,
    .topic-row:has(input:checked) {
        background: #fff;
    }

    .note-editor-actions {
        bottom: 0;
        display: grid;
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr);
        gap: 14px;
        width: 100%;
        max-width: 100vw;
        border-width: 1px 0 0;
        border-radius: 0;
        box-shadow: none;
        padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
    }

    .note-action-tools,
    .note-action-buttons {
        min-width: 0;
    }

    .note-action-tools {
        display: flex;
    }

    .note-action-buttons {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
        gap: 14px;
        width: 100%;
    }

    .voice-input-button {
        width: 100%;
        min-width: 0;
        min-height: 54px;
        font-size: 17px;
    }

    .voice-input-button span {
        white-space: nowrap;
    }

    .draft-button,
    .publish-button {
        min-width: 0;
        min-height: 54px;
        overflow: hidden;
        padding-inline: 8px;
        font-size: 19px;
        white-space: nowrap;
    }

    .product-editor-page .note-editor-actions > .publish-button {
        width: 100%;
    }

    .note-editor-actions.is-single-action {
        grid-template-columns: minmax(0, 1fr);
    }

    .product-editor-page .note-editor-actions {
        position: fixed;
        right: 0;
        left: 0;
        z-index: 30;
        background: var(--surface);
        box-shadow: 0 -8px 24px rgba(31, 35, 40, 0.08);
    }
}

@media (max-width: 420px) {
    .content {
        padding-inline: 10px;
    }

    .note-editor-actions {
        gap: 10px;
        grid-template-columns: 54px minmax(0, 1fr);
        padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    }

    .note-editor-actions.is-single-action {
        grid-template-columns: minmax(0, 1fr);
    }

    .note-action-buttons {
        gap: 10px;
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
    }

    .voice-input-button {
        width: 54px;
        padding: 0;
    }

    .draft-button,
    .publish-button {
        min-height: 52px;
        padding-inline: 6px;
        font-size: 17px;
    }

    .voice-input-button span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .category-bar {
        margin-left: -10px;
        margin-right: -10px;
        padding-left: 10px;
        padding-right: 10px;
        scroll-padding-inline: 10px;
    }

    .feed-grid {
        gap: 10px;
    }

    .category-pill {
        min-width: max-content;
        padding: 0 13px;
    }

    .author img {
        width: 22px;
        height: 22px;
    }
}
