/* =========================================================
   进华智慧社区 (JHCommunity) - 原型演示外框与控制台样式
   ========================================================= */

:root {
    --bg-dark: #090D16;
    --bg-card: #111827;
    --bg-card-border: #1F2937;
    --text-primary: #F3F4F6;
    --text-muted: #9CA3AF;
    --brand-blue: #36C0FF;
    --brand-indigo: #324DEB;
    --accent-green: #10B981;
    --accent-orange: #F59E0B;
    --accent-red: #EF4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", Roboto, sans-serif;
    background: radial-gradient(circle at 15% 15%, #151d32 0%, #090d16 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* 顶部演示导航栏 */
.demo-header {
    height: 60px;
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}

.demo-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.demo-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(54, 192, 255, 0.3);
}

.demo-title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #FFFFFF;
}

.demo-badge {
    font-size: 11px;
    padding: 3px 8px;
    background: linear-gradient(135deg, rgba(54, 192, 255, 0.2), rgba(50, 77, 235, 0.2));
    border: 1px solid rgba(54, 192, 255, 0.4);
    color: #60A5FA;
    border-radius: 20px;
}

.demo-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.role-switch-header {
    display: flex;
    background: #1F2937;
    padding: 3px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.role-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.role-btn.active {
    background: #3B82F6;
    color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
    font-weight: 500;
}

/* 主演示舞台 */
.demo-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    gap: 36px;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
}

/* 手机机身模拟器 (iPhone 15 Pro 质感外框) */
.phone-wrapper {
    position: relative;
    width: 390px;
    height: 820px;
    background: #000000;
    border-radius: 54px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8),
                0 0 0 12px #26272B,
                0 0 0 14px #121316,
                0 0 40px rgba(54, 192, 255, 0.15);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

/* 手机外壳按键细节 (音量键/电源键) */
.phone-wrapper::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 140px;
    width: 4px;
    height: 50px;
    background: #2E3035;
    border-radius: 2px 0 0 2px;
}
.phone-wrapper::after {
    content: "";
    position: absolute;
    right: -16px;
    top: 180px;
    width: 4px;
    height: 70px;
    background: #2E3035;
    border-radius: 0 2px 2px 0;
}

/* 状态栏 & 灵动岛 */
.phone-statusbar {
    height: 44px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: #FFFFFF;
    position: relative;
    z-index: 50;
    background: transparent;
    user-select: none;
}

.status-time {
    letter-spacing: -0.2px;
}

.dynamic-island {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 8px;
    width: 110px;
    height: 28px;
    background: #000000;
    border-radius: 20px;
    z-index: 60;
    box-shadow: 0 1px 3px rgba(255, 255, 255, 0.05);
}

.status-icons {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 移动端 App 内容视窗 */
.app-container {
    flex: 1;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    background: #F6F7FB;
    display: flex;
    flex-direction: column;
}

/* 底部小黑条 (Home Indicator) */
.home-indicator {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 130px;
    height: 4px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    z-index: 100;
    pointer-events: none;
}

/* 右侧演示控制面板 */
.demo-panel {
    flex: 1;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 820px;
}

.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.panel-title {
    font-size: 15px;
    font-weight: 600;
    color: #F9FAFB;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-title small {
    font-size: 12px;
    font-weight: normal;
    color: var(--text-muted);
}

/* 快捷演练操作按钮组 */
.scenario-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.scenario-btn {
    background: #1F2937;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.scenario-btn:hover {
    background: #253347;
    border-color: #3B82F6;
    transform: translateY(-2px);
}

.scenario-btn .icon {
    font-size: 18px;
    margin-bottom: 6px;
    display: block;
}

.scenario-btn .name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 3px;
}

.scenario-btn .desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* API 日志控制台 */
.api-console-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.api-terminal {
    flex: 1;
    background: #060910;
    border-radius: 8px;
    padding: 12px;
    font-family: "JetBrains Mono", Menlo, Consolas, monospace;
    font-size: 11px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.log-item {
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    border-left: 3px solid #3B82F6;
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.log-item.POST {
    border-left-color: #10B981;
}

.log-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.log-method {
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 10px;
}

.log-method.GET { background: rgba(54, 192, 255, 0.2); color: #38BDF8; }
.log-method.POST { background: rgba(16, 185, 129, 0.2); color: #34D399; }

.log-endpoint {
    color: #E2E8F0;
    font-weight: 500;
    margin-left: 6px;
}

.log-time {
    color: #64748B;
    font-size: 10px;
}

.log-detail {
    color: #94A3B8;
    word-break: break-all;
    font-size: 10px;
}

/* 纯手机全屏适配 */
@media (max-width: 900px) {
    body {
        background: #000000;
    }
    .demo-header {
        display: none;
    }
    .demo-panel {
        display: none;
    }
    .demo-stage {
        padding: 0;
        margin: 0;
        height: 100vh;
    }
    .phone-wrapper {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }
    .phone-wrapper::before,
    .phone-wrapper::after {
        display: none;
    }
}
