    :root {
      color-scheme: light dark;
      --primary: #165DFF;
      --action: #165DFF;
      --bg-body: #f7f9fc;
      --bg-top: #eef2ff;
      --bg-card: #ffffff;
      --bg-soft: #f8f9fa;
      --bg-hover: #eef4ff;
      --clock-bg: rgba(255,255,255,0.6);
      --clock-border: rgba(255,255,255,0.8);
      --text-main: #1f2937;
      --text-sub: #606b7b;
      --border: #eaecf0;
      --error: #c93232;
      --hint-border: #fcd34d;
      --hint-bg: #fffbeb;
      --hint-text: #92400e;
      --radius: 16px;
      --font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    }

    * { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
    body {
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      background-color: var(--bg-body);
      background-image: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-body) 400px);
      color: var(--text-main);
      font-family: var(--font-family);
      -webkit-font-smoothing: antialiased;
    }
    a { color: inherit; text-decoration: none; }
    button { border: 0; background: transparent; cursor: pointer; font-family: inherit; }
    input { font-family: inherit; }
    .container { width: 100%; max-width: 1000px; margin: 0 auto; padding: 0 1.25rem; }
    .hidden, [hidden] { display: none !important; }
    :focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
    .icon { width: 1.2em; height: 1.2em; fill: currentColor; vertical-align: middle; }
    main { flex: 1; padding-bottom: 4rem; }

    .header-section { padding: 3rem 1.25rem 2rem; text-align: center; }
    .header-section.without-time { padding-bottom: 1.5rem; }
    .header-section.without-time .home-title { margin-bottom: 0; }
    .home-title {
      margin-bottom: 1.2rem;
      color: var(--text-main);
      font-size: 1.65rem;
      font-weight: 750;
      line-height: 1.25;
      letter-spacing: 0;
    }
    .clock-card {
      display: inline-block;
      padding: 1.5rem 3rem;
      border: 1px solid var(--clock-border);
      border-radius: 24px;
      background: var(--clock-bg);
      box-shadow: 0 10px 30px rgba(22, 93, 255, 0.06);
      backdrop-filter: blur(10px);
    }
    .time-display {
      margin-bottom: 0.5rem;
      color: var(--text-main);
      font-size: 2.5rem;
      font-weight: 700;
      font-variant-numeric: tabular-nums;
      line-height: 1;
      letter-spacing: 0;
    }
    .date-display {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      color: var(--text-sub);
      font-size: 0.95rem;
      font-weight: 500;
    }

    .search-container { max-width: 680px; margin: 0 auto 2.5rem; position: relative; z-index: 50; }
    .search-box-wrapper {
      position: relative;
      display: flex;
      align-items: center;
      padding: 6px;
      border: 1px solid var(--border);
      border-radius: 999px;
      background: var(--bg-card);
      box-shadow: 0 4px 12px rgba(0,0,0,0.05);
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }
    .search-box-wrapper:focus-within { border-color: var(--primary); box-shadow: 0 4px 16px rgba(22,93,255,0.12); }
    .engine-btn { display: flex; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 999px; background: var(--bg-soft); }
    .engine-icon { width: 20px; height: 20px; object-fit: contain; }
    .search-input {
      flex: 1;
      min-width: 0;
      padding: 10px;
      border: 0;
      outline: 0;
      background: transparent;
      color: var(--text-main);
      font-size: 16px;
      font-weight: 500;
    }
    .clear-btn,
    .scan-btn {
      width: 34px;
      height: 34px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      color: var(--text-sub);
    }
    .clear-btn { color: var(--text-sub); }
    .scan-btn { margin-right: 4px; transition: color 0.2s ease, background 0.2s ease; }
    .scan-btn:hover { color: var(--primary); background: var(--bg-hover); }
    .search-btn {
      width: 44px;
      height: 44px;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      background: var(--action);
      color: #fff;
    }
    .search-btn:active { background: #0046c7; }
    .engine-menu,
    .local-results {
      position: absolute;
      top: 115%;
      overflow: hidden;
      border: 1px solid var(--border);
      border-radius: 16px;
      background: var(--bg-card);
      box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }
    .engine-menu { left: 0; z-index: 60; width: 130px; padding: 4px; }
    .local-results { left: 0; right: 0; z-index: 55; padding: 12px; }
    .engine-option { width: 100%; display: flex; align-items: center; padding: 10px; border-radius: 8px; color: var(--text-main); font-size: 14px; }
    .engine-option:active { background: var(--bg-soft); }
    .engine-option img { width: 18px; height: 18px; margin-right: 10px; }
    .result-item { display: flex; justify-content: space-between; gap: 12px; padding: 14px 12px; border-bottom: 1px solid var(--bg-soft); color: var(--text-main); font-size: 15px; }
    .result-item:last-child { border-bottom: 0; }
    .highlight { color: var(--primary); font-weight: 700; }

    .section-title {
      margin-bottom: 1rem;
      padding-left: 10px;
      border-left: 4px solid var(--primary);
      color: var(--text-main);
      font-size: 1.1rem;
      font-weight: 700;
      line-height: 1;
    }
    .quick-section { margin-bottom: 2.5rem; }
    .grid-quick {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px 8px;
    }
    .app-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px; }
    .app-icon-box {
      width: 52px;
      height: 52px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid var(--border);
      border-radius: 16px;
      background: var(--bg-card);
      color: var(--primary);
      font-size: 1.25rem;
      font-weight: 700;
      box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    }
    .app-name {
      overflow: hidden;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      color: var(--text-main);
      font-size: 12px;
      line-height: 1.3;
      text-align: center;
      word-break: break-all;
    }
    .categories-wrapper { display: flex; flex-direction: column; gap: 1.5rem; }
    .category-card {
      padding: 1.25rem;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: var(--bg-card);
      box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    }
    .link-grid {
      display: grid;
      grid-template-columns: repeat(var(--mobile-link-columns, 2), minmax(0, 1fr));
      gap: 10px;
    }
    .link-item {
      min-height: 44px;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 8px 12px;
      border-radius: 10px;
      background: var(--bg-soft);
      color: var(--text-main);
      font-size: 14px;
      font-weight: 500;
      line-height: 1.4;
      text-align: center;
      word-break: break-all;
      transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
    }
    .link-item:hover { background: var(--bg-hover); color: var(--primary); }
    .link-item:active { transform: translateY(1px); }
    .link-item.custom-text-color { color: var(--site-text-color); }
    .link-item.custom-text-color:hover { color: var(--site-text-color); }
    .link-item.custom-font-bold { font-weight: 700; }
    .empty-state {
      padding: 3rem 1.25rem;
      border: 1px dashed var(--border);
      border-radius: var(--radius);
      color: var(--text-sub);
      text-align: center;
    }
    footer { margin-top: auto; padding: 2rem 0; color: var(--text-sub); font-size: 12px; text-align: center; }
    #backToTop {
      position: fixed;
      right: 1.5rem;
      bottom: 2rem;
      z-index: 90;
      width: 44px;
      height: 44px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      background: var(--bg-card);
      color: var(--primary);
      box-shadow: 0 4px 12px rgba(0,0,0,0.1);
      opacity: 0;
      visibility: hidden;
      transform: translateY(10px);
      transition: all 0.25s ease;
    }
    #backToTop.show { opacity: 1; visibility: visible; transform: translateY(0); }

    .scan-modal {
      position: fixed;
      inset: 0;
      z-index: 1000;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      background: rgba(0,0,0,0.6);
      backdrop-filter: blur(4px);
      opacity: 0;
      visibility: hidden;
      transition: all 0.3s;
    }
    .scan-modal.show { opacity: 1; visibility: visible; }
    .scan-dialog {
      width: 100%;
      max-width: 420px;
      max-height: 90vh;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      border-radius: 20px;
      background: var(--bg-card);
      transform: scale(0.9);
      transition: transform 0.3s;
    }
    .scan-modal.show .scan-dialog { transform: scale(1); }
    .scan-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
    .scan-header h3 { color: var(--text-main); font-size: 18px; font-weight: 600; }
    .scan-close { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--bg-soft); color: var(--text-sub); }
    .scan-body { flex: 1; overflow-y: auto; padding: 20px; }
    .scan-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
    .scan-option {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      padding: 16px;
      border: 2px solid transparent;
      border-radius: 12px;
      background: var(--bg-soft);
      cursor: pointer;
      transition: all 0.2s;
    }
    .scan-option:hover { border-color: var(--primary); background: var(--bg-hover); }
    .scan-option svg { width: 32px; height: 32px; color: var(--primary); }
    .scan-option span { color: var(--text-main); font-size: 13px; font-weight: 500; }
    .scan-option.disabled { opacity: 0.5; pointer-events: none; }
    .scan-preview { width: 100%; aspect-ratio: 1; position: relative; overflow: hidden; margin-bottom: 16px; border-radius: 12px; background: #000; }
    .scan-preview video, .scan-preview canvas { width: 100%; height: 100%; object-fit: cover; }
    .scan-preview img { width: 100%; height: 100%; object-fit: contain; background: var(--bg-soft); }
    .scan-line { position: absolute; left: 10%; right: 10%; height: 2px; background: linear-gradient(90deg, transparent, var(--primary), transparent); animation: scanLine 2s linear infinite; }
    @keyframes scanLine { 0% { top: 10%; } 50% { top: 90%; } 100% { top: 10%; } }
    .scan-corners { position: absolute; inset: 10%; border: 2px solid rgba(255,255,255,0.3); border-radius: 8px; }
    .scan-corners::before, .scan-corners::after { content: ''; position: absolute; width: 20px; height: 20px; border: 3px solid var(--primary); }
    .scan-corners::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-radius: 4px 0 0 0; }
    .scan-corners::after { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-radius: 0 4px 0 0; }
    .scan-tip { margin-top: 12px; color: var(--text-sub); font-size: 13px; text-align: center; }
    .scan-result { max-height: 150px; overflow-y: auto; margin-bottom: 16px; padding: 16px; border-radius: 12px; background: var(--bg-soft); color: var(--text-main); font-size: 14px; line-height: 1.6; word-break: break-all; }
    .scan-actions { display: flex; gap: 12px; }
    .scan-actions button, .btn-back { padding: 12px; border-radius: 10px; font-size: 14px; font-weight: 500; }
    .scan-actions button { flex: 1; }
    .btn-copy, .btn-back { background: var(--border); color: var(--text-main); }
    .btn-open { background: var(--action); color: #fff; }
    .btn-back { width: 100%; margin-top: 12px; padding: 10px; }
    .scan-status { padding: 40px 20px; color: var(--text-sub); line-height: 1.8; text-align: center; }
    .scan-status.error { color: var(--error); }
    .scan-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; color: var(--text-sub); }
    .scan-loading .spinner { width: 40px; height: 40px; margin-bottom: 16px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
    @keyframes spin { to { transform: rotate(360deg); } }
    .file-input { display: none; }
    .pc-only { display: none; }
    .scan-hint { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 16px; padding: 10px 12px; border: 1px solid var(--hint-border); border-radius: 8px; background: var(--hint-bg); color: var(--hint-text); font-size: 12px; }

    @media (min-width: 640px) {
      .grid-quick { grid-template-columns: repeat(8, minmax(0, 1fr)); }
      .link-grid { grid-template-columns: repeat(var(--desktop-link-columns, 3), minmax(0, 1fr)); }
    }
    @media (min-width: 768px) { .pc-only { display: flex; } }
    @media (max-width: 520px) {
      .header-section { padding-top: 2rem; }
      .home-title { font-size: 1.35rem; }
      .clock-card { width: min(100%, 320px); padding: 1.25rem 1rem; }
      .time-display { font-size: 2.1rem; }
      .search-box-wrapper { padding: 5px; }
      .engine-btn { padding: 8px; }
    }
    @media (max-width: 400px) { .scan-options { grid-template-columns: 1fr; } }

    .search-help { margin: 10px 14px 0; color: var(--text-sub); font-size: 12px; line-height: 1.5; text-align: center; }
    .search-input:focus-visible { outline: 0; }
    .clear-btn, .scan-btn { width: 40px; height: 44px; flex-shrink: 0; }
    .engine-btn { min-height: 44px; color: var(--text-main); }
    .engine-option:hover, .engine-option:focus-visible { background: var(--bg-hover); }
    .local-results { top: 64px; }
    .results-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--text-sub); font-size: 12px; }
    .results-heading button { min-height: 36px; padding: 6px; color: var(--text-sub); }
    #resultsContainer { max-height: min(320px, 45vh); overflow-y: auto; }
    .result-item { align-items: center; border-radius: 8px; }
    .result-item:hover, .result-item[aria-selected="true"] { background: var(--bg-hover); }
    .result-item[aria-selected="true"] { box-shadow: inset 3px 0 var(--primary); }
    .result-name { min-width: 0; flex: 1; overflow-wrap: anywhere; }
    .result-url { display: block; overflow: hidden; margin-top: 4px; color: var(--text-sub); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
    .result-category { max-width: 30%; color: var(--text-sub); font-size: 12px; overflow-wrap: anywhere; }
    .result-selection { visibility: hidden; color: var(--primary); font-weight: 700; }
    .result-item[aria-selected="true"] .result-selection { visibility: visible; }
    .external-search-btn { width: 100%; min-height: 44px; margin-top: 8px; border-radius: 10px; background: var(--bg-soft); color: var(--primary); font-size: 14px; font-weight: 600; }
    .external-search-btn:hover { background: var(--bg-hover); }
    .category-title { margin-bottom: 0; padding-left: 0; border-left: 0; }
    .group-toggle { display: flex; width: 100%; min-height: 44px; align-items: center; gap: 10px; color: var(--text-main); font-size: inherit; font-weight: inherit; text-align: left; }
    .group-toggle > span:first-child { padding-left: 10px; border-left: 4px solid var(--primary); line-height: 1.4; overflow-wrap: anywhere; }
    .group-count { margin-left: auto; color: var(--text-sub); font-size: 12px; font-weight: 500; }
    .group-chevron { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-sub); transition: transform 0.18s ease; }
    .group-toggle[aria-expanded="false"] .group-chevron { transform: rotate(-90deg); }
    .category-card .link-grid { margin-top: 12px; }
    .scan-close { width: 44px; height: 44px; flex-shrink: 0; }

    @media (prefers-color-scheme: dark) {
      :root {
        --primary: #9bbbff;
        --bg-body: #0f1724;
        --bg-top: #19263f;
        --bg-card: #182233;
        --bg-soft: #202a3b;
        --bg-hover: #293953;
        --clock-bg: rgba(28,40,61,0.8);
        --clock-border: #35425a;
        --text-main: #e8eef8;
        --text-sub: #acb9ce;
        --border: #334159;
        --error: #ff9b9b;
        --hint-border: #75612b;
        --hint-bg: #372f1b;
        --hint-text: #f6d481;
      }
      .link-item.custom-text-color,
      .link-item.custom-text-color:hover { color: var(--site-text-color-dark); }
    }
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
    }
