/** 方圆资料库 - 样式表 */

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

:root {
  --primary: #1890ff;
  --primary-hover: #40a9ff;
  --primary-dark: #096dd9;
  --bg: #f5f5f5;
  --card-bg: #fff;
  --text: #333;
  --text-secondary: #666;
  --border: #e8e8e8;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* 头部 */
.header {
  background: var(--card-bg);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.logo h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--primary);
}

.version {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
}

.search-box {
  display: flex;
  gap: 8px;
  width: 400px;
}

.search-box input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
}

.search-box button {
  padding: 10px 20px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  white-space: nowrap;
}

.search-box button:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* 搜索历史 */
.search-box-wrapper {
  position: relative;
}

.search-history {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 200;
  max-height: 300px;
  overflow-y: auto;
}

.search-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

.search-history-header button {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
}

.search-history-header button:hover {
  text-decoration: underline;
}

.search-history-list {
  padding: 8px 0;
}

.search-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.search-history-item:hover {
  background: var(--bg);
}

.search-history-item span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-history-item .delete-btn {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.2s;
}

.search-history-item:hover .delete-btn {
  opacity: 1;
}

.search-history-item .delete-btn:hover {
  background: #fff2f0;
  color: #ff4d4f;
}

.search-history-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

/* 主体布局 */
.main {
  display: flex;
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
  gap: 24px;
}

/* 侧边栏 */
.sidebar {
  width: 260px;
  flex-shrink: 0;
}

.filter-section {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.filter-section h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

/* 统计 */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stat-item {
  text-align: center;
  padding: 8px;
  background: var(--bg);
  border-radius: 8px;
}

.stat-value {
  display: block;
  font-size: 24px;
  font-weight: 600;
  color: var(--primary);
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 类型筛选 */
.type-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.filter-item:hover {
  background: var(--bg);
}

.filter-item input {
  cursor: pointer;
}

/* 标签云 */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-item {
  display: inline-block;
  padding: 6px 12px;
  background: var(--bg);
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.tag-item:hover {
  background: var(--primary);
  color: white;
}

.tag-item.active {
  background: var(--primary);
  color: white;
}

/* 内容区 */
.content {
  flex: 1;
  min-width: 0;
}

/* 工具栏 */
.toolbar {
  background: var(--card-bg);
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: var(--shadow);
}

/* 时间范围下拉筛选 */
.time-range {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.time-range select {
  padding: 8px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  font-size: 14px;
  background: var(--card-bg);
  color: #555;
  cursor: pointer;
  max-width: 100%;
}

/* PC 端：内联同行显示 */
.custom-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.custom-range input[type="date"] {
  padding: 7px 10px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  font-size: 14px;
  background: var(--card-bg);
  color: #555;
}

.custom-range-sep {
  color: #888;
}

.custom-range .btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.quick-filter-btn {
  padding: 7px 14px;
  border: 1px solid #d9d9d9;
  border-radius: 16px;
  background: var(--card-bg);
  color: #555;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.quick-filter-btn:hover {
  border-color: #4a90e2;
  color: #4a90e2;
}

.quick-filter-btn.active {
  background: #4a90e2;
  border-color: #4a90e2;
  color: #fff;
}

.sort-options {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sort-options select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.sort-options button {
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  cursor: pointer;
}

.view-options {
  display: flex;
  gap: 6px;
}

.view-btn, .filter-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  background: white !important;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--text);
}

.view-btn.active, .filter-btn.active {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary);
}

/* 素材网格 */
.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.material-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.material-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.card-thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  position: relative;
  overflow: hidden;
}

.card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-type {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.card-info {
  padding: 10px;
}

.card-title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-secondary);
}

.card-tags {
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.card-tag {
  font-size: 9px;
  padding: 1px 5px;
  background: var(--bg);
  border-radius: 4px;
  color: var(--text-secondary);
}

/* 列表视图 */
.materials-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.material-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: background 0.2s;
}

.material-row:hover {
  background: #f8f8f8;
}

.row-icon {
  font-size: 32px;
  width: 48px;
  text-align: center;
  flex-shrink: 0;
}

.row-info {
  flex: 1;
  min-width: 0;
}

.row-title {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.row-type {
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
}

.row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 300px;
}

