/* AI Image Upscaler — 工具区样式
 * 配色与组件规范对齐主站主题（#09090b 底 / 蓝紫渐变 CTA / glass-panel 卡片），
 * 与 photo-repair.html 保持视觉一致；类名统一 up- 前缀，避免污染站点全局样式。
 */

.up-main { flex: 1; }
.up-wrap { max-width: 1040px; margin: 0 auto; padding: 56px 24px 96px; }

/* 标题区 */
.up-hero { text-align: center; margin-bottom: 40px; }
.up-badge {
    display: inline-block; padding: 5px 14px; border-radius: 999px; font-size: 12px;
    font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    color: #a5b4fc; background: rgba(99,102,241,.10); border: 1px solid rgba(99,102,241,.22);
}
.up-title {
    margin: 18px 0 12px; font-size: clamp(30px, 5vw, 46px); line-height: 1.15;
    font-weight: 800; letter-spacing: -.02em; color: #fff;
    background: linear-gradient(100deg,#fff 20%,#a5b4fc 60%,#c4b5fd 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.up-sub { max-width: 660px; margin: 0 auto; font-size: 16px; line-height: 1.7; color: #9ca3af; }

/* 本地处理提示 */
.up-privacy {
    display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px;
    padding: 14px 18px; border-radius: 14px; font-size: 13.5px; line-height: 1.6;
    color: #6ee7b7; background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.20);
}
.up-privacy svg { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.up-privacy strong { color: #a7f3d0; }

/* 卡片 */
.up-card {
    background: rgba(255,255,255,.03); backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.08); border-radius: 20px; padding: 28px;
}
.up-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 20px;
    padding: 16px 18px; border-radius: 14px;
    background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.07);
}
.up-label { font-size: 12px; font-weight: 600; color: #9ca3af; letter-spacing: .04em; text-transform: uppercase; }
.up-scale-group { display: inline-flex; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); overflow: hidden; }
.up-scale-btn {
    padding: 7px 20px; font-size: 14px; font-weight: 600; color: #d1d5db;
    background: rgba(255,255,255,.03); cursor: pointer; transition: all .15s;
}
.up-scale-btn:hover { background: rgba(255,255,255,.08); }
.up-scale-btn.active { background: linear-gradient(135deg,#3b82f6,#8b5cf6); color: #fff; }
.up-scale-btn:disabled { opacity: .5; cursor: not-allowed; }
.up-pill {
    margin-left: auto; font-size: 12px; padding: 4px 12px; border-radius: 999px;
    background: rgba(255,255,255,.06); color: #9ca3af; white-space: nowrap;
}
.up-pill-ok { background: rgba(52,211,153,.15); color: #6ee7b7; }

/* 状态 / 进度 */
.up-status {
    display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 11px 15px;
    border-radius: 12px; font-size: 13px; color: #d1d5db;
    background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.07);
}
.up-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #6b7280; flex: none; }
.up-status.info .up-status-dot { background: #818cf8; }
.up-status.ok { color: #6ee7b7; }
.up-status.ok .up-status-dot { background: #34d399; }
.up-status.error { color: #fca5a5; }
.up-status.error .up-status-dot { background: #f87171; }
.up-engine { margin-left: auto; font-size: 11px; color: #6b7280; white-space: nowrap; }
#progress-wrap { margin-bottom: 18px; }
.up-progress-label { display: flex; justify-content: space-between; font-size: 12px; color: #9ca3af; margin-bottom: 6px; }
.up-progress-track { height: 6px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
#progress-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg,#3b82f6,#8b5cf6); transition: width .15s linear; }
#error-box {
    display: none; margin-bottom: 18px; padding: 12px 16px; border-radius: 12px; font-size: 13.5px;
    color: #fca5a5; background: rgba(239,68,68,.10); border: 1px solid rgba(239,68,68,.25);
}

/* 上传区 */
.up-drop {
    border: 2px dashed rgba(255,255,255,.14); border-radius: 18px; text-align: center;
    padding: 56px 20px; cursor: pointer; transition: all .25s ease; background: rgba(255,255,255,.015);
}
.up-drop:hover, .up-drop.drag {
    border-color: rgba(99,102,241,.7); background: rgba(99,102,241,.06);
    box-shadow: 0 0 40px rgba(99,102,241,.12) inset;
}
.up-drop-icon {
    width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 30px; color: #a5b4fc;
    background: linear-gradient(135deg,rgba(59,130,246,.15),rgba(168,85,247,.15));
    border: 1px solid rgba(129,140,248,.3);
}
.up-drop-title { font-size: 16px; font-weight: 500; color: #e5e7eb; }
.up-drop-title em { font-style: normal; color: #a5b4fc; text-decoration: underline; }
.up-drop-hint { margin-top: 8px; font-size: 13px; color: #9ca3af; }
.up-drop-hint2 { margin-top: 6px; font-size: 12px; color: #6b7280; }

/* 结果区 */
.up-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.up-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border-radius: 10px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all .18s; border: 1px solid transparent;
}
.up-btn-primary { background: linear-gradient(135deg,#3b82f6,#8b5cf6); color: #fff; box-shadow: 0 4px 20px rgba(99,102,241,.35); }
.up-btn-primary:hover { filter: brightness(1.12); transform: translateY(-1px); }
.up-btn-ghost { background: rgba(255,255,255,.04); color: #d1d5db; border-color: rgba(255,255,255,.12); }
.up-btn-ghost:hover { background: rgba(255,255,255,.09); }
.up-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
.up-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.up-meta-card { background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.07); border-radius: 14px; padding: 16px; }
.up-meta-label { font-size: 12px; color: #6b7280; margin-bottom: 8px; }
.up-meta-thumb { width: 100%; height: 88px; object-fit: contain; border-radius: 8px; background: rgba(0,0,0,.35); margin-bottom: 10px; }
.up-meta-value { font-size: 13.5px; color: #e5e7eb; font-weight: 600; }
.up-placeholder {
    min-height: 200px; display: flex; align-items: center; justify-content: center;
    color: #6b7280; font-size: 14px; background: rgba(0,0,0,.25);
    border-radius: 14px; border: 1px solid rgba(255,255,255,.07);
}

/* 前后对比 */
.up-compare {
    position: relative; width: 100%; overflow: hidden; border-radius: 14px;
    border: 1px solid rgba(255,255,255,.09); background: #101014;
    touch-action: none; cursor: ew-resize; user-select: none;
}
.up-compare img { display: block; width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; }
.up-compare .up-after { position: absolute; inset: 0; overflow: hidden; }
.up-compare .up-after img { position: absolute; top: 0; left: 0; height: 100%; width: 100%; object-fit: cover; }
.up-handle {
    position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.9);
    box-shadow: 0 0 12px rgba(0,0,0,.6); pointer-events: none; z-index: 5;
}
.up-handle::after {
    content: '↔'; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 36px; height: 36px; border-radius: 50%; background: #fff; color: #111;
    display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700;
}
.up-tag {
    position: absolute; top: 12px; z-index: 4; font-size: 11px; font-weight: 600; padding: 5px 12px;
    border-radius: 999px; background: rgba(10,10,12,.7); border: 1px solid rgba(255,255,255,.18); color: #e5e7eb;
}
.up-tag-before { left: 12px; }
.up-tag-after { right: 12px; }
#compare-range { width: 100%; margin-top: 14px; accent-color: #6366f1; }

/* 说明 / FAQ / 相关工具 */
.up-section { margin-top: 72px; }
.up-section-title { font-size: 26px; font-weight: 700; color: #fff; text-align: center; margin-bottom: 36px; }
.up-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.up-step { text-align: center; }
.up-step .no {
    width: 42px; height: 42px; border-radius: 50%; margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff;
    background: linear-gradient(135deg,#3b82f6,#8b5cf6); box-shadow: 0 4px 14px rgba(99,102,241,.4);
}
.up-step h3 { font-size: 16px; font-weight: 600; color: #fff; margin-bottom: 8px; }
.up-step p { font-size: 13.5px; line-height: 1.7; color: #9ca3af; }
.up-faq { display: grid; gap: 14px; max-width: 840px; margin: 0 auto; }
.up-faq-item { background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.07); border-radius: 14px; padding: 20px 22px; }
.up-faq-item h3 { font-size: 15px; font-weight: 600; color: #fff; margin-bottom: 8px; }
.up-faq-item p { font-size: 13.5px; line-height: 1.75; color: #9ca3af; }
.up-related { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.up-related a {
    display: flex; align-items: flex-start; gap: 14px; padding: 18px;
    background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px; transition: all .2s;
}
.up-related a:hover { border-color: rgba(99,102,241,.45); background: rgba(99,102,241,.05); }
.up-related .ico {
    width: 40px; height: 40px; flex: none; border-radius: 10px; display: flex;
    align-items: center; justify-content: center; color: #a5b4fc; background: rgba(99,102,241,.10);
}
.up-related strong { display: block; font-size: 14px; color: #fff; margin-bottom: 4px; }
.up-related span { font-size: 12.5px; color: #9ca3af; line-height: 1.6; }

/* 自检面板 */
#selftest-panel { display: none; margin-top: 20px; padding: 18px; border-radius: 12px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.09); }
#selftest-report { font-size: 12px; line-height: 1.6; color: #a5b4fc; white-space: pre-wrap; word-break: break-all; margin: 0; max-height: 380px; overflow: auto; }

@media (max-width: 768px) {
    .up-wrap { padding: 36px 16px 64px; }
    .up-card { padding: 18px; }
    .up-steps, .up-related { grid-template-columns: 1fr; }
    .up-meta-grid { grid-template-columns: 1fr; }
    .up-drop { padding: 36px 14px; }
    .up-engine { display: none; }
}
