/**
 * 文件名称：home.css
 * 功能描述：首页/工作台样式 —— 作品卡片 / 示例动效横滑 / 反馈弹层 / 分享按钮
 * 所属模块：前端基础（阶段 5 收尾）
 * 作者：Software Engineer
 * 创建日期：2026-09-04
 */

/* —— 通用隐藏（首页视图/fab/弹层共用；editor.css 同级规则仅编辑器页加载） —— */
.hidden { display: none !important; }

/* —— 作品列表 —— */
.works-list { display: flex; flex-direction: column; gap: 10px; }

.panel-badge {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 6px;
}

.panel-hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 6px;
}

.work-card {
  display: flex;
  align-items: stretch;
  gap: 8px;
  background: #fafaff;
  border: 1px solid #ececf3;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.work-card:active { background: #f1f0ff; }

.work-card-body { flex: 1; min-width: 0; }

.work-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.work-name {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.work-fx {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--brand);
  background: #f0ecff;
  border-radius: 10px;
  padding: 2px 8px;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.work-card-status { font-size: 12px; line-height: 1.5; }
.status-local { color: #27ae60; }
.status-sample { color: var(--brand); }
.status-missing { color: #e67e22; }

.work-card-menu {
  flex: 0 0 auto;
  align-self: center;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 20px;
  padding: 4px 8px;
  cursor: pointer;
}

/* —— 示例动效横滑 —— */
.samples-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
}

.samples-carousel::-webkit-scrollbar { display: none; }

.sample-card {
  flex: 0 0 auto;
  width: 200px;
  background: #fff;
  border: 1px solid #ececf3;
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease;
}

.sample-card:active { transform: scale(.97); }

.sample-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #f4f4f8;
}

.sample-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sample-label {
  font-size: 13px;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-fx-tag {
  font-size: 11px;
  color: var(--brand);
  background: #f0ecff;
  border-radius: 8px;
  padding: 1px 6px;
  display: inline-block;
  margin-top: 4px;
}

/* —— 反馈弹层（与 editor.css 的 dialog-mask 同级样式，此处独立定义避免跨文件依赖） —— */
.dialog-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 20px;
}

.dialog-mask.hidden { display: none; }

.dialog {
  background: #fff;
  border-radius: 16px;
  padding: 18px 16px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
}

.dialog h3 { font-size: 17px; margin-bottom: 8px; }

.dialog-desc { font-size: 13px; color: var(--muted); margin-bottom: 10px; }

.feedback-textarea {
  width: 100%;
  min-height: 120px;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  background: #fafafa;
  box-sizing: border-box;
}

.feedback-textarea:focus { border-color: var(--brand); background: #fff; }

.feedback-counter {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  margin: 4px 0 8px;
}

.dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
}

.dialog-actions .btn-primary {
  width: auto;
  margin: 0;
  padding: 10px 18px;
  font-size: 14px;
}

.dialog-actions .ghost {
  border: 1px solid #e0e0e0;
  background: #fff;
  color: #666;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
}

/* —— 分享按钮 —— */
#btn-copy-link {
  font-size: 12px;
  color: var(--brand);
  border: 1px solid #d8d0f5;
  background: #f6f3ff;
  border-radius: 14px;
  padding: 3px 10px;
  margin-left: 6px;
  cursor: pointer;
}

#btn-copy-link:active { background: #ece7ff; }

/* 无作品时的占位 */
.placeholder { line-height: 1.6; }
