
    /* === 全局基础设置 === */
    :root {
      --primary-gradient: linear-gradient(135deg, #6366f1, #a855f7);
      --glass-bg: rgba(255, 255, 255, 0.8);
      --glass-border: rgba(0, 0, 0, 0.05);
      --text-color: #1f2937;
      --text-secondary: #6b7280;
    }

    body { 
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
      background: #ffffff; 
      margin: 0; 
      color: var(--text-color); 
      -webkit-tap-highlight-color: transparent; 
    }
    * { box-sizing: border-box; }
      
    .container { 
      display: flex; 
      flex-direction: column;
      justify-content: center; 
      align-items: center; 
      min-height: 100vh; 
      padding: 20px 20px 50px 20px; 
      box-sizing: border-box;
    }
    .hidden { display: none; }
    .flex { display: flex; }
    .container[hidden] { display: none; }
    #adminPanel { width: 100%; max-width: 1100px; margin: 0 auto auto; overflow-x: hidden; }
      
    /* Card */
    .glass-card {
      background: var(--glass-bg);
      border: 1px solid var(--glass-border);
      border-radius: 24px;
      padding: 3rem 2.5rem;
      width: 100%;
      max-width: 480px;
      box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
      text-align: center;
      transition: transform 0.3s ease;
      box-sizing: border-box;
    }
    .glass-card:hover {
      transform: translateY(-5px);
    }
    .small-card { max-width: 360px; padding: 2.5rem 2rem; }

    .card { background: white; padding: 2rem; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); width: 100%; max-width: 400px; text-align: center; }
    .admin-card { background: white; padding: 24px; border-radius: 20px; box-shadow: 0 4px 24px rgba(0,0,0,0.05); width: 100%; overflow-x: hidden; border: 1px solid rgba(0,0,0,0.05); }

    .icon-wrapper {
      width: 64px; height: 64px;
      background: var(--primary-gradient);
      border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      margin: 0 auto 1.5rem;
      color: white; font-size: 28px;
      box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2);
    }
    .admin-icon { background: linear-gradient(135deg, #3b82f6, #06b6d4); box-shadow: 0 10px 20px rgba(6, 182, 212, 0.3); }

    h1 { margin: 0 0 10px 0; font-size: 28px; font-weight: 800; letter-spacing: -0.5px; background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
    h2 { margin: 0 0 25px 0; font-size: 24px; font-weight: 700; color: var(--text-color); }
    .subtitle { color: var(--text-secondary); margin-bottom: 30px; font-size: 15px; }

    /* Inputs */
    .input-group { position: relative; margin-bottom: 20px; text-align: left; width: 100%; }
    .input-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #9ca3af; pointer-events: none; z-index: 2;}
    .input-group input { 
      width: 100%; 
      padding: 16px 16px 16px 48px; 
      border: 1.5px solid #e5e7eb; 
      border-radius: 16px; 
      font-size: 15px; 
      background: #f9fafb; 
      transition: all 0.3s ease; 
      outline: none; 
      color: var(--text-color); 
      box-sizing: border-box; 
      font-family: inherit;
    }
    .input-group input:focus { border-color: #6366f1; background: white; box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.05); }
    .input-group input::placeholder { color: #9ca3af; }

    input:not(.input-group input), select { 
      padding: 12px; border: 1.5px solid #e5e7eb; border-radius: 10px; font-size: 14px; outline: none; transition: 0.2s; background: #fff; box-sizing: border-box; font-family: inherit; 
    }
    input:not(.input-group input):focus, select:focus { border-color: #6366f1; }

    /* Advanced Toggle */
    .advanced-toggle {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      padding: 6px 4px;
      margin-top: -6px;
      margin-bottom: 16px;
      font-size: 13px;
      color: var(--text-secondary);
      cursor: pointer;
      user-select: none;
      transition: color 0.2s;
    }
    .advanced-toggle:hover { color: #6366f1; }

    /* Buttons */
    .btn-primary { 
      width: 100%; 
      padding: 16px; 
      border: none; 
      border-radius: 16px; 
      background: var(--primary-gradient); 
      color: white; 
      font-size: 16px; font-weight: 700; 
      cursor: pointer; 
      transition: all 0.3s; 
      box-shadow: 0 8px 16px rgba(99, 102, 241, 0.2); 
      position: relative; overflow: hidden;
      display: inline-flex; align-items: center; justify-content: center; gap: 8px;
      font-family: inherit;
    }
    .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 20px rgba(99, 102, 241, 0.25); }
    .btn-primary:disabled { opacity: 0.8; cursor: wait; }
    .loading { opacity: 0.8; cursor: wait; }

    button { border: none; padding: 12px; border-radius: 10px; cursor: pointer; width: 100%; font-size: 14px; font-weight: 600; margin-top: 10px; transition: 0.2s; font-family: inherit; }
    .btn-black { background: #111; color: white; }
    .btn-black:hover { background: #333; }
    .btn-green { background: #10b981; color: white; display: flex; align-items: center; justify-content: center; gap: 6px; }
      
    /* Result Area */
    .result-box { 
      margin-top: 25px; 
      padding: 20px; 
      background: #f0fdf4; 
      border: 1px solid #dcfce7; 
      border-radius: 16px; 
      text-align: left; 
    }
    .result-header { color: #166534; font-weight: 700; font-size: 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
    .short-url { 
      display: block; 
      font-size: 16px; font-weight: 700; color: #111827; 
      text-decoration: none; word-break: break-all; margin-bottom: 15px; 
      padding: 12px; background: white; border: 1px solid #e5e7eb; border-radius: 12px;
    }
    .btn-copy { 
      width: 100%; padding: 12px; border: none; border-radius: 12px; 
      color: white; font-weight: 600; font-size: 14px; cursor: pointer; 
      transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px;
      font-family: inherit;
      background: linear-gradient(135deg, #10b981, #059669);
      box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    }
    .btn-copy:hover { opacity: 0.9; }

    /* Footer */
    .footer { 
      padding: 12px 0 16px 0; 
      text-align: center; 
      border-top: none; 
      width: 100%; 
      box-sizing: border-box; 
    }
    #icpFooter, #adminLoginFooter {
      position: fixed;
      bottom: 0;
      left: 0;
      width: 100%;
      text-align: center;
      padding: 10px 0 14px 0;
      z-index: 10;
      background: transparent;
      pointer-events: auto;
    }
    .footer a { 
      color: #94a3b8; 
      opacity: 0.65; 
      text-decoration: none; 
      font-size: 11px; 
      letter-spacing: 0.3px; 
      transition: opacity 0.2s, color 0.2s; 
    }
    .footer a:hover { 
      color: var(--text-color); 
      opacity: 1; 
      text-decoration: underline; 
    }

    /* Animations */
    .fade-in { animation: fadeIn 0.6s ease-out forwards; }
    @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

    .slide-up { animation: slideUp 0.4s ease-out; }
    @keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

    @media (max-width: 480px) {
      .glass-card { padding: 2rem 1.5rem; }
      h1 { font-size: 24px; }
    }

    /* === 统计卡片 === */
    .dashboard-stats { display: flex; gap: 15px; margin-bottom: 25px; flex-wrap: wrap; }
    .stat-box { flex: 1; min-width: 140px; background: #f8fafc; border: 1px solid #e2e8f0; padding: 18px; border-radius: 16px; display: flex; flex-direction: column; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
    @media (max-width: 400px) { .stat-box { min-width: 100%; } }
      
    .stat-label { font-size: 12px; color: #64748b; font-weight: 600; margin-bottom: 6px; }
    .stat-value { font-size: 26px; font-weight: 800; color: #0f172a; line-height: 1.25; min-height: 1.25em; }
    .stat-value:empty::before {
      content: '';
      display: inline-block;
      width: 2.1em;
      height: 0.65em;
      border-radius: 6px;
      background: currentColor;
      opacity: 0.12;
    }
    .table-skeleton > div {
      height: 48px;
      border-bottom: 1px solid #f3f4f6;
      background: linear-gradient(90deg, #e2e8f0 14%, transparent 14% 19%, #e2e8f0 19% 62%, transparent 62% 75%, #e2e8f0 75% 94%, transparent 94%) no-repeat center / calc(100% - 24px) 12px;
    }
    .stat-box.highlight { background: #f5f3ff; border-color: #ddd6fe; }
    .stat-box.highlight .stat-value { color: #6366f1; }
    .stat-box.visited { background: #f0fdf4; border-color: #bbf7d0; }
    .stat-box.visited .stat-value { color: #16a34a; }
    .stat-box.visited.selected { background: #dcfce7; border-color: #86efac; box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25); }
    .stat-box.risk { background: #fef2f2; border-color: #fee2e2; }
    .stat-box.risk .stat-value { color: #dc2626; }
    .risk-status { color: #7f1d1d; font-size: 12px; }
    .risk-status:empty { display: none; }

    /* === 顶部栏 === */
    .admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 15px; flex-wrap: wrap; }
    .header-left { display: flex; align-items: center; gap: 10px; flex: 1; flex-wrap: wrap; }
    .header-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }

    .search-box { position: relative; width: 220px; }
    @media (max-width: 600px) { .search-box { width: 100%; } }
      
    .search-box input { padding: 8px 30px 8px 12px; font-size: 13px; border-radius: 6px; background: #f9fafb; width: 100%; }
    .search-box input:focus { background: white; border-color: #ccc; }
    .search-icon { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #999; font-size: 12px; pointer-events: none; }
    .filter-select { width: 100px; padding: 8px 12px; font-size: 13px; border-radius: 6px; border: 1px solid #e5e7eb; background: #f9fafb; cursor: pointer; }

    /* === 表格 (PC默认) === */
    table { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
    th { text-align: left; padding: 12px; background: #f9fafb; color: #6b7280; font-weight: 600; border-bottom: 2px solid #eee; white-space: nowrap; user-select: none; }
    td { padding: 14px 12px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; word-wrap: break-word; }

    .url-content { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    .sortable { cursor: pointer; transition: background 0.2s; }
    .sortable:hover { background: #f0fdfa; color: #000; }
    .sort-icon { display: inline-block; width: 12px; margin-left: 4px; color: #ccc; }
    .sort-active .sort-icon { color: #0d9488; font-weight: bold; }
    .tag {
      display: inline-block;
      padding: 2px 8px;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 600;
      background: #eff6ff;
      color: #2563eb;
      font-family: monospace;
      max-width: 100%;
      white-space: normal;
      word-break: break-all;
      overflow-wrap: anywhere;
    }    
      
    .visits-badge { background: #f3f4f6; color: #374151; padding: 4px 10px; border-radius: 12px; font-size: 13px; font-weight: bold; border: 1px solid #e5e7eb; display: inline-flex; align-items: center; gap: 6px;}
     .today-badge { background: #eff6ff; border-color: #dbeafe; color: #1d4ed8; }
    .risk-alert { font-size: 11px; background: #fee2e2; color: #b91c1c; padding: 2px 6px; border-radius: 4px; border: 1px solid #fecaca; display: inline-flex; align-items: center; gap: 3px; cursor: help; margin-left: 4px; vertical-align: middle; }
    .risk-alert-city { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
    .risk-alert-ua { background: #faf5ff; color: #7e22ce; border-color: #e9d5ff; }
    .risk-alert-both { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; font-weight: 700; box-shadow: 0 1px 2px rgba(220,38,38,0.15); }
    .risk-alert-crawler { width: auto; margin-top: 0; cursor: pointer; background: #fee2e2; color: #991b1b; border-color: #f87171; font-weight: 700; box-shadow: 0 1px 2px rgba(220,38,38,0.2); }

    .risk-breakdown-bar { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
    .risk-chip { font-size: 11px; padding: 2px 7px; border-radius: 9999px; cursor: pointer; font-weight: 500; transition: all 0.15s ease; user-select: none; display: inline-flex; align-items: center; gap: 3px; border: 1px solid transparent; }
    .risk-chip b { font-weight: 700; }
    .risk-chip-crawler { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
    .risk-chip-crawler:hover, .risk-chip-crawler.active { background: #b91c1c; color: #fff; border-color: #991b1b; }
    .risk-chip-city { background: #fff7ed; color: #c2410c; border-color: #ffedd5; }
    .risk-chip-city:hover, .risk-chip-city.active { background: #ea580c; color: #fff; border-color: #c2410c; }
    .risk-chip-ua { background: #faf5ff; color: #7e22ce; border-color: #f3e8ff; }
    .risk-chip-ua:hover, .risk-chip-ua.active { background: #9333ea; color: #fff; border-color: #7e22ce; }
    .risk-chip-both { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
    .risk-chip-both:hover, .risk-chip-both.active { background: #dc2626; color: #fff; border-color: #b91c1c; }

    .risk-filter-dropdown { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; font-weight: 600; cursor: pointer; height: 28px; line-height: 28px; padding: 0 8px; border-radius: 6px; outline: none; transition: all 0.2s; }
    .risk-filter-dropdown.active { background: #dc2626 !important; color: #ffffff !important; border-color: #b91c1c !important; }

    .note-text { color: #4b5563; font-size: 13px; background: #f3f4f6; padding: 2px 6px; border-radius: 4px; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .note-empty { color: #d1d5db; font-size: 12px; font-style: italic; }
    .date-text { color: #9ca3af; font-size: 12px; font-family: monospace; }

    .action-btns { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
    .link-devices-button { background: #eff6ff; color: #1d4ed8; }
    .btn-xs { padding: 6px 10px; width: auto; font-size: 12px; margin-top: 0; border-radius: 6px; white-space: nowrap; }
    .btn-emerald { background: #10b981; color: white; }
    .btn-teal { background: #0d9488; color: white; }
    .btn-blue { background: #3b82f6; color: white; }
    .btn-purple { background: #8b5cf6; color: white; }
    .btn-orange { background: #f59e0b; color: white; } /* 新增橙色按钮 */
    .btn-red { background: #ef4444; color: white; }

    .mobile-show { display: none; }
    .mobile-destination { display: none; }
    .mobile-only { display: none; }
    .sort-active-btn { background: #0d9488 !important; color: white !important; border-color: #0f766e !important; }



    .pagination-bar { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; padding-top: 15px; border-top: 1px solid #eee; }
    .btn-page { width: auto; padding: 8px 16px; background: white; border: 1px solid #e5e7eb; color: #333; }
    .btn-page:disabled { background: #f3f4f6; color: #999; }
    .loading { text-align: center; color: #999; padding: 20px; }

    /* Geo refresh modal */
    .geo-modal-card { background: white; width: 100%; max-width: 440px; border-radius: 18px; box-shadow: 0 20px 50px rgba(15,23,42,0.18); overflow: hidden; }
    .geo-modal-hero { background: linear-gradient(135deg, #0f766e 0%, #0d9488 45%, #14b8a6 100%); color: #fff; padding: 22px 22px 18px; }
    .geo-modal-hero h3 { margin: 0 0 6px 0; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
    .geo-modal-hero p { margin: 0; font-size: 13px; opacity: 0.9; line-height: 1.5; }
    .geo-modal-body { padding: 20px 22px 8px; }
    .geo-id-pill { display: inline-flex; align-items: center; gap: 6px; background: #f0fdfa; color: #0f766e; border: 1px solid #99f6e4; padding: 6px 12px; border-radius: 999px; font-family: monospace; font-size: 13px; font-weight: 700; max-width: 100%; word-break: break-all; }
    .geo-field-label { font-size: 12px; font-weight: 700; color: #64748b; margin: 16px 0 10px; letter-spacing: 0.04em; text-transform: uppercase; }
    .geo-range-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .geo-range-btn { margin: 0; width: 100%; padding: 10px 8px; border-radius: 10px; border: 1.5px solid #e2e8f0; background: #f8fafc; color: #334155; font-size: 13px; font-weight: 600; cursor: pointer; transition: 0.15s; }
    .geo-range-btn:hover { border-color: #5eead4; background: #f0fdfa; }
    .geo-range-btn.active { border-color: #0d9488; background: #0d9488; color: #fff; box-shadow: 0 4px 12px rgba(13,148,136,0.28); }
    .geo-tips { margin: 14px 0 0; padding: 12px 14px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; font-size: 12px; color: #92400e; line-height: 1.55; }
    .geo-tips b { color: #b45309; }
    .geo-progress-box { display: none; margin-top: 14px; padding: 12px 14px; background: #f1f5f9; border-radius: 10px; }
    .geo-progress-box.show { display: block; }
    .geo-progress-label { font-size: 12px; color: #64748b; margin-bottom: 6px; }
    .geo-progress-bar { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
    .geo-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #0d9488, #2dd4bf); border-radius: 99px; transition: width 0.25s; }
    .geo-progress-meta { margin-top: 6px; font-size: 12px; color: #0f172a; font-weight: 600; font-variant-numeric: tabular-nums; }
    .geo-modal-footer { display: flex; gap: 10px; padding: 16px 22px 22px; }
    .geo-modal-footer button { margin: 0; flex: 1; }
    .btn-ghost { background: #f1f5f9; color: #475569; }
    .btn-ghost:hover { background: #e2e8f0; }

    /* 创建成功：二维码 + 分享图 */
    .share-panel {
      margin-top: 16px; padding: 16px; border-radius: 14px;
      background: linear-gradient(180deg, #f0fdfa 0%, #f8fafc 100%);
      border: 1px solid #ccfbf1; display: flex; flex-direction: column; align-items: center; gap: 14px;
    }
    .share-qr-wrap { text-align: center; }
    .share-qr-wrap img {
      width: 160px; height: 160px; border-radius: 12px; background: #fff;
      border: 1px solid #e2e8f0; padding: 8px; display: block; margin: 0 auto;
      box-shadow: 0 4px 14px rgba(15,23,42,0.06);
    }
    .share-qr-hint { margin-top: 8px; font-size: 12px; color: #64748b; font-weight: 600; }
    .share-actions { width: 100%; display: flex; flex-direction: column; gap: 8px; }
    .share-actions button { margin: 0; width: 100%; }
    .btn-share {
      background: linear-gradient(135deg, #0d9488, #0f766e); color: #fff; border: none;
      padding: 12px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
    }
    .btn-share:hover { filter: brightness(1.05); }
    .btn-share-alt {
      background: #fff; color: #0f766e; border: 1.5px solid #99f6e4;
      padding: 12px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
    }
    .btn-share-alt:hover { background: #f0fdfa; }

    .geo-resume-box {
      display: none; margin-top: 14px; padding: 12px 14px; border-radius: 12px;
      background: #eff6ff; border: 1px solid #bfdbfe; font-size: 12px; color: #1e40af; line-height: 1.55;
    }
    .geo-resume-box.show { display: block; }
    .geo-resume-box b { color: #1d4ed8; }
    .geo-resume-actions { display: flex; gap: 8px; margin-top: 10px; }
    .geo-resume-actions button {
      flex: 1; margin: 0; padding: 8px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; border: none;
    }
    .geo-resume-continue { background: #2563eb; color: #fff; }
    .geo-resume-restart { background: #fff; color: #1e40af; border: 1px solid #93c5fd !important; }

    /* Geo result toast / modal */
    .geo-result-card {
      background: #fff; width: 100%; max-width: 420px; border-radius: 20px;
      box-shadow: 0 24px 60px rgba(15,23,42,0.22); overflow: hidden;
      animation: geoResultIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    }
    @keyframes geoResultIn {
      from { opacity: 0; transform: translateY(12px) scale(0.96); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }
    .geo-result-hero {
      padding: 28px 24px 22px; text-align: center; color: #fff; position: relative;
    }
    .geo-result-hero.success { background: linear-gradient(145deg, #047857 0%, #0d9488 50%, #14b8a6 100%); }
    .geo-result-hero.cancel { background: linear-gradient(145deg, #475569 0%, #64748b 55%, #94a3b8 100%); }
    .geo-result-hero.error { background: linear-gradient(145deg, #b91c1c 0%, #dc2626 50%, #f87171 100%); }
    .geo-result-icon {
      width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-size: 30px; line-height: 1;
      background: rgba(255,255,255,0.18); border: 2px solid rgba(255,255,255,0.35);
      box-shadow: 0 8px 24px rgba(0,0,0,0.12);
      animation: geoIconPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.08s both;
    }
    @keyframes geoIconPop {
      from { opacity: 0; transform: scale(0.5); }
      to { opacity: 1; transform: scale(1); }
    }
    .geo-result-hero h3 {
      margin: 0 0 6px; font-size: 19px; font-weight: 700; letter-spacing: -0.02em;
    }
    .geo-result-hero p {
      margin: 0; font-size: 13px; opacity: 0.92; line-height: 1.5;
    }
    .geo-result-body { padding: 18px 22px 8px; }
    .geo-result-meta {
      display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 14px;
    }
    .geo-result-chip {
      display: inline-flex; align-items: center; gap: 5px;
      padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
      background: #f0fdfa; color: #0f766e; border: 1px solid #99f6e4;
    }
    .geo-result-chip.muted {
      background: #f8fafc; color: #64748b; border-color: #e2e8f0;
    }
    .geo-result-chip.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
    .geo-result-stats {
      display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
    }
    .geo-result-stat {
      text-align: center; padding: 14px 8px 12px;
      background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
      border: 1px solid #e2e8f0; border-radius: 14px;
    }
    .geo-result-stat .num {
      font-size: 22px; font-weight: 800; color: #0f172a;
      font-variant-numeric: tabular-nums; letter-spacing: -0.03em; line-height: 1.15;
    }
    .geo-result-stat .num.teal { color: #0d9488; }
    .geo-result-stat .num.amber { color: #d97706; }
    .geo-result-stat .num.slate { color: #475569; }
    .geo-result-stat .lbl {
      margin-top: 6px; font-size: 11px; font-weight: 600; color: #94a3b8;
      letter-spacing: 0.02em;
    }
    .geo-result-note {
      margin: 14px 0 0; padding: 11px 13px; border-radius: 12px;
      background: #f0fdfa; border: 1px solid #ccfbf1;
      font-size: 12px; color: #0f766e; line-height: 1.55; text-align: left;
    }
    .geo-result-note.warn {
      background: #fffbeb; border-color: #fde68a; color: #92400e;
    }
    .geo-result-note.err {
      background: #fef2f2; border-color: #fecaca; color: #991b1b;
    }
    .geo-result-footer {
      display: flex; gap: 10px; padding: 16px 22px 22px;
    }
    .geo-result-footer button {
      margin: 0; flex: 1; border: none; border-radius: 12px;
      padding: 12px 16px; font-size: 14px; font-weight: 700; cursor: pointer;
      transition: transform 0.12s, box-shadow 0.12s, background 0.15s;
    }
    .geo-result-footer button:active { transform: scale(0.98); }
    .geo-result-btn-primary {
      background: linear-gradient(135deg, #0d9488, #0f766e); color: #fff;
      box-shadow: 0 6px 16px rgba(13,148,136,0.32);
    }
    .geo-result-btn-primary:hover { box-shadow: 0 8px 20px rgba(13,148,136,0.4); }
    .geo-result-btn-primary.is-error {
      background: linear-gradient(135deg, #dc2626, #b91c1c);
      box-shadow: 0 6px 16px rgba(220,38,38,0.28);
    }
    .geo-result-btn-primary.is-error:hover { box-shadow: 0 8px 20px rgba(220,38,38,0.4); }
    .geo-result-btn-secondary {
      background: #f1f5f9; color: #475569;
    }
    .geo-result-btn-secondary:hover { background: #e2e8f0; }
    @media (max-width: 420px) {
      .geo-result-stats { grid-template-columns: 1fr; }
      .geo-result-stat { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; text-align: left; }
      .geo-result-stat .lbl { margin-top: 0; }
    }

    /* 危险操作确认弹窗 */
    .confirm-card {
      background: #fff; width: 100%; max-width: 450px; border-radius: 20px;
      box-shadow: 0 24px 60px rgba(15,23,42,0.24); overflow: hidden;
      animation: geoResultIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .confirm-hero {
      padding: 26px 22px 20px; text-align: center; color: #fff;
      background: linear-gradient(145deg, #991b1b 0%, #dc2626 48%, #f87171 100%);
    }
    .confirm-hero.danger-soft {
      background: linear-gradient(145deg, #9a3412 0%, #ea580c 50%, #fb923c 100%);
    }
    .confirm-icon {
      width: 62px; height: 62px; margin: 0 auto 12px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-size: 28px; line-height: 1;
      background: rgba(255,255,255,0.18); border: 2px solid rgba(255,255,255,0.35);
      box-shadow: 0 8px 22px rgba(0,0,0,0.12);
      animation: geoIconPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.06s both;
    }
    .confirm-hero h3 { margin: 0 0 6px; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
    .confirm-hero p { margin: 0; font-size: 13px; opacity: 0.92; line-height: 1.5; }
    .confirm-body { padding: 18px 22px 6px; }
    .confirm-meta {
      display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 12px;
    }
    .confirm-chip {
      display: inline-flex; align-items: center; gap: 5px;
      padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
      background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca;
    }
    .confirm-chip.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
    .confirm-chip.muted { background: #f8fafc; color: #64748b; border-color: #e2e8f0; }
    .confirm-stat {
      text-align: center; padding: 14px 12px; margin-bottom: 12px;
      background: linear-gradient(180deg, #fff7ed 0%, #fef2f2 100%);
      border: 1px solid #fecaca; border-radius: 14px;
    }
    .confirm-stat .num {
      font-size: 28px; font-weight: 800; color: #b91c1c;
      font-variant-numeric: tabular-nums; letter-spacing: -0.03em; line-height: 1.1;
    }
    .confirm-stat .lbl { margin-top: 6px; font-size: 12px; font-weight: 600; color: #94a3b8; }
    .confirm-filter-wrap {
      margin: 0 0 12px; padding: 10px 14px;
      background: #fff7ed; border: 1.5px dashed #fed7aa; border-radius: 12px;
      transition: all 0.2s ease;
    }
    .confirm-filter-wrap.checked {
      background: #fef2f2; border: 1.5px solid #fca5a5;
    }
    .confirm-options-wrap {
      margin: 0 0 12px; padding: 12px 14px;
      background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px;
    }
    .confirm-options-label {
      font-size: 12px; font-weight: 700; color: #475569; margin-bottom: 8px;
      display: flex; align-items: center; justify-content: space-between;
    }
    .confirm-options-grid {
      display: grid; grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); gap: 6px;
    }
    .confirm-option-btn {
      padding: 8px 3px; font-size: 12px; font-weight: 600; text-align: center;
      border: 1.5px solid #cbd5e1; border-radius: 8px; background: #ffffff;
      color: #334155; cursor: pointer; transition: all 0.15s ease; user-select: none;
      line-height: 1.25;
    }
    .confirm-option-btn:hover {
      border-color: #94a3b8; background: #f1f5f9;
    }
    .confirm-option-btn.active {
      border-color: #dc2626; background: #fef2f2; color: #b91c1c; font-weight: 700;
      box-shadow: 0 0 0 1px #dc2626;
    }
    .confirm-option-btn.danger-option {
      color: #991b1b; border-color: #fca5a5; background: #fff5f5;
    }
    .confirm-option-btn.danger-option:hover {
      border-color: #f87171; background: #fee2e2;
    }
    .confirm-option-btn.danger-option.active {
      border-color: #991b1b; background: #7f1d1d; color: #ffffff;
      box-shadow: 0 0 0 1px #7f1d1d;
    }
    .confirm-list {
      margin: 0 0 12px; padding: 12px 14px; border-radius: 12px;
      background: #f8fafc; border: 1px solid #e2e8f0;
      list-style: none;
    }
    .confirm-list li {
      position: relative; padding: 5px 0 5px 18px; font-size: 12.5px; color: #475569; line-height: 1.5;
    }
    .confirm-list li::before {
      content: ''; position: absolute; left: 0; top: 11px;
      width: 7px; height: 7px; border-radius: 50%; background: #f87171;
    }
    .confirm-list li.ok::before { background: #34d399; }
    .confirm-warn {
      margin: 0 0 4px; padding: 11px 13px; border-radius: 12px;
      background: #fef2f2; border: 1px solid #fecaca;
      font-size: 12px; color: #991b1b; line-height: 1.55; font-weight: 600;
    }
    .confirm-footer {
      display: flex; gap: 10px; padding: 16px 22px 22px;
    }
    .confirm-footer button {
      margin: 0; flex: 1; border: none; border-radius: 12px;
      padding: 12px 16px; font-size: 14px; font-weight: 700; cursor: pointer;
      transition: transform 0.12s, box-shadow 0.12s, background 0.15s;
    }
    .confirm-footer button:active { transform: scale(0.98); }
    .confirm-btn-cancel { background: #f1f5f9; color: #475569; }
    .confirm-btn-cancel:hover { background: #e2e8f0; }
    .confirm-btn-danger {
      background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff;
      box-shadow: 0 6px 16px rgba(220,38,38,0.32);
    }
    .confirm-btn-danger:hover { box-shadow: 0 8px 20px rgba(220,38,38,0.42); }
    .confirm-btn-danger:disabled { opacity: 0.65; cursor: wait; }
    .confirm-btn-warn {
      background: linear-gradient(135deg, #ea580c, #c2410c); color: #fff;
      box-shadow: 0 6px 16px rgba(234,88,12,0.3);
    }

    /* ===== Prompt & Alert Modal ===== */
    .prompt-card {
      background: #fff; width: 100%; max-width: 440px; border-radius: 18px;
      box-shadow: 0 24px 60px rgba(15,23,42,0.25), 0 4px 16px rgba(0,0,0,0.08);
      overflow: hidden; animation: geoResultIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
      box-sizing: border-box;
    }
    .prompt-header {
      background: linear-gradient(135deg, #0f766e 0%, #0d9488 45%, #14b8a6 100%);
      color: #fff; padding: 16px 20px;
      display: flex !important; align-items: center !important; justify-content: space-between !important;
      gap: 12px !important; box-sizing: border-box;
    }
    .prompt-header-left {
      display: flex !important; align-items: center !important; gap: 12px !important;
      min-width: 0 !important; flex: 1 1 auto !important;
    }
    .prompt-icon {
      width: 40px !important; height: 40px !important; border-radius: 12px !important;
      display: flex !important; align-items: center !important; justify-content: center !important;
      font-size: 20px !important; flex-shrink: 0 !important;
      background: rgba(255, 255, 255, 0.2) !important; border: 1px solid rgba(255, 255, 255, 0.35) !important;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }
    .prompt-title-group {
      min-width: 0 !important; flex: 1 1 auto !important;
      display: flex !important; flex-direction: column !important; gap: 3px !important;
    }
    .prompt-title-group h3 {
      margin: 0 !important; font-size: 16px !important; font-weight: 700 !important;
      color: #fff !important; line-height: 1.3 !important; letter-spacing: -0.01em !important;
      white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important;
    }
    .prompt-sub-pill {
      margin: 0 !important; font-size: 11.5px !important; font-weight: 600 !important;
      color: #ccfbf1 !important; background: rgba(0, 0, 0, 0.22) !important;
      padding: 2px 8px !important; border-radius: 99px !important;
      display: inline-block !important; font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important;
      max-width: 260px !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important;
      border: 1px solid rgba(255, 255, 255, 0.15) !important; line-height: 1.4 !important;
    }
    .prompt-close {
      background: rgba(255, 255, 255, 0.18) !important; border: 1px solid rgba(255, 255, 255, 0.25) !important;
      font-size: 18px !important; color: #fff !important; cursor: pointer !important;
      padding: 0 !important; margin: 0 !important; width: 30px !important; height: 30px !important;
      min-width: 30px !important; max-width: 30px !important; border-radius: 50% !important;
      display: flex !important; align-items: center !important; justify-content: center !important;
      line-height: 1 !important; transition: all 0.15s !important; flex-shrink: 0 !important;
    }
    .prompt-close:hover { background: rgba(255, 255, 255, 0.35) !important; transform: scale(1.05); }
    .prompt-body { padding: 20px 22px 14px; background: #fff; box-sizing: border-box; }
    .prompt-input-wrap { width: 100%; }
    .prompt-input {
      width: 100% !important; padding: 12px 14px !important; border: 1.5px solid #cbd5e1 !important;
      border-radius: 10px !important; font-size: 14px !important; outline: none !important;
      box-sizing: border-box !important; background: #f8fafc !important; color: #0f172a !important;
      transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s !important;
    }
    .prompt-input:focus {
      border-color: #0d9488 !important; background: #fff !important;
      box-shadow: 0 0 0 3px rgba(13,148,136,0.18) !important;
    }
    .prompt-hint {
      margin-top: 12px; padding: 10px 14px; background: #f8fafc; border: 1px solid #e2e8f0;
      border-left: 3px solid #0d9488; border-radius: 8px; font-size: 12.5px; color: #64748b; line-height: 1.5;
      word-break: break-word;
    }
    .alert-message { font-size: 14px; color: #334155; line-height: 1.6; word-break: break-word; white-space: pre-wrap; padding: 4px 0; }
    .prompt-footer {
      display: flex !important; gap: 12px !important; padding: 12px 22px 22px !important; background: #fff !important;
      box-sizing: border-box !important;
    }
    .prompt-footer button {
      margin: 0 !important; width: auto !important; flex: 1 1 0 !important; border: none !important;
      border-radius: 10px !important; padding: 12px 16px !important; font-size: 14px !important;
      font-weight: 700 !important; cursor: pointer !important; transition: all 0.12s !important;
      box-sizing: border-box !important; display: inline-flex !important; align-items: center !important; justify-content: center !important;
    }
    .prompt-footer button:active { transform: scale(0.98); }
    .prompt-btn-cancel { background: #f1f5f9 !important; color: #475569 !important; border: 1px solid #e2e8f0 !important; }
    .prompt-btn-cancel:hover { background: #e2e8f0 !important; color: #1e293b !important; }
    .prompt-btn-ok {
      background: linear-gradient(135deg, #0d9488, #0f766e) !important; color: #fff !important;
      box-shadow: 0 4px 12px rgba(13,148,136,0.28) !important;
    }
    .prompt-btn-ok:hover { box-shadow: 0 6px 16px rgba(13,148,136,0.38) !important; }
    .prompt-btn-ok.danger {
      background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
      box-shadow: 0 4px 12px rgba(220,38,38,0.28) !important;
    }

    /* ===== Toast Notification ===== */
    #toastContainer {
      position: fixed; top: 22px; left: 50%; transform: translateX(-50%);
      z-index: 99999; display: flex; flex-direction: column; gap: 8px;
      pointer-events: none; max-width: 90vw; width: 400px;
    }
    .page-toast {
      pointer-events: auto; padding: 11px 16px; border-radius: 12px;
      background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(10px);
      box-shadow: 0 10px 28px rgba(15,23,42,0.16), 0 2px 6px rgba(0,0,0,0.06);
      border: 1px solid rgba(226, 232, 240, 0.9);
      color: #1e293b; font-size: 13.5px; font-weight: 600;
      display: flex; align-items: center; gap: 10px; cursor: pointer;
      animation: toastSlideDown 0.28s cubic-bezier(0.16, 1, 0.3, 1);
      transition: opacity 0.2s, transform 0.2s;
    }
    .page-toast.toast-out { opacity: 0; transform: translateY(-8px) scale(0.96); }
    .page-toast .toast-icon { font-size: 16px; flex-shrink: 0; line-height: 1; }
    .page-toast .toast-msg { flex: 1; word-break: break-word; line-height: 1.4; }
    .page-toast.toast-success { border-left: 4px solid #10b981; }
    .page-toast.toast-error { border-left: 4px solid #ef4444; }
    .page-toast.toast-warn { border-left: 4px solid #f59e0b; }
    .page-toast.toast-info { border-left: 4px solid #3b82f6; }
    @keyframes toastSlideDown {
      from { opacity: 0; transform: translateY(-16px) scale(0.95); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    /* Modal */
    .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; display: none; justify-content: center; align-items: center; padding: 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; box-sizing: border-box; }
    .modal-content { background: white; width: 100%; max-width: 700px; max-height: 88vh; border-radius: 16px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); display: flex; flex-direction: column; overflow: hidden; margin: auto; }
    .modal-header { padding: 15px 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; background: #f9fafb; flex-wrap: wrap; gap: 10px; }
    .modal-header h3 { margin: 0; font-size: 16px; }
    .modal-header .header-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .stats-header-title-row { display: flex; align-items: center; }
    .stats-header-actions { display: flex; align-items: center; gap: 8px; }
    .mobile-close { display: none; }
    .desktop-close { display: block; }
    .modal-close { background: none; border: none; font-size: 24px; color: #999; cursor: pointer; padding: 0; margin: 0; width: auto; line-height: 1; }
    .modal-body { padding: 0; overflow-y: auto; flex: 1; }
    .stats-device-details {
      margin: 10px 14px;
      border: 1px solid #bfdbfe;
      border-radius: 8px;
      background: #f8fafc;
    }
    .stats-device-details > summary {
      cursor: pointer;
      color: #075985;
      font-weight: 600;
    }
    .stats-device-details > summary { padding: 10px 12px; font-size: 13px; }
    .stats-crawler-evidence { padding: 10px 12px; color: #991b1b; border-color: #fecaca; background: #fff7f7; font-size: 13px; }
    .stats-crawler-evidence > div { margin-top: 8px; }
    .stats-crawler-evidence code { display: block; color: #334155; white-space: pre-wrap; overflow-wrap: anywhere; }
    .stats-device-content { padding: 0 12px 12px; color: #475569; font-size: 12px; }
    .stats-device-content > p { margin: 0 0 8px; }
    .stats-device-list, .stats-device-ua, .stats-device-times { margin: 0; padding: 0; list-style: none; }
    .stats-device-list > li {
      padding: 8px 10px;
      margin-top: 6px;
      border: 1px solid #e2e8f0;
      border-radius: 6px;
      background: #fff;
    }
    .stats-device-heading { cursor: pointer; color: #0f172a; }
    .stats-device-heading-line {
      display: inline-flex;
      justify-content: space-between;
      align-items: baseline;
      gap: 8px;
      width: calc(100% - 1.3em);
      vertical-align: baseline;
    }
    .stats-device-heading strong, .stats-device-ua code { min-width: 0; overflow-wrap: anywhere; }
    .stats-device-heading b { flex: 0 0 auto; }
    .stats-device-meta { display: block; margin-top: 3px; color: #475569; }
    .stats-device-times { font-variant-numeric: tabular-nums; }
    .stats-device-times li + li { margin-top: 3px; }
    .stats-device-ua { margin-top: 8px; }
    .stats-device-ua > li {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: start;
      gap: 6px 16px;
      padding: 8px 0;
      border-top: 1px solid #e2e8f0;
    }
    .stats-device-ua-visits > span { color: #334155; font-weight: 600; }
    @media (max-width: 560px) {
      .stats-device-ua > li { grid-template-columns: minmax(0, 1fr); }
    }

    .link-devices-dialog {
      box-sizing: border-box;
      width: min(880px, calc(100% - 24px));
      max-height: 85vh;
      max-height: 85dvh;
      padding: 0;
      border: 1px solid #e2e8f0;
      border-radius: 14px;
      color: #0f172a;
      overflow: hidden;
    }
    .link-devices-dialog[open] { display: flex; flex-direction: column; }
    .link-devices-dialog::backdrop { background: rgba(15, 23, 42, .55); }
    .link-devices-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 12px;
      padding: 16px clamp(12px, 4vw, 24px);
      border-bottom: 1px solid #e2e8f0;
      background: #f8fafc;
    }
    .link-devices-header > div { min-width: 0; overflow-wrap: anywhere; }
    .link-devices-header h3 { margin: 0; font-size: 17px; }
    .link-devices-header p { margin: 4px 0 0; color: #475569; font-size: 13px; }
    .link-devices-close { margin: 0; width: auto; white-space: nowrap; background: #e2e8f0; color: #1e293b; }
    .link-devices-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px clamp(12px, 4vw, 24px); }
    .link-devices-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 8px; }
    .link-devices-actions { display: flex; flex-wrap: wrap; gap: 8px; }
    .link-devices-actions button { margin: 0; width: auto; }
    .link-devices-status { margin: 0; font-size: 14px; font-weight: 600; }
    .link-devices-toolbar [hidden], .link-devices-body [role="status"][hidden] { display: none; }
    .link-devices-note { margin: 0 0 12px; color: #475569; font-size: 12px; }
    .link-devices-copy-status:empty { margin: 0; }
    .link-devices-group {
      margin-bottom: 8px;
      border: 1px solid #dbe3ed;
      border-radius: 8px;
    }
    .link-devices-group > summary {
      padding: 10px 12px;
      cursor: pointer;
      font-size: 13px;
      overflow-wrap: anywhere;
    }
    .link-devices-group-name { font-weight: 700; }
    .link-devices-group-count { margin-inline-start: 8px; color: #1e40af; }
    .link-devices-group-meta { display: block; margin-top: 4px; color: #475569; font-size: 12px; }
    .link-devices-sources { margin: 0; padding: 8px 12px; border-top: 1px solid #dbe3ed; list-style: none; }
    .link-devices-sources li { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; padding: 4px 0; font-size: 12px; overflow-wrap: anywhere; }
    .link-device-verify-ip { margin: 0; width: auto; background: #ecfdf5; color: #047857; }
    .link-device-query-results { flex: 1 0 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 6px; }
    .link-device-query-results:empty { display: none; }
    .link-device-query-result { display: grid; gap: 4px; align-content: start; padding: 8px; border-radius: 6px; background: #f1f5f9; }
    .link-device-query-result button { justify-self: start; }
    .link-device-ip-verified { display: inline-grid; place-items: center; width: 14px; height: 14px; margin-inline-start: 4px; border-radius: 50%; background: #d1fae5; color: #065f46; font-size: 10px; line-height: 1; font-weight: 700; vertical-align: middle; }
    .link-devices-ua, .link-devices-ua ul { margin: 0; padding: 0; list-style: none; }
    .link-devices-ua > li {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: start;
      gap: 8px 16px;
      border-top: 1px solid #e2e8f0;
      padding: 10px 12px;
      font-size: 12px;
    }
    .link-devices-ua code { min-width: 0; overflow-wrap: anywhere; }
    .link-devices-ua time { font-variant-numeric: tabular-nums; }
    .link-devices-ua ul { margin-top: 3px; color: #334155; }
    @media (max-width: 560px) {
      .link-devices-ua > li { grid-template-columns: minmax(0, 1fr); }
    }
      
    /* 区域分布统计优化 */
    .region-stats-box { padding: 15px 20px; border-bottom: 1px solid #f3f4f6; background: #fff; flex-shrink: 0; }
    .region-title { font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
    .region-list { display: flex; flex-wrap: wrap; gap: 8px; }
    
    .region-tag { 
      display: inline-flex; align-items: center; 
      background: #f0f9ff; color: #0369a1; 
      border: 1px solid #bae6fd; 
      padding: 4px 10px; border-radius: 6px; 
      font-size: 12px; font-weight: 500;
    }
    .region-tag b { 
      margin-left: 6px; 
      background: #0ea5e9; color: white; 
      padding: 0 6px; border-radius: 99px; 
      font-size: 11px; font-weight: 600;
      min-width: 18px; text-align: center;
    }

    .stats-summary { 
      padding: 15px 20px; /* Match modal-header padding */
      display: flex; 
      flex-wrap: wrap; 
      gap: 8px; 
      border-bottom: 1px solid #eee; 
      background: #fff; 
      align-items: center; /* Vertically center content */
      min-height: 56px; 
      flex-shrink: 0; /* 防止垂直压缩 */
    }
    .stats-chip { 
      display: inline-flex; 
      align-items: center; 
      gap: 5px; 
      padding: 3px 8px; 
      border-radius: 6px; 
      font-size: 12px; 
      background: #f8fafc; 
      color: #475569; 
      border: 1px solid #e2e8f0; 
      white-space: nowrap; 
    }
    .stats-chip b { 
      color: #0f172a; 
      font-weight: 700; 
    }
    /* 访问详情弹窗优化样式 */
    .stats-modebar { 
      padding: 12px 20px; 
      display: flex; 
      gap: 10px; 
      border-bottom: 1px solid #f3f4f6; 
      background: #fff; 
      overflow-x: auto; /* 允许移动端横向滚动 */
      flex-wrap: nowrap; /* 强制不换行 */
      white-space: nowrap;
      flex-shrink: 0; /* 防止垂直压缩 */
      min-height: 56px; /* 保证最小高度 */
    }
    .stats-mode-btn { 
      width: auto; 
      margin: 0; 
      padding: 6px 14px; 
      border-radius: 8px; 
      border: 1px solid #e5e7eb; 
      background: #f9fafb; 
      color: #4b5563; 
      font-size: 13px; 
      font-weight: 600; 
      cursor: pointer;
      transition: all 0.2s;
      white-space: nowrap;
      flex-shrink: 0; /* 防止按钮被挤压 */
      display: inline-flex;
      align-items: center;
      justify-content: center;
      height: 32px; /* 强制高度 */
      line-height: 1;
    }
    .stats-mode-btn:hover { background: #f3f4f6; }
    .stats-mode-btn.active { 
      background: #0f172a; 
      border-color: #0f172a; 
      color: #fff; 
      box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    }
    /* 封禁模式按钮特殊样式 */
    .stats-mode-btn.blocked-mode {
      color: #b91c1c; border-color: #fca5a5; background: #fef2f2;
    }
    .stats-mode-btn.blocked-mode.active {
      background: #dc2626; border-color: #dc2626; color: white;
    }

    .province-box { 
      padding: 15px 20px; 
      border-bottom: 1px solid #f3f4f6; 
      background: #fffbeb; 
    }
    .province-header { display:flex; justify-content:space-between; align-items:center; margin-bottom: 10px; }
    .province-title { font-size: 13px; font-weight: 700; color: #92400e; display:flex; align-items:center; gap:6px; }
    .province-desc { font-size: 12px; color: #b45309; }
    
    .province-tag-list { 
      display: flex; 
      flex-wrap: wrap; 
      gap: 8px; 
      margin-bottom: 12px; 
      min-height: 28px; 
    }
    .province-tag { 
      display: inline-flex; 
      align-items: center; 
      background: #fff; 
      border: 1px solid #fcd34d; 
      padding: 4px 10px; 
      border-radius: 6px; 
      font-size: 12px; 
      color: #92400e; 
      font-weight: 500;
      box-shadow: 0 1px 1px rgba(0,0,0,0.05);
    }
    .province-tag .remove-btn { 
      margin-left: 6px; 
      cursor: pointer; 
      color: #d97706; 
      font-weight: bold; 
      width: 16px; height: 16px;
      display: inline-flex; align-items: center; justify-content: center;
      border-radius: 50%;
      background: rgba(251, 191, 36, 0.2);
    }
    .province-tag .remove-btn:hover { background: #d97706; color:white; }

    .province-input-container { 
      display: flex; gap: 8px; align-items: center; 
      background: #fff; padding: 4px; border-radius: 8px; border: 1px solid #fcd34d;
      width: fit-content;
    }
    .province-input-container input { 
      border: none; outline: none; padding: 6px; font-size: 13px; width: 140px; 
    }
    .province-input-container button { margin:0; }

    /* 表格区域优化 */
    .stats-table th { 
      color: #6b7280; font-weight: 600; font-size: 12px; letter-spacing: 0.02em; 
      background: rgba(249, 250, 251, 0.95); backdrop-filter: blur(4px);
    }
    .ip-row:hover td { background: #f8fafc; }
    .toggle-icon { color: #cbd5e1; font-size: 10px; transition: all 0.2s; }
    .ip-row.open .toggle-icon { transform: rotate(90deg) scale(1.2); color: #0f172a; }
    
    .count-badge { 
      background: #f1f5f9; border: 1px solid #e2e8f0; color: #475569; 
      min-width: 24px; height: 24px; padding: 0 8px; border-radius: 12px;
      font-size: 12px; font-weight: 600;
    }

    /* 设备 UA 徽章与展开记录样式 */
    .ua-badge {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      background: #eff6ff;
      color: #1e40af;
      border: 1px solid #dbeafe;
      border-radius: 4px;
      padding: 1px 7px;
      font-size: 11px;
      font-weight: 500;
      cursor: pointer;
      white-space: nowrap;
      transition: all 0.15s ease;
      vertical-align: middle;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    }
    .ua-badge:hover {
      background: #dbeafe;
      border-color: #bfdbfe;
      color: #1d4ed8;
      box-shadow: 0 1px 2px rgba(37,99,235,0.12);
    }
    .ua-badge.ua-none {
      background: #f8fafc;
      color: #94a3b8;
      border-color: #e2e8f0;
      cursor: default;
    }
    .ua-badge.ua-badge-severe {
      background: #fee2e2;
      color: #991b1b;
      border: 1px solid #fca5a5;
      font-weight: 600;
      box-shadow: 0 1px 2px rgba(185,28,28,0.12);
    }
    .ua-badge.ua-badge-severe:hover {
      background: #fecaca;
      border-color: #f87171;
      color: #7f1d1d;
    }
    .history-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 6px 4px;
      border-bottom: 1px dashed #f1f5f9;
      font-size: 12px;
      color: #475569;
      gap: 10px;
    }
    .history-item:last-child {
      border-bottom: none;
    }
    .history-ua {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      color: #64748b;
      padding: 1px 6px;
      border-radius: 3px;
      font-size: 11px;
      cursor: pointer;
      white-space: nowrap;
    }
    .history-ua:hover {
      background: #e2e8f0;
      color: #0f172a;
    }
    .history-ua.history-ua-severe {
      background: #fee2e2;
      border: 1px solid #fca5a5;
      color: #991b1b;
      font-weight: 600;
    }
    .history-ua.history-ua-severe:hover {
      background: #fecaca;
      color: #7f1d1d;
    }
    .history-ua.ua-none {
      cursor: default;
      color: #cbd5e1;
      border-color: #f1f5f9;
    }

    /* IP 溯源与跨链分析：弹窗面板统一滚动，移动端按记录分组。 */
    #ipAnalysisModal .ip-analysis-modal-content {
      max-width: 1180px;
      max-height: 90vh;
      max-height: 90dvh;
      min-width: 0;
    }
    #ipAnalysisModal .modal-header, .ip-tab-bar { flex: 0 0 auto; }
    .ip-tab-bar { display: flex; border-bottom: 1px solid #e2e8f0; background: #f8fafc; padding: 0 12px; gap: 8px; }
    .ip-tab-btn {
      flex: 1 1 0;
      min-width: 0;
      width: auto;
      margin: 0;
      padding: 10px 6px;
      border-bottom: 3px solid transparent;
      border-radius: 0;
      background: transparent;
      color: #475569;
      font-size: 13px;
    }
    .ip-tab-btn:hover, .ip-tab-btn.active { color: #0369a1; }
    .ip-tab-btn.active { border-bottom-color: #0284c7; background: #fff; }
    .ip-panel-body { min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; }
    .ip-search-bar, .cross-filter-bar {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 10px;
      padding: 12px 16px;
      border-bottom: 1px solid #e2e8f0;
    }
    .ip-search-input { display: flex; flex: 1 1 190px; align-items: center; min-width: 0; gap: 8px; }
    .ip-search-input input { min-width: 0; width: 0; }
    .ip-search-input button { flex: 0 0 auto; }
    .ip-cross-controls { display: flex; flex: 1 1 360px; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
    .ip-cross-controls label { font-size: 12px; color: #475569; font-weight: 600; }
    .ip-cross-controls select { max-width: 100%; padding: 5px 8px; font-size: 12px; }
    .ip-results-section { padding: 12px 16px 16px; }
    .ip-summary-card {
      background: #f0f9ff;
      border: 1px solid #bae6fd;
      border-radius: 12px;
      padding: 14px;
      display: flex;
      align-items: flex-start;
      flex-wrap: wrap;
      gap: 12px;
    }
    .ip-summary-main { flex: 1 1 260px; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
    .ip-results-frame { border: 1px solid #e2e8f0; border-radius: 8px; }
    .ip-results-table { font-size: 12.5px; }
    .ip-results-table th, .ip-results-table td { padding: 10px; vertical-align: top; }
    .ip-results-table th { position: sticky; top: 0; z-index: 1; background: #f8fafc; }
    .ip-results-table th:nth-child(1) { width: 20%; }
    .ip-results-table th:nth-child(2) { width: 26%; }
    .ip-results-table th:nth-child(3) { width: 9%; }
    .ip-results-table th:nth-child(4) { width: 16%; }
    .ip-results-table th:nth-child(5) { width: 11%; }
    .ip-results-table th:nth-child(6) { width: 18%; }
    .ip-cross-table th:nth-child(2) { width: 9%; }
    .ip-cross-table th:nth-child(4) { width: 33%; }
    .ip-results-table td:not([colspan]) { text-align: left; }
    .ip-cell-value, .ip-entry-header code, .ip-entry-note, .ip-target-url, .ip-entry-details li { min-width: 0; overflow-wrap: anywhere; }
    .ip-entry-header, .ip-entry-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
    .ip-entry-header code { font-size: 13px; font-weight: 700; color: #0f172a; }
    .ip-entry-note { margin-top: 4px; color: #0369a1; }
    .ip-target-url { display: block; color: #0369a1; word-break: normal; }
    .ip-time { margin-top: 3px; color: #475569; font-size: 12px; }
    .ip-action { width: auto; max-width: 100%; margin: 0; padding: 4px 8px; white-space: normal; overflow-wrap: anywhere; }
    .ip-action.ip-related-link { background: #e0f2fe; color: #0369a1; text-align: left; }
    .ip-entry-details { margin-top: 6px; }
    .ip-entry-details summary { cursor: pointer; color: #0369a1; font-weight: 600; }
    .ip-entry-details ul { margin: 6px 0 0; padding-left: 1.1em; }
    .ip-entry-details li + li { margin-top: 6px; }
    .badge-cross-count { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; font-weight: 700; padding: 2px 6px; border-radius: 8px; font-size: 11.5px; }
    #statsModal.ip-analysis-drilldown { z-index: 1001; }
    #confirmModal { z-index: 1002; }

    @media (max-width: 850px) {
      #ipAnalysisModal .ip-analysis-modal-content { max-height: calc(100dvh - 20px) !important; }
      .ip-search-bar, .cross-filter-bar, .ip-results-section { padding-left: 10px; padding-right: 10px; }
      .ip-results-frame { border: 0; }
      .ip-results-table, .ip-results-table tbody, .ip-results-table tbody tr { display: block; }
      .ip-results-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip-path: inset(50%);
      }
      .ip-results-table tbody tr { margin-bottom: 8px; border: 1px solid #e2e8f0; border-radius: 8px; }
      .ip-results-table td:not([colspan]) {
        display: grid;
        grid-template-columns: minmax(0, 26%) minmax(0, 1fr);
        gap: 8px;
      }
      .ip-results-table td[data-label]::before {
        content: attr(data-label);
        color: #475569;
        font-weight: 600;
        overflow-wrap: anywhere;
      }
      .ip-results-table td[colspan], .ip-results-table tbody td:last-child { border-bottom: 0; }
      .ip-results-table td[colspan] { display: block; }
    }

    .stat-filter-button, .sort-button, button.risk-chip {
      width: auto;
      margin: 0;
      font: inherit;
      color: inherit;
    }
    .stat-filter-button, .sort-button { padding: 0; background: transparent; }
    .stat-filter-button:focus-visible, .sort-button:focus-visible, button.risk-chip:focus-visible {
      outline: 2px solid #1d4ed8;
      outline-offset: 3px;
    }
    .passkey-dialog { width: min(460px, calc(100% - 24px)); max-height: 85vh; overflow: auto; border: 0; border-radius: 16px; padding: 24px; }
    .passkey-dialog::backdrop { background: rgba(15, 23, 42, .55); }
    .passkey-dialog input { width: 100%; }
    .passkey-dialog li { margin: 8px 0; overflow-wrap: anywhere; }
    .passkey-dialog li button { width: auto; margin: 0 0 0 8px; }
    .passkey-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
    .passkey-actions button { width: auto; margin: 0; }
    #passkeySignIn[hidden], #managePasskeysButton[hidden] { display: none; }

    /* === 移动端重构样式 (Moved to end) === */
    @media screen and (max-width: 768px) {
      .container { padding: 10px; }
      .admin-card { padding: 15px; }
      
      /* === 链接表格移动端适配 === */
      #linkTable thead { display: none !important; }
      
      #linkTable tr { 
        display: block !important; 
        position: relative !important;
        margin-bottom: 16px; 
        border: 1px solid #e5e7eb; 
        border-radius: 12px; 
        background: #fff; 
        box-shadow: 0 1px 3px rgba(0,0,0,0.05); 
        overflow: hidden;
      }

      #linkTable td { 
        display: flex !important; 
        justify-content: space-between; 
        align-items: center;
        text-align: right; 
        padding: 10px 15px; 
        border-bottom: 1px solid #f3f4f6; 
        font-size: 13px;
        width: 100% !important;
        box-sizing: border-box;
      }
      #linkTable td::before { 
        content: attr(data-label); font-weight: 600; color: #6b7280; margin-right: 15px; text-align: left; flex-shrink: 0;
      }
      #linkTable td[data-label="ID"] { background: #f9fafb; border-bottom: 1px solid #e5e7eb; padding: 12px 15px; }
      #linkTable td[data-label="ID"]::before { display: none; }
      #linkTable td[data-label="操作"]::before { display: none; }
      #linkTable td[data-label="操作"] { justify-content: flex-end; }
      #linkTable td[data-label="原始链接"] { display: block !important; text-align: left; }
      #linkTable td[data-label="原始链接"]::before, .desktop-destination { display: none; }
      .mobile-destination { display: block; min-width: 0; overflow-wrap: anywhere; }
      .mobile-destination summary { cursor: pointer; color: #0369a1; }
      .mobile-destination span { display: block; padding-top: 6px; }
      #linkTable td[data-label="ID"] { flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
      #linkTable td[data-label="ID"] .tag { min-width: 0; overflow-wrap: anywhere; }
      #linkTable td[data-label="总计访问"] { display: none !important; }
      #linkTable td[data-label="今日访问"] { display: none !important; }
      #linkTable td[data-label="备注"] { display: block !important; padding: 10px 15px; }
      #linkTable td[data-label="备注"]::before { display: none; }
      
      .mobile-info-container { display: flex; justify-content: space-between; align-items: center; width: 100%; }
      .note-text, .note-empty { text-align: right; }
      .mobile-show { display: flex; flex: 0 0 100%; flex-wrap: wrap; align-items: center; gap: 5px; }
      .mobile-only { display: inline-flex; }
      .url-content { max-width: none; white-space: normal; word-break: break-all; color: #0369a1; }

      /* === 统计详情弹窗 (statsModal) 移动端重构 === */
      .modal-overlay {
        padding: 10px 8px !important;
      }
      .modal-content {
        max-height: 92vh !important;
        border-radius: 14px !important;
        width: 100% !important;
        margin: auto !important;
      }

      /* 弹窗头部：上排标题+关闭，下排操作按钮均匀铺满 */
      #statsModal .stats-modal-header {
        padding: 12px 14px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
      }
      .stats-header-title-row {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
      }
      .stats-header-title-row h3 {
        font-size: 15px !important;
        font-weight: 700 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        max-width: calc(100% - 36px) !important;
      }
      .mobile-close {
        display: block !important;
        font-size: 24px !important;
        line-height: 1 !important;
        padding: 0 4px !important;
      }
      .desktop-close {
        display: none !important;
      }
      .stats-header-actions {
        display: flex !important;
        gap: 8px !important;
        width: 100% !important;
      }
      .stats-header-actions button {
        flex: 1 !important;
        text-align: center !important;
        justify-content: center !important;
        height: 32px !important;
        padding: 4px 6px !important;
        font-size: 12px !important;
        border-radius: 6px !important;
        white-space: nowrap !important;
      }

      /* 模式切换栏移动端横滑与尺寸优化 */
      .stats-modebar {
        padding: 8px 12px !important;
        min-height: 46px !important;
        gap: 6px !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
      }
      .stats-modebar::-webkit-scrollbar {
        display: none;
      }
      .stats-mode-btn {
        padding: 5px 11px !important;
        font-size: 12px !important;
        height: 30px !important;
      }

      /* 统计汇总 & 访客分布 */
      .stats-summary {
        padding: 10px 14px !important;
        min-height: auto !important;
        gap: 6px !important;
      }
      .stats-chip {
        font-size: 11px !important;
        padding: 2px 7px !important;
      }
      .region-stats-box {
        padding: 10px 14px !important;
      }
      .region-title {
        font-size: 12px !important;
        margin-bottom: 6px !important;
      }
      .region-list {
        gap: 6px !important;
      }
      .region-tag {
        padding: 2px 7px !important;
        font-size: 11px !important;
      }
      .region-tag b {
        font-size: 10px !important;
        padding: 0 4px !important;
      }

      /* 省份白名单设置 */
      .province-box {
        padding: 10px 14px !important;
      }
      .province-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
      }
      .province-input-container {
        width: 100% !important;
        box-sizing: border-box !important;
      }
      .province-input-container input {
        flex: 1 !important;
        min-width: 0 !important;
        width: 100% !important;
      }

      /* 统计表格主体卡片化 */
      #statsModal .modal-body {
        padding: 10px 10px 20px 10px !important;
        -webkit-overflow-scrolling: touch;
      }
      .stats-table {
        display: block !important;
        width: 100% !important;
        border-collapse: separate !important;
      }
      .stats-table thead {
        display: none !important;
      }
      .stats-table tbody {
        display: block !important;
        width: 100% !important;
      }
      .stats-table tr.ip-row {
        display: block !important;
        position: relative !important;
        margin-bottom: 10px !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px !important;
        background: #fff !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
        overflow: hidden !important;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: background 0.15s, border-color 0.15s;
      }
      .stats-table tr.ip-row:active {
        background: #f8fafc !important;
      }
      .stats-table tr.ip-row.open {
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
        margin-bottom: 0 !important;
        border-bottom-color: transparent !important;
      }

      /* 展开图标位于左上角 */
      .stats-table td.stat-arrow-col {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: absolute !important;
        top: 10px !important;
        left: 8px !important;
        width: 22px !important;
        height: 22px !important;
        padding: 0 !important;
        border: none !important;
        z-index: 2;
        background: transparent !important;
      }

      /* 访问次数徽章位于右上角 */
      .stats-table td.stat-count-col {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: absolute !important;
        top: 9px !important;
        right: 10px !important;
        width: auto !important;
        padding: 0 !important;
        border: none !important;
        z-index: 2;
        background: transparent !important;
      }
      .stats-table td.stat-count-col .count-badge {
        font-size: 11px !important;
        height: 22px !important;
        min-width: 22px !important;
        padding: 0 6px !important;
        line-height: 22px !important;
        border-radius: 11px !important;
      }

      /* IP、UA、核对按钮主体：预留左右间隙 */
      .stats-table td.stat-ip-col {
        display: block !important;
        padding: 9px 48px 6px 32px !important;
        text-align: left !important;
        border-bottom: none !important;
        width: 100% !important;
        box-sizing: border-box !important;
      }
      .stats-table td.stat-ip-col > div:first-child {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        flex-wrap: wrap !important;
        word-break: break-all !important;
      }
      .stats-table td.stat-ip-col .ip-geo-text {
        font-size: 12px !important;
        color: #64748b !important;
        margin-top: 3px !important;
        word-break: break-all !important;
        text-align: left !important;
      }

      /* 底部状态栏：时间与封禁/解封按钮左右对齐 */
      .stats-table td.stat-time-col {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        border-top: 1px dashed #f1f5f9 !important;
        border-bottom: none !important;
        padding: 6px 10px !important;
        color: #64748b !important;
        font-size: 12px !important;
        text-align: left !important;
        width: 100% !important;
        box-sizing: border-box !important;
        background: #fafbfc !important;
      }
      .stats-table td.stat-time-col > div {
        display: inline-flex !important;
        align-items: center !important;
        gap: 5px !important;
        margin: 0 !important;
      }
      .stats-table td.stat-time-col button {
        margin: 0 !important;
        padding: 2px 7px !important;
        font-size: 11px !important;
      }

      /* 历史展开记录条目：紧接卡片底部 */
      .stats-table tr.history-row {
        margin-top: 0 !important;
        margin-bottom: 10px !important;
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        border-top: 1px dashed #e2e8f0 !important;
        border-radius: 0 0 12px 12px !important;
        overflow: hidden !important;
      }
      .stats-table tr.history-row td {
        display: block !important;
        padding: 8px 10px !important;
        text-align: left !important;
        width: 100% !important;
        box-sizing: border-box !important;
        border: none !important;
        background: transparent !important;
      }
      .stats-table tr.history-row .history-item {
        padding: 5px 0 !important;
        font-size: 11px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
      }

      /* 空状态/加载/错误提示居中 */
      .stats-table td[colspan] {
        text-align: center !important;
        padding: 24px 10px !important;
        color: #94a3b8 !important;
        border: none !important;
        width: 100% !important;
        box-sizing: border-box !important;
        display: block !important;
      }
    }