.row-tag {
  font-size: 12px;
  padding: 4px 10px;
  background: var(--bg);
  border-radius: 12px;
  color: var(--text-secondary);
}

.row-action {
  font-size: 20px;
  color: var(--text-secondary);
  padding: 0 8px;
}

/* 分页 */
.pagination {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 16px;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.pagination-main {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.page-ellipsis {
  padding: 0 4px;
  color: var(--text-secondary);
  font-size: 14px;
}

.page-info {
  font-size: 14px;
  color: var(--text-secondary);
}

.pagination-jump {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
}

.jump-label {
  white-space: nowrap;
}

.jump-input {
  width: 60px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-align: center;
  font-size: 14px;
  outline: none;
}

.jump-input:focus {
  border-color: var(--primary);
}

.jump-btn {
  padding: 4px 12px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
}

.jump-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* 弹窗 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.9);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex !important;
}

.modal-content {
  background: var(--bg, #1a1a2e) !important;
  border-radius: 12px !important;
  width: 90% !important;
  max-width: 1000px !important;
  height: auto !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Modal header */
.modal-header {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

/* 主页素材详情弹框与收藏/素材管理保持一致：白底、宽度 900px */
#detailModal .modal-content,
#detailModal .detail-content {
  background: #fff !important;
  max-width: 920px !important;
  height: 88vh !important;
  max-height: 88vh !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

#detailModal .modal-header {
  border-bottom-color: var(--border);
  flex-shrink: 0;
}

#detailModal .detail-body {
  padding: 8px 12px !important;
  flex: 1 1 auto !important;
  min-height: 0;
  max-height: none !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

#detailModal .detail-preview {
  flex: 1 1 0% !important;
  min-height: 180px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: #000 !important;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 6px;
  position: relative;
}

#detailModal .detail-preview video,
#detailModal .detail-preview img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  border-radius: 8px;
}

#detailModal .detail-info {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 10px;
  color: #666;
  font-size: 12px;
  padding: 2px 0;
}

#detailModal .detail-info.info-main {
  /* 元数据：单行横排显示，超出部分横向滚动（hover 可看完整 tooltip），
     去掉 label 后只留值，保证一屏能看完 type/size/date/duration/resolution */
  display: flex !important;
  flex-wrap: nowrap !important;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: center;
  gap: 6px;
  color: #888;
  font-size: 11.5px;
  line-height: 1.5;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 4px;
  padding-top: 2px;
  margin-bottom: 4px;
  min-height: 0;
  scrollbar-width: thin;
}
#detailModal .detail-info.info-main::-webkit-scrollbar { height: 2px; }
#detailModal .detail-info.info-main::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }
/* 分隔符"·"颜色稍浅，和数据值区分开 */
#detailModal .detail-info.info-main .info-sep { color: #ccc; padding: 0 2px; }
#detailModal .detail-info.info-main .file-path {
  display: inline !important;
  flex: 0 1 auto;
  width: auto !important;
  flex-basis: auto !important;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #bbb;
}

#detailModal .detail-relations {
  flex-shrink: 0;
  margin-bottom: 2px;
}

#detailModal .detail-relations .relations-list {
  max-height: 80px;
  overflow-y: auto;
}

#detailModal .detail-relations:empty {
  display: none;
}

#detailModal .detail-actions {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  flex-wrap: nowrap !important;   /* 三按钮强制一行 */
  align-items: stretch;
  margin-top: 0;
  padding-top: 0;
  width: 100%;
  box-sizing: border-box;
}
/* 三个按钮 flex:1 等分宽度，避免一行放不下折行 */
#detailModal .detail-actions > .btn-download,
#detailModal .detail-actions > .btn-cast,
#detailModal .detail-actions > .btn-favorite,
#detailModal .detail-actions > .btn-tablet-link {
  flex: 1 1 0% !important;
  min-width: 0 !important;
  justify-content: center;
  text-align: center;
  display: inline-flex !important;
  align-items: center;
  padding: 10px 8px !important;
  font-size: 13.5px !important;
  margin: 0 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#detailModal .detail-info .file-path {
  flex-basis: 100%;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  box-sizing: border-box;
}

