/**
 * 极简主题样式表
 * PersonalSite v3.0.2
 * 侧边栏导航 + 列表式书签 + 滑入动效
 */

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background: #fafafa;
    color: #2c2c2c;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* ===== Left Sidebar ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid #e8e8e8;
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    transform: translateX(-100%);
    animation: slideInLeft 0.5s ease forwards;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.sidebar-avatar {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 16px;
}

.sidebar-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: #2c2c2c;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: #fff;
    font-size: 32px;
}

.sidebar-nickname {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
}

.sidebar-bio {
    font-size: 13px;
    color: #888;
    margin-bottom: 20px;
    line-height: 1.5;
}

.sidebar-hitokoto {
    font-size: 12px;
    color: #aaa;
    font-style: italic;
    line-height: 1.7;
    padding: 12px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 24px;
    position: relative;
}

.sidebar-hitokoto .hitokoto-text {
    display: block;
}

.sidebar-hitokoto .hitokoto-from {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: #bbb;
    font-style: normal;
    font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
}

.sidebar-hitokoto .refresh-btn {
    position: absolute;
    top: 10px;
    right: 0;
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
    transition: color 0.2s, transform 0.3s;
}

.sidebar-hitokoto .refresh-btn:hover {
    color: #2c2c2c;
}

.sidebar-hitokoto .refresh-btn.spinning i {
    animation: spin 0.6s ease;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.sidebar-nav {
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 10px 0;
    color: #666;
    font-size: 13px;
    font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
    transition: color 0.2s;
    letter-spacing: 0.3px;
}

.sidebar-nav a:hover {
    color: #1a1a1a;
}

.sidebar-nav a i {
    width: 18px;
    margin-right: 10px;
    text-align: center;
    font-size: 13px;
}

.sidebar-footer-text {
    font-size: 11px;
    color: #ccc;
    font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
}

/* ===== Mobile Hamburger ===== */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #2c2c2c;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* ===== Main Content ===== */
.main-content {
    margin-left: 260px;
    padding: 48px 48px 24px;
    min-height: 100vh;
    opacity: 0;
    transform: translateX(20px);
    animation: slideInRight 0.5s ease 0.2s forwards;
}

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

/* ===== Category Section ===== */
.category-section {
    margin-bottom: 40px;
}

.category-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 12px;
    border-bottom: 1px solid #eee;
    margin-bottom: 0;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s;
}

.category-heading:hover {
    border-color: #ccc;
}

.category-heading .heading-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-heading .heading-left i {
    font-size: 14px;
    color: #999;
}

.category-heading .heading-left span {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: 0.5px;
}

.category-heading .toggle-icon {
    font-size: 12px;
    color: #bbb;
    transition: transform 0.3s ease;
}

.category-heading.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.category-list {
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.3s ease;
    max-height: 2000px;
    opacity: 1;
}

.category-list.collapsed {
    max-height: 0;
    opacity: 0;
}

/* ===== Bookmark List Item ===== */
.bookmark-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-left: 3px solid transparent;
    transition: background 0.2s, border-color 0.2s;
    text-decoration: none;
    color: inherit;
}

.bookmark-item:hover {
    background: #f5f5f5;
    border-left-color: #2c2c2c;
}

.bookmark-item .item-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 14px;
    margin-right: 14px;
    flex-shrink: 0;
}

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

.bookmark-item .item-title {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    line-height: 1.4;
}

.bookmark-item .item-desc {
    font-size: 12px;
    color: #999;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bookmark-item .item-arrow {
    color: #ccc;
    font-size: 12px;
    margin-left: 12px;
    flex-shrink: 0;
    transition: color 0.2s, transform 0.2s;
}

.bookmark-item:hover .item-arrow {
    color: #2c2c2c;
    transform: translateX(3px);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #ccc;
}

.empty-state i {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
}

.empty-state p {
    font-size: 13px;
    font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
}

/* ===== Footer ===== */
.site-footer {
    margin-top: 48px;
    padding: 24px 0;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 12px;
    color: #bbb;
    font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
}

.site-footer a {
    color: #999;
    transition: color 0.2s;
}

.site-footer a:hover {
    color: #2c2c2c;
}

.site-footer .icp-info {
    margin-top: 6px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        animation: none;
        transition: transform 0.3s ease;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    }

    .sidebar.open {
        transform: translateX(0);
        animation: none;
    }

    .mobile-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding: 72px 20px 24px;
        animation: none;
        opacity: 1;
        transform: none;
    }

    .bookmark-item {
        padding: 12px 8px;
    }

    .bookmark-item .item-desc {
        display: none;
    }
}
