/* ============================================
   极速导航 · 炫酷动态背景样式
   ============================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --text-main: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.09);
    --card-bg-hover: rgba(120, 140, 255, 0.30);
    --card-border: rgba(255, 255, 255, 0.16);
    --search-bg: #ffffff;
    --search-text: #2a2a3a;
    --search-btn: #1a1a2e;
    --title-line: rgba(255, 255, 255, 0.28);
    --mx: 0; /* 鼠标视差 X (-1 ~ 1) */
    --my: 0; /* 鼠标视差 Y (-1 ~ 1) */
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue",
                 Helvetica, Arial, sans-serif;
    min-height: 100vh;
    color: var(--text-main);
    overflow-x: hidden;
    position: relative;
    background: #1a0e3d;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== 1. 深空底色 ===== */
.space-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse at 18% 12%, rgba(70, 50, 160, 0.35), transparent 45%),
        radial-gradient(ellipse at 82% 78%, rgba(20, 90, 170, 0.30), transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(30, 20, 70, 0.25), transparent 70%),
        linear-gradient(160deg, #04050f 0%, #0a0820 38%, #120a2e 68%, #07061a 100%);
    pointer-events: none;
    will-change: translate;
    translate: calc(var(--mx) * 6px) calc(var(--my) * 6px);
}

/* ===== 2. 旋转星系 ===== */
.galaxy {
    position: fixed;
    top: -160px;
    right: -180px;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.7;
    transform-origin: 50% 50%;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 244, 214, 0.30) 0%, rgba(255, 220, 170, 0.10) 8%, transparent 16%),
        repeating-radial-gradient(circle at 50% 50%,
            rgba(150, 130, 255, 0) 0px,
            rgba(150, 130, 255, 0.10) 3px,
            rgba(120, 180, 255, 0) 26px,
            rgba(210, 130, 255, 0.08) 46px,
            transparent 66px);
    -webkit-mask: radial-gradient(circle at 50% 50%, #000 0%, #000 60%, transparent 100%);
    mask: radial-gradient(circle at 50% 50%, #000 0%, #000 60%, transparent 100%);
    filter: blur(1px);
    animation: galaxySpin 120s linear infinite;
    will-change: translate;
    translate: calc(var(--mx) * 12px) calc(var(--my) * 12px);
}

.galaxy::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg,
        rgba(120, 130, 255, 0.22),
        rgba(180, 120, 255, 0.05),
        rgba(90, 200, 255, 0.18),
        rgba(150, 120, 255, 0.04),
        rgba(120, 130, 255, 0.22));
    -webkit-mask: radial-gradient(circle at 50% 50%, transparent 30%, #000 38%, #000 70%, transparent 100%);
    mask: radial-gradient(circle at 50% 50%, transparent 30%, #000 38%, #000 70%, transparent 100%);
    mix-blend-mode: screen;
}

@keyframes galaxySpin {
    to { transform: rotate(360deg); }
}

/* ===== 3. 发光星球 ===== */
.planet {
    position: fixed;
    bottom: 90px;
    left: 5%;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle at 36% 30%, #9d8bff 0%, #5b3bb0 48%, #241149 100%);
    box-shadow: 0 0 70px rgba(120, 90, 255, 0.45), inset -24px -22px 46px rgba(0, 0, 0, 0.55);
    animation: planetFloat 18s ease-in-out infinite;
    will-change: translate;
    translate: calc(var(--mx) * 26px) calc(var(--my) * 26px);
}

.planet::after {
    content: '';
    position: absolute;
    inset: -38px -14px;
    border-radius: 50%;
    border: 2px solid rgba(200, 185, 255, 0.35);
    transform: rotate(-22deg) scaleY(0.34);
    box-shadow: 0 0 18px rgba(170, 150, 255, 0.35);
}

@keyframes planetFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-18px); }
}

/* ===== 4. 宇宙星云 ===== */
.cosmic-nebula {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    filter: blur(72px);
    opacity: 0.6;
    will-change: translate;
    translate: calc(var(--mx) * 16px) calc(var(--my) * 16px);
}

.cn-orb {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: screen;
}