#detailModal .detail-relations .relation-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  padding: 3px 8px;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  cursor: pointer;
  color: #333;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
  line-height: 1.4;
}

#detailModal .detail-relations .relation-btn:hover {
  background: #f0f7ff;
  border-color: #4096ff;
  color: #1677ff;
}

.modal-header h3 {
  margin: 0;
  font-size: 15px;          /* 弹窗标题字体缩小：18 → 15 */
  font-weight: 600;
  line-height: 1.4;
  max-height: 2.8em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.modal-header .close-btn,
.close-btn {
  border: none;
  font-size: 20px;
  cursor: pointer;
  background: transparent;
  color: inherit;
  padding: 4px 8px;
  line-height: 1;
}

.modal-header .close-btn:hover,
.close-btn:hover {
  opacity: 0.7;
}

/* 投送设置齿轮图标：固定在详情弹框 header 右侧（关闭按钮左边），仅已设置大屏时显示 */
.cast-settings-btn {
  margin-left: auto;
  border: none;
  font-size: 16px;
  cursor: pointer;
  background: transparent;
  color: #666;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.cast-settings-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #333;
}

.detail-body {
  flex: 1 !important;
  padding: 12px 16px !important;
  width: 100% !important;
  overflow-y: auto !important;
}

/* 详情弹窗布局 - 上下分栏 */
.detail-container {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.detail-preview {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.detail-title {
  display: block !important;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text, #e0e0e0);
  word-break: break-all;
}

.detail-media {
  background: #000 !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  max-height: 60vh !important;
  margin: 0 0 10px 0 !important;
  padding: 0 !important;
}

.detail-media img {
  max-width: 100% !important;
  max-height: 58vh !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: auto !important;
  margin-bottom: auto !important;
}

.detail-media video {
  max-width: 100% !important;
  max-height: 58vh !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16/9 !important;
  object-fit: contain !important;
  display: block !important;
}

/* 详情信息区域 */
.detail-info {
  display: block !important;
  min-width: 0;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
}

/* 播放状态徽章 */
#playbackModeBadge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #ecc94b;
  border-radius: 4px;
  font-size: 12px;
  z-index: 100;
}

/* 通用媒体容器居中 */
.media-center-wrapper {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 400px !important;
  background: #000 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.media-center-wrapper img,
.media-center-wrapper audio {
  max-width: 100% !important;
  max-height: 75vh !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: auto !important;
  margin-bottom: auto !important;
}

.media-center-wrapper video {
  max-width: 100% !important;
  max-height: 75vh !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16/9 !important;
  object-fit: contain !important;
  display: block !important;
}

/* 视频容器 */
#videoContainer {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #000 !important;
}

#videoContainer video {
  max-width: 100% !important;
  max-height: 75vh !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16/9 !important;
  object-fit: contain !important;
  display: block !important;
}

/* 强制所有媒体元素居中 */
.modal video,
.modal img,
.modal audio {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: 100% !important;
  max-height: 400px !important;
}

.detail-info {
  min-width: 0;
}

.detail-section-title {
  margin: 24px 0 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.detail-section-title:first-child {
  margin-top: 0;
}

.detail-info-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.detail-info-item {
  display: inline-flex;
  align-items: center;
  padding: 0;
  gap: 6px;
}

.detail-info-item.full-width {
  flex-basis: 100%;
}

.detail-info-label {
  min-width: auto;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  flex-shrink: 0;
}

.detail-info-value {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  word-break: break-all;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.info-value {
  font-size: 14px;
  color: var(--text);
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-tag {
  padding: 6px 14px;
  background: var(--bg);
  border-radius: 16px;
  font-size: 13px;
  color: var(--text);
}

.detail-summary {
  line-height: 1.8;
  color: var(--text);
  font-size: 14px;
}

.detail-attrs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attr-item {
  display: flex;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.attr-item:last-child {
  border-bottom: none;
}

/* 详情弹框可折叠区块（如"属性"），默认折叠 */
.detail-collapse-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 6px 0;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}
.detail-collapse-title {
  font-weight: 600;
}
.detail-collapse-count {
  background: var(--bg);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 12px;
  color: var(--text-secondary);
}
.detail-collapse-arrow {
  margin-left: auto;
  transition: transform 0.2s ease;
  font-size: 12px;
}
.detail-collapse-body {
  padding-top: 8px;
}

.attr-key {
  min-width: 70px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  flex-shrink: 0;
}

.attr-value {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  word-break: break-all;
}

.detail-actions {
  margin-top: 24px;
}

.btn-download {
  display: inline-block;
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  transition: background 0.2s;
  /* 统一 <a> 与 <button> 视觉一致（移动端改 button 后不掉样式） */
  border: none;
  cursor: pointer;
  line-height: 1.4;
  font-family: inherit;
  user-select: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.08);
}

.btn-download:active { transform: scale(0.98); }

.btn-download:hover {
  background: var(--primary-hover);
}

/* ============ 移动端下载进度遮罩 & 结果弹窗 ============ */
.dl-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;    /* 手机上从底部滑出 */
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
@media (min-width: 768px) { .dl-mask { align-items: center; } }

.dl-mask.dl-mask-open {
  opacity: 1;
  pointer-events: auto;
}

.dl-box {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 16px 16px 0 0;   /* 底部抽屉圆角（手机） */
  padding: 20px 18px 22px;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(20px);
  transition: transform 0.25s ease;
}
@media (min-width: 768px) {
  .dl-box { border-radius: 16px; transform: scale(0.98); }
  .dl-mask.dl-mask-open .dl-box { transform: scale(1); }
}
.dl-mask.dl-mask-open .dl-box { transform: translateY(0); }

.dl-header { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.dl-icon {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1890ff, #40a9ff);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.dl-title-wrap { flex: 1 1 auto; min-width: 0; }
.dl-title { font-size: 16px; font-weight: 600; color: #111; }
.dl-name  { font-size: 13px; color: #888; margin-top: 2px;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dl-progress-track {
  width: 100%;
  height: 8px;
  background: #f0f2f5;
  border-radius: 999px;
  overflow: hidden;
}
.dl-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1890ff, #52c41a);
  border-radius: 999px;
  transition: width 0.18s linear;
}

.dl-meta {
  display: flex;
  align-items: center;
  margin-top: 10px;
  font-size: 13px;
  color: #555;
  gap: 6px;
}
.dl-sep { color: #d9d9d9; }

.dl-speed { margin-top: 4px; font-size: 12px; color: #888; }

.dl-actions,
.dl-result-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  text-decoration: none;
  color: #fff;
}
.dl-btn-primary { background: #1890ff; }
.dl-btn-primary:hover { background: #096dd9; }
.dl-btn-ghost {
  background: #f5f5f5;
  color: #555;
}
.dl-btn-ghost:hover { background: #e8e8e8; }
.dl-btn-play { background: #52c41a; }
.dl-btn-play:hover { background: #389e0d; }
.dl-btn:active { transform: scale(0.97); }

/* ======= 下载完成结果弹窗 ======= */
.dl-box-result {
  max-width: 560px;
}
.dl-info-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #555;
}
.dl-info-tag {
  display: inline-block;
  padding: 2px 8px;
  background: #e6f4ff;
  color: #1890ff;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.dl-info-sep { color: #d9d9d9; }
.dl-info-size { color: #888; }
.dl-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dl-tips {
  background: #f6f9ff;
  border-left: 3px solid #1890ff;
  padding: 10px 12px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dl-tip { font-size: 13.5px; color: #333; line-height: 1.55; }

.dl-preview-media {
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  max-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dl-preview-media img,
.dl-preview-media video {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  display: block;
}
.dl-fail-msg {
  padding: 14px;
  background: #fff2f0;
  border: 1px solid #ffccc7;
  color: #cf1322;
  border-radius: 8px;
  font-size: 13.5px;
  text-align: center;
}

/* 手机端小屏优化 */
@media (max-width: 480px) {
  .dl-icon { width: 40px; height: 40px; font-size: 20px; flex: 0 0 40px; }
  .dl-title { font-size: 15px; }
  .dl-btn { padding: 10px 14px; font-size: 13.5px; }
}

/* 加载动画 */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 骨架屏样式：严格对齐真实 material-card 尺寸（列宽/比例/内边距），懒加载替换零跳变 */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.skeleton-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.skeleton-thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  position: relative;
  overflow: hidden;
}
.skeleton-thumbnail::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(232,232,232,0.7) 25%, rgba(240,240,240,0.85) 50%, rgba(232,232,232,0.7) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-info {
  padding: 10px;
}

.skeleton-line {
  height: 10px;
  border-radius: 4px;
  margin-bottom: 7px;
  background: linear-gradient(90deg, #e8e8e8 25%, #f0f0f0 50%, #e8e8e8 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-line.short {
  width: 55%;
  height: 9px;
  margin-bottom: 0;
}

.skeleton-line.medium {
  width: 85%;
}

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

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

/* 响应式 */
@media (max-width: 768px) {
  .main {
    flex-direction: column;
    padding: 12px;
  }
  
  .sidebar {
    width: 100%;
    display: none; /* 移动端默认隐藏侧边栏 */
  }
  
  .header {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }
  
  .header h1 {
    font-size: 20px;
  }
  
  .search-box {
    width: 100%;
  }
  
  .search-box input {
    padding: 10px 14px;
    font-size: 16px; /* 防止iOS缩放 */
  }
  
  /* 工具栏优化：排序左，视图右 */
  .toolbar {
    padding: 12px 16px;
    flex-direction: row;
    gap: 8px;
  }

  /* 移动端：浮框形式，避免撑开工具栏影响其他按钮 */
  .time-range {
    position: relative;
  }

  .custom-range {
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    z-index: 100;
    flex-wrap: nowrap;
    white-space: nowrap;
    margin-top: 4px;
    padding: 6px 8px;
    gap: 3px;
    background: var(--card-bg);
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
  }

  .custom-range input[type="date"] {
    width: 95px;
    min-width: 95px;
    padding: 4px 5px;
    font-size: 11px;
    border-radius: 5px;
    box-sizing: border-box;
  }

  .custom-range-sep {
    font-size: 11px;
  }

  .custom-range .btn-sm {
    padding: 4px 7px;
    font-size: 11px;
  }
  
  .sort-options {
    flex: 0 0 auto;
  }

  .sort-options select {
    width: auto;
    min-width: 80px;
    padding: 8px 10px;
    font-size: 13px;
  }
  
  .view-options {
    flex-shrink: 0;
  }

  .view-btn, .filter-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  /* 分页优化 */
  .pagination {
    padding: 12px 8px;
    gap: 8px;
  }
  
  .pagination-main {
    gap: 4px;
  }
  
  .page-btn {
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    font-size: 12px;
  }
  
  .page-ellipsis {
    font-size: 12px;
    padding: 0 2px;
  }
  
  .pagination-jump {
    font-size: 12px;
    gap: 4px;
  }
  
  .jump-input {
    width: 50px;
    padding: 3px 6px;
    font-size: 12px;
  }
  
  .jump-btn {
    padding: 3px 10px;
    font-size: 12px;
  }
  
  .page-info {
    font-size: 12px;
  }
  
  /* 素材网格移动端优化 */
  .materials-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* 骨架屏移动端：严格对齐真实卡片（2列/间距/缩略图比例/info内边距） */
  .skeleton-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .skeleton-info {
    padding: 6px;
  }
  .skeleton-line {
    height: 8px;
    margin-bottom: 5px;
  }
  .skeleton-line.short {
    height: 7px;
    margin-bottom: 0;
  }

  .card-thumbnail {
    aspect-ratio: 16/9;
  }
  
  .card-info {
    padding: 6px;
  }
  
  .card-title {
    font-size: 12px;
  }
  
  /* 列表视图移动端优化 */
  .material-row {
    padding: 12px;
    gap: 12px;
  }
  
  .row-icon {
    font-size: 24px;
    width: 36px;
  }
  
  .row-title {
    font-size: 14px;
  }
  
  .row-meta {
    font-size: 12px;
    gap: 8px;
    flex-wrap: wrap;
  }
  
  .row-tags {
    display: none; /* 移动端列表隐藏标签节省空间 */
  }
  
  /* 弹窗移动端优化 - 上下分栏 */
  .modal-content {
    width: 100%;
    margin: 0;
    border-radius: 16px 16px 0 0;
    max-height: 90vh;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
  }
  
  .detail-body {
    padding: 20px 16px;
  }
  
  /* 详情弹窗上下分栏 */
  .detail-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .detail-title {
    font-size: 18px;
    margin-bottom: 12px;
  }
  
  .detail-section-title {
    margin: 20px 0 10px;
    font-size: 15px;
  }
  
  .detail-info-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .info-item {
    gap: 2px;
  }
  
  .info-label {
    font-size: 11px;
  }
  
  .info-value {
    font-size: 13px;
  }
  
  .detail-tag {
    padding: 4px 10px;
    font-size: 12px;
  }
  
  .detail-summary {
    font-size: 13px;
    line-height: 1.7;
  }
  
  .attr-item {
    padding: 8px 0;
  }
  
  .attr-key, .attr-value {
    font-size: 13px;
  }
  
  .btn-download {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px;
    font-size: 15px;
  }

  /* ===== 详情弹窗：移动端按钮/标题/元数据精细适配 ===== */
  .modal-header h3 { font-size: 14px !important; line-height: 1.35; }
  .detail-title   { font-size: 15px !important; margin-bottom: 8px !important; }
  /* 覆盖上面通用 .btn-download width:100%：弹窗内三按钮必须一行等分 */
  #detailModal .detail-actions { gap: 4px; }
  #detailModal .detail-actions > .btn-download,
  #detailModal .detail-actions > .btn-cast,
  #detailModal .detail-actions > .btn-favorite,
  #detailModal .detail-actions > .btn-tablet-link {
    width: auto !important;
    display: inline-flex !important;
    flex: 1 1 0% !important;
    padding: 9px 4px !important;
    font-size: 12.5px !important;
    gap: 3px;
  }
  /* 弹窗元数据：移动端字体再小一点，更紧凑 */
  #detailModal .detail-info.info-main {
    font-size: 10.5px;
    gap: 4px;
  }
  #detailModal .detail-info.info-main .info-sep { padding: 0 1px; }
  
  /* 筛选面板移动端优化 */
  .filter-panel {
    width: 100%;
    right: -100%;
  }
  
  .filter-panel.open {
    right: 0;
  }
  
  .filter-panel-body {
    padding: 16px;
  }
  
  .date-range {
    flex-direction: column;
    gap: 8px;
  }
  
  .date-range span {
    text-align: center;
  }
}

/* 隐藏视频播放器中央的大播放按钮 */
video::-webkit-media-controls-play-button,
video::-webkit-media-controls-start-playback-button {
  display: none !important;
}

/* ============================================
   筛选面板样式
   ============================================ */

.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* 筛选面板 */
.filter-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  height: 100vh;
  background: var(--card-bg);
  box-shadow: -2px 0 12px rgba(0,0,0,0.15);
  z-index: 200;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.filter-panel.open {
  right: 0;
}

.filter-panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-panel-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.filter-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.filter-panel-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* 筛选组 */
.filter-group {
  margin-bottom: 20px;
}

.filter-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 10px;
}

/* 筛选项 */
.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
}

.filter-radio:hover {
  background: #e8e8e8;
}

.filter-radio input[type="radio"],
.filter-radio input[type="checkbox"] {
  display: none;
}

.filter-radio input[type="radio"]:checked + span,
.filter-radio input[type="checkbox"]:checked + span {
  color: var(--primary);
  font-weight: 500;
}

.filter-radio:has(input[type="radio"]:checked),
.filter-radio:has(input[type="checkbox"]:checked) {
  background: #e6f7ff;
  border: 1px solid var(--primary);
}

/* 筛选输入框 */
.filter-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.filter-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* 日期范围 */
.date-range {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-range .filter-input {
  flex: 1;
}

.date-range span {
  color: var(--text-secondary);
  font-size: 14px;
}

/* 按钮 */
.btn-primary {
  padding: 10px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  padding: 10px 24px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* 遮罩层 */
.filter-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
  display: none;
}

.filter-overlay.show {
  display: block;
}

/* 头部右侧布局 */
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* 用户菜单 */
.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}

.user-info:hover {
  background: var(--bg);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.user-name {
  font-weight: 500;
  font-size: 14px;
}

.user-role {
  font-size: 11px;
  padding: 2px 6px;
  background: var(--bg);
  border-radius: 4px;
  color: var(--text-secondary);
}

.login-link {
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}

.login-link:hover {
  background: var(--primary-hover);
}

/* 用户下拉菜单 */
.user-dropdown {
  position: relative;
}

.user-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  min-width: 160px;
  display: none;
  z-index: 150;
}

.user-dropdown-menu.show {
  display: block;
}

.user-dropdown-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
}

.user-dropdown-item:hover {
  background: var(--bg);
}

.user-dropdown-item:first-child {
  border-radius: 8px 8px 0 0;
}

.user-dropdown-item:last-child {
  border-radius: 0 0 8px 8px;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* 权限提示 */
.permission-hint {
  background: #fff7e6;
  border: 1px solid #ffd591;
  color: #d46b08;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

/* 详情页下载按钮 */
.detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  flex-wrap: wrap;
}

.btn-download {
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-download:hover {
  background: var(--primary-hover);
}

.btn-download:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-download.no-permission {
  background: #f5f5f5;
  color: #999;
  border: 1px dashed #d9d9d9;
}

/* 投送到展厅大屏按钮 */
.btn-cast {
  padding: 12px 24px;
  background: #7c3aed;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}

.btn-cast:hover {
  background: #6d28d9;
}

/* 正在投送中：按钮切换为“更改投放设置”，用青绿色区分当前处于投放态 */
.btn-cast.btn-cast-changing {
  background: #0d9488;
}
.btn-cast.btn-cast-changing:hover {
  background: #0f766e;
}

/* 详情弹框「完整控制→」跳转展厅平板端的链接 */
.btn-tablet-link {
  padding: 12px 16px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-tablet-link:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}

/* 快捷入口 */
.quick-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-link-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s;
}

.quick-link-item:hover {
  background: var(--primary);
  color: white;
}

/* 钉钉手机端浮动菜单 */
.dingtalk-float-menu {
  position: fixed;
  right: 16px;
  bottom: 80px;
  z-index: 1000;
}

.dingtalk-float-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 4px 16px rgba(24, 144, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.dingtalk-float-btn:active {
  transform: scale(0.95);
}

.dingtalk-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
}

.dingtalk-menu-panel {
  position: absolute;
  right: 0;
  bottom: 60px;
  width: 200px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s;
  overflow: hidden;
}

.dingtalk-menu-panel.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dingtalk-menu-header {
  padding: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
}

.dingtalk-menu-name {
  display: block;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}

.dingtalk-menu-role {
  font-size: 12px;
  opacity: 0.9;
}

.dingtalk-menu-items {
  padding: 8px 0;
}

.dingtalk-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}

.dingtalk-menu-item:hover {
  background: var(--bg);
}

.dingtalk-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* 响应式优化 */
@media (max-width: 768px) {
  .header-right {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 12px;
  }
  
  .search-box {
    width: 100%;
  }
  
  .user-menu {
    justify-content: flex-end;
  }
  
  .user-info .user-name {
    display: none;
  }
}

/* ============================================
   收藏功能样式
   ============================================ */

/* 卡片收藏按钮 */
.card-favorite-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 10;
}

.card-favorite-btn:hover {
  background: white;
  transform: scale(1.1);
  color: #ff6b6b;
}

.card-favorite-btn.favorited {
  color: #ff6b6b;
}

.card-favorite-btn.favorited:hover {
  color: #999;
}

/* 详情页收藏按钮 */
.detail-title {
  font-size: 17px;              /* 缩小：20 → 17 */
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
  margin-bottom: 16px;
}

.btn-favorite {
  padding: 12px 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-favorite:hover {
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.btn-favorite.favorited {
  background: #fff0f0;
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.btn-favorite.favorited:hover {
  background: #fff;
  border-color: #999;
  color: #999;
}

@media (max-width: 768px) {
  .btn-favorite {
    padding: 10px 16px;
    font-size: 14px;
  }
}

/* 返回全部按钮 */
.back-to-all-btn {
  padding: 10px 16px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  margin-right: 12px;
  transition: all 0.2s;
}

.back-to-all-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-text {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-hint {
  font-size: 14px;
  color: var(--text-secondary);
}

/* 收藏视图标题 */
.header-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--primary);
}
