* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial;
  background: #f7f9fc;
  color: #111;
  height: 100vh;
  margin: 0;
}

body.sidebar-collapsed .sidebar {
  width: 72px;
}

:root {
  --sidebar-width: 210px;
}

body.sidebar-collapsed {
  --sidebar-width: 72px;
}


body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed h4,
body.sidebar-collapsed .brand div {
  display: none;
}

body.sidebar-collapsed .nav-item {
  justify-content: center;
}

/* ===== SIDEBAR ===== */
aside {
  background: #f3f6fb;
  color: #1f2937;
  border-right: 1px solid #e5e9f0;
  transition: width 0.2s ease;
}

aside.sidebar {
  grid-column: 1;
  width: var(--sidebar-width);
  background: #f3f6fb;
  border-right: 1px solid #e5e9f0;
  transition: width 0.2s ease;
  position:relative;
  padding-top: 56px; /* 给 toggle 腾位置 */
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar-toggle {
  position: absolute;
  top: 12px;                 /* 距顶部一点点，更系统感 */
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 9px solid #374151; /* ← 默认朝左 */
  transition: transform 0.25s ease;
}


/* 折叠态反向 */
body.sidebar-collapsed .sidebar-toggle::before {
  transform: rotate(180deg);
}

.main {
  flex: 1;
  min-width: 0;
  padding: 28px;
  background: #f7f9fc;
}

.main-layout {
  height: calc(100vh - 64px - 48px); /* header + footer */
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 24px;
}

.main-wrapper {
  flex: 1;              /* 关键：自动吃掉剩余空间 */
  display: flex;
  flex-direction: column;
  min-width: 0;         /* 防止内容溢出导致布局错乱 */
}

.brand {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: white;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.brand-name { font-weight: 700; }
.brand-sub { font-size: 12px; color: #9fb6d1; }

h4 {
  margin: 18px 0 6px 6px;
  font-size: 12px;
  color: #6b7a8c;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin: 6px 0;
  border-radius: 8px;
  color:#1f2937;
  cursor: pointer;
}
.icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #e9eef6;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== HEADER ===== */
header {
  height: 64px;
  flex-shrink: 0;
  background: white;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
}
.group-nav {
  display: flex;
  gap: 12px;
}
.topbtn {
  padding: 8px 14px;
  border-radius: 8px;
  background: #f0f4f8;
  font-weight: 600;
  cursor: pointer;
}

/* ===== DISCOVER ===== */
.hidden {
  display: none;
}

.discover {
  background: white;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
}

.discover-intro {
  font-size: 14px;
  color: #6b7a8c;
  margin-bottom: 12px;
}

.discover-top-row {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}
.discover-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.discover-work-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  height: 160px;          /* 👈 你可以试 140 / 160 / 180 */
  border-radius: 14px;
  overflow: hidden;      /* 👈 非常关键，裁掉溢出部分 */
  cursor:pointer;
}
.searchbox {
  width: 220px;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #dce3ea;
}
.tabs-inline {
  display: flex;
  gap: 8px;
}
.tab {
  padding: 8px 14px;
  border-radius: 999px;
  background: #eef2f7;
}
.tab.active {
  background: #0b84ff;
  color: white;
}
.see-more {
  margin-left: 24px;
  font-size: 14px;
  color: #0b84ff;
  font-weight: 600;
}

.discover-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  align-items: center;
  justify-content: center;
  z-index: 999;
}

/* 显示状态 */
.discover-overlay.active {
  display: flex;
}

.discover-detail-card {
  width: 520px;
  max-width: 90vw;
  background: white;
  border-radius: 16px;
  padding: 20px;
  position: relative;
}

.discover-detail-image img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 12px;
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
}

.remix-btn {
  display: inline-block;
  margin-top: 16px;
  font-weight: 600;
  color: #0b84ff;
}


/* 内容区 */
.discover-content-row {
  flex: 1;                    /* 吃掉 discover 剩余高度 */
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  align-items: center;        /* ← 关键：垂直对齐 */
}


.discover-refresh-btn-inline {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #eef3fa;
  border: 1px solid #d5dde6;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.discover-refresh-btn-inline.loading {
  opacity: 0.6;
  pointer-events: none;
}


.work-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  height: 100%;
}

.content {
  display: flex;
  flex-direction: column;
  flex: 1;               /* 吃掉 sidebar 以外的所有空间 */
  min-width: 0;          /* 非常重要，防止内容撑爆 */
}

.card {
  background: #f8fbff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #084b8a;
}


/* ===== TWO COLUMN ===== */
.lower-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/*====MY WORKS====*/
.myworks {
  display: flex;
  flex-direction: column;
}

.myworks-visual img {
  width: 100%;
  max-height: 300px;          /* 👈 关键：限制高度 */
  object-fit: cover;          /* 裁切而不是压缩 */
  border-radius: 10px;
  display: block;
}

.myworks-label {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #0f172a;
  opacity: 0.7;
  white-space: nowrap;
  margin-bottom: 4px;
  padding-left: 14px;
}

.myworks-visual {
  display: flex;
  gap: 12px;
}

.myworks-content {
  display: grid;
  grid-template-columns: 1.2fr 1fr; /* 左图右文 */
  grid-template-rows: auto 1fr;
  gap: 24px;
  align-items: start;
}

.myworks-text {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.myworks-status {
  font-size: 13px;
  font-weight: 600;
  color: #e11d48;            /* 温和的警示红 */
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.myworks-visual.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.mywork-card {
  background: #f5faff;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 280px;          /* 👈 你可以试 140 / 160 / 180 */
  border-radius: 14px;
  overflow: hidden;      /* 👈 非常关键，裁掉溢出部分 */
}

.mywork-card img {
  width: 100%;
  border-radius: 6px;
}

.mywork-badge {
  font-size: 12px;
  color: #b45309;
}

.myworks-text h3 {
  margin: 0;
  font-size: 16px;
}

.myworks-text p {
  margin: 4px 0;
  font-size: 14px;
  color: #334155;
}

.myworks-text .hint {
  color: #64748b;
  font-size: 13px;
}

.skeleton {
  background: linear-gradient(
    90deg,
    #f1f5f9 25%,
    #e5e7eb 37%,
    #f1f5f9 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  height: 80px;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}


.create-block {
  background: white;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.create-placeholder {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 16px;
  background: #f6fbff;
  flex: 1;
  border-radius: 10px;
}

.create-item {
  background: #ffffff;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.create-item h4 {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.create-item p {
  font-size: 13px;
  color: #475569;
  line-height: 1.4;
}


.cta {
  padding: 14px;
  background: #06a0b0;
  color: white;
  border-radius: 12px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

/* ===== FOOTER ===== */
footer {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7a8c;
}
