* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #202124; background: #f8f9fa; line-height: 1.6; font-size: 16px; }
a { color: #1a73e8; text-decoration: none; }
img { max-width: 100%; height: auto; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

.header { background: #fff; border-bottom: 1px solid #e0e0e0; padding: 12px 0; position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo { font-size: 22px; font-weight: bold; color: #1a73e8; white-space: nowrap; }
.nav-menu { display: flex; gap: 10px; flex: 1; flex-wrap: wrap; }
.nav-menu a { color: #202124; padding: 6px 10px; border-radius: 4px; font-size: 15px; }
.nav-menu a:hover { background: #f0f0f0; text-decoration: none; }
.search-box { display: flex; }
.search-box input { padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px 0 0 4px; width: 180px; }
.search-box button { padding: 8px 16px; background: #1a73e8; color: #fff; border: none; border-radius: 0 4px 4px 0; cursor: pointer; }
.user-area { display: flex; gap: 8px; align-items: center; }
.user-area a { padding: 6px 12px; border-radius: 4px; font-size: 14px; }
.btn-login { background: #1a73e8; color: #fff !important; }
.btn-register { background: #34a853; color: #fff !important; }
.btn-admin { background: #fbbc04; color: #202124 !important; }
.btn-ask { background: #ea4335; color: #fff !important; font-weight: bold; }

.main { min-height: calc(100vh - 140px); padding: 20px 0; }

.alert { padding: 12px 16px; border-radius: 4px; margin-bottom: 20px; }
.alert-success { background: #e6f4ea; color: #34a853; }
.alert-error { background: #fce8e6; color: #ea4335; }
.alert-info { background: #e8f0fe; color: #1a73e8; }

.section-title { font-size: 20px; margin-bottom: 15px; }
.page-title { font-size: 22px; margin-bottom: 20px; }
.page-title small { font-size: 14px; color: #808080; }

.recommend-section { margin-bottom: 30px; }
.recommend-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 15px; }
.recommend-item { background: #fff; padding: 15px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.recommend-title { font-weight: bold; display: block; margin-bottom: 8px; }

.filter-bar { margin-bottom: 20px; background: #fff; padding: 12px; border-radius: 8px; overflow-x: auto; }
.filter-left { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-left a { padding: 6px 14px; border-radius: 20px; background: #f0f0f0; color: #202124; white-space: nowrap; }
.filter-left a.active { background: #1a73e8; color: #fff; }

.question-list { display: grid; grid-template-columns: 1fr; gap: 12px; }
.question-card { background: #fff; padding: 16px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.question-title { font-size: 17px; font-weight: bold; display: block; margin-bottom: 8px; }
.question-summary { color: #5f6368; margin-bottom: 10px; font-size: 14px; }
.question-meta { display: flex; gap: 12px; font-size: 13px; color: #808080; align-items: center; flex-wrap: wrap; }
.category-tag { background: #e8f0fe; color: #1a73e8; padding: 2px 8px; border-radius: 12px; font-size: 12px; }
.badge { padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.badge-resolved { background: #e6f4ea; color: #34a853; }
.badge-pending { background: #fef7e0; color: #f9ab00; }
.badge-rejected { background: #fce8e6; color: #ea4335; }

.empty-state { text-align: center; padding: 40px; color: #808080; }

.pagination { display: flex; justify-content: center; gap: 5px; margin-top: 20px; flex-wrap: wrap; }
.pagination a { padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; background: #fff; }
.pagination a.current { background: #1a73e8; color: #fff; border-color: #1a73e8; }

.detail-page { display: grid; grid-template-columns: 1fr 280px; gap: 20px; }
.detail-main { background: #fff; padding: 24px; border-radius: 8px; }
.question-content { margin: 20px 0; line-height: 1.8; }
.reply-section { margin-top: 30px; }
.answer-card { background: #e6f4ea; border: 2px solid #34a853; padding: 16px; border-radius: 8px; margin-bottom: 15px; }
.answer-badge { background: #34a853; color: #fff; padding: 4px 12px; border-radius: 4px; display: inline-block; margin-bottom: 10px; font-weight: bold; }
.reply-card { background: #f8f9fa; padding: 15px; border-radius: 8px; margin-bottom: 10px; }
.reply-author { font-weight: bold; margin-bottom: 5px; }
.reply-content { margin: 5px 0; }
.reply-time { font-size: 12px; color: #808080; }
.reply-form-wrapper { background: #fff; padding: 20px; border-radius: 8px; margin-top: 20px; }
.reply-form-wrapper textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; }
.detail-sidebar { background: #fff; padding: 20px; border-radius: 8px; height: fit-content; }
.related-item { display: block; padding: 8px 0; border-bottom: 1px solid #eee; }

.auth-page { display: flex; justify-content: center; padding: 20px 0; }
.auth-box { background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); width: 100%; max-width: 400px; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 16px; }
.btn-primary { background: #1a73e8; color: #fff; padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; }
.btn-secondary { background: #f0f0f0; color: #202124; padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; }
.btn-block { width: 100%; }
.auth-link { text-align: center; margin-top: 15px; }
.captcha-row { display: flex; gap: 10px; align-items: center; }
.captcha-row input { flex: 1; }
.captcha-img { cursor: pointer; height: 40px; border-radius: 4px; }

.user-center, .publish-page, .edit-page, .user-questions, .user-replies { background: #fff; padding: 20px; border-radius: 8px; }
.user-info-card { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.info-item { padding: 15px; background: #f8f9fa; border-radius: 4px; }
.info-item label { display: block; color: #808080; font-size: 14px; }
.user-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.question-actions { margin-top: 10px; display: flex; gap: 10px; }
.btn-edit-small, .btn-delete-small { padding: 4px 10px; font-size: 12px; border-radius: 4px; border: none; cursor: pointer; }
.btn-edit-small { background: #e8f0fe; color: #1a73e8; }
.btn-delete-small { background: #fce8e6; color: #ea4335; }
.cover-preview { max-width: 200px; margin-top: 10px; border-radius: 4px; }
.reply-delete-form { display: inline; }

.footer { background: #fff; border-top: 1px solid #e0e0e0; padding: 20px 0; text-align: center; color: #808080; font-size: 14px; }

@media (max-width: 992px) {
    .detail-page { grid-template-columns: 1fr; }
    .header-inner { gap: 12px; }
    .nav-menu { order: 3; width: 100%; }
}

@media (max-width: 768px) {
    .container { padding: 0 12px; }
    .header { padding: 10px 0; }
    .header-inner { gap: 8px; }
    .logo { font-size: 18px; }
    .nav-menu { gap: 6px; order: 3; width: 100%; }
    .nav-menu a { padding: 5px 8px; font-size: 14px; }
    .search-box { order: 2; flex: 1; }
    .search-box input { width: 100%; }
    .user-area { order: 1; }
    .user-area a { padding: 5px 8px; font-size: 13px; }

    .main { padding: 12px 0; }
    .question-card { padding: 12px; }
    .question-title { font-size: 16px; }
    .question-summary { font-size: 13px; }
    .question-meta { gap: 8px; font-size: 12px; }

    .detail-main { padding: 16px; }
    .auth-box { padding: 20px; margin: 0 12px; }
    .user-center, .publish-page, .edit-page, .user-questions, .user-replies { padding: 16px; }
    .user-info-card { grid-template-columns: 1fr; }
    .recommend-list { grid-template-columns: 1fr; }
    .page-title { font-size: 18px; }
    .section-title { font-size: 18px; }
    .filter-left a { padding: 5px 10px; font-size: 13px; }
}

@media (max-width: 480px) {
    .header-inner { flex-direction: column; align-items: stretch; }
    .logo { text-align: center; }
    .nav-menu { justify-content: center; }
    .search-box { width: 100%; }
    .search-box input { width: 100%; }
    .user-area { justify-content: center; }
    .pagination a { padding: 6px 10px; font-size: 14px; }
    .form-group input, .form-group select, .form-group textarea { font-size: 16px; }
}
