/**
 * app.css - 主样式表
 * 从原 index.html 提取的布局与组件样式
 */

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', Tahoma, Arial, sans-serif;
}

/* ===== 三栏布局（flex 自适应） ===== */
.layui-container {
    width: 100%;
    height: calc(100% - 40px);
    overflow: hidden;
}

.layui-row {
    height: 100%;
    margin: 0;
}

/* 仅顶层三栏行使用 flex，不影响 widgetList 内部 layui 网格 */
.layui-container > .layui-row {
    display: flex;
}

.column {
    height: 100%;
    flex-shrink: 0;
}

.column1 {
    width: 270px;
    min-width: 200px;
    background-color: #f2f2f2;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.column3 {
    width: 300px;
    min-width: 200px;
    background-color: #f2f2f2;
    overflow-y: auto;
    border-left: 1px solid #e6e6e6;
}

.column2 {
    flex: 1;
    min-width: 0;
    overflow: auto;
    background-color: #aeadac;
    position: relative;
}

/* ===== 顶部导航 ===== */
.layui-nav {
    position: relative;
    padding: 0 15px;
    background-color: #ffffff;
    color: #000000;
    font-size: 0;
    box-sizing: border-box;
}

.layui-nav .layui-nav-item {
    position: relative;
    display: inline-block;
    margin-top: 0;
    list-style: none;
    vertical-align: middle;
    line-height: 40px;
}

/* ===== 左侧组件选择器 ===== */
.tt {
    flex: 1;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    padding-top: 5px;
}

#tabBodyWrap {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    height: 100%;
    overflow: hidden;
}

#widgetList {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

#shopContainer {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.grid-demo-bg1 {
    border: 1px solid #CCC;
    height: 100%;
    box-sizing: border-box;
    text-align: center;
}

.grid-demo-bg1 .tab {
    text-align: center;
    display: block;
}

.grid-demo-bg2 {
    border-top: 1px solid #CCC;
    border-right: 1px solid #CCC;
    border-bottom: 1px solid #CCC;
    box-sizing: border-box;
}

.ws-docs-anim > div > div {
    padding: 5px;
    text-align: center;
    cursor: pointer;
}

.ws-docs-anim > div > div:hover {
    background-color: #e8e8e8;
    border-radius: 5%;
}

.ws-docs-anim > div .layui-anim {
    width: 125px;
    height: 125px;
    line-height: 125px;
    margin: 10px auto 10px;
    text-align: center;
    cursor: pointer;
    color: #fff;
    border-radius: 5%;
    user-select: none;
}

.ws-docs-anim > div .layui-anim img {
    border-radius: 5%;
}

.ws-docs-anim > div > div {
    text-align: center;
    white-space: nowrap;
}

/* ===== 中间预览区域 ===== */
#appv {
    max-width: 960px;
    max-height: 960px;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    margin: 10px auto;
}

#videoCanvas,
#tempLeaferContainer {
    display: none;
}

#canv {
    width: 1920px;
    height: 1080px;
    display: none;
}

/* ===== 视频状态 ===== */
.video-status {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 4px;
    z-index: 20;
    font-size: 14px;
    display: none;
}

/* ===== 进度条 + 播放按钮（与画布同宽、吸底居中） ===== */
#progressWrap {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 20px;
    width: 100%;
    max-width: 960px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    box-sizing: border-box;
}

#playBtn {
    flex: 0 0 auto;
    width: 34px;
    height: 28px;
    line-height: 1;
    padding: 0;
    font-size: 14px;
    color: #fff;
    background: #1e9fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#playBtn:hover {
    background: #0d8aee;
}

#progressBar {
    flex: 1;
    min-width: 0;
    width: auto;
}

/* ===== 设置面板 ===== */
.b169 {
    background: #fff;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid black;
    width: 90px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    margin-top: 30px;
    margin-bottom: 10px;
}

.b196 {
    background: #fff;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid black;
    width: 90px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 10px;
}

/* ===== Tab 切换 ===== */
.tab {
    display: inline-block;
    padding: 3px 8px;
    margin: 2px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 12px;
}

.tab.layui-this {
    background-color: #5FB878;
    color: #fff;
}

.iconcc {
    font-size: 20px !important;
}

.docs-icon-name {
    font-size: 11px;
    line-height: 16px;
}

/* ===== 模板商店 ===== */
.shop-root {
    padding: 5px;
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.shop-title {
    margin: 0;
    font-size: 14px;
    font-weight: bold;
}

.shop-search {
    margin-bottom: 8px;
}

.shop-search-input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    box-sizing: border-box;
}

.shop-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.shop-cat-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 3px;
    cursor: pointer;
    background: #e8e8e8;
    color: #666;
    transition: all 0.2s;
}

.shop-cat-tag.active,
.shop-cat-tag:hover {
    background: #5FB878;
    color: #fff;
}

.shop-list {
    max-height: 500px;
    overflow-y: auto;
}

.shop-card {
    display: flex;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: box-shadow 0.2s;
    overflow: hidden;
    background: #fff;
}

.shop-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.shop-card-thumb {
    width: 80px;
    height: 60px;
    background: #f5f5f5;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.shop-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-no-thumb {
    font-size: 10px;
    color: #ccc;
}

.shop-card-info {
    padding: 4px 8px;
    flex: 1;
    min-width: 0;
}

.shop-card-title {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-card-meta {
    font-size: 10px;
    color: #999;
    margin-top: 2px;
}

.shop-card-author {
    margin-right: 6px;
}

.shop-card-cat {
    background: #f0f0f0;
    padding: 0 4px;
    border-radius: 2px;
}

.shop-loading,
.shop-empty {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 12px;
}

/* ===== 商店预览弹窗 ===== */
.shop-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.shop-modal.show {
    display: flex;
}

.shop-modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.shop-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.shop-modal-title {
    margin: 0;
    font-size: 16px;
}

.shop-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
}

.shop-modal-body {
    padding: 20px;
}

.shop-preview-area {
    text-align: center;
    margin-bottom: 15px;
    background: #f5f5f5;
    border-radius: 4px;
    padding: 10px;
}

.shop-detail-info p {
    margin: 6px 0;
    font-size: 13px;
    color: #666;
}

.shop-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ===== 响应式：小屏隐藏右侧面板 ===== */
@media (max-width: 1100px) {
    .column3 {
        display: none;
    }
    .column1 {
        width: 220px;
    }
}

@media (max-width: 780px) {
    .column1 {
        width: 180px;
    }
    #appv {
        max-width: 400px;
    }
}
