/* ============================================================
   毕业项目 + 论文 资源检索站
   深色主题 + 绿色点缀，首页与详情页共用
   ============================================================ */

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: #1e1e2f;
  color: #eee;
  margin: 0;
  padding: 40px 20px;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  box-sizing: border-box;
  overflow-x: hidden; /* 防止水平滚动 */
}

/* --- 主容器 --- */
.container {
  max-width: 800px;
  width: 100%;
  background: #2a2a3b;
  color: #eee;
  padding: 30px 40px;
  border-radius: 4px;
  border: 1px solid #3a3a4b;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.container-wide {
  max-width: 1100px;
}

/* --- Logo + 标题 --- */
.header-section {
  text-align: center;
  margin-bottom: 30px;
  position: relative;
  padding: 15px 0;
}

.logo-title-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.logo-svg {
  width: 40px;
  height: 40px;
}

.main-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: #008000;
  line-height: 1.2;
}

.subtitle {
  font-size: 13px;
  color: #aaa;
  margin: 0;
  font-weight: 400;
  opacity: 0.8;
}

h2 {
  text-align: center;
  color: #008000;
  margin-bottom: 30px;
  font-weight: 600;
  letter-spacing: 1px;
}

/* --- 搜索框 --- */
input {
  width: 100%;
  padding: 15px 20px;
  font-size: 16px;
  border: 2px solid #3a3a4b;
  border-radius: 4px;
  outline: none;
  background: #181824;
  color: #eee;
  box-sizing: border-box;
  transition: all 0.3s ease;
  margin-bottom: 20px;
}

input:focus {
  border-color: #008000;
  background: #20202e;
}

/* --- 筛选条（论文 / PPT / 演示视频） --- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: -8px 0 6px;
  padding: 10px 14px;
  background: #20202e;
  border: 1px solid #3a3a4b;
  border-radius: 4px;
  font-size: 13px;
  color: #9aa;
}

.filter-bar .filter-label {
  color: #888;
  flex-shrink: 0;
}

.filter-bar .filter-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid #3a3a4b;
  border-radius: 4px;
  background: #26263a;
  color: #9aa;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}

.filter-bar .filter-item:hover {
  border-color: #008000;
  color: #eee;
}

.filter-bar .filter-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  padding: 0;
  accent-color: #008000;
  color-scheme: dark; /* 让未选中态也跟随深色主题 */
  cursor: pointer;
  flex-shrink: 0;
}

/* 选中状态高亮 */
.filter-bar .filter-item:has(input:checked) {
  border-color: #008000;
  background: rgba(0, 128, 0, 0.15);
  color: #7fd67f;
}

.filter-bar .filter-count {
  margin-left: auto;
  font-size: 12px;
  color: #777;
}

/* --- 搜索结果列表 --- */
ul.search-results {
  margin-top: 15px;
  padding-left: 0;
  list-style: none;
}

ul.search-results li {
  padding: 12px 20px;
  margin-bottom: 12px;
  background: #333344;
  border-left: 4px solid #008000;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
  opacity: 0;
  animation: slideInUp 0.4s ease forwards;
}

ul.search-results li.simulating {
  animation: none !important;
  opacity: 1 !important;
}

ul.search-results li:hover {
  background: #404052;
}

/* 结果项内部结构 */
.result-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex-grow: 1;
}

.result-cover {
  width: 72px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 3px;
  overflow: hidden;
  background: #26263a;
  border: 1px solid #3a3a4b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #555;
}

.result-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.result-text {
  min-width: 0;
  flex-grow: 1;
}

.result-text > span {
  display: block;
  word-break: break-word;
  line-height: 1.4;
}

.result-path {
  font-size: 11px;
  color: #777;
  margin-top: 4px;
  word-break: break-all;
}

.result-chips {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid #3a3a4b;
  color: #9aa;
}

.chip-img {
  color: #7fd67f;
  border-color: rgba(0, 128, 0, 0.45);
}

