/* ========== 猫三只的家 — 全局样式 v2 ========== */

:root {
    --bg: #faf8f5;
    --content-bg: #ffffff;
    --text: #3a3a3a;
    --text-light: #6a6a6a;
    --text-lighter: #9a8a7a;
    --accent: #c47a4a;
    --accent-hover: #a86a3a;
    --accent-light: rgba(196, 122, 74, 0.12);
    --border: #eee;
    --border-light: #f5f1ec;
    --shadow: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.08);
    --radius: 12px;
    --radius-sm: 8px;
}

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

::selection {
    background: var(--accent-light);
    color: var(--text);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.85;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

.container-wide {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ========== 头部 ========== */
header {
    text-align: center;
    padding: 25px 0;
}

header h1 {
    font-size: 1.8rem;
    color: var(--text);
    letter-spacing: 2px;
    font-weight: 600;
}

header h1 a {
    color: var(--text);
    text-decoration: none;
}

header h1 a:hover { color: var(--accent); }

.subtitle {
    color: var(--text-lighter);
    font-size: 0.9rem;
    margin-top: 6px;
}

/* ========== 导航栏（左导航 + 右搜索） ========== */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 20px 0 35px;
    position: relative;
}

.nav-left {
    display: flex;
    gap: 18px;
}

.nav-left a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.15s;
}

.nav-left a:hover { color: var(--accent); }

.nav-left a.nav-active {
    color: var(--accent);
    font-weight: 600;
}

.nav-right {
    position: relative;
}

.search-input {
    width: 180px;
    padding: 6px 12px;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg);
    color: var(--text);
    outline: none;
    font-family: inherit;
    transition: width 0.25s ease, border-color 0.15s, box-shadow 0.2s ease;
}

.search-input:focus {
    border-color: var(--accent);
    width: 220px;
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* ========== 搜索下拉结果 ========== */
.search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    width: 340px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--content-bg);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    z-index: 100;
}

.search-dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}

.search-dropdown-item:last-child { border-bottom: none; }
.search-dropdown-item:hover { background: #faf6f1; }

.search-dropdown-title {
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 10px;
}

.search-dropdown-date {
    color: var(--text-lighter);
    font-size: 0.78rem;
    flex-shrink: 0;
}

.search-dropdown-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-lighter);
    font-size: 0.88rem;
}

.search-dropdown-more {
    padding: 8px;
    text-align: center;
    color: var(--text-lighter);
    font-size: 0.8rem;
}

/* ========== 首页文章列表 ========== */
.articles h2, .archive h2, .tags-page h2 {
    color: var(--text);
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 600;
}

.list-item {
    background: var(--content-bg);
    padding: 24px 28px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.list-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}
.list-item h3 { margin-bottom: 6px; }
.list-item h3 a {
    color: var(--text);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 600;
    background-image: linear-gradient(var(--accent), var(--accent));
    background-size: 0% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.3s ease, color 0.15s;
}
.list-item h3 a:hover {
    color: var(--accent);
    background-size: 100% 1px;
}
.list-meta { color: var(--text-lighter); font-size: 0.82rem; margin-bottom: 8px; }
.list-summary { color: var(--text-light); font-size: 0.9rem; line-height: 1.7; }
.list-tags { margin-top: 8px; }

/* ========== 标签 ========== */
.tag {
    display: inline-block;
    background: #f5f0eb;
    color: var(--accent);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    text-decoration: none;
    margin-right: 5px;
    margin-bottom: 5px;
    transition: background 0.15s, transform 0.15s;
}

.tag:hover {
    background: #ede5dd;
    transform: translateY(-1px);
}
.article-tags { margin: 10px 0 20px; }

/* 标签云 */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud {
    font-size: 0.9rem;
    padding: 4px 14px;
}

.tag-count {
    color: var(--text-lighter);
    font-size: 0.75rem;
}

/* ========== 归档/时间线 ========== */
.archive-year { margin-bottom: 30px; }
.archive-year h2 { font-size: 1.1rem; margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.archive-year ul { list-style: none; }
.archive-year li { padding: 6px 0; font-size: 0.9rem; }
.archive-year time { color: var(--text-lighter); margin-right: 10px; font-size: 0.85rem; }
.archive-year a { color: var(--text); text-decoration: none; }
.archive-year a:hover { color: var(--accent); }
.empty { color: var(--text-lighter); text-align: center; padding: 40px 0; }

/* ========== 关于页 ========== */
.about-page { max-width: 600px; margin: 0 auto; }
.about-intro { color: var(--text-light); font-size: 1rem; margin: 15px 0 30px; }

.cats-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.cat-card {
    background: var(--content-bg);
    border-radius: var(--radius);
    padding: 25px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    flex: 1 1 180px;
    max-width: 200px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.cat-photo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #f5f0eb;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: transform 0.3s ease;
}

.cat-card:hover .cat-photo-placeholder {
    transform: scale(1.1);
}

.cat-card h3 { color: var(--text); font-size: 1.1rem; margin-bottom: 4px; }
.cat-breed { color: var(--text-lighter); font-size: 0.82rem; margin-bottom: 8px; }
.cat-personality { color: var(--text-light); font-size: 0.85rem; line-height: 1.6; }

/* ========== 页脚 ========== */
footer {
    text-align: center;
    padding: 30px 0 10px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

footer p { color: var(--text-lighter); font-size: 0.85rem; margin-bottom: 4px; }
footer .copy { font-size: 0.78rem; color: #b0a090; }
footer .copy a { color: #b0a090; text-decoration: none; }
footer .copy a:hover { color: var(--accent); }

/* ========== 响应式 ========== */
@media (max-width: 600px) {
    header h1 { font-size: 1.5rem; }
    .container, .container-wide { padding: 25px 16px; }
    .list-item { padding: 18px 20px; }
    nav { flex-direction: column; gap: 10px; align-items: stretch; }
    .nav-left { justify-content: center; }
    .nav-right { display: flex; justify-content: center; }
    .search-input { width: 100%; max-width: 250px; }
    .search-input:focus { width: 100%; max-width: 250px; }
    .search-dropdown { width: 100%; right: 0; }
    .cats-grid { flex-direction: column; align-items: center; }
}

/* ========== 系列标签 vs 普通标签 ========== */
.tag.tag-series {
    background: #f0f4f8;
    color: #6a8fa8;
}

.tag.tag-series:hover {
    background: #e4edf4;
}



/* 标签页分区标题 */
.tags-section-title {
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    margin: 25px 0 15px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.tags-section-title:first-of-type {
    margin-top: 0;
}


/* ========== 美化 — 列表卡片左边框 hover ========== */
.list-item {
    border-left: 3px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
}

.list-item:hover {
    border-left-color: var(--accent);
}

/* ========== 美化 — 导航活跃项下划线 ========== */
.nav-left a.nav-active {
    position: relative;
}

.nav-left a.nav-active::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}

/* ========== 美化 — 时间线竖线装饰 ========== */
.archive-year ul {
    position: relative;
    padding-left: 24px;
}

.archive-year ul::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
    border-radius: 1px;
}

.archive-year li {
    position: relative;
}

.archive-year li::before {
    content: "";
    position: absolute;
    left: -24px;
    top: 14px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
}

/* ========== 美化 — 页脚猫爪分隔 ========== */
footer {
    position: relative;
}

footer::before {
    content: "🐾";
    display: block;
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 15px;
    opacity: 0.4;
}
