/**
 * search.css — 搜索页样式
 */

/* ===== 搜索页布局 ===== */
.search-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 20px 0;
  padding-top: calc(64px + var(--safe-top));
}

/* ===== Logo 区域 ===== */
.search-logo-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 36px;
}

.search-logo-img {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
}

.search-logo-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 12px;
  letter-spacing: 0.05em;
}

/* ===== 搜索表单 ===== */
.search-form {
  width: 100%;
  max-width: 420px;
}

.search-field {
  margin-bottom: 16px;
}

.search-input-row {
  width: 100%;
  height: 52px;
  background: var(--color-card);
  border-radius: var(--radius-md);
  padding: 0 16px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.search-input {
  flex: 1;
  height: 52px;
  border: none;
  outline: none;
  font-size: 16px;
  background: transparent;
  color: var(--color-ink);
  padding: 0 8px;
}

.search-input::placeholder {
  color: var(--color-placeholder);
}

.search-input-required {
  color: var(--color-error);
  font-size: 18px;
  flex-shrink: 0;
  margin-left: 4px;
}

/* ===== 上传区域 ===== */
.search-upload-field {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.search-upload-btn {
  width: 100px;
  height: 100px;
  background: var(--color-card);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, transform 0.15s;
}

.search-upload-btn:active {
  background: var(--color-divider);
  opacity: 0.7;
  transform: scale(0.97);
}

.search-upload-icon {
  width: 24px;
  height: 24px;
  position: relative;
}

.search-upload-icon::before,
.search-upload-icon::after {
  content: '';
  position: absolute;
  background: var(--color-placeholder);
  border-radius: 1px;
}

.search-upload-icon::before {
  top: 50%;
  left: 0;
  width: 24px;
  height: 2px;
  transform: translateY(-50%);
}

.search-upload-icon::after {
  left: 50%;
  top: 0;
  width: 2px;
  height: 24px;
  transform: translateX(-50%);
}

.search-upload-text {
  font-size: 13px;
  color: var(--color-muted);
}

.search-upload-tips {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 4px;
}

.search-upload-tip {
  font-size: 11px;
  color: var(--color-placeholder);
  line-height: 1.6;
}

/* ===== 开始听书按钮 ===== */
.search-go-btn {
  width: 100%;
  height: 52px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  box-shadow: 0 4px 16px rgba(0, 100, 137, 0.25);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.search-go-btn:active {
  opacity: 0.85;
  transform: scale(0.98);
}

.search-go-btn:disabled {
  background: var(--color-border);
  box-shadow: none;
  cursor: not-allowed;
}

.search-go-text {
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 600;
}

/* ===== 搜索历史 ===== */
.search-history {
  width: 100%;
  max-width: 420px;
  margin-top: 32px;
}

.search-history-title {
  font-size: 13px;
  color: var(--color-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.search-history-clear {
  color: var(--color-placeholder);
  cursor: pointer;
  font-size: 12px;
}

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

.search-history-tag {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 13px;
  color: var(--color-muted);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.search-history-tag:active {
  opacity: 0.7;
  transform: scale(0.95);
}

/* ===== 搜索结果弹窗 ===== */
.search-result-modal {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.search-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--color-card);
  border-bottom: 1px solid var(--color-divider);
}

.search-result-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-ink);
}

.search-result-close {
  font-size: 20px;
  color: var(--color-placeholder);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.search-result-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px calc(12px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

.search-result-section-title {
  font-size: 13px;
  color: var(--color-placeholder);
  display: block;
  margin-bottom: 8px;
  margin-top: 16px;
}

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

/* 书籍结果卡片 */
.search-result-card {
  background: var(--color-card);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.search-result-card:active {
  opacity: 0.7;
  transform: scale(0.98);
}

.search-result-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 4px;
}

.search-result-card-author {
  font-size: 13px;
  color: var(--color-muted);
  margin-bottom: 4px;
}

.search-result-card-desc {
  font-size: 12px;
  color: var(--color-placeholder);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 0;
}

.search-result-empty-text {
  font-size: 15px;
  color: var(--color-muted);
  margin-bottom: 4px;
}

.search-result-empty-sub {
  font-size: 13px;
  color: var(--color-placeholder);
}

/* ===== 确认弹窗 ===== */
.search-confirm-book {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.search-confirm-book-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-ink);
}

.search-confirm-book-author {
  font-size: 14px;
  color: var(--color-muted);
}

.search-confirm-book-desc {
  font-size: 13px;
  color: var(--color-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