.chip-vid {
  color: #6fb3e0;
  border-color: rgba(74, 144, 226, 0.45);
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.highlight {
  color: #ffeb3b;
  font-weight: bold;
  background: rgba(255, 235, 59, 0.15);
  padding: 0 2px;
}

/* 详情入口链接 */
a.detail-link {
  display: inline-block;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  text-decoration: none;
  color: #7fb3e0;
  border: 1px solid #4a90e2;
  background: rgba(74, 144, 226, 0.12);
  transition: all 0.2s;
  white-space: nowrap;
}

a.detail-link:hover {
  background: #4a90e2;
  color: #fff;
}

.pending-badge {
  display: inline-block;
  padding: 5px 10px;
  font-size: 11px;
  color: #777;
  border: 1px dashed #3a3a4b;
  border-radius: 4px;
  white-space: nowrap;
}

/* --- 通用提示 / 空状态 --- */
.empty-tip {
  text-align: center;
  color: #666;
  font-size: 14px;
  padding: 24px 10px;
  line-height: 1.7;
}

.empty-tip code {
  color: #7fd67f;
  background: rgba(0, 128, 0, 0.1);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}

/* 筛选无结果时：追加展示「不限筛选条件」的关键词结果 */
.empty-tip .fallback-title {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px dashed #3a3a4b;
  color: #aaa;
  font-size: 13px;
}

.empty-tip .fallback-title b {
  color: #7fd67f;
}

/* 兜底结果列表：顶部加提示线，与上方提示区分 */
ul.search-results.fallback-list {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #3a3a4b;
}

/* --- 右下角悬浮按钮 (FAB) --- */
.cart-fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: #008000;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 1001;
  transition: all 0.3s ease;
  user-select: none;
  border: 2px solid #3a3a4b;
}

.cart-fab:hover {
  background: #4a90e2;
}

.cart-fab:active {
  transform: scale(0.95);
}

.cart-svg {
  width: 32px;
  height: 32px;
  transition: transform 0.3s ease;
}

.cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff6b6b;
  color: white;
  font-size: 12px;
  font-weight: bold;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid #2a2a3b;
  padding: 0 4px;
  opacity: 0; /* 默认隐藏，有数量时显示 */
  transition: all 0.3s ease;
}

.cart-badge.has-items {
  opacity: 1;
  transform: scale(1);
}

/* --- 悬浮面板 --- */
.floating-widget {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 300px;
  background: #2a2a3b;
  border: 1px solid #3a3a4b;
  border-radius: 4px;
  padding: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: 70vh;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transform-origin: bottom right;
  transition: all 0.3s ease;
}

