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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #FFF8F0;
    color: #2D2D2D;
    line-height: 1.6;
}

.container {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Home: Header ===== */
header {
    text-align: center;
    padding: 60px 0 40px;
}

header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: #E8762B;
    letter-spacing: -1px;
}

header p {
    font-size: 1.05rem;
    color: #7A7A7A;
    margin-top: 6px;
}

/* ===== Home: Intro ===== */
.intro {
    text-align: center;
    max-width: 560px;
    margin: 0 auto 48px;
    font-size: 1.05rem;
    color: #555;
}

/* ===== Home: Section Title ===== */
.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid #F0E6D8;
}

/* ===== Home: Cards ===== */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 56px;
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    height: 100%;
}

.card-link:hover .card {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.card p {
    font-size: 0.88rem;
    color: #666;
    margin-bottom: 12px;
}

.tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 20px;
    background: #FFF0E5;
    color: #D06820;
}

.tag.dev-tools { background: #E8F5E9; color: #2E7D32; }
.tag.cli       { background: #E3F2FD; color: #1565C0; }
.tag.web       { background: #FDE8F0; color: #AD1457; }
.tag.editor    { background: #F3E5F5; color: #7B1FA2; }

/* ===== Home: Bookmarks ===== */
.bookmarks {
    margin-bottom: 56px;
}

.bookmarks ul {
    list-style: none;
    padding: 0;
}

.bookmarks li {
    padding: 12px 0;
    border-bottom: 1px solid #F0E6D8;
}

.bookmarks li:last-child {
    border-bottom: none;
}

.bookmarks a {
    color: #E8762B;
    text-decoration: none;
    font-weight: 500;
}

.bookmarks a:hover {
    text-decoration: underline;
}

.bookmarks .desc {
    font-size: 0.88rem;
    color: #888;
    margin-top: 2px;
}

/* ===== Home: Footer ===== */
footer {
    text-align: center;
    padding: 40px 0;
    font-size: 0.85rem;
    color: #AAAAAA;
    border-top: 1px solid #F0E6D8;
}

/* ===== Note Pages: Layout ===== */
.note-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px 60px;
}

.back-link {
    padding: 20px 0;
}

.back-link a {
    color: #E8762B;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.back-link a:hover {
    text-decoration: underline;
}

.note-page h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #2D2D2D;
    margin-bottom: 8px;
}

.page-intro {
    font-size: 1.05rem;
    color: #666;
    margin-bottom: 36px;
}

/* ===== Note Pages: Table of Contents ===== */
.toc {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.toc h2 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin-bottom: 12px;
}

.toc ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.toc a {
    color: #E8762B;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
}

.toc a:hover {
    text-decoration: underline;
}

/* ===== Note Pages: Sections ===== */
.note-section {
    margin-bottom: 40px;
}

.note-section h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #F0E6D8;
}

.note-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 20px 0 8px;
    color: #444;
}

.note-section p {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 12px;
}

/* ===== Note Pages: Code Blocks ===== */
.code-wrap {
    position: relative;
    margin-bottom: 16px;
}

.code-wrap pre {
    background: #F5F0EB;
    border-radius: 10px;
    padding: 18px 20px;
    overflow-x: auto;
    border-left: 4px solid #E8762B;
    font-size: 0.88rem;
    line-height: 1.7;
}

.code-wrap code {
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    color: #2D2D2D;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #FFFFFF;
    border: 1px solid #E0D8CE;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.copy-btn:hover {
    color: #E8762B;
    border-color: #E8762B;
}

/* Inline code */
.note-section code:not(pre code) {
    background: #F5F0EB;
    padding: 2px 7px;
    border-radius: 5px;
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    font-size: 0.85em;
    color: #C45D1A;
}

/* ===== Responsive ===== */
@media (max-width: 540px) {
    header {
        padding: 40px 0 28px;
    }

    header h1 {
        font-size: 2.2rem;
    }

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

    .note-page h1 {
        font-size: 1.6rem;
    }

    .toc ul {
        flex-direction: column;
        gap: 6px;
    }
}

/* ===== Print ===== */
@media print {
    .back-link,
    .toc,
    .copy-btn {
        display: none;
    }

    .code-wrap pre {
        border-left: 2px solid #999;
        page-break-inside: avoid;
    }

    body {
        background: #fff;
    }
}
