:root {
    --primary: #0b5eff;
    --primary-soft: #e8f1ff;
    --primary-line: #b8d1ff;
    --page: #eff1f8;
    --surface: #ffffff;
    --text: #182946;
    --muted: #6c7688;
    --line: #e5e8ef;
    --fill: #f6f8fb;
    --warning: #ff710c;
    --success: #00a870;
    --success-soft: #e8f7f1;
}

* { box-sizing: border-box; }

html,
body {
    height: 100%;
    margin: 0;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button {
    font: inherit;
}

#prototypeCenter {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--page);
}

#prototypeCenter.has-auto-height-preview {
    align-items: flex-start;
    height: auto;
    min-height: 100vh;
    overflow: visible;
}

#prototypeCenter.has-auto-height-preview .side {
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
}

#prototypeCenter.has-auto-height-preview .main {
    align-self: stretch;
    height: auto;
    min-height: 100vh;
}

#prototypeCenter.has-auto-height-preview .preview,
#prototypeCenter.has-auto-height-preview .prototype-preview-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
}

#prototypeCenter.has-auto-height-preview .prototype-preview-shell iframe {
    min-height: 640px;
}

.side {
    width: 260px;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--line);
    transition: width .2s ease, min-width .2s ease;
}

.side.collapsed {
    width: 48px;
    min-width: 48px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 62px;
    padding: 0 14px;
    border-bottom: 1px solid var(--line);
}

.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--primary);
    font-weight: 700;
}

.brand-title {
    font-size: 15px;
    font-weight: 650;
}

.brand-subtitle {
    margin-top: 3px;
    font-size: 12px;
    color: var(--muted);
}

.icon-button {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.icon-button:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.brand .icon-button {
    margin-left: auto;
}

.search {
    padding: 10px 12px 6px;
    border-bottom: 1px solid var(--line);
}

.home-entry {
    width: calc(100% - 24px);
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 12px 4px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    font-weight: 650;
}

.home-entry:hover,
.home-entry.active {
    color: var(--primary);
    background: var(--primary-soft);
}

.home-entry i {
    font-size: 15px;
}

.tree {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0 12px;
}

.tree-node {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    line-height: 1.35;
}

.tree-node:hover {
    background: var(--fill);
}

.level-group { padding: 0 14px; }

.tree-node > i:first-child {
    width: 12px;
    flex-shrink: 0;
    color: var(--muted);
    font-size: 12px;
}

.tree-folder {
    flex-shrink: 0;
    color: #f0a020;
    font-size: 15px;
}

.prototype-item {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 8px 12px 8px 34px;
    border: 0;
    border-left: 3px solid transparent;
    color: #525f74;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.45;
}

.prototype-item:hover {
    background: var(--fill);
}

.prototype-item.active {
    border-left-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 500;
}

.prototype-item i {
    margin-top: 2px;
    color: currentColor;
    font-size: 14px;
    flex-shrink: 0;
}

.prototype-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-badge {
    flex-shrink: 0;
    margin-top: 1px;
    padding: 0 6px;
    border-radius: 9px;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    line-height: 16px;
}

.status-badge.is-waiting {
    color: #fff;
    background: var(--warning);
}

.status-badge.is-synced {
    color: var(--success);
    background: var(--success-soft);
}

.side-expand {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding-top: 16px;
    border: 0;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
}

.side-expand span {
    writing-mode: vertical-rl;
    color: var(--muted);
    font-weight: 650;
    letter-spacing: 3px;
}

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.preview {
    flex: 1;
    min-height: 0;
    margin-top: 0;
    overflow: hidden;
    background: var(--page);
}

.preview.home-preview {
    overflow: auto;
}

.home-page {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0 32px;
}

.home-header {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px;
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(24, 41, 70, 0.06);
}

.home-kicker {
    color: var(--primary);
    font-size: 13px;
    font-weight: 650;
}

.home-title-block h1 {
    margin: 8px 0 8px;
    font-size: 24px;
    line-height: 1.25;
    font-weight: 650;
    letter-spacing: 0;
}

.home-title-block p {
    max-width: 560px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.home-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(104px, 1fr));
    gap: 10px;
    min-width: 360px;
}

.home-stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 86px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--fill);
}

.home-stat span {
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.home-stat em {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.home-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 16px;
}

.home-section {
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(24, 41, 70, 0.05);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 0 18px;
    border-bottom: 1px solid var(--line);
}

.section-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 650;
}

.section-head span {
    color: var(--muted);
    font-size: 12px;
}

.release-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
}

.release-card:last-child {
    border-bottom: 0;
}

.release-date {
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

.release-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.release-title-row h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 650;
}

.release-body p {
    margin: 8px 0 10px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.release-body ul {
    margin: 0;
    padding-left: 18px;
    color: #525f74;
    font-size: 13px;
    line-height: 1.8;
}


.prototype-preview-shell {
    position: relative;
    width: 100%;
    height: 100%;
}

.prototype-actions {
    position: absolute;
    z-index: 5;
    top: 16px;
    right: 18px;
    display: flex;
    gap: 8px;
}

.prototype-document-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 13px;
    border: 1px solid #b8d1ff;
    border-radius: 8px;
    color: var(--primary);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 14px rgba(24, 41, 70, 0.08);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.prototype-document-link:hover {
    border-color: var(--primary);
    background: #eef4ff;
    box-shadow: 0 6px 18px rgba(11, 94, 255, 0.15);
}

.prototype-document-link.is-demo {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.prototype-document-link.is-demo:hover {
    background: var(--primary);
    opacity: 0.88;
}

.prototype-preview-shell iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

.empty {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.empty i {
    margin-bottom: 10px;
    font-size: 34px;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #d8dde8; border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 900px) {
    .side {
        width: 232px;
        min-width: 232px;
    }

    .home-header,
    .home-layout {
        grid-template-columns: 1fr;
        display: grid;
    }

    .home-stats {
        min-width: 0;
        grid-template-columns: 1fr;
    }

    .release-card {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}
