/* ============================================================
   Container Tracker — 全局样式
   移植自小程序 app.wxss + 各页面/组件 wxss
   ============================================================ */

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #333;
  background: #f5f5f5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 720px; margin: 0 auto; padding: 16px; }

/* === Header === */
.header {
  background: #1a73e8; color: #fff; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.header-title { font-size: 17px; font-weight: 600; }
.header-link { color: #fff; font-size: 13px; text-decoration: none; padding: 6px 12px; border: 1px solid rgba(255,255,255,0.5); border-radius: 4px; }
.header-link:hover { background: rgba(255,255,255,0.15); }

/* === Tab Bar === */
.tab-bar { display: flex; background: #fff; border-radius: 8px; overflow: hidden; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.tab-item { flex: 1; text-align: center; padding: 14px 0; font-size: 14px; color: #666; cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s; background: none; border-top: none; border-left: none; border-right: none; }
.tab-item.active { color: #1a73e8; border-bottom-color: #1a73e8; font-weight: 600; }
.tab-item:hover { background: #f8f9fa; }

/* === Cards === */
.card { background: #fff; border-radius: 8px; padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.card-header { border-bottom: 1px solid #e8f0fe; padding-bottom: 10px; margin-bottom: 12px; }
.card-header-title { font-size: 18px; font-weight: 700; color: #1a73e8; letter-spacing: 0.5px; }

/* === Field Rows === */
.field-row { display: flex; padding: 5px 0; border-bottom: 1px solid #f0f0f0; }
.field-row:last-child { border-bottom: none; }
.field-label { width: 80px; flex-shrink: 0; font-size: 13px; color: #888; }
.field-value { flex: 1; font-size: 13px; color: #333; word-break: break-all; }

/* === Search Bar === */
.search-wrap { display: flex; gap: 10px; margin-bottom: 16px; }
.search-input-wrap { flex: 1; display: flex; align-items: center; background: #fff; border-radius: 8px; padding: 0 12px; height: 44px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.search-input-wrap .icon { font-size: 18px; margin-right: 8px; flex-shrink: 0; }
.search-input-wrap input { flex: 1; border: none; outline: none; font-size: 15px; color: #333; background: transparent; }
.search-input-wrap input::placeholder { color: #bbb; }
.search-clear { font-size: 14px; color: #bbb; cursor: pointer; padding: 4px; border: none; background: none; }
.search-clear:hover { color: #999; }
.search-btn { width: 72px; height: 44px; background: #1a73e8; color: #fff; font-size: 15px; border: none; border-radius: 8px; cursor: pointer; flex-shrink: 0; }
.search-btn:hover { background: #1557b0; }
.search-btn:disabled { background: #a0c4f1; cursor: default; }

/* === States: Loading, Empty, Error === */
.state-wrap { text-align: center; padding: 60px 20px; }
.state-icon { font-size: 48px; margin-bottom: 12px; color: #ccc; }
.state-text { font-size: 15px; color: #888; margin-bottom: 8px; }
.state-hint { font-size: 12px; color: #bbb; }

.spinner { width: 24px; height: 24px; border: 2px solid #e0e0e0; border-top-color: #1a73e8; border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

.error-icon { font-size: 48px; margin-bottom: 12px; }
.error-text { color: #e53935; font-size: 14px; margin-bottom: 16px; }

/* === Buttons === */
.btn-primary { background: #1a73e8; color: #fff; border: none; border-radius: 6px; padding: 10px 24px; font-size: 15px; cursor: pointer; }
.btn-primary:hover { background: #1557b0; }
.btn-primary:disabled { background: #ccc; color: #999; cursor: default; }
.btn-secondary { background: #f0f0f0; color: #333; border: none; border-radius: 6px; padding: 8px 16px; font-size: 13px; cursor: pointer; }
.btn-secondary:hover { background: #e0e0e0; }
.btn-outline { background: #fff; color: #666; border: 1px solid #ddd; border-radius: 6px; padding: 8px 24px; font-size: 14px; cursor: pointer; }
.btn-outline:hover { background: #f5f5f5; }

/* === Results Header === */
.results-header { margin-bottom: 8px; }
.results-count { font-size: 13px; color: #888; }

/* === History Items === */
.log-item { background: #fff; border-radius: 8px; padding: 12px 16px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); cursor: pointer; transition: background 0.15s; }
.log-item:hover { background: #f5f5f5; }
.log-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.log-item-keyword { font-size: 16px; font-weight: 600; color: #1a73e8; }
.log-item-badge { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #f5f5f5; color: #666; }
.log-item-badge.found { background: #e8f0fe; color: #1a73e8; }
.log-item-meta { font-size: 12px; color: #bbb; display: flex; justify-content: space-between; }
.log-item-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.log-item-tag { font-size: 12px; color: #333; background: #f0f4ff; padding: 2px 8px; border-radius: 4px; }

.load-more { text-align: center; padding: 16px; color: #999; font-size: 13px; }
.no-more { text-align: center; padding: 20px; color: #ccc; font-size: 13px; }

/* ============================================================
   Admin Page Styles
   ============================================================ */

/* === Login Gate === */
.login-gate { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.login-card { background: #fff; border-radius: 8px; padding: 32px 24px; width: 100%; max-width: 360px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); text-align: center; }
.login-icon { font-size: 48px; margin-bottom: 16px; }
.login-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.login-subtitle { font-size: 13px; color: #999; margin-bottom: 20px; }
.login-input { width: 100%; height: 44px; border: 1px solid #ddd; border-radius: 6px; padding: 0 12px; font-size: 15px; margin-bottom: 12px; text-align: center; }
.login-input:focus { outline: none; border-color: #1a73e8; }
.login-error { color: #e53935; font-size: 13px; margin-bottom: 8px; }
.login-btn { width: 100%; padding: 12px; font-size: 16px; }

/* === Admin Panel === */
.admin-panel { display: none; }
.admin-panel.visible { display: block; }

/* === Upload Area === */
.upload-area { border: 2px dashed #ddd; border-radius: 8px; padding: 30px 16px; text-align: center; background: #fafafa; cursor: pointer; margin-bottom: 12px; transition: border-color 0.2s; }
.upload-area:hover { border-color: #1a73e8; }
.upload-icon { font-size: 36px; margin-bottom: 8px; }
.upload-text { font-size: 14px; color: #888; }
.upload-hint { font-size: 12px; color: #aaa; margin-top: 4px; }

/* === Progress Bar === */
.progress-wrap { margin: 16px 0; }
.progress-bar { height: 8px; background: #e0e0e0; border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; background: #1a73e8; border-radius: 4px; transition: width 0.3s ease; width: 0%; }
.progress-text { text-align: center; font-size: 13px; color: #666; }

/* === Done State === */
.done-wrap { text-align: center; padding: 24px 0; }
.done-icon { font-size: 48px; margin-bottom: 8px; }
.done-title { font-size: 18px; font-weight: 600; color: #4caf50; margin-bottom: 8px; }
.done-stats { font-size: 14px; color: #666; margin-bottom: 16px; }

/* === Export Panel === */
.export-warning { display: flex; align-items: flex-start; background: #fff3e0; border: 1px solid #ffcc80; border-radius: 6px; padding: 12px; margin-bottom: 16px; }
.export-warning .icon { font-size: 18px; margin-right: 8px; flex-shrink: 0; }
.export-warning .text { font-size: 13px; color: #e65100; line-height: 1.5; }

.export-all-btn { width: 100%; margin-bottom: 12px; padding: 12px; font-size: 15px; }
.export-single-btns { display: flex; gap: 8px; margin-bottom: 16px; }
.export-single-btn { flex: 1; font-size: 12px; padding: 10px 4px; }

.export-result { background: #f5f5f5; border-radius: 4px; padding: 8px 12px; margin-bottom: 4px; display: flex; align-items: center; }
.export-result .col-name { flex: 1; font-size: 13px; font-family: monospace; }
.export-result .col-count { font-size: 13px; color: #666; font-weight: 600; }

.export-files { background: #e8f5e9; border-radius: 6px; padding: 12px; margin: 12px 0; }
.export-files .title { font-size: 14px; font-weight: 600; color: #2e7d32; display: block; margin-bottom: 8px; }
.export-file-item { font-size: 12px; color: #666; padding: 4px 0; word-break: break-all; }

.export-tips { background: #f8f9fa; border-radius: 6px; padding: 12px; }
.export-tips .title { font-size: 14px; font-weight: 600; color: #555; display: block; margin-bottom: 8px; }
.export-tips .item { font-size: 12px; color: #777; line-height: 1.8; display: block; }

/* === Log Table === */
.log-table-wrap { overflow-x: auto; }
.log-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.log-table th { background: #f5f5f5; padding: 10px 8px; font-size: 12px; color: #888; font-weight: 600; text-align: left; white-space: nowrap; }
.log-table td { padding: 8px; font-size: 13px; border-bottom: 1px solid #f5f5f5; }
.log-table .col-openid { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #999; font-size: 12px; }
.log-table .col-keyword { color: #1a73e8; font-weight: 500; }
.log-table .col-size { text-align: center; }
.log-table .col-time { color: #bbb; font-size: 12px; white-space: nowrap; text-align: right; }

/* === File Input Hidden === */
.file-input-hidden { display: none; }

/* === Responsive === */
@media (max-width: 480px) {
  .container { padding: 12px; }
  .card { padding: 12px; }
  .field-label { width: 65px; font-size: 12px; }
  .tab-item { font-size: 13px; padding: 12px 0; }
  .export-single-btns { flex-direction: column; }
}
