/* 存档猫 PC 端样式：仿 AirPortal 极简清爽风格，纯 CSS 无框架 */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --theme: #4191f5;
  --theme-hover: #2c80eb;
  --theme-tint: rgba(65, 145, 245, 0.1);
  --theme-shadow: rgba(65, 145, 245, 0.28);
  --wx-green: #07c160;
  --alert: #eb003c;
  --text-main: rgba(0, 0, 0, 0.85);
  --text-sub: rgba(0, 0, 0, 0.56);
  --text-muted: rgba(0, 0, 0, 0.36);
  --border-light: rgba(0, 0, 0, 0.07);
  --radius-card: 20px;
  --radius-btn: 10px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

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

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-main);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font-family: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

/* 顶部悬浮圆角导航栏（仿 AirPortal .rth4fcdfea1） */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  margin: 12px 16px;
  padding: 10px 18px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 5px 20px rgba(65, 145, 245, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.4px;
}

.brand-tag {
  font-size: 12px;
  color: var(--theme);
  background: var(--theme-tint);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-wx-login {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  background: #f2f7ff;
  color: var(--theme);
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.2s, transform 0.15s;
}

.btn-wx-login:hover {
  background: #e3efff;
}

.btn-wx-login:active {
  transform: scale(0.97);
}

.wx-dot {
  color: var(--wx-green);
  display: inline-flex;
  align-items: center;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: #eef2f7;
  flex-shrink: 0;
}

.user-avatar-block {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-quota {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-logout {
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-sub);
  transition: background-color 0.2s, color 0.2s;
}

.btn-logout:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-main);
}

/* 居中主舞台（仿 AirPortal .rth242b1959） */
.stage {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 92px 20px 64px;
}

.hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 40px;
  border-radius: 28px;
}

.hero-emblem {
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.hero-logo {
  width: 84px;
  height: 84px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 10px 22px rgba(65, 145, 245, 0.22));
}

.hero-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.6px;
}

.hero-sub {
  margin-top: 8px;
  margin-bottom: 42px;
  font-size: 14px;
  color: var(--text-sub);
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.hero-btn {
  width: 240px;
  height: 52px;
  border-radius: var(--radius-btn);
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color 0.22s, box-shadow 0.22s, transform 0.16s, opacity 0.2s;
}

.hero-btn:active {
  transform: scale(0.96);
  opacity: 0.9;
}

.hero-btn-primary {
  background: var(--theme);
  color: #fff;
  box-shadow: 0 6px 22px rgba(65, 145, 245, 0.34);
}

.hero-btn-primary:hover {
  background: var(--theme-hover);
  box-shadow: 0 10px 28px rgba(65, 145, 245, 0.42);
}

.hero-btn-secondary {
  background: var(--surface);
  color: var(--theme);
  box-shadow: 0 6px 22px rgba(65, 145, 245, 0.18);
}

.hero-btn-secondary:hover {
  background: #f5f9ff;
  box-shadow: 0 10px 28px rgba(65, 145, 245, 0.26);
}

.count-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--theme-tint);
  color: var(--theme);
}

.hero-tip {
  margin-top: 26px;
  font-size: 12px;
  color: var(--text-muted);
}

/* 底部版权与协议 */
.page-footer {
  position: fixed;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.page-footer a {
  pointer-events: auto;
  transition: color 0.2s;
}

.page-footer a:hover {
  color: var(--theme);
}

/* 通用居中弹层（仿 AirPortal 弹卡风格） */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(16, 24, 40, 0.28);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-mask.mask-top {
  z-index: 60;
}

.panel-card {
  position: relative;
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.14);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: popIn 0.18s ease-out;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.panel-upload {
  max-width: 560px;
  max-height: 84vh;
}

.panel-query {
  max-width: 820px;
  height: min(78vh, 660px);
}

.panel-wx {
  max-width: 390px;
  text-align: center;
}

.panel-agreement {
  max-width: 520px;
  max-height: 82vh;
}

.panel-preview {
  max-width: 900px;
  max-height: 88vh;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.panel-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-head-acts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-link {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--theme);
  background: var(--theme-tint);
  transition: background-color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-link:hover {
  background: rgba(65, 145, 245, 0.18);
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--text-sub);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
}

.btn-icon:hover {
  background: var(--theme-tint);
  color: var(--theme);
}

.btn-icon.spinning svg {
  animation: spin 0.8s linear infinite;
}

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

.panel-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}

/* 上传面板 */
.dropzone {
  border: 2px dashed #bdd7fb;
  background: #f6faff;
  border-radius: 16px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.dropzone:hover,
.dropzone.is-drag {
  border-color: var(--theme);
  background: #ecf4ff;
}

.dropzone-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: #e2eeff;
  color: var(--theme);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.dropzone-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.upload-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upload-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f7f8fb;
}

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

.upload-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.upload-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-status {
  font-size: 12px;
  color: var(--text-sub);
  flex-shrink: 0;
}

.upload-status.ok {
  color: var(--theme);
  font-weight: 600;
}

.upload-status.fail {
  color: var(--alert);
  font-weight: 600;
}

.upload-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}

.progress-track {
  margin-top: 6px;
  height: 4px;
  border-radius: 2px;
  background: #e6ebf2;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: var(--theme);
  transition: width 0.15s ease;
}

.progress-fill.fail {
  width: 100% !important;
  background: var(--alert);
}

.panel-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.foot-summary {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--text-sub);
}

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

