/* ============================================================
   ai-theme.css · 迅睿工具箱 AI 羽白主题
   设计体系：羽白底色 + 浅色光晕 + 白色玻璃卡片 + 紫青渐变强调
   覆盖 layui.css / base.css，须在两者之后加载
   ============================================================ */

:root {
    --bg: #f7f8fc;
    --card: #ffffff;
    --card-border: #e7e9f2;
    --divider: #eef0f6;
    --text-1: #0f172a;
    --text-2: #55607a;
    --text-3: #94a0b8;
    --accent-1: #6d5cff;
    --accent-2: #8b5cf6;
    --accent-3: #0ea5e9;
    --ok: #10b981;
    --grad-brand: linear-gradient(120deg, #6d5cff, #0ea5e9 62%, #10b981);
    --grad-accent: linear-gradient(135deg, #6d5cff, #8b5cf6);
    --grad-blue: linear-gradient(135deg, #38bdf8, #3b82f6);
    --grad-teal: linear-gradient(135deg, #14b8a6, #10b981);
    --grad-slate: linear-gradient(135deg, #64748b, #475569);
    --shadow-card: 0 10px 30px -14px rgba(30, 41, 59, .14);
    --shadow-card-hover: 0 20px 44px -18px rgba(109, 92, 255, .28);
    --font-sans: "Inter", "SF Pro Text", "PingFang SC", "HarmonyOS Sans SC",
        "Microsoft YaHei UI", "Microsoft YaHei", -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code",
        Consolas, "Courier New", monospace;
}

/* ---------- 基础 ---------- */

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--text-1);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    animation: pageIn .5s ease both;
}

@keyframes pageIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

::selection { background: rgba(109, 92, 255, .2); color: var(--text-1); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, .16);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(15, 23, 42, .3); background-clip: content-box; }

/* ---------- 背景层：浅色光晕 + 细网格 + 光标光斑 ---------- */

.ai-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.ai-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(88px);
    opacity: .5;
    will-change: transform;
}

.ai-blob.b1 {
    width: 640px; height: 640px;
    left: -160px; top: -200px;
    background: radial-gradient(circle, #c7d2fe 0%, rgba(199, 210, 254, 0) 68%);
    animation: aiFloat1 26s ease-in-out infinite alternate;
}

.ai-blob.b2 {
    width: 560px; height: 560px;
    right: -160px; top: 4%;
    background: radial-gradient(circle, #bae6fd 0%, rgba(186, 230, 253, 0) 68%);
    animation: aiFloat2 30s ease-in-out infinite alternate;
}

.ai-blob.b3 {
    width: 620px; height: 620px;
    left: 30%; bottom: -280px;
    background: radial-gradient(circle, #ddd6fe 0%, rgba(221, 214, 254, 0) 70%);
    animation: aiFloat3 34s ease-in-out infinite alternate;
}

@keyframes aiFloat1 {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(90px, 60px) scale(1.12); }
}

@keyframes aiFloat2 {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(-70px, 80px) scale(1.08); }
}

@keyframes aiFloat3 {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(60px, -50px) scale(1.15); }
}

.ai-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(15, 23, 42, .032) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, .032) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse 90% 64% at 50% 0%, #000 0%, transparent 78%);
    mask-image: radial-gradient(ellipse 90% 64% at 50% 0%, #000 0%, transparent 78%);
}

.ai-spot {
    position: absolute;
    inset: 0;
    background: radial-gradient(620px circle at var(--spot-x, 50%) var(--spot-y, 0%), rgba(109, 92, 255, .055), transparent 65%);
}

/* ---------- 顶栏 ---------- */

.pcheader {
    background: rgba(255, 255, 255, .82) !important;
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    backdrop-filter: blur(16px) saturate(1.6);
    border-bottom: 1px solid rgba(15, 23, 42, .07);
    transition: background .3s ease, box-shadow .3s ease;
    animation: headerIn .55s cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes headerIn {
    from { transform: translateY(-100%); }
    to   { transform: translateY(0); }
}

.pcheader.scrolled {
    background: rgba(255, 255, 255, .94) !important;
    box-shadow: 0 12px 28px -18px rgba(15, 23, 42, .25);
}

/* 顶栏底部渐变细线 */
.pcheader::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(109, 92, 255, .4), rgba(14, 165, 233, .35), transparent);
    pointer-events: none;
}

