* {
  margin:0;
  padding:0;
  box-sizing:border-box;
}
html, body {
  overflow-x:hidden;
}
body {
  background:#f7fbf8;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto;
  padding:16px;
  padding-top:150px;
  color:#222;
  -webkit-tap-highlight-color: transparent;
}
.container {
  max-width:1400px;
  margin:0 auto;
}
.page-header {
  text-align:center;
  margin-bottom:32px;
  color:#166534;
  position:relative;
}
.page-header h2 {
  font-size:32px;
  font-weight:700;
  letter-spacing:2px;
  opacity:0.5;
  background:linear-gradient(90deg, #166534, #22a74d, #0d47a1, #6a1b9a, #d32f2f, #f57c00, #166534);
  background-size:300% 100%;
  -webkit-background-clip:text;
  background-clip:text;
  -webkit-text-fill-color:transparent;
  animation: titleGradient 4s linear infinite;
  text-shadow:none;
}
@keyframes titleGradient {
  0% { background-position:0% 50%; }
  100% { background-position:300% 50%; }
}
.admin-link {
  position:absolute;
  right:0;
  top:50%;
  transform:translateY(-50%);
  color:#166534;
  text-decoration:none;
  font-size:14px;
  padding:6px 12px;
  border:1px solid #86c993;
  border-radius:8px;
  background:rgba(255,255,255,0.5);
}
.admin-link:hover {
  background:#dcf5e3;
}
.last-update {
  position:fixed;
  right:16px;
  bottom:16px;
  z-index:100;
  color:#888;
  font-size:11px;
  white-space:nowrap;
  background:rgba(230,245,235,0.85);
  padding:4px 10px;
  border-radius:6px;
  box-shadow:0 1px 3px rgba(0,0,0,0.08);
}
.page-header {
  position:relative;
  min-height:48px;
}

.search-wrap {
  display:flex;
  gap:12px;
  margin-bottom:16px;
}
.search-input-wrap {
  flex:1;
  position:relative;
}
.search-input {
  width:100%;
  border:1px solid #86c993;
  border-radius:12px;
  padding:12px 40px 12px 14px;
  font-size:16px;
  background:#ffffff;
  min-width:0;
}
.search-input:focus {
  outline:none;
  border-color:#22a74d;
  box-shadow:0 0 0 2px rgba(34,167,77,0.15);
}
.clear-btn {
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%);
  width:24px;
  height:24px;
  border:none;
  border-radius:50%;
  background:#d1d5db;
  color:#fff;
  font-size:16px;
  line-height:1;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
}
.clear-btn:hover {
  background:#9ca3af;
}
.search-btn {
  min-width:90px;
}

.ios26-glass {
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 4px 16px rgba(22,101,52,0.12), inset 0 1px 0 rgba(255,255,255,0.7);
  color:#166534;
  border-radius:14px;
  padding:12px 20px;
  font-size:15px;
  cursor:pointer;
  transition: all 0.22s ease;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  white-space:nowrap;
}
.ios26-glass:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.38);
  box-shadow: 0 6px 20px rgba(22,101,52,0.15), inset 0 1px 0 rgba(255,255,255,0.8);
}
.ios26-glass:active:not(:disabled) {
  transform: scale(0.96);
  background:rgba(255,255,255,0.18);
  box-shadow:0 2px 8px rgba(22,101,52,0.08);
}
.ios26-glass:disabled {
  opacity:0.6;
  cursor:not-allowed;
}