.c1 {
    width: 440px; height: 440px;
    background: radial-gradient(circle, #6a3cff, transparent 70%);
    top: 12%; left: 8%;
    animation: drift1 30s ease-in-out infinite;
}

.c2 {
    width: 380px; height: 380px;
    background: radial-gradient(circle, #00a6ff, transparent 70%);
    top: 42%; right: 4%;
    animation: drift2 34s ease-in-out infinite;
}

.c3 {
    width: 340px; height: 340px;
    background: radial-gradient(circle, #ff3d81, transparent 70%);
    bottom: 18%; left: 40%;
    animation: drift3 38s ease-in-out infinite;
}

@keyframes drift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(90px, 70px) scale(1.18); }
}
@keyframes drift2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-80px, 50px) scale(1.14); }
}
@keyframes drift3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(60px, -60px) scale(1.22); }
}

/* ===== 5. 星空 ===== */
.stars {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    will-change: translate;
    translate: calc(var(--mx) * 22px) calc(var(--my) * 22px);
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    opacity: 0.7;
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.25; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.35); }
}

/* ===== 6. 流星 ===== */
.shooting-star {
    position: fixed;
    top: 10%;
    left: 80%;
    width: 150px;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), transparent);
    border-radius: 2px;
    transform: rotate(-35deg);
    opacity: 0;
    z-index: 0;
    animation: shoot 7s ease-in-out infinite;
    pointer-events: none;
}

.shooting-star::before {
    content: '';
    position: absolute;
    right: 0;
    top: -2px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.9);
}

.shooting-star-2 {
    top: 30%;
    left: 62%;
    width: 95px;
    animation-delay: 3.5s;
}

.shooting-star-3 {
    top: 18%;
    left: 40%;
    width: 120px;
    animation-delay: 5.5s;
}

@keyframes shoot {
    0% { opacity: 0; transform: translate(0, 0) rotate(-35deg); }
    8% { opacity: 1; }
    18% { opacity: 0; transform: translate(-260px, 182px) rotate(-35deg); }
    100% { opacity: 0; transform: translate(-260px, 182px) rotate(-35deg); }
}

/* ===== 页面容器 ===== */
.page-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 0 40px 100px;
}

/* ===== 顶部搜索栏 ===== */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 28px 0;
    max-width: 1200px;
    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.brand-icon {
    display: flex;
    filter: drop-shadow(0 2px 8px rgba(255, 120, 180, 0.5));
    animation: iconFloat 4s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-4px) rotate(8deg); }
}

.brand-text {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
    text-shadow: 0 2px 12px rgba(255, 100, 160, 0.4);
}

.search-form {
    display: flex;
    align-items: center;
    max-width: 560px;
    width: 100%;
    background: var(--search-bg);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(255,255,255,0.1);
    transition: box-shadow 0.3s ease;
}

.search-form:focus-within {
    box-shadow: 0 8px 40px rgba(255, 120, 180, 0.25), 0 0 0 3px rgba(255,255,255,0.2);
}

.search-icon-baidu {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 18px;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 14px 14px;
    font-size: 15px;
    color: var(--search-text);
}

.search-input::placeholder {
    color: #999;
}

.search-submit {
    padding: 0 32px;
    height: 44px;
    margin: 3px;
    border: none;
    border-radius: 26px;
    background: linear-gradient(135deg, #5b2ed6, #2a8bff);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.search-submit:hover {
    filter: brightness(1.12);
    transform: scale(1.03);
}

.search-submit:active {
    transform: scale(0.97);
}

/* ===== 天气 ===== */
/* ===== 分类网格 ===== */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin: 20px auto 0;
}

.nav-group {
    background: rgba(9, 11, 30, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    padding: 18px 14px 14px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.nav-group:hover {
    transform: translateY(-3px);
    border-color: rgba(150, 180, 255, 0.45);
    box-shadow: 0 16px 44px rgba(50, 70, 200, 0.35);
}

.group-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 14px;
    padding-left: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 0 12px rgba(120, 170, 255, 0.55);
}

.group-title::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7cc6ff, #a98bff);
    box-shadow: 0 0 12px rgba(140, 180, 255, 0.9);
    flex-shrink: 0;
}

.group-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--title-line);
    margin-left: 6px;
}

