/* ============================================================================
   X-GORB 图搜 — 链接识图（无上传）
   与搜索页 / 图书页 / 词典页同一套表面与令牌
   ========================================================================== */
body.page-tu{
  --tu-surface:var(--y-canvas,#fff);
  --tu-surface-2:var(--y-canvas-2,#f8f9fa);
  --tu-line:var(--y-line,#dfe1e5);
  --tu-text:var(--y-ink,#202124);
  --tu-text-2:var(--y-ink-2,#4d5156);
  --tu-text-3:var(--y-ink-3,#70757a);
  --tu-brand:var(--y-purple,#1a73e8);
  --tu-brand-soft:var(--y-purple-soft,#e8f0fe);
  --tu-ok:#188038;
  --tu-warn:#b26b00;
  --tu-error:#d93025;
  --tu-radius:18px;
  --tu-shadow:0 1px 2px rgba(60,64,67,.10);
  --tu-ease:cubic-bezier(.2,0,.2,1);
}

/* ---------- 顶栏 ---------- */
body.page-tu main.tu-main{padding:6px 0 44px}
body.page-tu > header .nav-actions{margin-left:auto;display:flex;align-items:center;gap:6px}
body.page-tu > header .action-btn{width:38px;height:38px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0}
body.page-tu > header .action-btn svg{width:17px;height:17px;pointer-events:none}
body.page-tu > header .theme-toggle-btn .icon-sun{display:none}
body.page-tu > header .theme-toggle-btn .icon-moon{display:block}
html[data-theme="dark"] body.page-tu > header .theme-toggle-btn .icon-sun{display:block}
html[data-theme="dark"] body.page-tu > header .theme-toggle-btn .icon-moon{display:none}

body.page-tu > header .tu-headline{
  display:inline-flex;align-items:center;gap:8px;flex:0 1 auto;min-width:0;
  padding:4px 13px 4px 5px;border-radius:100px;
  background:var(--tu-surface-2);border:1px solid var(--tu-line);
  font-size:.82rem;font-weight:600;color:var(--tu-text-2);white-space:nowrap;
}
body.page-tu > header .tu-headline-icon{
  width:26px;height:26px;border-radius:50%;flex:none;
  display:inline-flex;align-items:center;justify-content:center;
  background:var(--tu-brand-soft);color:var(--tu-brand);font-size:.74rem;
}
body.page-tu > header .tu-lang-btn{
  width:auto;min-width:38px;padding:0 10px;border-radius:100px;
  font-size:.74rem;font-weight:700;letter-spacing:.02em;text-decoration:none;
}

.tu-wrap,
.tu-navwrap{width:100%;max-width:1060px;margin:0 auto;padding:0 20px}

/* ---------- 首屏 ---------- */
.tu-hero{padding:34px 6px 20px;text-align:center}
.tu-eyebrow{
  display:inline-flex;align-items:center;gap:6px;
  padding:5px 13px;border-radius:100px;
  background:var(--tu-brand-soft);color:var(--tu-brand);
  font-size:.74rem;font-weight:600;letter-spacing:.02em;
}
.tu-hero h1{
  margin:14px 0 0;font-size:2.1rem;line-height:1.32;font-weight:700;
  letter-spacing:-.02em;color:var(--tu-text);
}
.tu-hero h1 .tu-grad{
  background:linear-gradient(96deg,#1a73e8 0%,#a767e5 60%,#12bcee 100%);
  -webkit-background-clip:text;background-clip:text;color:transparent;
}
html[data-theme="dark"] .tu-hero h1 .tu-grad{
  background:linear-gradient(96deg,#8ab4f8 0%,#c9a6ff 60%,#7ed7ff 100%);
  -webkit-background-clip:text;background-clip:text;
}
.tu-hero p{margin:12px auto 0;max-width:620px;font-size:.9rem;line-height:1.75;color:var(--tu-text-3)}

/* ---------- 输入卡 ---------- */
.tu-card{
  background:var(--tu-surface);border:1px solid var(--tu-line);border-radius:var(--tu-radius);
  box-shadow:var(--tu-shadow);
}
.tu-composer{
  padding:18px 18px 16px;border-radius:20px;
  box-shadow:0 1px 2px rgba(60,64,67,.08),0 18px 40px -32px rgba(26,115,232,.7);
}
.tu-linkbox{
  display:flex;align-items:center;gap:8px;
  padding:6px 6px 6px 16px;
  border:1px solid var(--tu-line);border-radius:100px;
  background:var(--tu-surface-2);
  transition:border-color .18s var(--tu-ease),box-shadow .18s var(--tu-ease),background .18s var(--tu-ease);
}
.tu-linkbox:focus-within{
  border-color:var(--tu-brand);background:var(--tu-surface);
  box-shadow:0 0 0 4px color-mix(in srgb,var(--tu-brand) 14%,transparent);
}
.tu-linkicon{flex:none;color:var(--tu-text-3);font-size:.88rem}
.tu-linkbox input{
  flex:1 1 auto;min-width:0;padding:11px 2px;border:0;outline:0;background:transparent;
  font-family:inherit;font-size:.92rem;color:var(--tu-text);
}
.tu-linkbox input::placeholder{color:var(--tu-text-3)}
.tu-linkbox .tu-btn{flex:none;height:38px;padding:0 16px;border-radius:100px}

/* ---------- 按钮 ---------- */
.tu-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  padding:8px 15px;border-radius:100px;border:1px solid var(--tu-line);
  background:var(--tu-surface);color:var(--tu-text-2);
  font-family:inherit;font-size:.82rem;font-weight:500;line-height:1.2;
  text-decoration:none;white-space:nowrap;cursor:pointer;
  transition:color .16s var(--tu-ease),border-color .16s var(--tu-ease),background .16s var(--tu-ease);
}
.tu-btn i{font-size:.82rem}
.tu-btn:hover{color:var(--tu-brand);border-color:var(--tu-brand);background:var(--tu-brand-soft)}
.tu-btn-primary{background:var(--tu-brand);border-color:var(--tu-brand);color:#fff}
.tu-btn-primary:hover{background:color-mix(in srgb,var(--tu-brand) 86%,#000);border-color:transparent;color:#fff}
.tu-btn-soft{background:var(--tu-brand-soft);border-color:transparent;color:var(--tu-brand)}
.tu-btn-soft:hover{background:color-mix(in srgb,var(--tu-brand-soft) 78%,var(--tu-brand) 10%)}
.tu-btn-ghost{background:transparent}
.tu-btn:focus-visible,.tu-sample:focus-visible,.tu-lang-btn:focus-visible{
  outline:2px solid var(--tu-brand);outline-offset:2px;
}
.tu-btn[disabled]{opacity:.5;pointer-events:none}

/* ---------- 示例 ---------- */
.tu-samples{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:12px}
.tu-samples-label{font-size:.74rem;color:var(--tu-text-3);letter-spacing:.02em}
.tu-sample{
  display:inline-flex;align-items:center;gap:5px;padding:5px 12px;border-radius:100px;
  border:1px dashed color-mix(in srgb,var(--tu-line) 65%,var(--tu-brand));
  background:transparent;color:var(--tu-text-2);
  font-family:inherit;font-size:.78rem;line-height:1.4;cursor:pointer;
  transition:color .16s var(--tu-ease),border-color .16s var(--tu-ease),background .16s var(--tu-ease);
}
.tu-sample:hover{color:var(--tu-brand);border-color:var(--tu-brand);border-style:solid;background:var(--tu-brand-soft)}
.tu-sample i{font-size:.72rem;color:var(--tu-brand)}

/* ---------- 状态 / 隐私 ---------- */
.tu-status{margin:12px 2px 0;min-height:1.3em;font-size:.8rem;line-height:1.6;color:var(--tu-text-3)}
.tu-status[data-tone="ok"]{color:var(--tu-ok)}
.tu-status[data-tone="warn"]{color:var(--tu-warn)}
.tu-status[data-tone="error"]{color:var(--tu-error)}
html[data-theme="dark"] .tu-status[data-tone="ok"]{color:#81c995}
html[data-theme="dark"] .tu-status[data-tone="warn"]{color:#fdd663}
html[data-theme="dark"] .tu-status[data-tone="error"]{color:#f28b82}
.tu-privacy{display:flex;align-items:flex-start;gap:6px;margin:6px 2px 0;font-size:.74rem;line-height:1.6;color:var(--tu-text-3)}
.tu-privacy i{flex:none;margin-top:2px;color:var(--tu-brand)}

/* ---------- 预览 ---------- */
.tu-preview[hidden]{display:none}
.tu-preview{margin-top:18px}
.tu-preview-card{
  display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);
  gap:24px;align-items:start;padding:20px;
  background:var(--tu-surface);border:1px solid var(--tu-line);
  border-radius:20px;box-shadow:var(--tu-shadow);
}
.tu-shot{
  position:relative;display:flex;align-items:center;justify-content:center;
  min-height:240px;max-height:340px;padding:10px;overflow:hidden;
  border:1px solid var(--tu-line);border-radius:14px;background:var(--tu-surface-2);
}
.tu-shot img{display:block;max-width:100%;max-height:320px;width:auto;height:auto;object-fit:contain;border-radius:8px}
.tu-shot img:not([src]){display:none}
.tu-shot-fallback{display:none;flex-direction:column;align-items:center;gap:8px;padding:0 12px;text-align:center;font-size:.78rem;color:var(--tu-text-3)}
.tu-shot-fallback i{font-size:1.3rem;color:var(--tu-text-3)}
.tu-shot.is-failed .tu-shot-fallback{display:flex}
.tu-shot.is-failed img{display:none}

.tu-details{min-width:0}
.tu-kicker{
  display:inline-flex;align-items:center;padding:3px 10px;border-radius:100px;
  background:#e6f4ea;color:#137333;font-size:.68rem;font-weight:600;letter-spacing:.04em;
}
html[data-theme="dark"] .tu-kicker{background:rgba(129,201,149,.16);color:#81c995}
.tu-details h2{margin:10px 0 14px;font-size:1.05rem;font-weight:600;color:var(--tu-text)}
.tu-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:0 0 14px;padding:0;list-style:none}
.tu-facts li{min-width:0;padding:9px 11px;border:1px solid var(--tu-line);border-radius:10px;background:var(--tu-surface-2)}
.tu-facts span{display:block;font-size:.68rem;letter-spacing:.04em;text-transform:uppercase;color:var(--tu-text-3)}
.tu-facts b{display:block;margin-top:3px;font-size:.82rem;font-weight:600;color:var(--tu-text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tu-linklabel{display:block;margin:0 0 5px;font-size:.72rem;color:var(--tu-text-3)}
.tu-copyrow{display:flex;gap:8px;margin-bottom:12px}
.tu-copyrow input{
  flex:1 1 auto;min-width:0;padding:9px 14px;border:1px solid var(--tu-line);border-radius:100px;
  background:var(--tu-surface-2);color:var(--tu-text-2);outline:0;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.76rem;
}
.tu-copyrow input:focus{border-color:var(--tu-brand);background:var(--tu-surface)}
.tu-copyrow .tu-btn{flex:none;height:38px;padding:0 16px}
.tu-pactions{display:flex;flex-wrap:wrap;gap:8px}

/* ---------- 识图过程 ---------- */
.tu-btn.is-busy{pointer-events:none;opacity:.9}
.tu-btn.is-busy i{display:none}
.tu-btn.is-busy::before{
  content:'';width:13px;height:13px;flex:none;
  border:2px solid currentColor;border-right-color:transparent;border-radius:50%;
  animation:tu-spin .7s linear infinite;
}
@keyframes tu-spin{to{transform:rotate(360deg)}}

.tu-loading{
  display:flex;align-items:center;justify-content:center;gap:10px;
  margin-top:18px;padding:24px;border:1px dashed var(--tu-line);border-radius:16px;
  background:var(--tu-surface-2);color:var(--tu-text-3);font-size:.84rem;
}
.tu-loading[hidden]{display:none}
.tu-spinner{
  width:18px;height:18px;flex:none;border-radius:50%;
  border:2px solid color-mix(in srgb,var(--tu-brand) 28%,transparent);
  border-top-color:var(--tu-brand);
  animation:tu-spin .8s linear infinite;
}

.tu-error{
  display:flex;align-items:flex-start;gap:12px;margin-top:16px;padding:15px 18px;
  border:1px solid color-mix(in srgb,var(--tu-error) 32%,var(--tu-line));
  background:color-mix(in srgb,var(--tu-error) 6%,var(--tu-surface));
  border-radius:14px;
}
.tu-error[hidden]{display:none}
.tu-error-icon{
  width:32px;height:32px;flex:none;border-radius:10px;
  display:inline-flex;align-items:center;justify-content:center;
  background:color-mix(in srgb,var(--tu-error) 14%,transparent);color:var(--tu-error);font-size:.86rem;
}
.tu-error-body{min-width:0}
.tu-error-body p{margin:2px 0 10px;font-size:.84rem;line-height:1.65;color:var(--tu-text-2)}

/* ---------- 识图结果 ---------- */
.tu-results[hidden]{display:none}
.tu-results{margin-top:20px}
.tu-summary{
  display:flex;align-items:center;gap:14px;padding:16px 18px;
  background:var(--tu-surface);border:1px solid var(--tu-line);border-radius:18px;
  box-shadow:var(--tu-shadow);
}
.tu-summary-thumb{
  width:64px;height:64px;flex:none;overflow:hidden;border-radius:12px;
  border:1px solid var(--tu-line);background:var(--tu-surface-2);
  display:flex;align-items:center;justify-content:center;color:var(--tu-text-3);
}
.tu-summary-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.tu-summary-thumb img:not([src]){display:none}
.tu-summary-text{flex:1 1 auto;min-width:0}
.tu-summary-text h2{margin:6px 0 3px;font-size:1.02rem;font-weight:600;line-height:1.4;color:var(--tu-text)}
.tu-summary-meta{margin:0;font-size:.76rem;line-height:1.6;color:var(--tu-text-3)}
.tu-summary-retry{flex:none}

.tu-empty{
  display:flex;flex-direction:column;align-items:center;gap:8px;margin-top:16px;padding:26px 18px;
  border:1px dashed var(--tu-line);border-radius:16px;background:var(--tu-surface-2);
  text-align:center;color:var(--tu-text-3);
}
.tu-empty[hidden]{display:none}
.tu-empty i{font-size:1.4rem;color:var(--tu-brand)}
.tu-empty p{margin:0;font-size:.82rem;line-height:1.6}

.tu-result-block{margin-top:22px}
.tu-result-block[hidden]{display:none}
.tu-block-head{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;margin:0 2px 10px}
.tu-block-head h3{margin:0;font-size:.95rem;font-weight:600;color:var(--tu-text)}
.tu-block-head p{margin:0;font-size:.76rem;color:var(--tu-text-3)}
.tu-block-empty{margin:6px 2px 0;font-size:.8rem;line-height:1.6;color:var(--tu-text-3)}
.tu-block-empty[hidden]{display:none}

.tu-match-list{display:flex;flex-direction:column;gap:8px}
.tu-match{
  display:flex;align-items:center;gap:12px;padding:10px 14px 10px 10px;
  background:var(--tu-surface);border:1px solid var(--tu-line);border-radius:14px;
  text-decoration:none;
  transition:border-color .16s var(--tu-ease),background .16s var(--tu-ease);
}
.tu-match:hover{border-color:color-mix(in srgb,var(--tu-brand) 45%,var(--tu-line));background:var(--tu-brand-soft)}
.tu-thumbbox{
  position:relative;width:76px;height:58px;flex:none;overflow:hidden;border-radius:9px;
  border:1px solid var(--tu-line);background:var(--tu-surface-2);
  display:flex;align-items:center;justify-content:center;color:var(--tu-text-3);
}
.tu-thumbbox img{width:100%;height:100%;object-fit:cover;display:block}
.tu-thumbbox i{display:none;font-size:.95rem}
.tu-thumbbox.is-empty i{display:block}
.tu-match-body{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:3px}
.tu-match-body strong{
  font-size:.86rem;font-weight:600;line-height:1.45;color:var(--tu-text);
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.tu-match-meta{font-size:.72rem;color:var(--tu-text-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tu-match-go{flex:none;font-size:.72rem;color:var(--tu-text-3)}
.tu-match:hover .tu-match-go{color:var(--tu-brand)}

.tu-sim-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(152px,1fr));gap:10px}
.tu-sim{
  display:flex;flex-direction:column;overflow:hidden;
  background:var(--tu-surface);border:1px solid var(--tu-line);border-radius:14px;
  text-decoration:none;
  transition:border-color .16s var(--tu-ease),transform .16s var(--tu-ease),box-shadow .16s var(--tu-ease);
}
.tu-sim:hover{
  border-color:color-mix(in srgb,var(--tu-brand) 45%,var(--tu-line));
  transform:translateY(-1px);
  box-shadow:0 10px 24px -20px rgba(26,115,232,.8);
}
.tu-sim .tu-thumbbox{width:100%;height:auto;aspect-ratio:4/3;border:0;border-bottom:1px solid var(--tu-line);border-radius:0}
.tu-sim-body{padding:8px 10px 10px;display:flex;flex-direction:column;gap:3px;min-width:0}
.tu-sim-title{
  font-size:.78rem;font-weight:500;line-height:1.45;color:var(--tu-text);min-height:2.2em;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.tu-sim-meta{font-size:.68rem;color:var(--tu-text-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tu-source-note{margin:16px 2px 0;font-size:.72rem;color:var(--tu-text-3);text-align:right}

/* ---------- 说明 ---------- */
.tu-notes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:26px}
.tu-note{
  padding:18px;background:var(--tu-surface);border:1px solid var(--tu-line);
  border-radius:16px;box-shadow:var(--tu-shadow);
}
.tu-note-icon{
  width:34px;height:34px;margin-bottom:10px;border-radius:11px;
  display:inline-flex;align-items:center;justify-content:center;
  background:var(--tu-brand-soft);color:var(--tu-brand);font-size:.82rem;
}
.tu-note h3{margin:0 0 6px;font-size:.9rem;font-weight:600;color:var(--tu-text)}
.tu-note p{margin:0;font-size:.8rem;line-height:1.75;color:var(--tu-text-3)}

/* ---------- 页脚按钮 ---------- */
.tu-cookie-btn{
  border:1px solid var(--y-line);background:var(--y-canvas);color:var(--y-ink-2);
  font-family:inherit;font-size:.72rem;font-weight:500;padding:5px 12px;border-radius:100px;line-height:1.4;cursor:pointer;
  transition:color .16s var(--tu-ease),border-color .16s var(--tu-ease);
}
.tu-cookie-btn:hover{color:var(--tu-brand);border-color:var(--tu-brand)}

/* ---------- 提示条 ---------- */
.tu-toast{
  position:fixed;left:50%;bottom:28px;z-index:9999;
  transform:translate(-50%,16px);
  max-width:min(520px,calc(100vw - 32px));padding:11px 18px;border-radius:100px;
  background:#202124;color:#fff;font-size:.82rem;line-height:1.4;text-align:center;
  box-shadow:0 10px 30px rgba(0,0,0,.28);
  opacity:0;pointer-events:none;
  transition:opacity .2s var(--tu-ease),transform .2s var(--tu-ease);
}
.tu-toast.show{opacity:1;transform:translate(-50%,0)}
.tu-toast[data-tone="error"]{background:#b3261e}
html[data-theme="dark"] .tu-toast{background:#e8eaed;color:#202124}
html[data-theme="dark"] .tu-toast[data-tone="error"]{background:#f28b82;color:#3c0a06}

/* ---------- 响应式 ---------- */
@media(max-width:900px){
  .tu-notes{grid-template-columns:1fr 1fr}
  .tu-notes .tu-note:last-child{grid-column:1 / -1}
}
@media(max-width:820px){
  .tu-hero{padding:24px 4px 16px}
  .tu-hero h1{font-size:1.72rem}
  .tu-hero p{font-size:.85rem}
  .tu-preview-card{grid-template-columns:1fr;gap:18px;padding:16px}
  .tu-shot{min-height:190px;max-height:300px}
  .tu-shot img{max-height:280px}
  .tu-notes{grid-template-columns:1fr;margin-top:20px}
  .tu-notes .tu-note:last-child{grid-column:auto}
  .tu-summary{flex-wrap:wrap}
  .tu-summary-text{flex:1 1 60%}
  .tu-sim-grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr))}
}
@media(max-width:600px){
  .tu-wrap,.tu-navwrap{padding:0 14px}
  body.page-tu > header .tu-headline{display:none}
  .tu-composer{padding:14px 12px 12px;border-radius:18px}
  .tu-linkbox{flex-wrap:wrap;gap:6px;padding:8px 10px;border-radius:16px}
  .tu-linkicon{display:none}
  .tu-linkbox input{flex:1 1 100%;padding:6px 4px 8px;font-size:.88rem}
  .tu-linkbox .tu-btn{flex:1 1 auto;height:36px;padding:0 12px}
  .tu-samples{gap:6px;margin-top:10px}
  .tu-samples-label{flex:1 1 100%}
  .tu-facts{grid-template-columns:1fr 1fr}
  .tu-copyrow{flex-direction:column}
  .tu-copyrow .tu-btn{width:100%;height:36px}
  .tu-pactions .tu-btn{flex:1 1 auto;justify-content:center}
  .tu-shot{min-height:170px;max-height:260px}
  .tu-shot img{max-height:240px}
  .tu-summary{padding:13px 14px;gap:11px}
  .tu-summary-thumb{width:52px;height:52px;border-radius:10px}
  .tu-summary-text h2{font-size:.94rem}
  .tu-summary-retry{padding:7px 12px}
  .tu-summary-retry span{display:none}
  .tu-match{padding:8px 10px 8px 8px;gap:10px}
  .tu-thumbbox{width:64px;height:50px}
  .tu-match-body strong{font-size:.82rem}
  .tu-sim-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .tu-sim-body{padding:7px 8px 9px}
  .tu-sim-title{font-size:.74rem}
  .tu-source-note{text-align:left}
  .tu-toast{bottom:18px;font-size:.8rem}
}
@media(max-width:360px){
  .tu-wrap,.tu-navwrap{padding:0 10px}
}
@media(max-width:420px){
  .tu-hero h1{font-size:1.5rem}
  .tu-facts{grid-template-columns:1fr}
  .tu-thumbbox{width:56px;height:46px}
}

@media(prefers-reduced-motion:reduce){
  .tu-btn,.tu-sim,.tu-match,.tu-toast,.tu-sample,.tu-linkbox{transition-duration:.01ms !important}
  .tu-sim:hover{transform:none}
}
