/**
 * Topic View Page Styles
 * Moved from views/topic/view.php
 */

/* 评论菜单样式 */
.comment-menu {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.comment-menu .menu-item {
  color: #999;
  margin-right: 15px;
  cursor: pointer;
}
.comment-menu .menu-item > svg,
.comment-menu .menu-item > span {
  vertical-align: middle;
}
.comment-menu .menu-item:hover {
  color: #333;
}
.comment-menu .menu-item.clicked {
  color: #e70606;
}
.comment-menu .menu-item.favorited {
  color: #ffa500;
}
.comment-menu .menu-item.favorited:hover {
  color: #ff8c00;
}
.comment-menu .menu-item .iconpark-icon {
  margin-right: 5px;
}

/* 热门评论标识 */
.hot-badge {
  display: inline-block;
  font-size: 16px;
  margin-right: 5px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.floor-link-wrapper {
  display: flex;
  align-items: center;
}

/* 评论编辑器样式 */
.comment-editor-wrapper{margin-top:20px}
.comment-editor-header{margin-bottom:10px}
.comment-editor-header h3{margin:0;font-size:16px;font-weight:600}
.comment-editor-body{margin-bottom:10px}
.comment-editor-footer{margin-top:10px;text-align:right}
.comment-editor-footer .submit-btn{padding:6px 16px;font-size:14px}
#comment-editor-body{background-color:var(--bg-sub-color);display:flex;flex-direction:column;border-radius:5px;box-shadow:0 0 3px rgba(0,0,0,0.3)}
#comment-editor-body #comment-cm-editor-wrapper{height:200px;width:100%;min-height:150px;max-height:50vh;overflow:hidden;flex-shrink:0}
#comment-editor-body .content-area{min-height:150px;max-height:50vh;border-top:1px solid rgba(0,0,0,0.1);border-bottom:1px solid rgba(0,0,0,0.1);overflow:hidden;display:flex;flex-direction:column;flex-shrink:0}
#comment-editor-body .content-area .form-group{margin-bottom:0;height:100%;flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column}
#comment-editor-body .content-area #comment-textarea{border:none;width:100%;height:100%;min-height:150px;max-height:100%;box-sizing:border-box;resize:none;line-height:1.5;padding:0.5rem;background:transparent;overflow-y:auto;flex:1}
#comment-editor-body .content-area #comment-textarea:hover{outline:#b4cdb9 1px solid}
#comment-editor-body .content-area #comment-textarea::-moz-placeholder{color:#ccc}
#comment-editor-body .content-area #comment-textarea::placeholder{color:#ccc}
#comment-editor-body .tab-select{display:flex;align-items:center;border-bottom:1px solid rgba(0,0,0,0.1);}
#comment-editor-body .tab-select .tab-option{font-size:14px;line-height:30px;height:30px;cursor:pointer;padding:0 10px}
.tab-select{color: #777;background-color: #f8f8f8;}
.dark-layout #comment-editor-body .mde-toolbar {background-color:var(--bg-sub-color);color: #aaa;} 
.dark-layout .mde-toolbar .toolbar-item {background-color:var(--bg-sub-color);color: #aaa;} 
#comment-editor-body .mde-toolbar{display:flex !important;align-items:center;padding:8px 12px;border-bottom:1px solid rgba(0,0,0,0.1);background:#f8f9fa;flex-wrap:wrap;gap:4px;width:100%;box-sizing:border-box}
#comment-editor-body .mde-toolbar[style*=display:none],#comment-editor-body .mde-toolbar[style*=display:none]{display:none !important;height:0 !important;padding:0 !important;border-bottom:none !important;overflow:hidden !important;visibility:hidden !important}
#comment-editor-body .expression{display:flex;align-items:center;padding:0 5px;height:30px;background-color:#f8f8f8;border-bottom:1px solid rgba(0,0,0,0.05)}
#comment-editor-body .expression .exp-item{padding:0 5px;cursor:pointer;transition:all 0.3s;pointer-events:auto !important;position:relative;z-index:10;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}
#comment-editor-body .expression .exp-item:hover{transform:scale(1.1)}
#comment-editor-body .expression .exp-item.current-group{transform:scale(1.2)}
#comment-editor-body .exp-container{max-height:0;box-sizing:border-box;padding:0 10px;width:100%;display:flex;justify-content:space-around;align-items:center;flex-wrap:wrap;justify-items:flex-start;overflow:hidden;transition:max-height 0.5s}
#comment-editor-body .exp-container.open{padding:10px;display:flex;max-height:280px;overflow:auto}
#comment-form .help-block,#comment-form .help-block-error{color:#dc3545;font-size:14px;margin-top:5px;display:block}

.dark-layout .pagination .page-link{background-color:var(--bg-sub-color);border-color:var(--fade-color);color:var(--link-color)}
.dark-layout .pagination .page-link:hover{background-color:var(--bg-main-color);border-color:var(--main-color);color:var(--link-hover-color)}
.dark-layout .pagination .page-item.active .page-link,.dark-layout .pagination .sf-btn{background-color:var(--main-color);border-color:var(--main-color);color:#fff}
.dark-layout .pagination .page-item.active .page-link:hover,.dark-layout .pagination .sf-btn:hover{background-color:var(--sub-color);border-color:var(--sub-color);color:#fff}
.dark-layout .pagination .page-item.disabled .page-link{background-color:var(--bg-sub-color);border-color:var(--fade-color);color:var(--gray-color);opacity:0.5}

/* ========================
   Markdown 扩展语法样式
   ======================== */

/* ---- 高亮标记 ---- */
mark {
    background: #fff59d;
    color: #333;
    padding: 1px 4px;
    border-radius: 3px;
}
.dark-layout mark {
    background: #594f00;
    color: #fff9c4;
}

/* ---- 上标 / 下标 ---- */
sup, sub {
    font-size: 0.85em;
    line-height: 1;
}
sup {
    vertical-align: super;
    position: relative;
    top: -0.4em;
}
sub {
    vertical-align: sub;
    position: relative;
    bottom: -0.3em;
}

/* ---- 键盘按键 ---- */
kbd {
    display: inline-block;
    font-family: 'SF Mono', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
    font-size: 0.85em;
    font-weight: 600;
    color: #333;
    background: #f4f4f4;
    border: 1px solid #ccc;
    border-bottom-width: 3px;
    border-radius: 4px;
    padding: 1px 7px;
    line-height: 1.4;
    white-space: nowrap;
    vertical-align: baseline;
    margin: 0 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.dark-layout kbd {
    background: #2d2d2d;
    border-color: #555;
    color: #e0e0e0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* ---- 居中对齐 ---- */
.content-area div[style*="text-align:center"] {
    margin: 0.8em auto;
    text-align: center;
}

/* ---- 剧透 / 隐藏内容 ---- */
.spoiler {
    display: inline;
    background: #2d2d2d;
    color: #2d2d2d;
    border-radius: 4px;
    padding: 1px 5px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    user-select: none;
}
.spoiler:hover,
.spoiler:focus {
    background: #404040;
    color: #fff;
    outline: none;
}
.spoiler.revealed {
    background: #4a4a4a;
    color: #e0e0e0;
    cursor: default;
}

/* ---- 任务列表样式 ---- */
.task-list {
    list-style: none;
    padding-left: 0;
}
.task-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.3em;
}
.task-checkbox-wrapper {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: 8px;
    cursor: pointer;
}
.task-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #aaa;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin: 0;
    flex-shrink: 0;
}
.dark-layout .task-checkbox {
    background: var(--bg-sub-color);
    border-color: #666;
}
.task-checkbox:checked {
    background: var(--main-color, #2ea44f);
    border-color: var(--main-color, #2ea44f);
}
.task-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 4px;
    width: 4px;
    height: 8px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}
.task-checkbox:disabled {
    cursor: default;
    opacity: 0.6;
}
.task-content {
    flex: 1;
    min-width: 0;
}
.task-done .task-content {
    text-decoration: line-through;
    color: #999;
}
.dark-layout .task-done .task-content {
    color: #666;
}
