/**
 * 前端样式 - 暗色主题 + 玻璃拟态设计
 */

/* ========== 基础重置 ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-base: #1a1a2e;
    --bg-card: rgba(22, 33, 62, 0.7);
    --bg-card-solid: #16213e;
    --accent: #0f3460;
    --highlight: #e94560;
    --text: #eee;
    --text-dim: #aaa;
    --glass-bg: rgba(22, 33, 62, 0.55);
    --glass-border: rgba(255, 255, 255, 0.08);
    --radius: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* ========== 背景层 ========== */
.bg-layer {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
}

.bg-color {
    width: 100%; height: 100%;
}

.bg-image {
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.bg-video {
    width: 100%; height: 100%;
    object-fit: cover;
}

/* ========== 容器 ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    position: relative;
    z-index: 1;
}

/* ========== 头部 ========== */
.site-header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInDown 0.8s ease;
}

.site-title {
    font-size: 2.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, var(--highlight));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.site-subtitle {
    font-size: 1.1rem;
    color: var(--text-dim);
    letter-spacing: 1px;
}

/* ========== 日期时间 ========== */
.datetime-wrap {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeIn 1s ease 0.2s both;
}

/* Style 1: 简单日期 */
.dt-style1 {
    font-size: 1.3rem;
    color: var(--text-dim);
    letter-spacing: 1px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 10px 30px;
    display: inline-block;
}

/* Style 2: 大时钟 */
.dt-style2 {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 20px 40px;
    display: inline-block;
}

.dt2-time {
    font-size: 4rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 4px;
    color: #fff;
    line-height: 1;
}

.dt2-date {
    font-size: 1.1rem;
    color: var(--text-dim);
    margin-top: 8px;
}

/* Style 3: 翻页数字 */
.dt-style3 {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 15px 25px;
}

.flip-digit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 65px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-radius: 8px;
    font-size: 2.4rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--highlight);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
    transition: transform 0.3s ease;
}

.flip-sep {
    font-size: 2rem;
    font-weight: 700;
    color: var(--highlight);
    margin: 0 2px;
}

.dt3-date {
    text-align: center;
    font-size: 1rem;
    color: var(--text-dim);
    margin-top: 10px;
}

/* Style 4: 模拟时钟 */
.dt-style4 {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    padding: 25px;
}

.analog-clock {
    filter: drop-shadow(0 2px 10px rgba(0,0,0,0.3));
}

.dt4-date {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-top: 10px;
}

/* ========== 搜索栏 ========== */
.search-wrap {
    max-width: 600px;
    margin: 0 auto 40px;
    animation: fadeIn 1s ease 0.4s both;
}

.search-form {
    display: flex;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.search-form:focus-within {
    border-color: var(--highlight);
    box-shadow: 0 4px 30px rgba(233, 69, 96, 0.15);
}

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

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

.search-btn {
    background: linear-gradient(135deg, var(--highlight), #c0392b);
    border: none;
    color: #fff;
    padding: 14px 28px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.search-btn:hover {
    background: linear-gradient(135deg, #ff5a7a, var(--highlight));
}

/* ========== 分类与链接 ========== */
.categories-wrap {
    animation: fadeIn 1s ease 0.6s both;
}

.category-section {
    margin-bottom: 35px;
}

.category-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 16px;
    padding-left: 12px;
    border-left: 4px solid var(--highlight);
    color: #fff;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text);
}

.link-card:hover {
    transform: translateY(-4px);
    background: rgba(15, 52, 96, 0.6);
    border-color: var(--highlight);
    box-shadow: 0 8px 30px rgba(233, 69, 96, 0.15);
}

.link-card:active {
    transform: translateY(-1px);
}

.link-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    flex-shrink: 0;
}

.link-info {
    flex: 1;
    min-width: 0;
}

.link-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== 备案信息 ========== */
.site-footer {
    text-align: center;
    padding: 30px 0 10px;
    font-size: 0.85rem;
    color: var(--text-dim);
    animation: fadeIn 1s ease 0.8s both;
}

.site-footer a {
    color: var(--text-dim);
    transition: var(--transition);
}

.site-footer a:hover {
    color: var(--highlight);
}

.icp-info, .psb-info {
    margin: 5px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.psb-icon {
    width: 16px;
    height: 16px;
}

/* ========== 弹窗 ========== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-box {
    background: var(--bg-card-solid);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: slideUp 0.3s ease;
}

.modal-wide {
    max-width: 600px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h3 {
    font-size: 1.2rem;
    color: #fff;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 6px;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--highlight);
}

.modal-body {
    padding: 24px;
    line-height: 1.8;
    color: var(--text);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
    text-align: right;
}

/* ========== 按钮 ========== */
.btn-primary {
    background: linear-gradient(135deg, var(--highlight), #c0392b);
    border: none;
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
}

/* ========== 音乐播放器 ========== */
.music-player {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 8px 16px;
    z-index: 100;
    animation: fadeIn 1s ease 1s both;
}

.music-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 4px;
}

.music-btn:hover {
    transform: scale(1.2);
}

.music-btn.playing {
    animation: pulse 1.5s infinite;
}

.music-volume {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    outline: none;
}

.music-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--highlight);
    border-radius: 50%;
    cursor: pointer;
}

/* ========== 动画 ========== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .container {
        padding: 25px 15px 70px;
    }

    .site-title {
        font-size: 2rem;
    }

    .dt2-time {
        font-size: 2.8rem;
    }

    .flip-digit {
        width: 36px;
        height: 50px;
        font-size: 1.8rem;
    }

    .links-grid {
        grid-template-columns: 1fr;
    }

    .search-form {
        flex-direction: column;
        border-radius: var(--radius);
    }

    .search-btn {
        border-radius: 0 0 var(--radius) var(--radius);
    }

    .music-player {
        bottom: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.6rem;
    }

    .dt-style1 {
        font-size: 1rem;
        padding: 8px 16px;
    }
}
