/* 首页样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f5f7; color: #333; height: 100vh; overflow: hidden; }
.layout { display: flex; height: 100vh; }

/* 左侧图标栏 */
.ant_left_c { width: 70px; background: #fafafc; border-right: 1px solid #ebebeb; display: flex; flex-direction: column; flex-shrink: 0; height: 100vh; }
.ant_left_c .icon-item { width: 48px; min-height: 48px; padding: 6px 0; padding-top: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer;  background-color: #fff; border-radius: 4px; margin: 0 auto; margin-bottom: 10px; }
.ant_left_c .icon-item.icon-item-logo { min-height: 50px; }
.ant_left_c .icon-item img { width: 28px; height: 28px; }
.ant_left_c .icon-item:hover { background: #f5f5f5; }
.ant_left_c .icon-item a { display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: inherit; }
.ant_left_c .icon-item .icon-label { font-size: 12px; color: #777; margin-top: 2px; }

/* 导航面板 */
.nav-panel { width: 235px; background: #fafafc; display:none; border-right: 1px solid #eee;  flex-direction: column; padding-top: 12px; flex-shrink: 0; height: 100vh; overflow-y: auto; }
.nav-logo { width: 36px; height: 36px; margin: 0 auto 16px; display: block; }
.nav-btn { display: flex; align-items: center; gap: 8px; padding: 10px 16px; margin: 0 8px 2px; border-radius: 3px; cursor: pointer; border: none; background: none; color: #666; font-size: 13px; margin-bottom: 10px; width: calc(100% - 16px); text-align: left; transition: background 0.2s; }
.nav-btn:hover { background: #f0f0f5; color: #333; }
.nav-btn.active { background: #f0f0f5; color: #333;  }
.nav-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-bottom { margin-top: auto; display: flex; justify-content: center; align-items: center; font-size: 12px; color:#fff; background: linear-gradient(91deg, rgb(89, 189, 255) -7.44%, rgb(64, 71, 255) 49.38%, rgb(255, 102, 247) 100%); min-height: 30px; border-radius: 4px; margin-bottom: 10px; width: calc(100% - 16px); margin-left: 8px; cursor: default; }
.nav-bottom .home-logout-btn:hover { background: rgba(255,255,255,0.5) !important; }
.home-login-modal { display: none; }

/* 主内容区 */
.main { flex: 1; overflow-y: auto; padding: 24px 28px;background-color: #fff;}
.main-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.main-header h2 { font-size: 18px; font-weight: 700; }

/* 顶部栏 logo+登录 */
.home-top-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 0 16px; margin-bottom: 8px; background-color: #fafafc; }
.home-top-bar .home-logo { width: 32px; height: 32px; }
.home-top-bar .home-login { font-size: 13px; color: #333; cursor: pointer; padding: 4px 12px; border-radius: 6px; border: 1px solid #ddd; background: #fff; transition: all 0.2s; }
.home-top-bar .home-login:hover { background: #f5f5f5; border-color: #ccc; }
.home-top-bar .home-login.logged-in { color: #52c41a; border-color: #b7eb8f; background: #f6ffed; }

/* 第一行：新建空白页 + 我的保存 */
.home-first-row { display: flex; gap: 16px; margin-bottom: 20px; align-items: flex-start; }
.quick-card-new { flex-shrink: 0; width: 140px; margin: 0; }
.quick-card-icon { width: 38px; height: 38px; border-radius: 3px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.quick-card-icon.gradient-purple { background: #8b63ff; margin-left: 53px; margin-top: 6px; }
.quick-card-icon.gradient-pink { background:#ff82d7; flex-shrink: 0; margin-bottom: 0; margin-left: 56px;  }
.quick-card-title { font-size: 12px; margin-bottom: 3px; margin-left: 40px; }
.quick-card-desc { font-size: 11px; color: #999; margin-left: 40px; }
.quick-card {  min-width: 0; background: #fff; border-radius: 6px; padding: 16px 18px; cursor: pointer; transition: box-shadow 0.2s, transform 0.15s;  background-color: #f2f1ff; position: relative; overflow: hidden; text-decoration: none; color: inherit; display: block; }
.quick-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.07); transform: translateY(-2px); }
.quick-card-badge { position: absolute; top: 10px; right: 10px; font-size: 10px; background: #f0f0f5; color: #666; padding: 2px 6px; border-radius: 8px; }

.saves-slot { flex: 1; min-width: 0; }
.section-title { font-size: 18px; margin-bottom: 24px; display: flex; align-items: center; gap: 8px; }
.section-title .save-count-badge { font-size: 12px; color: #999;  }
.section-title.hidden { display: none !important; }
.saves-row { display: flex; gap: 15px; margin-bottom: 24px; overflow-x: auto; padding-bottom: 6px; }
.saves-row::-webkit-scrollbar { height: 4px; }
.saves-row::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

/* 保存卡片 */
.save-card { width:180px; height:126px;  background: #f2f1ff; border-radius: 6px; overflow: hidden; cursor: pointer; transition: box-shadow 0.2s; flex-shrink: 0;  }
.save-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
.save-card-thumb-wrap { position: relative; width: 100%; height: 50px; }
.save-card-thumb { width: 100%; height: 80px; object-fit: cover; display: block; background: #f0f0f5; }
.save-card-thumb-placeholder { display: flex; align-items: center; justify-content: center; color: #ccc; font-size: 18px; width: 100%; height: 80px; }
.save-card-hover-overlay { position: absolute; top: -24px; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.35); display: none; align-items: center; justify-content: center; transition: opacity 0.2s; height:126px; }
.save-card:hover .save-card-hover-overlay { display: flex; }
.save-card .use-btn { padding: 6px 16px; background: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 12px; color: #333; box-shadow: 0 2px 8px rgba(0,0,0,0.15); transition: all 0.2s; }
.save-card .use-btn:hover { background: #f0f0f0; transform: scale(1.05); }
.save-card-body { background-color: #f2f1ff; text-align: center; }
.save-card-name { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save-card-time { font-size: 10px; color: #aaa; margin-top: 2px; }
.save-card-actions { display: flex; gap: 4px; margin-top: 6px; display: none; }
.save-card-actions button { border: none; background: #f5f5f5; border-radius: 4px; padding: 2px 8px; font-size: 10px; cursor: pointer; color: #666; }
.save-card-actions button:hover { background: #e8e8e8; }
.save-card-actions button.del { color: #e74c3c; }

/* 未完成的编辑 */
#autosave-section { margin-bottom: 20px; }
#autosave-section.hidden { display: none !important; }
.card-autosave { cursor: pointer;height: 126px; }
.card-autosave-inner { margin-top:5px;}

/* 精选模块 */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(150px, 18vw, 220px), 1fr));
    gap: clamp(10px, 1.2vw, 14px);
    align-items: start;
}

/* 套装区域：只显示一行，并随屏幕缩放 */
#suite-grid.modules-grid {
    display: flex !important;
    flex-wrap: nowrap;
    gap: clamp(10px, 1.2vw, 14px);
    align-items: stretch;
    overflow: hidden;
}

.module-card { background: #fff; border-radius: 10px; overflow: hidden; cursor: pointer; transition: box-shadow 0.2s, transform 0.15s; border: 1px solid #f0f0f0; }
#suite-grid.modules-grid .module-card {
    flex: 1 1 0;     /* 宽度随容器自适应缩放/放大 */
    min-width: 0;    /* 允许缩小，避免被内容撑开导致溢出 */
}
.module-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.07); transform: translateY(-2px); }
.module-card-img-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f8f8f8;
    aspect-ratio: 3 / 4;
}
.module-card img { width: 100%; height: 100%; object-fit: cover; display: block; background: #f8f8f8; }
.module-card-hover-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.35); display: none; align-items: center; justify-content: center; transition: opacity 0.2s; }
.module-card:hover .module-card-hover-overlay { display: flex; }
.module-card .use-btn { padding: 8px 20px; background: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; color: #333; box-shadow: 0 2px 8px rgba(0,0,0,0.15); transition: all 0.2s; }
.module-card .use-btn:hover { background: #f0f0f0; transform: scale(1.05); }
.module-card-info { padding: 8px 10px; }
.module-card-name { font-size: clamp(11px, 1vw, 12px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; color:#999; }

.cat-tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.cat-tab { padding: 4px 12px; border-radius: 4px; font-size: 12px; cursor: pointer; border: 1px solid #e0e0e0; background: #fff; color: #666; transition: all 0.2s; }
.cat-tab:hover { border-color: #aaa; }
.cat-tab.active { background: #222; color: #fff; border-color: #222; }

/* QQ/微信弹窗 */
.home-modal { display: none; position: absolute; z-index: 999; left:58px; top:8px; }
.home-modal-inner { background: #fff;  border-radius: 5px; text-align: center; box-shadow: 0 2px 12px rgba(0,0,0,0.1); overflow: hidden; }
.home-modal-inner img { width: 140px; height: 140px; }
.home-modal-inner .modal-caption { font-size: 12px; color: #666; margin-bottom: 8px; font-weight: 500;text-align: left; padding-left: 10px; }
.home-modal-close { position: absolute; top: 138px; right: 8px; width: 28px; height: 20px; border: none; background: #f0f0f0; border-radius: 3px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #666; font-size: 18px; line-height: 1; padding: 0; transition: background 0.2s, color 0.2s; }

/* 版本切换选项卡 */
.home-version-tabs,
.module-version-tabs { display: flex; gap: 8px;  }
.home-version-tabs .home-version-tab,
.module-version-tabs .module-version-tab {
    padding: 1px 6px; font-size: 12px; border-radius: 2px; cursor: pointer;
    background: #f0f0f5; color: #666; border: 1px solid #e0e0e0;
    margin-top: 13px;
    transition: all 0.2s;
}
.home-version-tabs .home-version-tab:hover,
.module-version-tabs .module-version-tab:hover { background: #e8e8ed; color: #333; }
.home-version-tabs .home-version-tab.active,
.module-version-tabs .module-version-tab.active {
    background: #8b63ff; color: #fff; border-color: #8b63ff;
}
.module-version-tabs { margin-bottom: 12px; }