.header-box { width: 1180px; margin: auto; }

.layui-nav {
    background: transparent !important;
    padding: 0;
    border-radius: 0;
}

.layui-nav .layui-nav-item { line-height: 62px; }

.layui-nav .layui-nav-item a {
    display: inline-block;
    padding: 0 16px;
    color: rgba(15, 23, 42, .68);
    font-size: 14.5px;
    letter-spacing: .02em;
    position: relative;
    transition: color .25s ease;
}

.layui-nav .layui-nav-item a::after {
    content: "";
    position: absolute;
    left: 16px; right: 16px; bottom: 14px;
    height: 2px;
    border-radius: 2px;
    background: var(--grad-accent);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .32s cubic-bezier(.2, .7, .2, 1);
}

.layui-nav .layui-nav-item a:hover { color: var(--text-1); }
.layui-nav .layui-nav-item a:hover::after { transform: scaleX(1); }
.layui-nav .layui-nav-item.layui-this a { color: var(--text-1); font-weight: 600; }
.layui-nav .layui-nav-item.layui-this a::after { transform: scaleX(1); }

.layui-nav .layui-nav-item.layui-this::after,
.layui-nav .layui-nav-item.layui-this > a::before { display: none; }

/* Logo：渐变字 */
.logo { width: auto; padding: 0 24px 0 6px; }

.logo a {
    background: var(--grad-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent !important;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: .05em;
}

.mb-header { height: 62px; }

/* ---------- Hero 区 ---------- */

.ai-hero {
    position: relative;
    z-index: 1;
    padding: 58px 0 38px;
    text-align: center;
}

.ai-hero-inner { max-width: 760px; margin: 0 auto; padding: 0 20px; }

.ai-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 12.5px;
    letter-spacing: .08em;
    color: var(--accent-1);
    background: rgba(109, 92, 255, .09);
    border: 1px solid rgba(109, 92, 255, .18);
}

.ai-eyebrow i {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--grad-accent);
    box-shadow: 0 0 8px rgba(109, 92, 255, .7);
    animation: aiPulse 2.4s ease-in-out infinite;
}

@keyframes aiPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: .55; }
}

.ai-hero-title {
    margin: 0 0 12px;
    font-size: 36px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: .02em;
    color: var(--text-1);
}

.ai-hero-title em {
    font-style: normal;
    background: var(--grad-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ai-hero-sub {
    margin: 0 auto 26px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-2);
    max-width: 560px;
}

/* 搜索框 */
.ai-search {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    padding: 6px 8px 6px 18px;
    box-shadow: var(--shadow-card);
    transition: border-color .25s ease, box-shadow .25s ease;
}

.ai-search:focus-within {
    border-color: rgba(109, 92, 255, .55);
    box-shadow: 0 0 0 4px rgba(109, 92, 255, .12), var(--shadow-card-hover);
}

.ai-search-icon {
    flex: none;
    color: var(--text-3);
}

.ai-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 14.5px;
    color: var(--text-1);
    font-family: inherit;
}

.ai-search-input::placeholder { color: var(--text-3); }

.ai-search-count {
    flex: none;
    font-size: 12px;
    color: var(--text-3);
    background: rgba(15, 23, 42, .05);
    border-radius: 999px;
    padding: 4px 12px;
    white-space: nowrap;
}

/* ---------- 主体内容 ---------- */

main { position: relative; z-index: 1; }

main .layui-container {
    max-width: 1180px;
    padding-top: 6px;
    padding-bottom: 48px;
}

.bgff { background: transparent; }

/* ---------- 标签分组卡片 ---------- */

.layui-form-item {
    position: relative;
    display: block;
    margin: 0 0 24px;
    padding: 26px 30px 28px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    box-shadow: var(--shadow-card);
    transition: transform .35s cubic-bezier(.2, .7, .2, 1),
                border-color .3s ease, box-shadow .3s ease, opacity .6s ease;
}

.layui-form-item:hover {
    transform: translateY(-2px);
    border-color: rgba(109, 92, 255, .3);
    box-shadow: var(--shadow-card-hover);
}

