/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.bg-white,
.shadow-sm {
    background-color: rgba(255, 255, 255, 0.42) !important;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.header {
    background-color: rgba(255, 255, 255, 0.42) !important;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.footer {
    background-color: rgba(255, 255, 255, 0.3) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.hero {
    background-color: rgba(255, 255, 255, 0.42) !important;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.article-card {
    background-color: rgba(255, 255, 255, 0.42) !important;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.article-card:hover {
    background-color: rgba(255, 255, 255, 0.6) !important;
}

.admin-table {
    background-color: rgba(255, 255, 255, 0.42) !important;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.modal {
    background-color: rgba(255, 255, 255, 0.72) !important;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

.about-content,
.article,
.contact-form,
.login-box,
.sidebar-section,
.comments-admin-list,
.decoration-admin,
.about-admin {
    background-color: rgba(255, 255, 255, 0.42) !important;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.empty-state {
    background-color: rgba(255, 255, 255, 0.42) !important;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.toolbar-btn {
    background-color: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(4px);
    border-color: rgba(0, 0, 0, 0.1);
}

.toolbar-btn:hover {
    background-color: rgba(37, 99, 235, 0.12) !important;
    border-color: rgba(37, 99, 235, 0.4);
}

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

/* 头部导航 */
.header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2563eb;
    text-decoration: none;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-list a {
    text-decoration: none;
    color: #666;
    transition: color 0.3s;
}

.nav-list a:hover,
.nav-list a.active {
    color: #2563eb;
}

/* 主内容区 */
.main {
    flex: 1;
    padding: 2rem 0;
}

.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* 首页布局 */
.home-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.sidebar {
    width: 220px;
    flex-shrink: 0;
}

.sidebar-section {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.clock-section {
    text-align: center;
}

.clock {
    font-family: 'Courier New', monospace;
}

.clock-date {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.clock-time {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    letter-spacing: 2px;
}

.divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 1rem 0;
}

.cat-section {
    margin-top: 1rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.cat-section:hover {
    transform: scale(1.02);
}

.cat-container {
    padding: 1rem;
}

/* ========== 卡通猫 ========== */
.cartoon-cat {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    user-select: none;
    transition: transform 0.3s ease;
    min-height: 0;
    transform: scale(0.64);
    transform-origin: top center;
    margin-bottom: -30px;
}

.cartoon-cat.bounce {
    animation: catBounce 0.5s ease;
}

.cartoon-cat.shake {
    animation: catShake 0.4s ease;
}

.cartoon-cat.spin {
    animation: catSpin 0.6s ease;
}

@keyframes catBounce {
    0%, 100% { transform: scale(0.64) translateY(0); }
    15% { transform: scale(0.64) translateY(-14px); }
    30% { transform: scale(0.64) translateY(-8px); }
    45% { transform: scale(0.64) translateY(-16px); }
    60% { transform: scale(0.64) translateY(0); }
    75% { transform: scale(0.64) translateY(-4px); }
}

@keyframes catShake {
    0%, 100% { transform: scale(0.64) translateX(0) rotate(0); }
    15% { transform: scale(0.64) translateX(-4px) rotate(-4deg); }
    30% { transform: scale(0.64) translateX(4px) rotate(4deg); }
    45% { transform: scale(0.64) translateX(-2px) rotate(-2deg); }
    60% { transform: scale(0.64) translateX(2px) rotate(2deg); }
    75% { transform: scale(0.64) translateX(-1px) rotate(0deg); }
}

@keyframes catSpin {
    0% { transform: scale(0.64) rotate(0deg); }
    50% { transform: scale(0.64) rotate(180deg); }
    100% { transform: scale(0.64) rotate(360deg); }
}

@keyframes catEarWiggle {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(10deg); }
}

/* --- 头部区域 --- */
.cat-head-area {
    position: relative;
    width: 130px;
    height: 120px;
}

/* 头部 */
.cat-head {
    width: 120px;
    height: 115px;
    background: linear-gradient(170deg, #f5deb3 0%, #f0c78e 50%, #e8b878 100%);
    border-radius: 55% 55% 50% 50%;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 14px rgba(180, 140, 100, 0.25), inset 0 -6px 14px rgba(0,0,0,0.05);
    z-index: 1;
    overflow: visible;
}

/* 耳朵 */
.cat-ear {
    position: absolute;
    top: 2px;
    width: 0;
    height: 0;
    border-left: 22px solid transparent;
    border-right: 22px solid transparent;
    border-bottom: 40px solid #e8b878;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 -1px 3px rgba(180,140,100,0.2));
}

.cat-ear-l {
    left: 6px;
    transform: rotate(-5deg);
}

.cat-ear-r {
    right: 6px;
    transform: rotate(5deg);
}

.cat-ear-inner {
    position: absolute;
    top: 12px;
    left: -14px;
    width: 0;
    height: 0;
    border-left: 13px solid transparent;
    border-right: 13px solid transparent;
    border-bottom: 26px solid #f5deb3;
}

/* 悬停时耳朵动 */
#catSection:hover .cat-ear-l {
    animation: catEarWiggle 0.45s ease;
}
#catSection:hover .cat-ear-r {
    animation: catEarWiggle 0.45s ease 0.12s;
}

/* --- 眼睛 --- */
.cat-eye-area {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 26px;
}

.cat-eye {
    width: 28px;
    height: 30px;
    background: #2c2520;
    border-radius: 50% 50% 45% 45%;
    position: relative;
    overflow: hidden;
}

/* 大高光 */
.eye-shine-big {
    position: absolute;
    width: 11px;
    height: 11px;
    background: #fff;
    border-radius: 50%;
    top: 4px;
    left: 5px;
    z-index: 1;
}

/* 小高光 */
.eye-shine-small {
    position: absolute;
    width: 5px;
    height: 5px;
    background: #fff;
    border-radius: 50%;
    bottom: 7px;
    left: 17px;
    z-index: 1;
}

/* --- 表情状态 --- */

/* 开心 */
.cartoon-cat.happy .cat-eye {
    border-radius: 0 0 50% 50%;
    height: 10px;
    margin-top: 10px;
    width: 28px;
}
.cartoon-cat.happy .eye-shine-big,
.cartoon-cat.happy .eye-shine-small {
    display: none;
}

/* 爱心 */
.cartoon-cat.love .cat-eye {
    background: transparent;
    overflow: visible;
    box-shadow: none;
}
.cartoon-cat.love .eye-shine-big {
    width: 28px;
    height: 28px;
    background: transparent;
    top: 0;
    left: 0;
    border-radius: 0;
}
.cartoon-cat.love .eye-shine-big::before {
    content: '♥';
    position: absolute;
    font-size: 24px;
    color: #ff6b8a;
    top: -4px;
    left: 2px;
    animation: heartBeat 0.7s ease infinite;
}
.cartoon-cat.love .eye-shine-small {
    display: none;
}

/* 惊讶 */
.cartoon-cat.surprised .cat-eye {
    width: 32px;
    height: 34px;
}

/* 困倦 */
.cartoon-cat.sleepy .cat-eye {
    height: 7px;
    border-radius: 0;
    margin-top: 13px;
    background: #5a4e44;
}
.cartoon-cat.sleepy .eye-shine-big,
.cartoon-cat.sleepy .eye-shine-small {
    display: none;
}

/* --- 腮红 --- */
.cat-cheek {
    position: absolute;
    width: 22px;
    height: 14px;
    background: rgba(255, 179, 167, 0.55);
    border-radius: 50%;
    top: 56px;
}

.cat-cheek-l {
    left: 8px;
}

.cat-cheek-r {
    right: 8px;
}

/* --- 鼻子 --- */
.cat-nose {
    position: absolute;
    top: 52px;
    left: 50%;
    transform: translateX(-50%);
    width: 11px;
    height: 9px;
    background: #ffaaa5;
    border-radius: 50% 50% 45% 45%;
}

/* --- 嘴巴 W型 --- */
.cat-mouth-w {
    position: absolute;
    top: 58px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 14px;
    display: flex;
    justify-content: center;
    gap: 0;
}

.mouth-line {
    width: 13px;
    height: 12px;
    border-bottom: 2px solid #b8937a;
    border-radius: 0 0 50% 50%;
}

/* 开心时嘴巴更大 */
.cartoon-cat.happy .cat-mouth-w {
    width: 36px;
}
.cartoon-cat.happy .mouth-line {
    width: 16px;
    height: 15px;
}

/* 惊讶时嘴巴 */
.cartoon-cat.surprised .cat-mouth-w {
    top: 57px;
}
.cartoon-cat.surprised .mouth-line {
    width: 9px;
    height: 14px;
    border-bottom: none;
    border: 2px solid #b8937a;
    border-radius: 50%;
    background: #5a4e44;
}

/* --- 胡须 --- */
.cat-whiskers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.whisker {
    position: absolute;
    height: 1.5px;
    background: rgba(160, 130, 105, 0.5);
    border-radius: 1px;
    transform-origin: right center;
}

.wk1 { top: 54px; left: -22px; width: 28px; transform: rotate(6deg); }
.wk2 { top: 58px; left: -26px; width: 30px; transform: rotate(0deg); }
.wk3 { top: 54px; right: -22px; width: 28px; transform: rotate(-6deg); }
.wk4 { top: 58px; right: -26px; width: 30px; transform: rotate(0deg); }

/* --- 身体 --- */
.cat-body {
    width: 56px;
    height: 42px;
    background: linear-gradient(180deg, #f0c78e 0%, #e8b878 100%);
    border-radius: 0 0 30px 30px;
    margin-top: -2px;
    position: relative;
    z-index: 0;
    box-shadow: 0 3px 8px rgba(180,140,100,0.2), inset 0 2px 8px rgba(0,0,0,0.04);
}

/* 爪子 */
.cat-paw {
    position: absolute;
    bottom: 4px;
    width: 18px;
    height: 16px;
    background: #f5deb3;
    border-radius: 0 0 12px 12px;
}

.cat-paw-l {
    left: 6px;
}

.cat-paw-r {
    right: 6px;
}

/* --- 粒子特效 --- */
.cat-particle {
    position: absolute;
    pointer-events: none;
    z-index: 10;
}
.cat-particle.heart {
    animation: floatUp 1s ease-out forwards;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.35); }
}

@keyframes floatUp {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-60px) scale(0.5); opacity: 0; }
}

.cat-message {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.5rem;
    transition: opacity 0.3s ease;
}

.sidebar-section h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.category-list {
    list-style: none;
}

.category-item {
    display: block;
    padding: 0.5rem 0;
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.category-item:hover {
    color: #2563eb;
}

.category-item.active {
    color: #2563eb;
    font-weight: 500;
}

.category-count {
    color: #999;
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.content-area {
    flex: 1;
    min-width: 0;
}

.sidebar-right {
    width: 280px;
    flex-shrink: 0;
}

/* 留言板样式 */
.comment-section {
    position: sticky;
    top: 100px;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.comment-form input,
.comment-form textarea {
    padding: 0.625rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: inherit;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #2563eb;
}

.comment-form textarea {
    resize: none;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.comment-list {
    max-height: 400px;
    overflow-y: auto;
}

.comment-item {
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.comment-name {
    font-weight: 500;
    color: #333;
}

.comment-date {
    font-size: 0.7rem;
    color: #999;
}

.comment-content {
    color: #666;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-replies {
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 2px solid #e5e7eb;
    margin-top: 0.75rem;
}

.reply-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.reply-item:last-child {
    border-bottom: none;
}

.reply-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.reply-form input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
}

.reply-form button {
    padding: 0.5rem 0.75rem;
    background: #eff6ff;
    color: #2563eb;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
}

.reply-form button:hover {
    background: #dbeafe;
}

.comment-empty {
    text-align: center;
    color: #999;
    padding: 1.5rem;
    font-size: 0.875rem;
}

/* 后台留言管理 */
.comments-admin-list {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
}

.admin-comment-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.admin-comment-item:last-child {
    border-bottom: none;
}

/* 后台主动评论表单 */
.admin-comment-form-wrap {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.admin-comment-form-wrap h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.admin-comment-form .form-group {
    margin-bottom: 0.75rem;
}

.admin-comment-name-input {
    width: 100%;
    max-width: 300px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

.admin-comment-name-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.admin-comment-content-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    outline: none;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s;
}

.admin-comment-content-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.admin-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.admin-comment-name {
    font-weight: 500;
}

.admin-comment-time {
    font-size: 0.75rem;
    color: #999;
}

.admin-comment-content {
    color: #666;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    white-space: pre-wrap;
}

.admin-comment-actions {
    display: flex;
    gap: 0.5rem;
}

.admin-comment-actions .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.admin-comment-replies {
    margin-left: 1.5rem;
    margin-top: 0.75rem;
    padding-left: 1rem;
    border-left: 2px solid #e5e7eb;
}

.admin-reply-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.admin-reply-item:last-child {
    border-bottom: none;
}

.admin-name {
    color: red;
    font-weight: bold;
}

/* 回复表单 */
.reply-form {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.reply-name-input {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
}

.reply-content-input {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
    resize: vertical;
}

.reply-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* 装饰管理 */
.decoration-admin {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
}

.decoration-admin h2 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    color: #333;
}

.radio-group {
    display: flex;
    gap: 1.5rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    margin: 0;
}

.color-picker-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.color-picker-row input[type="color"] {
    width: 50px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.color-picker-row input[type="text"] {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.color-presets {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.color-presets span {
    color: #666;
    font-size: 0.875rem;
}

.color-preset {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #ddd;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-preset:hover {
    transform: scale(1.2);
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slider-row input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 3px;
    outline: none;
}

.slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #2563eb;
    border-radius: 50%;
    cursor: pointer;
}

.empty-state {
    display: block;
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
    font-style: italic;
}

.slider-row input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #2563eb;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.slider-row span {
    width: 50px;
    text-align: right;
    color: #666;
    font-size: 0.875rem;
}

/* 首页英雄区 */
.hero {
    text-align: center;
    padding: 2.5rem;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.hero p {
    color: #666;
    font-size: 1.1rem;
}

/* 文章列表 */
.articles-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.articles h2 {
    font-size: 1.5rem;
}

.article-count {
    color: #999;
    font-size: 0.875rem;
}

.articles .article-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 500px !important;
    height: 500px !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    flex-shrink: 0;
}

.loading {
    text-align: center;
    color: #999;
    padding: 2rem;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 3rem;
    background: #fff;
    border-radius: 8px;
}

.article-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.article-date {
    color: #999;
    font-size: 0.875rem;
}

.article-card h3 {
    margin: 0.5rem 0;
    font-size: 1.25rem;
}

.article-card h3 a {
    color: #333;
    text-decoration: none;
}

.article-card h3 a:hover {
    color: #2563eb;
}

.article-card p {
    color: #666;
    margin-bottom: 1rem;
}

.read-more {
    display: inline-block;
    color: #2563eb;
    text-decoration: none;
    font-size: 0.875rem;
}

.read-more:hover {
    text-decoration: underline;
}

/* 关于页面 */
.about h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.about-content {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.about-avatar {
    display: flex;
    justify-content: center;
}

.about-avatar-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto;
}

.avatar-placeholder {
    width: 120px;
    height: 120px;
    background: #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 2rem;
    font-weight: bold;
}

.about-info h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.about-info h3 {
    font-size: 1.1rem;
    margin: 1.5rem 0 1rem;
    color: #333;
}

.about-info p {
    color: #666;
    margin-bottom: 0.5rem;
}

.skills-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skills-list li {
    background: #eff6ff;
    color: #2563eb;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* 联系页面 */
.contact h1 {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.contact > p {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
}

.contact-methods {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.contact-item {
    text-align: center;
}

.contact-item h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.contact-item p {
    color: #666;
}

.contact-form {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
}

.btn-submit {
    width: 100%;
    padding: 0.75rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-submit:hover {
    background: #1d4ed8;
}

/* 文章详情页 */
.article-wrapper {
    max-width: 60%;
    width: 100%;
    margin: 0 auto;
}

.article {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.article-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.article-header h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    gap: 1.5rem;
    color: #999;
    font-size: 0.875rem;
}

.article-meta .likes-count {
    color: #ef4444;
}

.article-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #333;
}

.article-content h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
}

.article-content h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 1rem;
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content ul, .article-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.article-content code {
    background: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    font-size: 0.9em;
}

.article-content pre {
    background: #e8e8e8 !important;
    color: #333;
    padding: 1rem;
    padding-top: 2.2rem;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    margin: 1rem 0;
    position: relative;
    overflow: visible;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.article-content pre::before {
    content: attr(data-language);
    position: absolute;
    top: 6px;
    left: 10px;
    background: #3b82f6;
    color: #fff;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 4px;
    font-family: monospace;
    z-index: 2;
    line-height: 1.4;
    pointer-events: none;
}

.article-content pre > code {
    display: block;
    overflow-x: auto;
    max-width: 100%;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.code-lang-label {
    position: absolute;
    top: 4px;
    left: 8px;
    background: #3b82f6;
    color: #fff;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 4px;
    font-family: monospace;
    user-select: none;
    pointer-events: none;
    z-index: 5;
    line-height: 1.4;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.article-content blockquote {
    border-left: 4px solid #2563eb;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #666;
    font-style: italic;
}

.article-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.back-link {
    color: #2563eb;
    text-decoration: none;
}

.article-actions {
    margin-bottom: 1rem;
}

.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.25s ease;
}

.like-btn:hover {
    border-color: #f87171;
    color: #ef4444;
    background: #fef2f2;
}

.like-btn.liked {
    color: #ef4444;
    border-color: #ef4444;
    background: #fef2f2;
}

.like-btn.liked .like-icon {
    fill: #ef4444;
    stroke: #ef4444;
    animation: likePop 0.35s ease;
}

.like-btn .like-icon {
    width: 18px;
    height: 18px;
    transition: all 0.25s ease;
}

@keyframes likePop {
    0% { transform: scale(1); }
    30% { transform: scale(1.35); }
    60% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

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

@media (max-width: 1200px) {
    .article-wrapper {
        max-width: 70%;
    }
}

@media (max-width: 900px) {
    .article-wrapper {
        max-width: 85%;
    }
}

@media (max-width: 600px) {
    .article-wrapper {
        max-width: 95%;
    }
    
    .article {
        padding: 1rem;
    }
    
    .article-header h1 {
        font-size: 1.5rem;
    }
}

.article-content p {
    margin-bottom: 1rem;
    color: #444;
}

.article-content ul {
    margin: 1rem 0 1.5rem 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0 1.5rem;
}

.article-content code {
    font-family: 'Consolas', 'Monaco', monospace;
}

.article-content pre code {
    font-size: 0.875rem;
}

.article-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.back-link {
    color: #2563eb;
    text-decoration: none;
}

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

/* 管理页面 */
.admin h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.admin.main {
    max-width: none;
    margin: 0;
    padding: 1rem 2rem 0;
    display: flex;
    flex-direction: column;
}

.admin.main + .footer { display: none; }

.admin-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-shrink: 0;
    align-items: center;
}

.admin-search-wrap {
    flex: 1;
    max-width: 400px;
}

.admin-search-input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

.admin-search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.admin-search-input::placeholder {
    color: #9ca3af;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-edit {
    background: #f59e0b;
    color: #fff;
}

.btn-edit:hover {
    background: #d97706;
}

.btn-delete {
    background: #dc2626;
    color: #fff;
}

.btn-delete:hover {
    background: #b91c1c;
}

.btn-cancel {
    background: #6b7280;
    color: #fff;
}

.btn-cancel:hover {
    background: #4b5563;
}

.btn-reply {
    background: #2563eb;
    color: #fff;
}

.btn-reply:hover {
    background: #1d4ed8;
}

.admin-table {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background: #f9fafb;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

.admin-table tr:hover {
    background: #f9fafb;
}

.admin-table .actions {
    display: flex;
    gap: 0.5rem;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal h2 {
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* 通知提示 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    color: #fff;
    font-weight: 500;
    z-index: 2000;
    transform: translateX(120%);
    transition: transform 0.3s;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #10b981;
}

.notification.error {
    background: #ef4444;
}

.notification.show {
    transform: translateX(0);
}

.notification.fadeout {
    transform: translateX(120%);
}

/* 页脚 */
.footer {
    background: #fff;
    text-align: center;
    padding: 0.5rem 0;
    color: #666;
    font-size: 0.875rem;
}

/* 响应式设计 */
@media (max-width: 640px) {
    .nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-list {
        gap: 1rem;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .contact-methods {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .admin-table {
        font-size: 0.875rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.5rem;
    }
    
    .admin-table .actions {
        flex-direction: column;
    }
}

/* 登录页面 */
.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: #fff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
    font-size: 1.75rem;
}

.login-box .form-group {
    margin-bottom: 1.5rem;
}

.login-box .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.login-box .form-group input {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.login-box .form-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-box .form-group input::placeholder {
    color: #999;
}

.login-box .btn-submit {
    width: 100%;
    padding: 0.875rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.login-box .btn-submit:hover {
    background: #1d4ed8;
}

.login-box .hint {
    text-align: center;
    margin-top: 1.5rem;
    color: #999;
    font-size: 0.875rem;
}

/* 导航栏登录状态 */
.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-user span {
    font-size: 0.875rem;
    color: #666;
}

.btn-logout {
    padding: 0.375rem 0.75rem;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #b91c1c;
}

/* 管理标签页 */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0;
    flex-shrink: 0;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    font-size: 1rem;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.3s, border-color 0.3s;
}

.tab-btn:hover {
    color: #2563eb;
}

.tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    font-weight: 500;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.admin-table-wrap {
    flex: 1;
    overflow: auto;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    min-height: 0;
}

.about-admin,
.comments-admin-list,
.decoration-admin {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* 关于管理表单 */
.about-admin {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
}

.about-admin h2 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.about-admin .form-group {
    margin-bottom: 1.25rem;
}

.about-admin .btn-primary {
    margin-top: 0.5rem;
    padding: 0.75rem 2rem;
}

/* 头像上传样式 */
.avatar-upload {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.avatar-preview-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px dashed #ddd;
}

.avatar-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-input {
    display: none;
}

.avatar-btn {
    cursor: pointer;
}

.avatar-hint {
    font-size: 0.75rem;
    color: #999;
}

.avatar-placeholder {
    width: 120px;
    height: 120px;
    background: #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.875rem;
}

.avatar-preview-wrapper img {
    border-radius: 50%;
}

/* 编辑器页面 */
.editor-page {
    max-width: 60%;
    width: 100%;
    margin: 0 auto;
}

.editor-page h1 {
    margin-bottom: 2rem;
    font-size: 1.75rem;
}

@media (max-width: 1200px) {
    .editor-page {
        max-width: 70%;
    }
}

@media (max-width: 900px) {
    .editor-page {
        max-width: 85%;
    }
}

@media (max-width: 600px) {
    .editor-page {
        max-width: 95%;
    }
}

.editor-section {
    margin-bottom: 1.5rem;
}

.editor-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.editor-section input,
.editor-section select,
.editor-section textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.editor-section textarea {
    min-height: 100px;
    resize: vertical;
}

/* 编辑器工具栏 */
.editor-toolbar {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f9fafb;
    border: 1px solid #ddd;
    border-radius: 4px 4px 0 0;
    flex-wrap: wrap;
}

.toolbar-btn {
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.3s;
}

.toolbar-btn:hover {
    background: #eff6ff;
    border-color: #2563eb;
}

.image-btn {
    color: #2563eb;
}

/* 编辑器内容区 */
#articleContent {
    width: 100%;
    min-height: 400px;
    border-radius: 0 0 4px 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.editor-preview-section {
    margin-top: 0.75rem;
}

.editor-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.editor-actions a {
    padding: 0.75rem 1.5rem;
    background: #6b7280;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.editor-actions a:hover {
    background: #4b5563;
}

/* 图片上传弹窗 */
.image-modal {
    max-width: 600px;
}

.image-upload-area {
    margin-bottom: 1rem;
}

#imageFileInput {
    display: none;
}

.image-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    border: 2px dashed #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.3s;
}

.image-upload-label:hover {
    border-color: #2563eb;
    background: #f9fafb;
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.image-preview-container {
    margin-bottom: 1rem;
}

.image-preview-container img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
}

/* 预览弹窗 */
.preview-modal {
    max-width: 800px;
    max-height: 80vh;
}

.preview-content {
    max-height: 60vh;
    overflow-y: auto;
    padding: 1rem;
}

.preview-content h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.preview-content h2 {
    font-size: 1.25rem;
    margin: 1.5rem 0 1rem;
}

.preview-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.preview-content ul,
.preview-content ol {
    margin: 1rem 0 1.5rem 1.5rem;
}

.preview-content li {
    margin-bottom: 0.5rem;
}

.preview-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0 1.5rem;
}

.preview-content code {
    font-family: 'Consolas', 'Monaco', monospace;
}

.preview-content img {
    max-width: 100%;
    border-radius: 4px;
    margin: 1rem 0;
}

.preview-content a {
    color: #2563eb;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .home-layout {
        flex-direction: column;
    }
    
    .sidebar,
    .sidebar-right {
        width: 100%;
    }
    
    .sidebar-right {
        order: 3;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
}

