/* ========== Base ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; background: #f0f2f5; color: #333; line-height: 1.6; }
a { color: #1a73e8; text-decoration: none; }
a:hover { color: #1557b0; }

/* ========== Layout ========== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ========== Header ========== */
.site-header { background: linear-gradient(135deg, #1a73e8, #0d47a1); color: #fff; padding: 14px 0; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.site-header .container { display: flex; justify-content: space-between; align-items: center; }
.site-title { font-size: 22px; font-weight: 700; }
.site-title a { color: #fff; }
.header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.welcome { font-size: 14px; }
.welcome strong { color: #ffd54f; }

/* ========== Buttons ========== */
.btn { display: inline-block; padding: 8px 20px; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: all .2s; text-align: center; }
.btn-primary { background: #1a73e8; color: #fff; }
.btn-primary:hover { background: #1557b0; color: #fff; }
.btn-success { background: #34a853; color: #fff; }
.btn-success:hover { background: #2d8f47; }
.btn-danger { background: #ea4335; color: #fff; }
.btn-danger:hover { background: #c62828; }
.btn-outline { background: transparent; border: 1px solid #dadce0; color: #5f6368; }
.btn-outline:hover { background: #f1f3f4; }
.btn-admin { background: #7c4dff; color: #fff; }
.btn-admin:hover { background: #651fff; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-full { width: 100%; padding: 12px; font-size: 16px; }

/* ========== Alerts ========== */
.alert { padding: 12px 18px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #e6f4ea; color: #137333; border: 1px solid #ceead6; }
.alert-error { background: #fce8e6; color: #c5221f; border: 1px solid #f5c6cb; }

/* ========== Auth ========== */
.auth-box { max-width: 420px; margin: 60px auto; background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.auth-title { font-size: 28px; text-align: center; color: #1a73e8; margin-bottom: 6px; }
.auth-subtitle { font-size: 18px; text-align: center; color: #666; margin-bottom: 28px; font-weight: 400; }
.auth-links { margin-top: 20px; text-align: center; display: flex; justify-content: space-between; font-size: 14px; }

/* ========== Forms ========== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: #333; }
.form-group input[type="text"], .form-group input[type="password"], .form-group input[type="email"], .form-group textarea { width: 100%; padding: 10px 14px; border: 1px solid #dadce0; border-radius: 8px; font-size: 14px; transition: border .2s; outline: none; }
.form-group input:focus, .form-group textarea:focus { border-color: #1a73e8; box-shadow: 0 0 0 2px rgba(26,115,232,.15); }
.form-group textarea { resize: vertical; min-height: 120px; font-family: inherit; }
.form-help { font-size: 12px; color: #888; margin-top: 4px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.required { color: #ea4335; }

/* ========== Stats Bar ========== */
.stats-bar { background: #fff; padding: 14px 20px; border-radius: 10px; margin: 20px 0; display: flex; gap: 30px; box-shadow: 0 1px 4px rgba(0,0,0,.06); font-size: 14px; color: #666; }

/* ========== Posts List ========== */
.posts-list { background: #fff; border-radius: 10px; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.posts-list h2 { font-size: 18px; margin-bottom: 16px; color: #333; }
.post-card { padding: 16px 0; border-bottom: 1px solid #f0f0f0; }
.post-card:last-child { border-bottom: none; }
.post-title { font-size: 17px; margin-bottom: 6px; }
.post-title a { color: #333; }
.post-title a:hover { color: #1a73e8; }
.post-meta { font-size: 13px; color: #888; margin-bottom: 8px; display: flex; gap: 16px; align-items: center; }
.admin-badge { color: #7c4dff; font-weight: 600; }
.post-excerpt { font-size: 14px; color: #666; line-height: 1.7; }

/* ========== Empty State ========== */
.empty-state { text-align: center; padding: 60px 20px; color: #888; }
.empty-state p { font-size: 16px; margin-bottom: 20px; }

/* ========== Pagination ========== */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 24px; }
.page-link { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 6px; font-size: 14px; color: #333; background: #f1f3f4; }
.page-link.active { background: #1a73e8; color: #fff; }
.page-link:hover:not(.active) { background: #e8eaed; }

/* ========== Post Detail ========== */
.post-detail { background: #fff; border-radius: 10px; padding: 32px; margin: 24px 0; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.post-detail-title { font-size: 24px; margin-bottom: 10px; }
.post-detail-meta { font-size: 13px; color: #888; margin-bottom: 24px; display: flex; gap: 16px; align-items: center; }
.post-detail-content { font-size: 15px; line-height: 1.8; color: #333; white-space: pre-wrap; }
.post-detail-actions { margin-top: 30px; padding-top: 20px; border-top: 1px solid #f0f0f0; }
.edited { font-style: italic; }

/* ========== Create Post ========== */
.create-post-box { background: #fff; border-radius: 10px; padding: 28px; margin: 24px 0; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.create-post-box h2 { font-size: 20px; margin-bottom: 20px; }

/* ========== Admin ========== */
.page-title { font-size: 24px; margin: 24px 0; color: #333; }
.admin-nav { display: flex; gap: 4px; margin-bottom: 24px; background: #fff; border-radius: 10px; padding: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.admin-nav-link { padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 500; color: #666; transition: all .2s; }
.admin-nav-link:hover { background: #f1f3f4; color: #333; }
.admin-nav-link.active { background: #1a73e8; color: #fff; }

/* ========== Stats Grid ========== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; padding: 24px; border-radius: 10px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.stat-number { font-size: 36px; font-weight: 700; color: #1a73e8; }
.stat-label { font-size: 14px; color: #888; margin-top: 4px; }
.stat-success .stat-number { color: #34a853; }
.stat-danger .stat-number { color: #ea4335; }

/* ========== Admin Panels ========== */
.admin-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
@media (max-width: 768px) { .admin-panels { grid-template-columns: 1fr; } }
.admin-panel { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.admin-panel h2 { font-size: 16px; margin-bottom: 12px; color: #333; }

/* ========== Data Table ========== */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { background: #f8f9fa; padding: 10px 12px; text-align: left; font-weight: 600; color: #555; border-bottom: 2px solid #e8eaed; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
.data-table tr:hover { background: #f8f9fa; }
.action-cell { white-space: nowrap; }
.text-muted { color: #bbb; }
.text-center { text-align: center; color: #888; padding: 30px !important; }

/* ========== Status Badge ========== */
.status-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.status-active { background: #e6f4ea; color: #137333; }
.status-banned { background: #fce8e6; color: #c5221f; }

/* ========== Toolbar ========== */
.toolbar { margin-bottom: 16px; }
.search-form { display: flex; gap: 8px; align-items: center; }
.search-form input { padding: 8px 14px; border: 1px solid #dadce0; border-radius: 8px; font-size: 14px; flex: 1; max-width: 300px; outline: none; }
.search-form input:focus { border-color: #1a73e8; }

/* ========== Settings ========== */
.settings-box { background: #fff; border-radius: 10px; padding: 28px; box-shadow: 0 1px 4px rgba(0,0,0,.06); margin-bottom: 24px; }
.settings-box h2 { font-size: 18px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid #f0f0f0; }
.setting-item { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid #f5f5f5; }
.setting-item:last-child { border-bottom: none; }
.setting-info label { font-size: 15px; font-weight: 500; }
.setting-desc { font-size: 13px; color: #888; margin-top: 2px; }
.setting-control { flex-shrink: 0; }

/* ========== Switch ========== */
.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #ccc; transition: .3s; border-radius: 26px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background: #fff; transition: .3s; border-radius: 50%; }
.switch input:checked + .slider { background: #1a73e8; }
.switch input:checked + .slider:before { transform: translateX(22px); }

/* ========== Profile Page ========== */
.profile-header { background: #fff; border-radius: 12px; padding: 32px; margin: 24px 0; box-shadow: 0 1px 4px rgba(0,0,0,.06); display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.profile-avatar { flex-shrink: 0; }
.avatar-circle { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, #1a73e8, #0d47a1); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 700; }
.profile-info { flex: 1; min-width: 200px; }
.profile-info h1 { font-size: 24px; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-meta { display: flex; gap: 20px; font-size: 14px; color: #888; flex-wrap: wrap; }
.profile-actions { flex-shrink: 0; }

/* ========== Author Links ========== */
.author-link { color: #555; font-weight: 500; }
.author-link:hover { color: #1a73e8; }
.author-link.admin-badge:hover { color: #651fff; }
.profile-link { color: #ffd54f; }
.profile-link:hover { color: #fff; }

/* ========== Footer ========== */
.site-footer { text-align: center; padding: 24px 0; color: #888; font-size: 13px; margin-top: 40px; border-top: 1px solid #e8eaed; }