.links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.links a {
    display: block;
    padding: 11px 8px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    transition: all 0.25s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.links a:hover {
    background: rgba(120, 140, 255, 0.30);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(90, 120, 255, 0.45);
    color: #fff;
    border-color: rgba(160, 185, 255, 0.65);
    text-shadow: 0 1px 6px rgba(120, 160, 255, 0.7);
}

.links a:active {
    transform: translateY(0);
}

/* ===== 响应式 ===== */
@media (max-width: 1100px) {
    .nav-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .page-wrapper { padding: 0 16px 80px; }
    .top-header {
        flex-direction: column;
        gap: 16px;
        padding: 20px 0;
    }
    .search-form { max-width: 100%; }
    .nav-grid { grid-template-columns: 1fr; gap: 16px; }
    .links { grid-template-columns: repeat(3, 1fr); }
    .planet { width: 110px; height: 110px; bottom: 70px; }
    .galaxy { width: 380px; height: 380px; top: -120px; right: -140px; }
}

@media (max-width: 480px) {
    .brand-text { font-size: 22px; }
    .links { grid-template-columns: repeat(2, 1fr); }
    .search-submit { padding: 0 20px; }
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.28);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.45);
}

::selection {
    background: rgba(255, 200, 230, 0.35);
    color: #fff;
}

/* ============================================
   后台管理 · 登录注册 / 管理面板
   ============================================ */

/* 顶部右侧容器 */
.header-right {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-shrink: 0;
}

.auth-area {
    display: flex;
    align-items: center;
}

/* 提示条 */
.hint-bar {
    max-width: 1200px;
    margin: 0 auto 16px;
    text-align: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.82);
}

.link-like {
    background: none;
    border: none;
    color: #8fb6ff;
    cursor: pointer;
    text-decoration: underline;
    font-size: 13px;
    padding: 0;
}

/* 按钮 */
.btn-ghost {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    background: transparent;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-primary {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #5b2ed6, #2a8bff);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary.sm { padding: 8px 14px; font-size: 13px; }

/* 弹窗 */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(2, 3, 12, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay:not([hidden]) {
    display: flex;
    animation: overlayIn 0.2s ease;
}
.modal {
    position: relative;
    width: 420px;
    max-width: 92vw;
    max-height: 88vh;
    overflow-y: auto;
    background: rgba(14, 16, 38, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    padding: 26px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
    animation: modalIn 0.25s ease;
}
.modal-lg { width: 760px; }

@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}
.modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}
.modal-head h2,
.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}
.modal-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 16px;
}

/* 登录 / 注册 选项卡 */
.auth-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.auth-tab {
    flex: 1;
    padding: 10px 0;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s ease;
}
.auth-tab.active {
    color: #fff;
    border-bottom-color: #7c8bff;
    font-weight: 600;
}

/* 表单 */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group input::placeholder { color: rgba(255, 255, 255, 0.4); }
.form-group input:focus,
.form-group select:focus {
    border-color: #7c8bff;
    box-shadow: 0 0 0 3px rgba(124, 139, 255, 0.25);
}
.form-group select option {
    background: #15162e;
    color: #fff;
}
.form-msg {
    font-size: 13px;
    min-height: 18px;
    color: #ff9a9a;
}
.form-msg.ok { color: #8affb0; }
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 2px;
}

/* 管理列表 */
.manage-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.manage-cat-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.manage-cat-title::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7cc6ff, #a98bff);
    box-shadow: 0 0 10px rgba(140, 180, 255, 0.9);
}
.link-rows {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.link-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
}
.lr-title {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}
.lr-url {
    flex: 1;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lr-actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn {
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    background: transparent;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.18s ease;
}
.icon-btn.edit:hover {
    border-color: #7c8bff;
    color: #aebcff;
    background: rgba(124, 139, 255, 0.12);
}
.icon-btn.del:hover {
    border-color: #ff7a7a;
    color: #ff9a9a;
    background: rgba(255, 90, 90, 0.12);
}

/* 管理弹窗在小屏的适配 */
@media (max-width: 560px) {
    .header-right { gap: 10px; }
    .link-rows { grid-template-columns: 1fr; }
    .auth-area .btn-ghost { padding: 6px 12px; font-size: 12px; }
}
