/* ===== 全站基础（还原参考站设计） ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
    
}

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

body {
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: auto;
    padding: 0;
    margin: 0;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    /*overflow-x: hidden;*/
    display: flex;
    flex-direction: column;
}

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

/* 标题彩虹渐变 */
.colorText {
    display: inline;
    background: linear-gradient(90deg, #fff, #00ff00, #ff0000, #fff, #ff00c8, #ffffff, #00f2ff, #ffff00, #fff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    background-size: 400% 400%;
    animation: rainbow 24s ease infinite;
}

@keyframes rainbow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes card-entrance {
    0%   { opacity: 0; transform: translate3d(0, 30px, 0) scale3d(0.95, 0.95, 0.95); }
    100% { opacity: 1; transform: translate3d(0, 0, 0) scale3d(1, 1, 1); }
}

@keyframes carousel360 {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes rotate360 {
    0%   { transform: rotate(0deg) scale(1); }
    50%  { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

/* ===== 头部玻璃面板 ===== */
header {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    text-align: center;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    width: 100%;
    flex-shrink: 0;
    min-height: 330px;
    max-width: 1200px;
    margin: 0 auto;
    background: linear-gradient(135deg,
            rgba(102, 126, 234, 0.1) 0%,
            rgba(118, 75, 162, 0.1) 50%,
            rgba(102, 126, 234, 0.1) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 4px 16px rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    gap: 20px;
    padding: 35px 20px;
    overflow: hidden;
    z-index: 1;
}

.top-bar {
    position: absolute;
    z-index: 9;
    gap: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    top: 10px;
    font-size: 16px;
}

.top-bar.right { right: 10px; }
.top-bar.left  { left: 10px; }

.top-bar a {
    font-size: 16px;
    border: 0px solid #fff;
    border-radius: 6px;
    padding: 5px 15px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-bar a:hover { background-color: rgba(102, 126, 234, 0.3); }

/* 图标和品牌名称 */
.branding {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.branding .title {
    font-size: 48px;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.branding .desc {
    font-size: 14px;
    color: #e0e0e0;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* 搜索栏 */
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 700px;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 10px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 3px solid rgba(102, 126, 234, 0.5);
    transition: border 0.3s ease-in-out;
}

.search-bar:hover { border: 3px solid rgba(102, 126, 234, 0.8); }

.search-bar input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    font-size: 18px;
    padding: 5px;
    background: transparent;
    color: #ffffff;
}

.search-bar input::placeholder { color: rgba(255, 255, 255, 0.55); }

.search-bar button {
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 5px 20px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    background: linear-gradient(to right, #667eea, #764ba2);
    transition: all 0.3s ease-in-out;
}

.search-bar button:hover { background: linear-gradient(to right, #7c8ff0, #8a5bb8); }

/* ===== 卡片网格（主体滚动区，页面本身不滚动） ===== */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 66px 32px 0;
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    overflow-y: hidden;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.container::-webkit-scrollbar { width: 8px; }
.container::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.3); border-radius: 4px; }
.container::-webkit-scrollbar-track { background: transparent; }

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 48px;
    padding: 20px;
    justify-items: center;
    margin: 0;
}

/* ===== 卡片 ===== */
.card {
    position: relative;
    z-index: 2;
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    outline: none;
    text-decoration: none;
    color: inherit;
    overflow: visible;
    min-height: 380px;
    max-height: 380px;
    width: 100%;
    max-width: 320px;
    margin: 0;
    opacity: 0;
    transform: translate3d(0, 30px, 0) scale3d(0.95, 0.95, 0.95);
    animation: card-entrance 0.4s ease-out forwards;
    will-change: transform, opacity;
    backface-visibility: hidden;
    perspective: 1000px;
    --mouse-x: 50%;
    --mouse-y: 50%;
}

.card:hover {
    transform: translate3d(0, -8px, 0) scale3d(1.02, 1.02, 1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.card:hover::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(102, 126, 234, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.card:hover .fancy-border::before {
    filter: brightness(1.3) saturate(1.5);
    box-shadow:
        0 0 20px rgba(199, 21, 133, 0.6),
        0 0 40px rgba(0, 191, 255, 0.4),
        0 0 60px rgba(255, 0, 0, 0.3),
        0 0 80px rgba(255, 165, 0, 0.2);
}

.card:nth-child(1)  { animation-delay: 0.05s; }
.card:nth-child(2)  { animation-delay: 0.1s; }
.card:nth-child(3)  { animation-delay: 0.15s; }
.card:nth-child(4)  { animation-delay: 0.2s; }
.card:nth-child(5)  { animation-delay: 0.25s; }
.card:nth-child(6)  { animation-delay: 0.3s; }
.card:nth-child(7)  { animation-delay: 0.35s; }
.card:nth-child(8)  { animation-delay: 0.4s; }
.card:nth-child(9)  { animation-delay: 0.45s; }
.card:nth-child(10) { animation-delay: 0.5s; }
.card:nth-child(11) { animation-delay: 0.55s; }
.card:nth-child(12) { animation-delay: 0.6s; }

/* VIP 渐变边框（卡外圈 -6px，::before 旋转渐变，::after 内底色） */
.card .fancy-border {
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 13px;
    z-index: -1;
    overflow: hidden;
}

.fancy-border::before {
    content: '';
    position: absolute;
    z-index: 0;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: var(--vip-border-color, linear-gradient(25deg, #c71585, #00bfff, #ff0000, #ffa500, #008000, #32cd32, #c71585));
}

.fancy-border.marquee::before { animation: carousel360 8s linear infinite; }

.fancy-border::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    background: var(--vip-bg-color, linear-gradient(-35deg, #fff, #fff));
    border-radius: 10px;
    z-index: 10;
}

/* 卡片标题行 */
.card .title-box {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
    z-index: 11;
}

.card .title-box img {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.card .title-box img.rotate360 { animation: rotate360 3s linear infinite; }

.card .title-box .title {
    font-size: 1.1rem;
    color: #2d3748;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 卡片内容 */
.card .content-box {
    width: 100%;
    overflow: hidden;
    background-color: transparent;
    position: relative;
    z-index: 11;
}

.card .content-box .label {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.2);
    white-space: nowrap;
    margin-bottom: 6px;
}

.card .content-box .content-item {
    display: block;
    margin-bottom: 12px;
    width: 100%;
    min-height: 100px;
    position: relative;
    z-index: 11;
}

.card .content-box .content-text {
    color: #718096;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    white-space: normal;
    user-select: text;
}

.card .content-box .content-text.keyword { -webkit-line-clamp: 3; }

.card-link {
    display: inline-flex;
    align-items: center;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    z-index: 11;
}

.card-link:hover { color: #764ba2; }

.card-link::after {
    content: '→';
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.card-link:hover::after { transform: translateX(3px); }

/* 右上角 VIP 角标 */
.vip-text {
    pointer-events: none;
    position: absolute;
    z-index: 12;
    top: 10px;
    right: 10px;
}

.vip-text::after {
    content: 'VIP';
    position: absolute;
    right: 0;
    top: 0;
    padding: 1px 10px;
    white-space: nowrap;
    font-size: 1.0rem;
    font-weight: bold;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 2;
    border-radius: 5px;
    text-align: center;
    color: red;
    background-color: #fff;
}

.vip { z-index: 0; }

.vip .content-text { color: var(--vip-text-cl, #fff) !important; }
.vip .title        { color: var(--vip-title-cl, #fff) !important; }

/* ===== 页脚 ===== */
footer {
    text-align: center;
    padding: 0.8rem;
    color: #bdb8b8;
    font-size: 12px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

footer a { color: #d6d1d1; }

/* ===== 空状态 ===== */
.empty-tip {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    padding: 60px 0;
    font-size: 15px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ===== 轻提示 ===== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 13px 20px;
    border-radius: 10px;
    color: #fff;
    font-size: 13.5px;
    z-index: 99999;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 320px;
    word-break: break-all;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.toast.show { transform: translateX(0); }
.toast.success { background: #2ea36b; }
.toast.error   { background: #d84b4b; }
.toast.warning { background: #d98a2b; }
.toast.info    { background: #3a6ff0; }

/* ===== 响应式 ===== */
@media (max-width: 1200px) {
    .masonry-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .branding .title { font-size: 28px; }
    .container { padding: 0 15px; }

    .masonry-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .card { max-width: 320px; }
}

@media (max-width: 480px) {
    .masonry-grid { grid-template-columns: 1fr; }
    .card { max-width: 300px; padding: 20px; }
    .container { padding: 0 10px; }
}

@media (max-width: 320px) {
    .masonry-grid { grid-template-columns: 1fr; }
    .card { padding: 15px; min-height: 320px; }
    .container { padding: 0 8px; }
}