.layui-form-label {
    float: none;
    display: flex;
    align-items: center;
    width: auto;
    padding: 0 0 16px;
    margin: 0 0 18px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-1);
    text-align: left;
    letter-spacing: .03em;
    border-bottom: 1px solid var(--divider);
}

.layui-form-label::before {
    content: "";
    width: 9px; height: 9px;
    margin-right: 11px;
    border-radius: 50%;
    background: var(--grad-accent);
    box-shadow: 0 0 10px rgba(109, 92, 255, .6);
    flex: none;
}

.ai-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .02em;
    color: var(--text-3);
    background: rgba(15, 23, 42, .05);
    border: 1px solid rgba(15, 23, 42, .05);
    border-radius: 999px;
    padding: 3px 12px;
    transition: color .25s ease, background .25s ease;
}

.ai-count.hit { color: var(--accent-1); background: rgba(109, 92, 255, .1); }

/* 按钮网格 */
.layui-input-block {
    margin-left: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
    gap: 12px;
    align-items: stretch;
}

.layui-input-block .layui-btn { margin-bottom: 0; }

/* 隐藏的剪贴板来源 */
textarea {
    opacity: 0;
    overflow: hidden;
    width: 0;
    height: 0;
    margin-left: -4px;
    position: absolute;
}

/* 筛选隐藏态 */
.ai-hidden { display: none !important; }
.ai-card-hidden { display: none !important; }

/* ---------- 标签按钮：胶囊 + 网格卡片 ---------- */

.layui-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    height: 46px;
    padding: 0 18px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: .02em;
    color: var(--text-2);
    background: #fff;
    border: 1px solid var(--card-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    white-space: nowrap;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .28s ease,
                border-color .28s ease, background .28s ease,
                color .28s ease, opacity .28s ease;
}

.layui-btn::before {
    content: "";
    flex: none;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: .65;
    transition: transform .2s ease, opacity .2s ease;
}

.layui-btn:hover {
    transform: translateY(-2px);
    color: var(--text-1);
    border-color: rgba(109, 92, 255, .5);
    box-shadow: 0 12px 26px -12px rgba(109, 92, 255, .4);
}

.layui-btn:hover::before { transform: scale(1.5); opacity: .95; }

.layui-btn:active { transform: translateY(0) scale(.97); }

.layui-btn:focus-visible,
.layui-nav .layui-nav-item a:focus-visible,
.ai-search-input:focus-visible,
.ai-top:focus-visible {
    outline: 2px solid var(--accent-1);
    outline-offset: 3px;
}

/* 三组语义色（覆盖行内 background） */
.layui-btn[style*="background:#009688"] {
    background: var(--grad-teal) !important;
    border-color: rgba(16, 185, 129, .32);
    color: #fff;
}
.layui-btn[style*="background:#009688"]:hover {
    box-shadow: 0 12px 26px -12px rgba(16, 185, 129, .55);
    border-color: rgba(16, 185, 129, .8);
    color: #fff;
}

.layui-btn[style*="background:#1E9FFF"] {
    background: var(--grad-blue) !important;
    border-color: rgba(56, 189, 248, .32);
    color: #fff;
}
.layui-btn[style*="background:#1E9FFF"]:hover {
    box-shadow: 0 12px 26px -12px rgba(56, 189, 248, .55);
    border-color: rgba(56, 189, 248, .8);
    color: #fff;
}

.layui-btn[style*="background:#2F4056"] {
    background: var(--grad-slate) !important;
    border-color: rgba(100, 116, 139, .3);
    color: #fff;
}
.layui-btn[style*="background:#2F4056"]:hover {
    box-shadow: 0 12px 26px -12px rgba(100, 116, 139, .5);
    border-color: rgba(100, 116, 139, .75);
    color: #fff;
}

/* 复制成功态 */
.layui-btn.copied {
    background: linear-gradient(135deg, #34d399, #10b981) !important;
    border-color: rgba(52, 211, 153, .65) !important;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, .18), 0 12px 26px -12px rgba(16, 185, 129, .55) !important;
    color: #fff !important;
    transform: scale(.97);
}
.layui-btn.copied::before { opacity: 0; }

/* ---------- 滚动揭示（JS 注入 .reveal / .revealed） ---------- */

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
}

