/* Base */
:root { --primary: #007bff; --dark: #333; --gray: #999; --border: #eee; --bg-odd: #fcfcfc; --bg-even: #ffffff; }
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 14px; color: var(--dark); background: #fff; line-height: 1.6; }
a { text-decoration: none; color: var(--dark); transition: 0.2s; }
a:hover { color: var(--primary); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* Header */
.header { padding: 15px 0; border-bottom: 1px solid var(--border); }
.header-wrap { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 22px; font-weight: bold; display: flex; align-items: center; }
.logo img { height: 36px; }

.search-area { position: relative; width: 300px; }
.search-area form { display: flex; border: 1px solid #ddd; border-radius: 4px; overflow: hidden; }
.search-area input { flex: 1; border: none; padding: 8px 15px; outline: none; background: #fafafa; }
.search-area button { border: none; background: #fafafa; width: 40px; cursor: pointer; color: #666; }
#search-result { position: absolute; top: 100%; left: 0; width: 100%; background: #fff; border: 1px solid #ddd; z-index: 100; display: none; box-shadow: 0 4px 10px rgba(0,0,0,0.1); border-radius: 4px; margin-top: 5px; }
.search-item { display: block; padding: 8px 12px; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.search-item:hover { background: #f0f8ff; color: var(--primary); }

/* Nav (Mobile Compatible) */
.nav-bar { background: #fdfdfd; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.nav-list { display: flex; list-style: none; padding: 0; margin: 0; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
.nav-list::-webkit-scrollbar { display: none; }
.nav-list li a { display: block; padding: 12px 20px; color: #555; font-weight: 500; font-size: 15px; }
.nav-list li a:hover, .nav-list li a.active { color: var(--primary); background: #f0f8ff; border-bottom: 2px solid var(--primary); margin-bottom: -2px; }

.notice { background: #eaf2ff; color: #0056b3; padding: 10px 15px; border-radius: 4px; margin-bottom: 20px; border: 1px solid #d0e3ff; display: flex; align-items: center; gap: 8px; font-size: 13px; }

/* Layout */
.row { display: flex; gap: 20px; }
.main-col { flex: 1; min-width: 0; }
.side-col { width: 300px; flex-shrink: 0; }

/* Zebra List (斑马纹) */
.list-box { border: 1px solid var(--border); border-radius: 4px; }
.list-item { display: flex; align-items: center; padding: 12px 15px; border-bottom: 1px solid var(--border); transition: background 0.2s; }
.list-item:nth-child(odd) { background: var(--bg-odd); }
.list-item:nth-child(even) { background: var(--bg-even); }
.list-item:hover { background: #f0f8ff; }
.list-item:last-child { border-bottom: none; }

.post-title { flex: 1; font-size: 15px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: flex; align-items: center; }
.post-title a { color: #333; margin-left: 5px; }
.top-icon { color: #ff4757; font-size: 14px; margin-right: 5px; }
.sort-tag { color: #999; margin-right: 5px; font-size: 13px; }
.post-date { color: #999; font-size: 12px; margin-left: 15px; min-width: 80px; text-align: right; }
.highlight { color: red !important; font-weight: bold; }

/* Article */
.article-box { padding: 20px; background: #fff; border: 1px solid #eee; }
.art-title { font-size: 24px; text-align: center; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 15px; }
.art-meta { text-align: center; color: #999; font-size: 12px; background: #f9f9f9; padding: 8px; margin-bottom: 20px; display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
.art-content { line-height: 1.8; font-size: 15px; color: #333; }
.art-content img { max-width: 100%; border: 1px solid #eee; padding: 4px; cursor: zoom-in; }
.art-content pre { background: #f6f8fa; padding: 15px; border-radius: 4px; overflow-x: auto; border: 1px solid #ddd; position: relative; margin: 20px 0; }
.copy-btn { position: absolute; top: 5px; right: 5px; font-size: 12px; border: 1px solid #ddd; background: #fff; padding: 2px 6px; cursor: pointer; border-radius: 3px; }

.art-tags { margin-top: 30px; padding-top: 15px; border-top: 1px dashed #ddd; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.tag-item { background: #f0f2f5; color: #666; padding: 3px 10px; border-radius: 20px; font-size: 12px; margin-right: 5px; }
.no-tag { color: #ccc; font-size: 12px; }

/* Icons Bar */
.action-bar { display: flex; gap: 10px; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #eee; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 18px; color: #666; transition: 0.2s; background: #fff; position: relative; }
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn.like.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.like-num { position: absolute; top: -5px; right: -5px; background: #ff4757; color: #fff; font-size: 10px; padding: 0 4px; border-radius: 10px; }

/* Comments */
.comments-wrap { margin-top: 40px; }
.comment-item { padding: 15px 0; border-bottom: 1px dashed #eee; }
.c-header { font-size: 12px; color: #999; margin-bottom: 5px; display: flex; justify-content: space-between; }
.c-user { font-weight: bold; color: #333; font-size: 14px; }
.c-reply { cursor: pointer; color: var(--primary); }
.child { margin-left: 30px; background: #f9f9f9; padding: 10px; margin-top: 5px; border-radius: 4px; }

.comment-form { background: #f9f9f9; padding: 15px; margin-top: 20px; border-radius: 4px; border: 1px solid #eee; }
.form-row { display: flex; gap: 10px; margin-bottom: 10px; }
.form-row input { flex: 1; padding: 8px; border: 1px solid #ddd; border-radius: 3px; }
.editor-wrap { border: 1px solid #ddd; background: #fff; border-radius: 3px; position: relative; }
textarea#comment { width: 100%; border: none; padding: 10px; height: 100px; resize: vertical; outline: none; }
.toolbar { padding: 5px 10px; border-top: 1px solid #eee; background: #fafafa; position: relative; }
#emoji-btn { cursor: pointer; color: #666; font-size: 13px; display: flex; align-items: center; gap: 5px; }
#emoji-list { position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid #ddd; padding: 5px; display: none; width: 200px; flex-wrap: wrap; gap: 5px; z-index: 10; box-shadow: 0 2px 8px rgba(0,0,0,0.1); margin-top: 5px; }
#emoji-list span { cursor: pointer; font-size: 18px; padding: 3px; }
.form-footer { margin-top: 10px; display: flex; justify-content: space-between; align-items: center; }
.submit-btn { background: var(--primary); color: #fff; border: none; padding: 6px 20px; border-radius: 3px; cursor: pointer; }

/* Sidebar */
.widget { margin-bottom: 20px; border: 1px solid #eee; border-radius: 4px; background: #fff; }
.widget-title { background: #f9f9f9; padding: 10px 15px; font-weight: bold; border-bottom: 1px solid #eee; font-size: 14px; }
.widget ul { list-style: none; padding: 5px 0; margin: 0; }
.widget li { padding: 6px 15px; border-bottom: 1px dashed #eee; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#toc-list li { border: none; }
#toc-list a { color: #666; display: block; }
#toc-list a:hover { color: var(--primary); }

/* Mobile */
@media (max-width: 768px) {
    .container { padding: 0 10px; }
    .header-wrap { flex-direction: column; align-items: flex-start; gap: 10px; }
    .search-area { width: 100%; }
    .row { flex-direction: column; }
    .col-side { width: 100%; }
    .post-date { display: none; }
    .art-tags { flex-direction: column; align-items: flex-start; gap: 15px; }
    .action-bar { width: 100%; justify-content: center; }
}

.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); background: rgba(0,0,0,0.8); color: #fff; padding: 10px 20px; border-radius: 4px; z-index: 3000; display: none; }
.modal-mask { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; display: none; align-items: center; justify-content: center; }
.modal-box { background: #fff; padding: 20px; border-radius: 5px; text-align: center; }