.floating-widget.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.widget-header {
  font-size: 14px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.close-panel-btn {
  position: absolute;
  right: 0;
  top: -5px;
  font-size: 20px;
  cursor: pointer;
  color: #888;
  padding: 0 5px;
}

.close-panel-btn:hover {
  color: #fff;
}

.cart-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cart-title {
  font-size: 14px;
  color: #008000;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.cart-list-wrapper {
  overflow-y: auto;
  max-height: 35vh;
  padding-right: 5px;
}

.cart-list-wrapper::-webkit-scrollbar {
  width: 6px;
}

.cart-list-wrapper::-webkit-scrollbar-thumb {
  background: #4a4a5b;
  border-radius: 3px;
}

.cart-list-wrapper::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

ul.cart-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

ul.cart-list li {
  background: rgba(0, 0, 0, 0.2);
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: fadeIn 0.3s ease;
  border-left: 2px solid #aaa;
}

ul.cart-list li span {
  flex-grow: 1;
  word-break: break-word;
  white-space: normal;
  line-height: 1.3;
}

.remove-btn {
  background: transparent;
  color: #e57373;
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 5px;
  opacity: 0.7;
  transition: opacity 0.2s;
  box-shadow: none;
}

.remove-btn:hover {
  opacity: 1;
  background: transparent;
}

.empty-cart-tip {
  text-align: center;
  color: #555;
  font-size: 13px;
  padding: 20px 0;
  font-style: italic;
}

/* --- 联系与操作区 --- */
.contact-section {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 15px;
  text-align: center;
  flex-shrink: 0;
}

.wechat-id {
  font-size: 18px;
  color: #f9d681;
  display: block;
  margin: 5px 0 15px 0;
}

/* --- 按钮通用样式 --- */
button {
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  background: #008000;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

ul.search-results button {
  padding: 6px 15px;
  font-size: 12px;
  min-width: 60px;
}

button:hover:not([disabled]) {
  background: #4a90e2;
}

button:active:not([disabled]) {
  transform: scale(0.96);
}

button:disabled {
  background: #444;
  color: #888;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: #9aa;
  border: 1px solid #3a3a4b;
}

.btn-secondary:hover:not([disabled]) {
  background: #3a3a4b;
  color: #fff;
}

#copyGreeting {
  width: 100%;
  background: linear-gradient(45deg, #ff9800, #ff5722);
  font-size: 14px;
  line-height: 1.4;
  display: none;
}

#copyGreeting:hover {
  background: linear-gradient(45deg, #ffa726, #ff7043);
}

/* VIP 流光特效 */
.vip-glow {
  position: relative;
  display: inline-block;
  overflow: hidden;
  width: 100%;
}

.vip-glow::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
  animation: shine 3s infinite;
  pointer-events: none;
}

@keyframes shine {
  0% { left: -75%; }
  20% { left: 125%; }
  100% { left: 125%; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Toast 提示 --- */
#toast {
  visibility: hidden;
  min-width: 250px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 4px;
  padding: 16px;
  position: fixed;
  z-index: 2000;
  left: 50%;
  top: 30px;
  transform: translateX(-50%);
  border: 1px solid #008000;
  opacity: 0;
  transition: opacity 0.3s, top 0.3s;
  max-width: calc(100% - 40px);
  box-sizing: border-box;
}

#toast.show {
  visibility: visible;
  opacity: 1;
  top: 60px;
}

.hidden {
  display: none !important;
}

/* ============================================================
   详情页
   ============================================================ */

.detail-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.back-link {
  color: #7fb3e0;
  text-decoration: none;
  font-size: 14px;
  border: 1px solid #3a3a4b;
  padding: 8px 14px;
  border-radius: 4px;
  transition: all 0.2s;
}

.back-link:hover {
  border-color: #4a90e2;
  background: rgba(74, 144, 226, 0.12);
}

.detail-title {
  font-size: 22px;
  color: #fff;
  margin: 10px 0;
  line-height: 1.4;
  word-break: break-word;
}

.detail-path {
  font-size: 12px;
  color: #888;
  word-break: break-all;
  margin: 0 0 20px;
}

/* 统计卡片 */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 26px;
}

.stat-card {
  background: #333344;
  border: 1px solid #3a3a4b;
  border-radius: 4px;
  padding: 12px 14px;
}

.stat-card span {
  display: block;
  font-size: 12px;
  color: #888;
  margin-bottom: 6px;
}

.stat-card strong {
  font-size: 18px;
  color: #7fd67f;
}