.reveal.revealed { opacity: 1; transform: none; }

/* ---------- 折叠面板（个人笔记页） ---------- */

.layui-collapse { border: none; border-radius: 0; background: transparent; }

.layui-colla-item {
    margin-bottom: 18px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform .35s cubic-bezier(.2, .7, .2, 1),
                border-color .3s ease, box-shadow .3s ease;
}

.layui-colla-item:hover {
    border-color: rgba(109, 92, 255, .3);
    box-shadow: var(--shadow-card-hover);
}

.layui-colla-title {
    height: auto;
    padding: 18px 20px 18px 48px;
    line-height: 1.5;
    background: transparent;
    color: var(--text-1);
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: .02em;
    transition: background .25s ease, color .25s ease;
}

.layui-colla-title:hover { background: rgba(109, 92, 255, .045); color: var(--text-1); }

.layui-colla-title .layui-colla-icon {
    left: 18px;
    top: 0;
    color: var(--accent-1);
    font-size: 13px;
    transition: transform .3s cubic-bezier(.2, .7, .2, 1);
}

.layui-colla-item:has(.layui-show) .layui-colla-icon { transform: rotate(180deg); }

.layui-colla-content {
    padding: 4px 20px 22px;
    color: var(--text-2);
    line-height: 1.75;
    border-top: 1px solid var(--divider);
    font-size: 14px;
}

.layui-colla-content.layui-show { border-top: 1px solid var(--divider); }

/* 代码块：保持深色以突出代码 */
.layui-colla-content pre {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    padding: 18px;
    overflow: auto;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.75;
    color: #cbd5e1;
}

.layui-colla-content pre .keyword { color: #ff7b72; font-weight: 700; }
.layui-colla-content pre .string, .layui-colla-content pre .string a { color: #7ee787; }
.layui-colla-content pre .functions, .layui-colla-content pre .function { color: #d2a8ff; }
.layui-colla-content pre .plain, .layui-colla-content pre .plain a { color: #cbd5e1; }
.layui-colla-content pre .comments, .layui-colla-content pre .comments a { color: #64748b; }

/* 语法高亮外壳（若 shcore 生效时） */
.syntaxhighlighter {
    background: #0f172a !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, .08) !important;
}

/* ---------- 返回顶部 ---------- */

.ai-top {
    position: fixed;
    right: 26px;
    bottom: 34px;
    z-index: 9999;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-1);
    background: #fff;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-card);
    cursor: pointer;
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
    transition: opacity .3s ease, transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.ai-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

.ai-top:hover {
    border-color: rgba(109, 92, 255, .5);
    box-shadow: var(--shadow-card-hover);
}

/* ---------- 页脚 ---------- */

footer { position: relative; z-index: 1; }

.copy {
    color: var(--text-3);
    margin: 26px 0 0;
    line-height: 30px;
    font-size: 13px;
}

.copy a { color: var(--accent-1); transition: color .2s ease; }
.copy a:hover { color: var(--accent-3); }

/* ---------- 响应式 ---------- */

@media (max-width: 1024px) {
    .header-box { width: 100%; padding: 0 16px; }
    main .layui-container { max-width: 100%; }
    .layui-input-block { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
}

@media (max-width: 768px) {
    .pcheader { overflow-x: auto; }
    .layui-nav { white-space: nowrap; }
    .layui-nav .layui-nav-item a { padding: 0 13px; }
    .logo { padding: 0 16px 0 4px; }
    .logo a { font-size: 19px; }
    .mb-header { height: 62px; }

    .ai-hero { padding: 40px 0 28px; }
    .ai-hero-title { font-size: 28px; }
    .ai-hero-sub { font-size: 14px; }

    main .layui-container { padding: 4px 12px 36px; }
    .layui-form-item { padding: 20px 16px 22px; border-radius: 15px; }
    .layui-form-label { font-size: 16px; }
    .layui-input-block { gap: 10px; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); }
    .layui-btn { height: 44px; font-size: 13px; padding: 0 12px; }

    .copy { font-size: 13.5px; line-height: 26px; }
    .ai-top { right: 16px; bottom: 22px; }
}

/* ---------- 减弱动效 ---------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
}
