:root {
    --a: #010711;
    --b: rgba(10, 28, 50, 0.45);
    --c: rgba(16, 46, 82, 0.65);
    --d: rgba(60, 150, 255, 0.3);
    --e: #55aaff;
    --f: #3ddc84;
    --g: #eef6ff;
    --h: #94bcdb;
    --i: #5e86a8;
    --j: #2f8fff;
    --k: #55aaff;
    --l: #2cd4ff;
    --m: #3ddc84;
    --n: #5aff9e;
    --o: 18px;
    --p: 12px;
    --q: -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    --r: 'SF Mono', 'Cascadia Code', 'Consolas', 'Courier New', monospace;
    --s: 50vw;
    --t: 50vh;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background: #010711;
    font-family: var(--q);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: 16px;
    touch-action: manipulation;
}

a, button {
    -webkit-tap-highlight-color: transparent;
    outline: none;
    -webkit-focus-ring-color: transparent;
}

a:focus, button:focus {
    outline: none;
    box-shadow: none;
}

/* ========== 辉光球（恢复原大小，无动画） ========== */
.glow-x {
    position: fixed;
    inset: 0;
    z-index: 35;
    pointer-events: none;
    background: radial-gradient(circle at var(--s) var(--t),
            rgba(80, 170, 255, 0.2) 0%,
            rgba(47, 143, 255, 0.07) 10%,
            transparent 15%);
    mix-blend-mode: screen;
    transition: opacity 0.3s ease;
    will-change: background;
}

.glow-x.off {
    opacity: 0;
    pointer-events: none;
}