/* 分区标题 */
.section-title {
  font-size: 16px;
  color: #008000;
  font-weight: 600;
  margin: 28px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #3a3a4b;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

/* 标题左侧文字 + 数量（数量紧跟在标题右侧） */
.section-title .section-head {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

/* 标题右侧操作按钮组（靠右） */
.section-title .section-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.section-title .count {
  font-size: 13px;
  color: #888;
  font-weight: 400;
}

/* 图片网格 */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.image-grid figure {
  margin: 0;
  position: relative;
  background: #26263a;
  border: 1px solid #3a3a4b;
  border-radius: 4px;
  overflow: hidden;
  cursor: zoom-in;
  transition: all 0.2s;
}

.image-grid figure:hover {
  border-color: #008000;
  transform: translateY(-2px);
}

.image-grid img {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
  object-position: top center;
}

.image-grid figcaption {
  font-size: 11px;
  color: #888;
  padding: 5px 7px;
  border-top: 1px solid #3a3a4b;
}

/* 视频 */
.video-player {
  width: 100%;
  max-height: 460px;
  background: #000;
  border: 1px solid #3a3a4b;
  border-radius: 4px;
  margin-bottom: 12px;
}

.video-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.video-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
  background: #333344;
  border-left: 4px solid #4a90e2;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.video-list li:hover {
  background: #404052;
}

.video-list li.active {
  border-left-color: #008000;
  background: #3b4a3b;
}

.video-list li .vname {
  word-break: break-all;
  flex-grow: 1;
}

.video-list li .vsize {
  color: #888;
  font-size: 11px;
  flex-shrink: 0;
}

/* 文件树 */
.tree-text {
  background: #181824;
  border: 1px solid #3a3a4b;
  border-radius: 4px;
  padding: 14px 16px;
  margin: 0;
  font-family: "Cascadia Mono", Consolas, "Microsoft YaHei", monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: #b9c4d0;
  max-height: 420px;
  max-width: 100%;
  overflow: auto;
  white-space: pre;
}

.tree-view,
.tree-view ul {
  list-style: none;
  margin: 0;
  padding-left: 16px;
  font-size: 13px;
  line-height: 1.8;
}

.tree-view {
  padding-left: 0;
}

.tree-view ul {
  border-left: 1px dashed #3a3a4b;
}

.tree-view .tname {
  color: #b9c4d0;
}

.tree-view .tdir > .tname {
  color: #7fd67f;
}

.tree-view .tsize {
  color: #666;
  font-size: 11px;
  margin-left: 8px;
}

.tree-box {
  background: #20202e;
  border: 1px solid #3a3a4b;
  border-radius: 4px;
  padding: 14px 16px;
  max-height: 420px;
  max-width: 100%;
  overflow: auto;
}

/* 灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 60px;
}

.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 130px);
  border: 1px solid #3a3a4b;
  border-radius: 4px;
}

.lightbox-caption {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: #ccc;
  background: rgba(42, 42, 59, 0.9);
  border: 1px solid #3a3a4b;
  padding: 6px 14px;
  border-radius: 4px;
}

.lb-btn {
  position: absolute;
  display: flex;            /* 让 × / ‹ / › 在按钮内居中 */
  align-items: center;
  justify-content: center;
  padding: 0;               /* 清除全局 button 的 padding，否则内容偏移 */
  line-height: 1;
  background: rgba(42, 42, 59, 0.9);
  border: 1px solid #3a3a4b;
  color: #eee;
  font-size: 22px;
  width: 40px;
  height: 56px;
  border-radius: 4px;
  cursor: pointer;
}

.lb-btn:hover {
  border-color: #008000;
  background: rgba(60, 60, 80, 0.95);
}

.lb-close { top: 16px; right: 20px; width: 40px; height: 40px; }
/* 用 margin 定位而非 transform: translateY(-50%)，
   避免被全局 button:active{transform:scale(.96)} 覆盖导致点击时按钮跳动 */
.lb-prev { left: 12px; top: 50%; margin-top: -28px; }
.lb-next { right: 12px; top: 50%; margin-top: -28px; }

