/* Wiki页面样式 */
.wiki-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.wiki-header {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.breadcrumb {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.breadcrumb a {
    color: var(--accent-color);
}

.breadcrumb .current {
    color: var(--secondary-color);
    font-weight: bold;
}

.wiki-title-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.wiki-title {
    color: var(--accent-color);
    font-size: 32px;
    margin: 0;
}

/* 筛选功能样式 */
.filter-section {
    margin: 25px 0 15px 0;
    padding: 20px;
    background: var(--primary-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 14px;
}

.filter-group select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    min-width: 120px;
}

.filter-btn, .reset-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filter-btn {
    background: var(--accent-color);
    color: white;
}

.filter-btn:hover {
    background: var(--secondary-color);
}

.reset-btn {
    background: #6c757d;
    color: white;
}

.reset-btn:hover {
    background: #5a6268;
}

.wiki-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.wiki-actions button {
    padding: 8px 15px;
    border: 1px solid var(--primary-dark);
    background: var(--light-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.wiki-actions button:hover {
    background: var(--primary-color);
}

.btn-support:hover {
    background: #e8f5e8 !important;
    border-color: #4caf50;
}

.btn-oppose:hover {
    background: #ffe8e8 !important;
    border-color: #f44336;
}

/* 元信息样式 */
.wiki-meta {
    background: var(--primary-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.editor {
    background: var(--light-color);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* 前言样式 */
.wiki-foreword {
    background: #f8f9fa;
    padding: 20px;
    border-left: 4px solid var(--accent-color);
    margin-bottom: 30px;
    border-radius: 0 8px 8px 0;
}

.wiki-foreword h2 {
    color: var(--secondary-color);
    margin-top: 0;
}

/* 主要内容表格 */
.wiki-content h2 {
    color: var(--secondary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.content-table-container {
    background: var(--light-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.wiki-table {
    width: 100%;
    border-collapse: collapse;
}

.wiki-table th,
.wiki-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.wiki-table th {
    background: var(--primary-color);
    font-weight: 600;
    color: var(--secondary-color);
    width: 25%;
}

.wiki-table tr:hover {
    background: #f9f9f9;
}

.wiki-table ul {
    margin: 0;
    padding-left: 20px;
}

.wiki-table li {
    margin-bottom: 5px;
}

/* 图片单元格样式 - 桌面端 */
.image-cell {
    width: 30%;
    text-align: center;
    vertical-align: top;
    border-right: 1px solid #eee;
    background: #fafafa;
    padding: 20px;
}

.table-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* 图片包装器 */
.image-wrapper {
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0;
    box-sizing: border-box;
    position: relative;
}

/* 主图片样式 */
.wiki-main-image {
    max-width: 100%;
    max-height: 100%;
    width: 80%;
    height: 80%;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.image-wrapper:hover .wiki-main-image {
    transform: scale(1.02);
    transition: transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.image-title {
    margin-top: 0;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--accent-color);
    text-align: center;
    line-height: 1.3;
}

/* 图片简介样式 */
.image-introduction {
    font-size: 1rem;
    color: #666;
    line-height: 1.5;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    max-width: 100%;
    word-wrap: break-word;
}

/* 参考资料样式 */
.wiki-references {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.wiki-references h2 {
    color: var(--secondary-color);
    margin-top: 0;
}

.reference-list {
    list-style: none;
    padding: 0;
}

.reference-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.reference-list li:last-child {
    border-bottom: none;
}

.reference-list a {
    color: var(--accent-color);
    text-decoration: none;
}

.reference-list a:hover {
    text-decoration: underline;
}

/* 评论区域样式 */
.wiki-comments {
    margin-top: 40px;
}

.wiki-comments h2 {
    color: var(--secondary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.comment-form {
    margin: 20px 0;
}

.comment-input {
    width: 100%;
    height: 100px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
}

.btn-submit-comment {
    background: var(--accent-color);
    color: var(--light-color);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.btn-submit-comment:hover {
    background: var(--secondary-color);
}

/* Wiki列表样式 */
.wiki-list {
    margin-top: 30px;
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(4vw, 80px), 1fr));
    gap: 15px;
    justify-items: center;
}

.item-card {
    background: var(--light-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    width: min(4vw, 80px);
    min-width: 80px;
    display: flex;
    flex-direction: column;
}

.item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 图片容器 - 始终保持正方形，增大显示 */
.item-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 5px;
    box-sizing: border-box;
}

.item-image img {
    width: 95%;
    height: 95%;
    object-fit: contain;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.item-card:hover .item-image img {
    transform: scale(1.05);
}

/* 信息区域 - 增大字号 */
.item-info {
    padding: 8px 5px;
    text-align: center;
    min-height: 25px;
}

.item-info h3 {
    margin: 0;
    font-size: 12px;
    line-height: 1.3;
    font-weight: 600;
}

.item-info h3 a {
    color: var(--accent-color);
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-desc {
    display: none;
}

.no-items {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-items p {
    font-size: 18px;
    margin: 0;
}

/* 投票消息样式 */
.vote-message {
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: 500;
    text-align: center;
    animation: slideDown 0.3s ease;
}

.vote-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.vote-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.vote-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 按钮禁用状态 */
.wiki-actions button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wiki-actions button:disabled:hover {
    background: var(--light-color);
}

/* 投票按钮动画 */
.btn-support:active, .btn-oppose:active {
    transform: scale(0.95);
    transition: transform 0.1s;
}

/* ========== 手机端适配修改 ========== */

/* 手机端图片区域 - 放在最上方 */
.mobile-image-section {
    display: none;
    background: #fafafa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mobile-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.mobile-image-wrapper {
    width: 100%;
    max-width: 300px;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 0 auto;
}

.mobile-wiki-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.mobile-image-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color);
    text-align: center;
    line-height: 1.3;
}

.mobile-image-introduction {
    font-size: 1rem;
    color: #666;
    line-height: 1.5;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}


/* 手机端表格适配 - 改为竖向排列 */
@media (max-width: 768px) {
    .wiki-container {
        padding: 15px;
    }
    
    /* 隐藏桌面端图片单元格 */
    .image-cell {
        display: none;
    }
    
    /* 显示手机端图片区域 */
    .mobile-image-section {
        display: block;
    }
    
    /* 表格改为竖向排列 */
    .wiki-table {
        display: block;
        width: 100%;
    }
    
    .wiki-table thead,
    .wiki-table tbody,
    .wiki-table tr {
        display: block;
        width: 100%;
    }
    
    .wiki-table th,
    .wiki-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
        text-align: left;
    }
    
    .wiki-table th {
        background: var(--primary-color);
        font-weight: 600;
        color: var(--secondary-color);
        border-bottom: none;
        padding: 12px 15px;
    }
    
    .wiki-table td {
        padding: 12px 15px 20px;
        border-bottom: 1px solid #eee;
    }
    
    .wiki-table tr {
        margin-bottom: 0;
        border-bottom: 1px solid #eee;
    }
    
    .wiki-table tr:last-child {
        border-bottom: none;
    }
    
    /* 调整其他元素的手机端样式 */
    .wiki-title-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .wiki-title {
        font-size: 24px;
    }
    
    .wiki-actions {
        width: 100%;
        justify-content: center;
    }
    
    .wiki-meta {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group select {
        width: 100%;
    }
    
    .mobile-image-wrapper {
        height: 200px;
    }
    
    .mobile-image-title {
        font-size: 1.3rem;
    }
    
    .mobile-image-introduction {
        font-size: 0.9rem;
        padding: 12px;
    }
}

/* 小屏幕手机调整 */
@media (max-width: 480px) {
    .wiki-container {
        padding: 10px;
    }
    
    .wiki-title {
        font-size: 20px;
    }
    
    .mobile-image-wrapper {
        height: 180px;
    }
    
    .mobile-image-title {
        font-size: 1.2rem;
    }
    
    .mobile-wiki-image {
        max-height: 160px;
    }
    
    .wiki-table th,
    .wiki-table td {
        padding: 10px 12px;
    }
    
    .wiki-actions {
        flex-direction: column;
    }
    
    .wiki-actions button {
        width: 100%;
    }
}

/* 响应式断点 - 列表样式 */

/* 超小屏幕 (手机竖屏) */
@media (max-width: 375px) {
    .item-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
    }
    
    .item-card {
        width: 80px;
    }
    
    .item-info h3 {
        font-size: 11px;
    }
}

/* 小屏幕 (手机横屏/小平板) */
@media (min-width: 376px) and (max-width: 767px) {
    .item-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(5vw, 100px), 1fr));
        gap: 15px;
    }
    
    .item-card {
        width: min(5vw, 100px);
        min-width: 90px;
    }
    
    .item-info h3 {
        font-size: 12px;
    }
}

/* 中等屏幕 (平板) */
@media (min-width: 768px) and (max-width: 1023px) {
    .item-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(7vw, 140px), 1fr));
        gap: 20px;
    }
    
    .item-card {
        width: min(7vw, 140px);
        min-width: 120px;
    }
    
    .item-info {
        padding: 10px 8px;
    }
    
    .item-info h3 {
        font-size: 14px;
    }
    
    .item-desc {
        display: block;
        font-size: 11px;
        color: #666;
        line-height: 1.3;
        margin-bottom: 5px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* 大屏幕 (桌面) */
@media (min-width: 1024px) and (max-width: 1439px) {
    .item-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(9vw, 200px), 1fr));
        gap: 25px;
    }
    
    .item-card {
        width: min(9vw, 200px);
        min-width: 160px;
    }
    
    .item-info {
        padding: 12px 10px;
    }
    
    .item-info h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .item-desc {
        font-size: 12px;
        -webkit-line-clamp: 3;
        margin-bottom: 8px;
    }
}

/* 超大屏幕 */
@media (min-width: 1440px) {
    .item-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(10vw, 240px), 1fr));
        gap: 30px;
    }
    
    .item-card {
        width: min(10vw, 240px);
        min-width: 200px;
    }
    
    .item-info {
        padding: 15px 12px;
    }
    
    .item-info h3 {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .item-desc {
        font-size: 13px;
        -webkit-line-clamp: 3;
    }
}