/* ========== 背景图片（静态） ========== */
.bg-img {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image: url('bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(4px) brightness(0.8) saturate(1);
    background-color: #010711;
}

/* ========== 背景网格（静态，优化性能） ========== */
.grid-x {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(64, 156, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(64, 156, 255, 0.03) 1px, transparent 1px);
    background-size: 44px 44px;
}

.bg-cv {
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0.6;
}

/* ========== 主面板 ========== */
.panel-x {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 680px;
    background: rgba(8, 24, 44, 0.45);
    border: 1px solid var(--d);
    border-radius: var(--o);
    backdrop-filter: blur(25px) saturate(1.3);
    -webkit-backdrop-filter: blur(25px) saturate(1.3);
    box-shadow:
        0 0 0 1px rgba(47, 143, 255, 0.08) inset,
        0 25px 70px rgba(0, 0, 0, 0.5),
        0 0 120px rgba(47, 143, 255, 0.15);
    padding: 20px 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: pIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.3s ease;
}

.panel-x.off {
    pointer-events: none;
    opacity: 0.3;
}

@keyframes pIn {
    0% { opacity: 0; transform: translateY(50px) scale(0.9); }
    60% { opacity: 1; transform: translateY(-5px) scale(1.02); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .panel-x { background: rgba(8, 24, 44, 0.88); }
    .opt-x { background: rgba(10, 28, 50, 0.75); }
    .dl-panel { background: rgba(8, 24, 44, 0.95); }
    .dl-item { background: rgba(10, 28, 50, 0.85); }
    .tb-x, .gd-x, .pf-x, .dt-x {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

/* ========== 检测提示 ========== */
.dt-x {
    display: none;
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(47, 143, 255, 0.3);
    background: rgba(8, 24, 44, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 11px;
    line-height: 1.4;
    color: var(--h);
    margin-bottom: 2px;
    animation: fadeInDown 0.5s ease forwards;
}

.dt-x.on { display: block; }
.dt-x.w1 { border-color: rgba(255, 160, 80, 0.5); color: #ffb880; }
.dt-x.w2 { border-color: rgba(255, 200, 80, 0.5); color: #ffd699; }
.dt-x.w3 { border-color: rgba(255, 200, 80, 0.4); color: #ffcc88; }

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== 顶部栏 ========== */
.tb-x {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(64, 156, 255, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.tb-x .d1 { width: 7px; height: 7px; border-radius: 50%; background: var(--j); box-shadow: 0 0 8px rgba(47, 143, 255, 0.5); animation: pulse 2s infinite; }
.tb-x .d2 { width: 7px; height: 7px; border-radius: 50%; background: var(--l); animation: pulse 2s infinite 0.3s; }
.tb-x .d3 { width: 7px; height: 7px; border-radius: 50%; background: #6ea8ff; animation: pulse 2s infinite 0.6s; }
.tb-x .tt { margin-left: auto; font-size: 10px; color: var(--i); letter-spacing: 1px; }

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
}

/* ========== 标题区域 ========== */
.ph-x {
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
    user-select: none;
}

.ph-x .pt { font-size: 20px; font-weight: 700; color: var(--g); }
.ph-x .pt .ta {
    background: linear-gradient(135deg, #55aaff, #2cd4ff, #55aaff);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradShift 3s ease infinite;
}
.ph-x .ps { font-size: 10px; color: var(--h); display: flex; align-items: center; gap: 6px; }
.ph-x .ps .dl { width: 18px; height: 1px; background: linear-gradient(90deg, var(--j), transparent); animation: lineMove 1.5s ease infinite; }

@keyframes gradShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
@keyframes lineMove {
    0% { transform: scaleX(0); opacity: 0; }
    50% { transform: scaleX(1); opacity: 1; }
    100% { transform: scaleX(0); opacity: 0; }
}

/* ========== 选项卡片 ========== */
.opt-x {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--b);
    border: 2px solid rgba(64, 156, 255, 0.3);
    border-radius: var(--p);
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    text-decoration: none;
    backdrop-filter: blur(18px) saturate(1.1);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
    outline: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    animation: cardIn 0.6s ease backwards;
    transform-style: preserve-3d;
    will-change: transform;
}

.opt-x:nth-child(1) { animation-delay: 0.1s; }
.opt-x:nth-child(3) { animation-delay: 0.2s; }
.opt-x:nth-child(4) { animation-delay: 0.3s; }
.opt-x:nth-child(5) { animation-delay: 0.4s; }

@keyframes cardIn {
    from { opacity: 0; transform: translateX(-30px) rotateY(10deg); }
    to { opacity: 1; transform: translateX(0) rotateY(0); }
}

.opt-x.rec {
    border-color: var(--f) !important;
    box-shadow: 0 0 0 1px rgba(61, 220, 132, 0.4) inset, 0 0 18px rgba(61, 220, 132, 0.25);
}

.opt-x.hv, .opt-x:hover {
    border-color: var(--e) !important;
    box-shadow: 0 0 0 1px rgba(85, 170, 255, 0.6) inset, 0 0 35px rgba(85, 170, 255, 0.6), 0 15px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(-8px) scale(1.02) rotateX(2deg) rotateY(1deg);
}

.opt-x.rec.hv, .opt-x.rec:hover {
    border-color: var(--n) !important;
    box-shadow: 0 0 0 2px rgba(90, 255, 158, 0.7) inset, 0 0 45px rgba(61, 220, 132, 0.7), 0 15px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(-8px) scale(1.02) rotateX(2deg) rotateY(1deg);
}

.opt-x.prs { transform: scale(0.94) rotateX(0deg) rotateY(0deg); }
.opt-x.prs:not(.rec) {
    border-color: var(--e) !important;
    box-shadow: 0 0 50px rgba(85, 170, 255, 0.9), 0 0 100px rgba(85, 170, 255, 0.6), 0 0 0 4px rgba(255, 255, 255, 0.8) inset !important;
}
.opt-x.rec.prs {
    border-color: var(--n) !important;
    box-shadow: 0 0 50px rgba(61, 220, 132, 0.9), 0 0 100px rgba(61, 220, 132, 0.6), 0 0 0 4px rgba(255, 255, 255, 0.8) inset !important;
}

.cb-x {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 7px;
    font-weight: 700;
    color: #052010;
    background: var(--m);
    padding: 2px 7px;
    border-radius: 100px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(61, 220, 132, 0.5);
    animation: badgePulse 1.2s ease infinite;
}

.opt-x.rec .cb-x { opacity: 1; }

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); box-shadow: 0 0 15px rgba(61, 220, 132, 0.8); }
}

.oi-x {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: rgba(47, 143, 255, 0.12);
    border: 1px solid rgba(47, 143, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--k);
    transition: all 0.3s ease;
}

.opt-x:hover .oi-x {
    background: rgba(47, 143, 255, 0.3);
    box-shadow: 0 0 15px rgba(47, 143, 255, 0.6);
    transform: scale(1.1);
}

.of-x { flex: 1; min-width: 0; }
.on-x { font-size: 12px; font-weight: 600; color: var(--g); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.od-x { font-size: 9px; color: var(--h); margin-top: 1px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

.od-x .tg {
    font-size: 7px;
    padding: 2px 5px;
    border-radius: 100px;
    background: rgba(47, 143, 255, 0.12);
    border: 1px solid rgba(47, 143, 255, 0.28);
    color: var(--k);
    white-space: nowrap;
    transition: all 0.3s ease;
}

.opt-x:hover .tg {
    background: rgba(47, 143, 255, 0.3);
    box-shadow: 0 0 10px rgba(47, 143, 255, 0.6);
}

.oa-x {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(47, 143, 255, 0.08);
    border: 1px solid rgba(47, 143, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--k);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.opt-x:hover .oa-x {
    transform: translateX(5px) scale(1.1);
    background: rgba(47, 143, 255, 0.25);
}

.oa-x svg { width: 12px; height: 12px; }

/* ========== 分组标签 ========== */
.gd-x {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.gd-x .l1 { flex: 1; height: 1px; background: rgba(64, 156, 255, 0.2); }
.gd-x .l2 {
    font-size: 11px;
    letter-spacing: 1px;
    color: #9ec3e0;
    white-space: nowrap;
    font-weight: 600;
    text-shadow: 0 0 6px rgba(47, 143, 255, 0.3);
}
.gd-x .l3 {
    font-size: 9px;
    color: #6d94b5;
    white-space: nowrap;
}

/* ========== 页脚 ========== */
.pf-x {
    padding-top: 6px;
    border-top: 1px solid rgba(64, 156, 255, 0.18);
    display: flex;
    justify-content: flex-end;
    font-size: 9px;
    color: var(--i);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.vt-x { color: #8ab8d8; font-weight: 500; }
.vn-x {
    color: #b8d9ff;
    font-weight: 700;
    background: rgba(47, 143, 255, 0.15);
    padding: 2px 7px;
    border-radius: 100px;
    border: 1px solid rgba(47, 143, 255, 0.3);
    font-family: var(--r);
    transition: all 0.3s ease;
}

.vn-x:hover {
    background: rgba(47, 143, 255, 0.35);
    box-shadow: 0 0 15px rgba(47, 143, 255, 0.6);
    transform: translateY(-2px);
}

/* ========== 下载面板 ========== */
.dl-ov {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: none;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(18px) saturate(1.1);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
    align-items: center;
    justify-content: center;
    padding: 20px;
    pointer-events: auto;
}

.dl-ov.on { display: flex; }

.dl-panel {
    width: 100%;
    max-width: 520px;
    background: rgba(8, 24, 44, 0.9);
    border: 1px solid var(--e);
    border-radius: var(--o);
    padding: 22px 26px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: panelSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    pointer-events: auto;
}

@keyframes panelSlideUp {
    from { opacity: 0; transform: translateY(50px) scale(0.85); }
    70% { opacity: 1; transform: translateY(-5px) scale(1.03); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.dl-hd { display: flex; align-items: center; justify-content: space-between; }
.dl-tt { font-size: 15px; font-weight: 700; color: var(--g); animation: fadeInDown 0.6s ease; }

.bk-bt {
    background: rgba(47, 143, 255, 0.1);
    border: 1px solid rgba(47, 143, 255, 0.3);
    color: var(--k);
    padding: 5px 12px;
    border-radius: 100px;
    cursor: pointer;
    font-size: 11px;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.25s ease;
    pointer-events: auto;
    -webkit-user-select: none;
    user-select: none;
}

.bk-bt:hover {
    background: rgba(47, 143, 255, 0.3);
    box-shadow: 0 0 15px rgba(47, 143, 255, 0.5);
    transform: translateX(-3px);
}

.bk-bt:active { transform: scale(0.9); }

.dl-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    background: rgba(10, 28, 50, 0.7);
    border-radius: 12px;
    border: 2px solid rgba(64, 156, 255, 0.3);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(30px) saturate(1.2);
    -webkit-backdrop-filter: blur(30px) saturate(1.2);
    pointer-events: auto;
    animation: itemIn 0.5s ease backwards;
    will-change: transform;
}

.dl-item:nth-child(1) { animation-delay: 0.05s; }
.dl-item:nth-child(2) { animation-delay: 0.12s; }

@keyframes itemIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.dl-item:hover {
    border-color: var(--e);
    box-shadow: 0 0 0 1px rgba(85, 170, 255, 0.5) inset, 0 0 30px rgba(85, 170, 255, 0.5), 0 10px 25px rgba(0, 0, 0, 0.5);
    transform: translateY(-5px) scale(1.01);
}

.dl-item:active {
    transform: scale(0.96);
    border-color: var(--e);
    box-shadow: 0 0 35px rgba(85, 170, 255, 0.8), 0 0 0 3px rgba(255, 255, 255, 0.7) inset;
}

.dl-item.hv {
    border-color: var(--e) !important;
    box-shadow: 0 0 0 1px rgba(85, 170, 255, 0.6) inset, 0 0 30px rgba(85, 170, 255, 0.6), 0 10px 25px rgba(0, 0, 0, 0.5);
}

.dl-in { font-size: 13px; font-weight: 600; color: var(--g); }
.dl-id { font-size: 10px; color: var(--h); margin-top: 3px; }

.dl-bt {
    background: rgba(47, 143, 255, 0.2);
    border: 1px solid rgba(47, 143, 255, 0.4);
    color: var(--k);
    padding: 7px 16px;
    border-radius: 100px;
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.25s ease;
    white-space: nowrap;
    pointer-events: auto;
    -webkit-user-select: none;
    user-select: none;
}

.dl-bt:hover {
    background: rgba(47, 143, 255, 0.45);
    border-color: var(--k);
    color: #fff;
    box-shadow: 0 0 20px rgba(47, 143, 255, 0.8);
    transform: translateY(-2px) scale(1.05);
}

.dl-bt:active {
    transform: scale(0.9);
    box-shadow: 0 0 30px rgba(47, 143, 255, 1);
}

/* ========== 署名区域 ========== */
.fb-x {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 28, 50, 0.6);
    border-top-left-radius: 14px;
    padding: 8px 16px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-left: 1px solid rgba(47, 143, 255, 0.25);
    border-top: 1px solid rgba(47, 143, 255, 0.25);
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: rgba(170, 210, 255, 0.7);
    text-shadow: 0 0 8px rgba(47, 143, 255, 0.3);
    font-family: var(--q);
    transition: all 0.3s ease;
}

.fb-x:hover {
    background: rgba(10, 28, 50, 0.85);
    color: #fff;
    text-shadow: 0 0 15px rgba(47, 143, 255, 0.9);
    box-shadow: 0 0 20px rgba(47, 143, 255, 0.4);
    transform: translateY(-3px);
}

/* ========== 响应式 ========== */
@media (max-width: 560px) {
    body { padding: 10px; }
    .panel-x { padding: 14px 12px 12px; gap: 8px; border-radius: 14px; }
    .opt-x { padding: 7px 9px; gap: 8px; border-radius: 10px; }
    .oi-x { width: 24px; height: 24px; font-size: 9px; border-radius: 6px; }
    .on-x { font-size: 11px; }
    .od-x { font-size: 8px; }
    .oa-x { width: 20px; height: 20px; }
    .oa-x svg { width: 10px; height: 10px; }
    .dl-panel { padding: 16px 14px; border-radius: 14px; gap: 8px; }
    .dl-item { padding: 10px 12px; gap: 10px; border-radius: 10px; }
    .ph-x .pt { font-size: 17px; }
    .cb-x { font-size: 6px; padding: 1px 6px; top: 4px; right: 4px; }
    .fb-x { padding: 6px 12px; }
    .gd-x .l2 { font-size: 10px; }
    .gd-x .l3 { font-size: 8px; }
}

@media (orientation: landscape) and (max-height: 500px) {
    body { overflow-y: auto; align-items: flex-start; padding: 10px 16px; }
    .panel-x { padding: 12px 16px; gap: 6px; border-radius: 12px; max-width: 520px; }
    .opt-x { padding: 5px 10px; gap: 6px; border-radius: 8px; }
    .ph-x .pt { font-size: 15px; }
    .on-x { font-size: 10px; }
    .od-x { font-size: 8px; }
    .oi-x { width: 22px; height: 22px; font-size: 8px; }
    .gd-x { margin: 1px 0; }
    .gd-x .l2 { font-size: 9px; }
    .gd-x .l3 { font-size: 7px; }
    .pf-x { padding-top: 4px; font-size: 8px; }
    .fb-x { display: none; }
    .dl-panel { max-width: 400px; padding: 12px 16px; gap: 8px; }
    .dl-item { padding: 8px 10px; }
}