/* 视频弹框 */
.video-modal-body {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-modal-title {
  color: #eee;
  font-size: 14px;
  text-align: center;
  word-break: break-all;
  padding: 0 40px;
}

.video-modal-player {
  width: 100%;
  max-height: calc(100vh - 170px);
  background: #000;
  border: 1px solid #3a3a4b;
  border-radius: 4px;
}

/* 轻量版：视频文件未提供，列表项为提示态 */
.video-list li.video-omitted {
  border-left-color: #777;
  cursor: help;
}

.video-list li.video-omitted:hover {
  background: #3b3b4d;
}

.video-list li.video-omitted .vname {
  color: #9aa;
}

/* 视频区提示条 */
.video-note {
  font-size: 13px;
  color: #bbb;
  background: rgba(255, 152, 0, 0.08);
  border: 1px solid rgba(255, 152, 0, 0.35);
  border-left: 4px solid #ff9800;
  border-radius: 4px;
  padding: 12px 14px;
  margin-bottom: 12px;
  line-height: 1.6;
}

.video-note b {
  color: #ffb74d;
}

/* --- 响应式设计 --- */
@media (max-width: 768px) {
  body {
    flex-direction: column;
    padding: 10px;
    min-height: 100vh;
  }

  .container {
    padding: 15px;
    margin: 0 auto 15px auto;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .header-section {
    margin-bottom: 25px;
    padding: 12px 0;
  }

  .logo-title-container {
    gap: 10px;
    margin-bottom: 6px;
  }

  .logo-svg {
    width: 32px;
    height: 32px;
  }

  .main-title {
    font-size: 20px;
  }

  .subtitle {
    font-size: 12px;
  }

  h2 {
    font-size: 22px;
    margin-bottom: 20px;
    text-align: center;
  }

  input {
    font-size: 16px; /* 防止 iOS 缩放 */
    padding: 12px 15px;
    width: 100%;
    box-sizing: border-box;
  }

  /* 搜索结果在移动端的优化 */
  ul.search-results li {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px;
    margin-bottom: 10px;
  }

  ul.search-results li span {
    width: 100%;
    word-break: break-word;
    line-height: 1.4;
    font-size: 14px;
  }

  .result-actions {
    justify-content: flex-end;
  }

  ul.search-results button {
    padding: 5px 12px;
    font-size: 11px;
    min-width: 65px;
    width: auto;
  }

  a.detail-link {
    font-size: 11px;
    padding: 5px 12px;
  }

  /* 悬浮按钮 */
  .cart-fab {
    bottom: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
  }

  .cart-svg {
    width: 26px;
    height: 26px;
  }

  /* 悬浮面板 */
  .floating-widget {
    width: calc(100% - 20px);
    right: 10px;
    left: 10px;
    bottom: 80px;
    max-height: 65vh;
    padding: 12px;
    box-sizing: border-box;
  }

  .widget-header {
    font-size: 12px;
    padding-bottom: 8px;
  }

  .cart-list-wrapper {
    max-height: 30vh;
  }

  ul.cart-list li {
    padding: 8px;
    font-size: 13px;
    word-break: break-word;
  }

  ul.cart-list li span {
    flex-grow: 1;
    margin-right: 8px;
    word-break: break-word;
    white-space: normal;
    line-height: 1.3;
  }

  .wechat-id {
    font-size: 16px;
    margin: 8px 0 10px 0;
  }

  button {
    padding: 10px 15px;
    font-size: 14px;
    touch-action: manipulation;
  }

  #copyGreeting {
    font-size: 13px;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
  }

  #toast {
    min-width: 200px;
    max-width: calc(100vw - 40px);
    padding: 12px 16px;
    font-size: 14px;
  }

  /* 详情页 */
  .stat-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .image-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .image-grid img {
    height: 100px;
  }

  .lightbox {
    padding: 30px 10px 70px;
  }

  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }
}

/* 小屏幕设备进一步优化 */
@media (max-width: 480px) {
  body {
    padding: 5px;
  }

  .container {
    padding: 12px;
    width: 100%;
    margin: 0 auto 15px auto;
  }

  .header-section {
    margin-bottom: 20px;
    padding: 10px 0;
  }

  .logo-title-container {
    gap: 8px;
    margin-bottom: 5px;
  }

  .logo-svg {
    width: 28px;
    height: 28px;
  }

  .main-title {
    font-size: 18px;
  }

  .subtitle {
    font-size: 11px;
  }

  h2 {
    font-size: 20px;
    margin-bottom: 15px;
  }

  input {
    padding: 10px 12px;
    font-size: 16px;
  }

  ul.search-results li {
    padding: 10px;
  }

  ul.search-results li span {
    font-size: 16px;
  }

  ul.search-results button {
    padding: 5px 12px;
    font-size: 13px;
    min-width: 55px;
  }

  .floating-widget {
    width: calc(100% - 10px);
    right: 5px;
    left: 5px;
    padding: 10px;
    bottom: 70px;
    max-height: 60vh;
  }

  .cart-fab {
    width: 45px;
    height: 45px;
    bottom: 10px;
    right: 10px;
  }

  .cart-svg {
    width: 24px;
    height: 24px;
  }

  .wechat-id {
    font-size: 15px;
  }

  ul.cart-list li {
    font-size: 17px;
    padding: 6px;
    word-break: break-word;
  }

  .result-cover {
    width: 60px;
    height: 44px;
  }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
  .floating-widget {
    max-height: 50vh;
  }

  .cart-list-wrapper {
    max-height: 25vh;
  }
}