.btn-primary {
  height: 36px;
  padding: 0 16px;
  border-radius: 9px;
  background: var(--theme);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.2s;
}

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-ghost {
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  background: #f2f4f8;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.2s, color 0.2s;
}

.btn-ghost:hover {
  background: #e7ebf2;
  color: var(--text-main);
}

/* 查询面板：搜索与筛选 */
.query-toolbar {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  border-radius: 11px;
  background: #f5f7fa;
  border: 1px solid transparent;
  transition: background-color 0.2s, border-color 0.2s;
}

.search-box:focus-within {
  background: #fff;
  border-color: var(--theme);
  box-shadow: 0 0 0 3px rgba(65, 145, 245, 0.12);
}

.search-box-icon {
  color: var(--text-muted);
  display: inline-flex;
  margin-right: 8px;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-main);
}

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

.search-clear {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #cfd5df;
  color: #fff;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-clear:hover {
  background: #aab3c2;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-sub);
  background: #f3f5f8;
  transition: background-color 0.2s, color 0.2s;
}

.filter-chip:hover {
  background: #e9eef6;
}

.filter-chip.active {
  background: var(--theme-tint);
  color: var(--theme);
  font-weight: 600;
}

/* 文件列表 */
.query-list-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px 16px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 10px;
  border-radius: 12px;
  transition: background-color 0.16s;
}

.file-row:hover {
  background: #f6f9fe;
}

.file-thumb-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  background: #eef1f6;
  flex-shrink: 0;
}

.file-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-play::after {
  content: "";
  margin-left: 2px;
  border-left: 6px solid #fff;
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
}

.file-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-main {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-today {
  color: var(--theme);
  font-weight: 600;
}

.file-snippet {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

mark.kw-hit {
  background: rgba(65, 145, 245, 0.16);
  color: var(--theme);
  border-radius: 3px;
  padding: 0 2px;
}

.file-acts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-mini {
  height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  background: #f2f4f8;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.18s, color 0.18s;
}

.btn-mini:hover {
  background: #e5e9f0;
  color: var(--text-main);
}

.btn-mini-primary {
  color: var(--theme);
  background: var(--theme-tint);
}

.btn-mini-primary:hover {
  background: var(--theme);
  color: #fff;
}

.query-empty {
  height: 100%;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* 微信登录弹窗 */
.wx-body {
  padding: 18px 24px 24px;
}

.wx-subtitle {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 14px;
}

.wx-qr-clip {
  height: 224px;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.wx-fast-tip {
  margin-top: 10px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
}

.wx-loading {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
}

.wx-note {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff8eb;
  color: #946200;
  font-size: 12px;
  line-height: 1.5;
}

.wx-agree {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.wx-agree a {
  color: var(--theme);
}

/* 协议弹层 */
.ag-body {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-sub);
  text-align: justify;
}

.ag-body p + p {
  margin-top: 10px;
}

.ag-err {
  margin-top: 10px;
  font-size: 12px;
  color: var(--alert);
  text-align: center;
}

/* 预览弹窗 */
.preview-body {
  padding: 16px;
  background: #f5f7fa;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  max-height: 70vh;
  overflow: auto;
  position: relative;
}

.preview-img {
  max-width: 100%;
  max-height: 64vh;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.preview-video {
  max-width: 100%;
  max-height: 64vh;
  border-radius: 8px;
  background: #000;
}

.preview-frame {
  width: 100%;
  height: 64vh;
  border: none;
  border-radius: 8px;
  background: #fff;
}

.preview-text {
  width: 100%;
  max-height: 64vh;
  overflow: auto;
  padding: 16px;
  border-radius: 10px;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-main);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-nav.prev {
  left: 16px;
}

.preview-nav.next {
  right: 16px;
}

/* 全屏拖拽上传遮罩 */
.drag-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(65, 145, 245, 0.12);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 24px;
  display: flex;
}

.drag-overlay-box {
  flex: 1;
  border: 3px dashed var(--theme);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--theme);
  font-size: 20px;
  font-weight: 700;
}

/* 顶部轻量提示 */
.toast {
  position: fixed;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(24, 28, 36, 0.88);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  pointer-events: none;
}

/* 回调页 */
.callback-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: 20px;
  padding: 36px 28px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.callback-spinner {
  width: 38px;
  height: 38px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid #e6eefc;
  border-top-color: var(--theme);
  animation: spin 0.8s linear infinite;
}

.callback-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}

.callback-err {
  margin-top: 10px;
  font-size: 13px;
  color: var(--alert);
}

.callback-back {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 640px) {
  .topbar {
    margin: 8px 10px;
    padding: 8px 12px;
  }
  .brand-tag,
  .user-quota {
    display: none;
  }
  .hero-card {
    padding: 24px 16px;
  }
  .panel-head {
    padding: 14px 16px;
  }
  .panel-body {
    padding: 16px;
  }
  .panel-foot {
    padding: 12px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .foot-summary {
    text-align: center;
    font-size: 12px;
  }
  .foot-acts {
    width: 100%;
    gap: 10px;
  }
  .foot-acts .btn-ghost,
  .foot-acts .btn-primary {
    flex: 1;
    height: 40px;
  }
  .query-toolbar {
    padding: 12px 16px;
  }
  .panel-query {
    height: 86vh;
  }
  .panel-preview .panel-head-acts .btn-ghost,
  .panel-preview .panel-head-acts .btn-primary {
    padding: 0 10px;
    font-size: 12px;
    height: 32px;
  }
  .file-acts {
    flex-direction: column;
    gap: 4px;
  }
}
