/* Zhihu Module Styles - Version 1 */

/* ===== home.pug ===== */
.zhihu-card {
    border-bottom: 1px solid #e5e5e5;
    padding: 20px 0;
}
.zhihu-card:last-child {
    border-bottom: none;
}
.vote-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f6f6f6;
    padding: 8px 4px;
    border-radius: 4px;
    min-width: 40px;
}
.vote-btn {
    background: none;
    border: none;
    color: #8590a6;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}
.vote-btn:hover {
    color: #175199;
}
.vote-btn.voted {
    color: #0066ff;
}
.vote-count {
    font-size: 14px;
    font-weight: 600;
    color: #121212;
    margin: 4px 0;
}
.content-preview {
    color: #121212;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.action-bar {
    display: flex;
    gap: 20px;
    margin-top: 12px;
    font-size: 14px;
    color: #8590a6;
}
.action-btn {
    color: #8590a6;
    text-decoration: none;
    cursor: pointer;
}
.action-btn:hover {
    color: #175199;
}
.author-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.author-name {
    font-weight: 600;
    color: #444;
}
.author-bio {
    color: #8590a6;
    font-size: 14px;
}
.follow-user-btn {
    background: #0066ff;
    color: white;
    border: none;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 8px;
}
.follow-user-btn:hover {
    background: #0052cc;
}
.follow-user-btn.following {
    background: #f6f6f6;
    color: #8590a6;
    border: 1px solid #e5e5e5;
}
.follow-user-btn.following:hover {
    background: #ebebeb;
}
.question-title {
    font-size: 18px;
    font-weight: 600;
    color: #121212;
    margin-bottom: 8px;
}
.question-title:hover {
    color: #175199;
}
.nav-tabs-zhihu {
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 20px;
}
.nav-tabs-zhihu .nav-link {
    color: #8590a6;
    border: none;
    padding: 12px 20px;
    font-size: 15px;
}
.nav-tabs-zhihu .nav-link.active {
    color: #121212;
    border-bottom: 3px solid #0066ff;
    font-weight: 600;
}

/* ===== question.pug ===== */
.question-header {
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 20px;
    margin-bottom: 20px;
}
.question-title {
    font-size: 22px;
    font-weight: 600;
    color: #121212;
    margin-bottom: 12px;
}
.question-meta {
    color: #8590a6;
    font-size: 14px;
    margin-bottom: 16px;
}
.topic-tag {
    display: inline-block;
    background: #f0f7ff;
    color: #175199;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    margin-right: 8px;
    margin-bottom: 8px;
    text-decoration: none;
}
.topic-tag:hover {
    background: #e6f0ff;
}
.action-btn-primary {
    background: #0066ff;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}
.action-btn-primary:hover {
    background: #0052cc;
}
.action-btn-secondary {
    background: #f6f6f6;
    color: #8590a6;
    border: 1px solid #e5e5e5;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}
.action-btn-secondary:hover {
    background: #ebebeb;
}
.action-btn-secondary.following {
    background: #e6f0ff;
    color: #175199;
    border-color: #175199;
}
.answer-section {
    margin-top: 30px;
}
.answer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e5e5;
}
.answer-count {
    font-size: 16px;
    font-weight: 600;
    color: #121212;
}
.sort-options {
    font-size: 14px;
}
.sort-options a {
    color: #8590a6;
    text-decoration: none;
    margin-left: 16px;
}
.sort-options a.active {
    color: #121212;
    font-weight: 600;
}
.answer-card {
    border-bottom: 1px solid #e5e5e5;
    padding: 20px 0;
}
.answer-author {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}
.answer-author img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    margin-right: 12px;
}
.author-details {
    flex: 1;
}
.author-name {
    font-weight: 600;
    color: #444;
    font-size: 15px;
}
.author-bio {
    color: #8590a6;
    font-size: 13px;
}
.answer-content {
    color: #121212;
    line-height: 1.8;
    font-size: 15px;
}
.answer-content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    background: #f6f6f6;
    padding: 12px;
    border-radius: 4px;
}
.answer-content.collapsed {
    max-height: 300px;
    overflow: hidden;
    position: relative;
}
.answer-content.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(transparent, white);
    pointer-events: none;
}
.expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #175199;
    font-size: 14px;
    text-decoration: none;
    padding: 8px 12px;
    margin-top: 4px;
    cursor: pointer;
    background: none;
    border: none;
}
.expand-btn:hover {
    color: #0052cc;
}
.answer-actions {
    display: flex;
    gap: 20px;
    margin-top: 16px;
    padding-top: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.vote-btn-group {
    display: flex;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}
.vote-btn-group .upvote-btn {
    background: #0066ff;
    border: none;
    color: white;
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    white-space: nowrap;
}
.vote-btn-group .upvote-btn .vote-count {
    color: white;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}
.vote-btn-group .upvote-btn:hover {
    background: #0052cc;
}
.vote-btn-group .upvote-btn.voted {
    background: #004bb5;
}
.vote-btn-group .downvote-btn {
    background: #0066ff;
    border: none;
    border-left: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.vote-btn-group .downvote-btn:hover {
    background: #0052cc;
}
.vote-btn-group .downvote-btn.voted {
    background: #004bb5;
}
.action-link {
    color: #8590a6;
    font-size: 14px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.action-link:hover {
    color: #175199;
}
.comment-section {
    background: #f6f6f6;
    padding: 16px;
    border-radius: 4px;
    margin-top: 16px;
}
.comment-item {
    padding: 12px 0;
    border-bottom: 1px solid #e5e5e5;
}
.comment-item:last-child {
    border-bottom: none;
}
.comment-item .avatar-link {
    flex-shrink: 0;
}
.comment-item .avatar-link img {
    width: 32px;
    height: 32px;
    border-radius: 4px;
}
.comment-item .comment-body {
    flex: 1;
    min-width: 0;
}
.comment-item .comment-user {
    font-weight: 600;
    color: #444;
    text-decoration: none;
}
.comment-item .comment-user:hover {
    color: #175199;
}
.comment-item .comment-content {
    color: #444;
    line-height: 1.6;
    word-wrap: break-word;
}
.comment-item .comment-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
}
.comment-item .comment-actions .action-btn {
    color: #8590a6;
    font-size: 13px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}
.comment-item .comment-actions .action-btn:hover {
    color: #175199;
}
.comment-item .comment-actions .action-btn.liked {
    color: #175199;
}
.comment-item .comment-date {
    color: #8590a6;
    font-size: 13px;
}
/* Nested replies with thread line like real Zhihu */
.replies-container {
    margin-left: 44px;
    padding-left: 12px;
    border-left: 2px solid #e5e5e5;
    margin-top: 8px;
}
.reply-item {
    padding: 10px 0;
    position: relative;
}
.reply-item::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 20px;
    width: 12px;
    height: 2px;
    background: #e5e5e5;
}
.reply-item:last-child {
    padding-bottom: 0;
}
.reply-item .avatar-link img {
    width: 24px;
    height: 24px;
}
.reply-item .comment-user {
    font-size: 13px;
}
.reply-item .comment-content {
    font-size: 13px;
}
.reply-item .comment-actions {
    margin-top: 4px;
}
.view-replies-btn {
    color: #175199;
    font-size: 13px;
    background: none;
    border: none;
    padding: 4px 0;
    cursor: pointer;
    margin-left: 44px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.view-replies-btn:hover {
    color: #0052cc;
    text-decoration: underline;
}
.comment-input-area {
    padding: 12px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e5e5e5;
}
.comment-input-area input {
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
}
.comment-input-area input:focus {
    outline: none;
    border-color: #175199;
}
.comments-list {
    max-height: 500px;
    overflow-y: auto;
}

/* ===== topics.pug ===== */
.topics-header {
    margin-bottom: 24px;
}
.topics-header h3 {
    font-weight: 600;
}
.topic-card {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    transition: box-shadow 0.2s;
}
.topic-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.topic-icon {
    width: 60px;
    height: 60px;
    background: #0066ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
}
.topic-name {
    font-size: 18px;
    font-weight: 600;
    color: #121212;
    margin-bottom: 8px;
}
.topic-desc {
    color: #8590a6;
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.5;
}
.topic-stats {
    color: #8590a6;
    font-size: 13px;
    margin-bottom: 12px;
}
.follow-btn {
    background: #0066ff;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
}
.follow-btn:hover {
    background: #0052cc;
}
.follow-btn.following {
    background: #f6f6f6;
    color: #8590a6;
}
.follow-btn.following:hover {
    background: #ebebeb;
}

/* ===== topic.pug ===== */
.topic-header {
    background: linear-gradient(135deg, #0066ff 0%, #0052cc 100%);
    color: white;
    padding: 40px 30px;
    border-radius: 8px;
    margin-bottom: 30px;
}
.topic-icon-large {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 16px;
}
.topic-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}
.follow-btn-large {
    background: white;
    color: #0066ff;
    border: none;
    padding: 10px 30px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
}
.follow-btn-large:hover {
    background: #f0f0f0;
}
.follow-btn-large.following {
    background: rgba(255,255,255,0.2);
    color: white;
}
.question-item {
    padding: 20px 0;
    border-bottom: 1px solid #e5e5e5;
}
.question-item:last-child {
    border-bottom: none;
}
.question-title-link {
    font-size: 18px;
    font-weight: 600;
    color: #121212;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
}
.question-title-link:hover {
    color: #175199;
}

/* ===== ask.pug ===== */
.ask-container {
    max-width: 800px;
    margin: 0 auto;
}
.ask-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
}
.form-group {
    margin-bottom: 20px;
}
.form-label {
    font-weight: 600;
    color: #121212;
    margin-bottom: 8px;
    display: block;
}
.form-hint {
    font-size: 12px;
    color: #8590a6;
    margin-top: 4px;
}

/* ===== submissions.pug ===== */
.submissions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.submission-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 16px;
}
.submission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.submission-name {
    font-size: 16px;
    font-weight: 600;
    color: #121212;
}
.submission-status .badge {
    font-size: 12px;
    padding: 4px 8px;
}
.submission-description {
    color: #444;
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.6;
}
.submission-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
    color: #8590a6;
}
.submission-date::before {
    content: "📅 ";
}
.reject-reason {
    color: #dc3545;
    width: 100%;
}
.reject-reason::before {
    content: "⚠ ";
}
.topic-select {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.topic-checkbox {
    display: none;
}
.topic-label {
    padding: 6px 14px;
    background: #f6f6f6;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #444;
    transition: all 0.2s;
}
.topic-checkbox:checked + .topic-label {
    background: #0066ff;
    color: white;
    border-color: #0066ff;
}
.topic-label:hover {
    background: #ebebeb;
}
.topic-checkbox:checked + .topic-label:hover {
    background: #0052cc;
}

/* ===== write_answer.pug ===== */
.write-container {
    max-width: 800px;
    margin: 0 auto;
}
.question-info {
    background: #f6f6f6;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}
.question-info h5 {
    margin-bottom: 8px;
    font-weight: 600;
}
.question-info p {
    color: #8590a6;
    margin-bottom: 0;
}
.write-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
}
.editor-toolbar {
    background: #f6f6f6;
    padding: 8px 12px;
    border: 1px solid #e5e5e5;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    display: flex;
    gap: 12px;
}
.editor-toolbar button {
    background: none;
    border: none;
    color: #8590a6;
    cursor: pointer;
    padding: 4px 8px;
}
.editor-toolbar button:hover {
    color: #175199;
}
.editor-content {
    border: 1px solid #e5e5e5;
    border-radius: 0 0 4px 4px;
    min-height: 300px;
}
.editor-content textarea {
    width: 100%;
    min-height: 300px;
    border: none;
    padding: 16px;
    resize: vertical;
    font-size: 15px;
    line-height: 1.8;
}
.editor-content textarea:focus {
    outline: none;
}
.word-count {
    text-align: right;
    color: #8590a6;
    font-size: 13px;
    margin-top: 8px;
}

/* ===== me/questions.pug, me/follows.pug ===== */
.content-list {
    margin-top: 20px;
}
.content-item {
    padding: 20px 0;
    border-bottom: 1px solid #e5e5e5;
}
.content-item:last-child {
    border-bottom: none;
}
.item-title {
    font-size: 17px;
    font-weight: 600;
    color: #121212;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
}
.item-title:hover {
    color: #175199;
}
.item-meta {
    color: #8590a6;
    font-size: 14px;
    margin-bottom: 8px;
}
.item-stats {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: #8590a6;
}
.item-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== me/answers.pug ===== */
.question-link {
    color: #8590a6;
    font-size: 14px;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
}
.question-link:hover {
    color: #175199;
}
.answer-content.preview {
    color: #121212;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.answer-content.preview pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

/* ===== me/topics.pug ===== */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 20px;
}
.topic-card-simple {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    transition: box-shadow 0.2s;
}
.topic-card-simple:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.topic-icon-circle {
    width: 50px;
    height: 50px;
    background: #0066ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin: 0 auto 12px;
}
.topic-name-simple {
    font-size: 15px;
    font-weight: 600;
    color: #121212;
    margin-bottom: 8px;
}
.topic-stats-simple {
    color: #8590a6;
    font-size: 13px;
}

/* ===== search.pug ===== */
.search-box {
    margin-bottom: 16px;
}
.search-box .input-group {
    max-width: 600px;
}
.search-box input {
    border-radius: 4px 0 0 4px;
    border: 1px solid #e5e5e5;
    padding: 10px 16px;
}
.search-box button {
    border-radius: 0 4px 4px 0;
    padding: 10px 20px;
}
.search-header {
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 20px;
}
.search-header h5 {
    color: #121212;
    font-weight: 600;
}

/* ===== Mobile responsive fixes ===== */
@media (max-width: 576px) {
    .vote-btn-group button {
        padding: 6px 10px;
        font-size: 13px;
        gap: 4px;
    }
    .answer-actions {
        gap: 12px;
    }
    .action-link {
        font-size: 13px;
    }
}
