:root {
    --bg: #0b1220;
    --panel: #0f1a33;
    --panel2: #0c162c;
    --border: rgba(148, 163, 184, 0.18);
    --text: #e5e7eb;
    --muted: #9ca3af;
    --brand: #38bdf8;
    --ok: #22c55e;
    --warn: #f59e0b;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    background: radial-gradient(1200px 600px at 20% 0%, rgba(56,189,248,0.12), transparent 50%),
    radial-gradient(900px 500px at 80% 10%, rgba(34,197,94,0.10), transparent 55%),
    var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

/* Shell layout */
.pg-shell {
    height: 100vh;
    width: 100vw;
    display: grid;
    grid-template-columns: 280px 1fr;
}

/* Sidebar */
.pg-sidebar {
    border-right: 1px solid var(--border);
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(10px);
    padding: 16px 12px;
    overflow: auto;
}

.brand {
    display: flex;
    gap: 10px;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    padding: 10px 10px;
    border-radius: 14px;
    border: 1px solid rgba(148,163,184,0.12);
    background: rgba(15, 23, 42, 0.35);
}

.brand:hover {
    border-color: rgba(56,189,248,0.35);
    background: rgba(56,189,248,0.06);
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #001018;
    background: linear-gradient(135deg, rgba(56,189,248,1), rgba(34,197,94,1));
}

.brand-title {
    font-weight: 800;
    letter-spacing: 0.6px;
}

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

.nav {
    margin-top: 14px;
}

.nav-title {
    font-size: 12px;
    color: var(--muted);
    padding: 10px 10px 6px;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    border: 1px solid rgba(148,163,184,0.10);
    background: rgba(15,23,42,0.25);
}

.nav-link:hover {
    border-color: rgba(56,189,248,0.35);
    background: rgba(56,189,248,0.06);
}

.nav-link.is-active {
    border-color: rgba(56,189,248,0.65);
    box-shadow: 0 0 0 2px rgba(56,189,248,0.18);
    background: rgba(56,189,248,0.08);
}

.tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 9999px;
    border: 1px solid rgba(148,163,184,0.16);
    color: var(--muted);
    white-space: nowrap;
}

.tag-ready {
    border-color: rgba(34,197,94,0.35);
    color: #bbf7d0;
    background: rgba(34,197,94,0.10);
}

.tag-soon {
    border-color: rgba(245,158,11,0.35);
    color: #fde68a;
    background: rgba(245,158,11,0.08);
}

.sidebar-footer {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(148,163,184,0.10);
}

.itshin-btn {
    display: block;
    text-align: center;
    padding: 10px 10px;
    border-radius: 14px;
    text-decoration: none;
    color: #031018;
    font-weight: 800;
    background: linear-gradient(135deg, rgba(56,189,248,1), rgba(34,197,94,1));
}

.itshin-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

/* Main */
.pg-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(2, 6, 23, 0.35);
    backdrop-filter: blur(10px);
}

.topbar-title {
    font-weight: 800;
    letter-spacing: 0.3px;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(148,163,184,0.16);
    background: rgba(15, 23, 42, 0.35);
    padding: 6px 10px;
    border-radius: 9999px;
}

.lang-label {
    font-size: 12px;
    color: var(--muted);
    margin-right: 2px;
    white-space: nowrap;
}

.lang-btn {
    border: 1px solid rgba(148,163,184,0.18);
    background: rgba(2,6,23,0.55);
    color: var(--text);
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 9999px;
    cursor: pointer;
}

.lang-btn:hover {
    background: rgba(2,6,23,0.75);
}

.lang-btn.is-active {
    border-color: rgba(56,189,248,0.65);
    box-shadow: 0 0 0 2px rgba(56,189,248,0.18);
}

.pg-content {
    flex: 1;
    overflow: auto;
    padding: 16px;
}

/* Content blocks */
.hero {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(148,163,184,0.12);
    background: linear-gradient(180deg, rgba(15,23,42,0.55), rgba(2,6,23,0.35));
}

.hero h1 {
    margin: 0 0 8px;
    font-size: 18px;
}

.hero p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

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

.card {
    border-radius: 18px;
    border: 1px solid rgba(148,163,184,0.12);
    background: rgba(2,6,23,0.35);
    padding: 14px;
}

.card-title {
    font-weight: 800;
    margin: 0 0 6px;
}

.card-desc {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 9999px;
    border: 1px solid rgba(148,163,184,0.16);
    background: rgba(15,23,42,0.40);
    color: var(--text);
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.btn:hover {
    background: rgba(56,189,248,0.10);
    border-color: rgba(56,189,248,0.35);
}

.panel {
    border-radius: 18px;
    border: 1px solid rgba(148,163,184,0.12);
    background: rgba(2,6,23,0.35);
    padding: 14px;
}

.panel h2 {
    margin: 0 0 8px;
    font-size: 16px;
}

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

.iframe-wrap {
    border-radius: 16px;
    border: 1px solid rgba(148,163,184,0.12);
    overflow: hidden;
    height: calc(100vh - 170px);
    background: rgba(0,0,0,0.2);
}

.iframe-wrap iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Responsive */
@media (max-width: 980px) {
    .pg-shell {
        grid-template-columns: 1fr;
    }
    .pg-sidebar {
        position: sticky;
        top: 0;
        z-index: 50;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .grid {
        grid-template-columns: 1fr;
    }
    .iframe-wrap {
        height: 70vh;
    }
}
/* ===== 侧边栏折叠布局 ===== */

/* 确保外层是左右布局 */
.pg-shell {
    display: flex;
    min-height: 100vh;
}

/* 默认侧边栏宽度 */
.pg-sidebar {
    width: 260px;
    flex-shrink: 0;
    transition: width 0.2s ease, padding 0.2s ease;
}

/* 主区域占满剩余空间 */
.pg-main {
    flex: 1;
    min-width: 0;
}

/* 折叠时：侧边栏宽度变 0，内部内容隐藏，主区域自动放大 */
body.sidebar-collapsed .pg-sidebar {
    width: 0;
    padding-left: 0;
    padding-right: 0;
    border-right: none;
}

body.sidebar-collapsed .pg-sidebar > * {
    opacity: 0;
    pointer-events: none;
}

/* 顶部栏左侧：让按钮和标题在一行 */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 折叠按钮样式 */
.sidebar-toggle-btn {
    border-radius: 9999px;
    border: 1px solid #4b5563;
    background: #020617;
    color: #e5e7eb;
    padding: 4px 10px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.sidebar-toggle-btn:hover {
    background: #111827;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.6);
}

/* 窄屏下可以默认折叠（可选） */
/*
@media (max-width: 768px) {
  body:not(.sidebar-collapsed) {
    /* 小屏默认折叠 */
/* comment-in if you want this:
sidebar-collapsed: 如果想默认收起可以在脚本里加
}
}
*/