.spinner {
  width:16px;
  height:16px;
  border:2px solid rgba(22,101,52,0.2);
  border-top-color:#166534;
  border-radius:50%;
  animation: spin 0.6s linear infinite;
  display:inline-block;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.result-stats {
  font-size:14px;
  color:#555;
  margin-bottom:12px;
}
.result-stats strong {
  color:#166534;
  font-size:16px;
}
.result-stats-empty {
  color:#aaa;
}
.error-msg {
  background:#fef2f2;
  border:1px solid #fecaca;
  color:#dc2626;
  padding:12px 16px;
  border-radius:8px;
  margin-bottom:16px;
  font-size:14px;
}
.result-stats-empty strong {
  color:#999;
}

/* 结果表格 */
.table-wrap {
  overflow-x:auto;
  overflow-y:auto;
  max-height:calc(100vh - 200px);
  border:2px solid #22a74d;
  border-radius:12px;
  background:#fff;
  -webkit-overflow-scrolling:touch;
  box-shadow:0 2px 8px rgba(22,101,52,0.08);
}

/* 表格外搜索栏（固定不随表格滚动） */
.table-search-bar {
  display:flex;
  gap:10px;
  padding:14px 16px;
  margin-bottom:16px;
  background:linear-gradient(180deg, #f0faf3, #e6f5ea);
  border:2px solid #86c993;
  border-radius:12px;
  align-items:center;
}
.table-search-input {
  flex:1;
}
.table-search-input .search-input {
  font-size:14px;
  padding:10px 36px 10px 12px;
}
.search-btn-small {
  padding:10px 20px;
  font-size:14px;
  white-space:nowrap;
}

/* 搜索进度条 */
.search-progress-bar {
  position:relative;
  height:28px;
  background:#e8f5ed;
  overflow:hidden;
  margin:4px 2px 0;
  border-radius:14px;
}
.search-progress-fill {
  position:absolute;
  top:0;
  left:0;
  height:100%;
  background:linear-gradient(90deg, #166534, #22a74d, #4ade80, #22a74d, #166534);
  background-size:300% 100%;
  transition:width 0.15s ease-out;
  animation: progressShimmer 1.2s linear infinite;
}
@keyframes progressShimmer {
  0% { background-position:0% 50%; }
  100% { background-position:300% 50%; }
}
.search-progress-text {
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%, -50%);
  font-size:12px;
  font-weight:600;
  color:#166534;
  white-space:nowrap;
  z-index:2;
  letter-spacing:0.5px;
}
.result-table {
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  font-size:13px;
  min-width:1400px;
}
.result-table th {
  background:linear-gradient(180deg, #f0faf3, #e6f5ea);
  color:#166534;
  font-weight:600;
  padding:12px 10px;
  text-align:center;
  border-bottom:2px solid #86c993;
  border-right:1px solid #b8e1c1;
  white-space:nowrap;
  position:sticky;
  top:0;
  z-index:10;
  background-clip:padding-box;
}
.result-table th:last-child {
  border-right:none;
}
.result-table td {
  padding:10px;
  border-bottom:1px solid #e8f5ed;
  border-right:1px solid #e8f5ed;
  white-space:nowrap;
  color:#333;
  background:#fff;
  text-align:center;
}
.result-table td:last-child {
  border-right:none;
}
.result-table tbody tr:hover td {
  background:#f4faf5;
}
.result-table tbody tr:last-child td {
  border-bottom:none;
}
.result-table tbody tr.row-left td,
.result-table tbody tr.row-left td.loc-col {
  background:rgba(173, 216, 230, 0.5) !important;
}
.result-table tbody tr.row-right td,
.result-table tbody tr.row-right td.loc-col {
  background:rgba(144, 238, 144, 0.5) !important;
}
.result-table tbody tr.row-left.row-border td,
.result-table tbody tr.row-right.row-border td {
  --bc: #ef4444;
  animation: marqueeRainbow 1.2s linear infinite;
}
.result-table tbody tr.row-left.row-border td:first-child,
.result-table tbody tr.row-right.row-border td:first-child {
  box-shadow:
    inset 0 3px 0 var(--bc),
    inset 0 -3px 0 var(--bc),
    inset 3px 0 0 var(--bc);
}
.result-table tbody tr.row-left.row-border td:last-child,
.result-table tbody tr.row-right.row-border td:last-child {
  box-shadow:
    inset 0 3px 0 var(--bc),
    inset 0 -3px 0 var(--bc),
    inset -3px 0 0 var(--bc);
}
.result-table tbody tr.row-left.row-border td:not(:first-child):not(:last-child),
.result-table tbody tr.row-right.row-border td:not(:first-child):not(:last-child) {
  box-shadow:
    inset 0 3px 0 var(--bc),
    inset 0 -3px 0 var(--bc);
}
@keyframes marqueeRainbow {
  0%   { --bc: #ef4444; }
  16%  { --bc: #f97316; }
  33%  { --bc: #eab308; }
  50%  { --bc: #22c55e; }
  66%  { --bc: #06b6d4; }
  83%  { --bc: #3b82f6; }
  100% { --bc: #ef4444; }
}
.loc-col {
  color:#166534;
  font-weight:500;
  background:#f0faf3 !important;
  min-width:100px;
}
.td-empty {
  text-align:center;
  color:#888;
  padding:40px 0 !important;
  font-size:14px;
}
.td-error {
  color:#dc2626;
  background:#fef2f2 !important;
}
.td-loading {
  text-align:center;
  color:#166534;
  padding:30px 0 !important;
  font-size:14px;
}
.empty-row {
  text-align:center;
  color:#999;
  padding:40px 8px !important;
  background:#fafdfb;
}
.hl {
  background:#fef08a;
  color:#166534;
  font-style:normal;
  border-radius:2px;
  padding:0 1px;
  animation: hlPulse 1.5s ease-in-out infinite;
}
@keyframes hlPulse {
  0%, 100% {
    background:#fef08a;
    box-shadow:0 0 0 0 rgba(254,240,138,0.6);
  }
  50% {
    background:#fde047;
    box-shadow:0 0 6px 2px rgba(253,224,71,0.5);
  }
}

/* 颜色徽章 - 高对比度 */
.color-badge {
  display:inline-block;
  padding:4px 12px;
  border-radius:14px;
  font-size:12px;
  font-weight:600;
  border:1.5px solid #ccc;
  min-width:56px;
  text-align:center;
  line-height:1.4;
  position:relative;
  overflow:hidden;
  white-space:nowrap;
  letter-spacing:0.3px;
}
.color-badge-dual {
  position:relative;
  padding:4px 12px;
}
.color-badge-dual .color-half {
  position:absolute;
  left:0;
  right:0;
  height:50%;
}
.color-badge-dual .color-half-top {
  top:0;
}
.color-badge-dual .color-half-bottom {
  bottom:0;
}
.color-badge-dual .color-text {
  position:relative;
  z-index:1;
  font-weight:700;
  font-size:11px;
}
.color-unknown {
  color:#666;
  font-size:13px;
}

.empty-tip {
  text-align:center;
  color:#779980;
  padding:60px 0;
  font-size:15px;
}

.footer-counter {
  text-align:center;
  color:#8ab197;
  font-size:13px;
  padding:24px 0 8px;
}
.footer-counter strong {
  color:#166534;
  font-size:16px;
  margin:0 2px;
}
.footer-counter .greeting {
  color:#7a9eaf;
  font-style:italic;
  font-size:12px;
}
.daily-quote {
  margin-top:6px;
  font-size:16px;
  font-style:italic;
  letter-spacing:0.5px;
  overflow:hidden;
  white-space:nowrap;
  max-width:400px;
  margin-left:auto;
  margin-right:auto;
}
.daily-quote span {
  display:inline-block;
  padding-left:100%;
  background:linear-gradient(90deg, #166534, #0d47a1, #6a1b9a, #d32f2f, #f57c00, #166534);
  background-size:300% 100%;
  -webkit-background-clip:text;
  background-clip:text;
  -webkit-text-fill-color:transparent;
  animation: quoteScroll 12s linear infinite, titleGradient 4s linear infinite;
}
@keyframes quoteScroll {
  0% { transform:translateX(0); }
  100% { transform:translateX(-100%); }
}
.eop-warn {
  display:inline-block;
  margin-top:6px;
  padding:8px 16px;
  font-size:15px;
  font-weight:bold;
  color:#dc2626;
  background:#fef08a;
  border-radius:6px;
  animation:eopBlink 0.8s ease-in-out infinite;
}
@keyframes eopBlink {
  0%, 100% { background:#fef08a; color:#dc2626; }
  50% { background:#fde047; color:#b91c1c; }
}

/* 备案信息 */
.footer-icp {
  width:100%;
  text-align:center;
  padding:8px 0 16px;
}
.icp-text {
  display:inline-block;
  font-size:12px;
  color:#8ab197;
  text-decoration:none;
  position:relative;
  padding:4px 12px;
  overflow:hidden;
  border-radius:4px;
}
.icp-text::after {
  content:"";
  position:absolute;
  top:0;
  left:-100%;
  width:100%;
  height:100%;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: icpShine 3s ease-in-out infinite;
}
.icp-text:hover {
  color:#166534;
}
@keyframes icpShine {
  0% { left:-100%; }
  50% { left:100%; }
  100% { left:100%; }
}

/* 上传相关 */
.upload-row {
  display:flex;
  gap:10px;
  align-items:center;
  margin-bottom:8px;
}
.target-select {
  flex:1;
  border:1px solid #86c993;
  border-radius:12px;
  padding:12px 14px;
  font-size:14px;
  background:#fff;
  color:#166534;
  cursor:pointer;
  appearance:none;
  background-image:url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23166534' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat:no-repeat;
  background-position:right 12px center;
  background-size:16px;
  padding-right:36px;
}
.target-select:focus {
  outline:none;
  border-color:#22a74d;
  box-shadow:0 0 0 2px rgba(34,167,77,0.15);
}
.btn-disabled {
  opacity:0.5;
  cursor:not-allowed;
  pointer-events:none;
}
.upload-progress {
  margin-top:10px;
  display:flex;
  align-items:center;
  gap:10px;
}
.progress-bar {
  flex:1;
  height:8px;
  background:#e8f5ed;
  border-radius:4px;
  overflow:hidden;
}
.progress-fill {
  height:100%;
  background:linear-gradient(90deg, #22a74d, #16a34a);
  border-radius:4px;
  transition: width 0.3s ease;
}
.progress-text {
  font-size:13px;
  color:#166534;
  font-weight:500;
  min-width:50px;
  text-align:right;
}
.upload-msg {
  font-size:13px;
  color:#337044;
  margin-top:6px;
  padding-left:2px;
}
.upload-info-text {
  font-size:13px;
  color:#6b9b78;
  margin-bottom:8px;
}
.tip {
  margin-top:8px;
  font-size:14px;
  color:#22a74d;
}
.tip-error {
  color:#dc2626;
}

/* 管理页面 */
.login-box {
  max-width:400px;
  margin:60px auto;
  background:#fff;
  border:1px solid #b8e1c1;
  border-radius:16px;
  padding:32px 24px;
  text-align:center;
}
.login-box h3 {
  color:#166534;
  margin-bottom:20px;
}
.login-input-row {
  display:flex;
  gap:10px;
  margin-bottom:12px;
}
.admin-section {
  background:#fff;
  border:1px solid #b8e1c1;
  border-radius:12px;
  padding:20px;
  margin-bottom:16px;
}
.admin-section h3 {
  color:#166534;
  margin-bottom:16px;
  font-size:16px;
}
.help-list {
  list-style:none;
  padding:0;
}
.help-note {
  color:#888;
  font-size:13px;
  margin-bottom:12px;
}
.columns-preview {
  display:flex;
  gap:16px;
  flex-wrap:wrap;
}
.columns-block {
  flex:1;
  min-width:280px;
  background:#f7fbf8;
  border:1px solid #d1e7d8;
  border-radius:8px;
  padding:12px;
}
.columns-title {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
  color:#166534;
  font-weight:500;
  font-size:14px;
}
.columns-list {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.col-tag {
  background:#fff;
  border:1px solid #b8e1c1;
  color:#337044;
  padding:3px 8px;
  border-radius:4px;
  font-size:12px;
}
.columns-empty {
  color:#aaa;
  font-size:13px;
  text-align:center;
  padding:16px 0;
}
.help-list li {
  padding:6px 0;
  color:#555;
  font-size:14px;
  padding-left:18px;
  position:relative;
}
.help-list li::before {
  content:"•";
  color:#22a74d;
  position:absolute;
  left:4px;
}
.help-list strong {
  color:#166534;
}

/* 统计卡片 */
.stats-card {
  display:flex;
  gap:16px;
  margin-bottom:16px;
  flex-wrap:wrap;
}
.stats-item {
  flex:1;
  min-width:200px;
  background:#fff;
  border:1px solid #b8e1c1;
  border-radius:12px;
  padding:16px 20px;
  display:flex;
  align-items:center;
  gap:12px;
}
.stats-label {
  color:#555;
  font-size:14px;
}
.stats-num {
  color:#166534;
  font-size:24px;
  font-weight:600;
  flex:1;
}
.mini-btn {
  background:#fef2f2;
  border:1px solid #fca5a5;
  color:#dc2626;
  padding:4px 10px;
  border-radius:6px;
  font-size:12px;
  cursor:pointer;
}
.mini-btn:hover {
  background:#fee2e2;
}

@media(max-width:640px){
  body {
    padding:10px;
  }
  .page-header h2 {
    font-size:18px;
  }
  .page-header {
    text-align:center;
    margin-bottom:16px;
  }
  .admin-link {
    position:static;
    transform:none;
    display:inline-block;
    margin-top:10px;
    font-size:13px;
  }
  .search-wrap {
    flex-direction:column;
  }
  .search-input {
    font-size:16px !important;
    padding:14px 44px 14px 16px !important;
  }
  .clear-btn {
    width:28px;
    height:28px;
    right:12px;
    font-size:18px;
  }
  .ios26-glass {
    width:100%;
    text-align:center;
    padding:14px 20px;
    font-size:16px;
    min-height:48px;
  }
  /* 表格外搜索栏 —— 移动端改为上下布局，输入框更大，居中显示 */
  .table-search-bar {
    flex-direction:column;
    gap:10px;
    padding:14px;
    margin:0 auto 16px;
    max-width:92%;
    border-radius:12px;
  }
  .table-search-input {
    width:100%;
  }
  .table-search-input .search-input {
    font-size:16px !important;
    padding:14px 44px 14px 16px !important;
    border-radius:12px;
  }
  .search-btn-small {
    width:100%;
    padding:14px 20px;
    font-size:16px;
    min-height:48px;
  }
  .login-box {
    margin:30px auto;
    padding:24px 16px;
  }
  .login-input-row {
    flex-direction:column;
  }
  .stats-card {
    flex-direction:column;
  }
  .stats-item {
    min-width:auto;
  }
  .upload-row {
    flex-direction:column;
    align-items:stretch;
  }
  .target-select {
    font-size:16px;
    padding:14px 40px 14px 16px;
  }
  .result-table {
    font-size:12px;
    min-width:1200px;
  }
  .result-table th,
  .result-table td {
    padding:8px 6px;
  }
  .table-wrap {
    max-height:calc(100vh - 260px);
    margin:0 auto;
    max-width:96%;
  }
  .result-stats {
    font-size:13px;
  }
  .footer-counter {
    font-size:12px;
    padding:16px 0 4px;
  }
}

@supports not (backdrop-filter: blur(14px)) {
  .ios26-glass {
    background: rgba(220, 245, 227, 0.85);
  }
}
