/* 全局重置 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.7;
}
.container { max-width: 800px; margin: 0 auto; padding: 0 20px; }

/* 移动端点击反馈：去除点击瞬间的蓝色高亮与选中色 */
html {
    -webkit-tap-highlight-color: transparent;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
*, *::before, *::after {
    -webkit-tap-highlight-color: transparent;
}
::selection { background: #e2e8f0; color: inherit; }
::-moz-selection { background: #e2e8f0; color: inherit; }
a, button, .cat-tag, .page-num, .note-card, .read-more, .logo, .beian a {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
input, textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* 头部 */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,.03);
}
.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
    text-decoration: none;
}
.nav a {
    color: #666;
    text-decoration: none;
    margin-left: 20px;
    font-size: 14px;
}
.nav a:hover { color: #667eea; }

/* Hero */
.hero {
    text-align: center;
    padding: 50px 0 30px;
}
.hero h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
}
.hero-desc {
    color: #999;
    font-size: 15px;
    margin-bottom: 24px;
}
.search-form {
    display: flex;
    max-width: 400px;
    margin: 0 auto;
    gap: 0;
}
.search-form input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px 0 0 8px;
    font-size: 14px;
    outline: none;
}
.search-form input:focus { border-color: #667eea; }
.search-form button {
    padding: 12px 20px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 14px;
}

/* 分类标签 */
.category-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}
.cat-tag {
    padding: 6px 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: all .2s;
}
.cat-tag:hover { border-color: #667eea; color: #667eea; }
.cat-tag.active {
    background: #eef1f6;
    color: #334155;
    border-color: #cbd5e1;
    font-weight: 600;
}

/* 笔记列表 */
.note-list { margin-bottom: 40px; }
.note-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    transition: transform .2s, box-shadow .2s;
}
.note-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.08);
}
.note-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.note-cat {
    background: #f0f2ff;
    color: #667eea;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
}
.note-date {
    color: #aaa;
    font-size: 12px;
}
.note-title {
    font-size: 20px;
    margin-bottom: 10px;
}
.note-title a {
    color: #333;
    text-decoration: none;
}
.note-title a:hover { color: #667eea; }
.note-excerpt {
    color: #888;
    font-size: 14px;
    margin-bottom: 12px;
}
.read-more {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}
.read-more:hover { text-decoration: underline; }

/* 详情页 */
.note-detail {
    background: #fff;
    border-radius: 12px;
    padding: 36px;
    margin: 20px 0 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.detail-title {
    font-size: 26px;
    margin-bottom: 16px;
    color: #222;
}
.note-content {
    font-size: 15px;
    line-height: 1.9;
    color: #444;
    margin-top: 20px;
}
.detail-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}
.back-btn {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 30px 0;
}
.page-num {
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
}
.page-num.current {
    background: #eef1f6;
    color: #334155;
    border-color: #cbd5e1;
    font-weight: 600;
}

/* 空状态 */
.empty {
    text-align: center;
    color: #999;
    padding: 60px 0;
    font-size: 15px;
}

/* 底部 */
.site-footer {
    background: #fff;
    border-top: 1px solid #eee;
    padding: 24px 0;
    text-align: center;
    margin-top: 40px;
}
.copyright {
    color: #999;
    font-size: 13px;
    margin-bottom: 6px;
}
.beian {
    margin: 0;
    line-height: 1.8;
}
.beian a {
    color: #999;
    font-size: 12px;
    letter-spacing: .2px;
    text-decoration: none;
    transition: color .15s;
}
.beian a:hover { color: #667eea; }

/* 移动端适配 */
@media (max-width: 600px) {
    .hero h1 { font-size: 22px; }
    .note-detail { padding: 20px; }
    .detail-title { font-size: 20px; }
}

/* 触摸设备：点击后不残留 hover 的蓝色边框/文字（sticky hover） */
@media (hover: none) {
    .nav a:hover { color: #666; }
    .cat-tag:hover { border-color: #e0e0e0; color: #666; }
    .cat-tag.active:hover { border-color: #cbd5e1; color: #334155; }
    .note-title a:hover { color: #333; }
    .read-more:hover { text-decoration: none; }
    .beian a:hover { color: #999; }
    .search-form input:focus { border-color: #cbd5e1; }
    .note-card:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0,0,0,.04);
    }
}
