/* /var/www/html/bbs/style.css - 留言板样式 v2 */

/* ====== Base Layout ====== */
.bbs-wrap {
  max-width: 800px;
  margin: 0px auto;
  padding: 0 16px;
}

.bbs-form-card,
.bbs-list-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 24px;
  margin-bottom: 20px;
}

.bbs-section-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid #e8edf2;
}

/* ====== Two-Column Layout (standalone /bbs page) ====== */
.bbs-two-col .bbs-wrap {
  max-width: 1100px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.bbs-two-col .bbs-col-left {
  flex: 1;
  min-width: 0;
}

.bbs-two-col .bbs-col-right {
  flex: 0 0 360px;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.bbs-two-col .bbs-col-right .bbs-form-card {
  margin-bottom: 0;
}

.bbs-two-col .bbs-col-left .bbs-list-card {
  margin-bottom: 0;
}

/* ====== Form Styles ====== */
.bbs-form-group {
  margin-bottom: 16px;
}

.bbs-form-group label {
  display: block;
  font-size: 14px;
  color: #555;
  margin-bottom: 6px;
  font-weight: 500;
}

.bbs-form-group .required {
  color: #e74c3c;
}

.bbs-form-group input,
.bbs-form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  background: #fafbfc;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  font-family: inherit;
}

.bbs-form-group input:focus,
.bbs-form-group textarea:focus {
  outline: none;
  border-color: #4a90d9;
  box-shadow: 0 0 0 3px rgba(74,144,217,0.15);
  background: #fff;
}

.bbs-form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.bbs-char-count {
  text-align: right;
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.bbs-submit-btn {
  display: inline-block;
  padding: 10px 32px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.bbs-submit-btn:hover {
  opacity: 0.9;
}

.bbs-submit-btn:active {
  transform: scale(0.98);
}

.bbs-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bbs-hint {
  padding: 16px;
  background: #fff8e1;
  border-radius: 8px;
  color: #856404;
  font-size: 14px;
  text-align: center;
}

.bbs-hint a {
  color: #4a90d9;
  text-decoration: none;
  font-weight: 500;
}

.bbs-hint a:hover {
  text-decoration: underline;
}

.bbs-success {
  padding: 16px;
  background: #e8f5e9;
  border-radius: 8px;
  color: #2e7d32;
  font-size: 14px;
  text-align: center;
}

/* ====== Message List ====== */
.bbs-message {
  background: #fafbfc;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid #e8edf2;
  transition: box-shadow 0.2s;
}

.bbs-message:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.bbs-msg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.bbs-msg-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bbs-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.bbs-msg-username {
  font-weight: 600;
  color: #333;
  font-size: 15px;
}

.bbs-msg-time {
  font-size: 12px;
  color: #999;
}

.bbs-msg-subject {
  font-size: 13px;
  color: #667eea;
  background: #f0f3ff;
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.bbs-msg-content {
  font-size: 14px;
  color: #444;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ====== Nested Reply ====== */
.bbs-msg-reply {
  margin-top: 14px;
  margin-left: 24px;
  padding: 14px 16px;
  background: #f0f7ff;
  border-left: 3px solid #4a90d9;
  border-radius: 0 8px 8px 0;
}

.bbs-reply-label {
  font-size: 12px;
  color: #4a90d9;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.bbs-reply-content {
  font-size: 14px;
  color: #333;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.bbs-reply-time {
  font-size: 12px;
  color: #999;
  margin-top: 6px;
}

/* ====== Pagination ====== */
.bbs-pagination {
  text-align: center;
  margin-top: 20px;
}

.bbs-pagination button {
  padding: 6px 16px;
  margin: 0 4px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #fff;
  color: #555;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.bbs-pagination button:hover:not(:disabled) {
  background: #4a90d9;
  color: #fff;
  border-color: #4a90d9;
}

.bbs-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.bbs-pagination span {
  margin: 0 8px;
  font-size: 13px;
  color: #666;
}

/* ====== Empty / Loading ====== */
.bbs-empty {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 15px;
}

.bbs-loading {
  text-align: center;
  padding: 30px;
  color: #999;
  font-size: 14px;
}

/* ====== Embedded BBS Widget (single-col, for other modules) ====== */
.bbs-widget {
  margin-top: 0px;
}

.bbs-widget .bbs-form-card,
.bbs-widget .bbs-list-card {
  box-shadow: none;
  border: 1px solid #e8edf2;
}

.bbs-widget .bbs-wrap {
  max-width: 100%;
  padding: 0;
}

/* ====== Mobile Responsive ====== */
@media (max-width: 768px) {
  .bbs-two-col .bbs-wrap {
    flex-direction: column;
  }

  .bbs-two-col .bbs-col-left,
  .bbs-two-col .bbs-col-right {
    flex: 1 1 auto;
    width: 100%;
  }

  .bbs-two-col .bbs-col-right {
    position: static;
    flex: 0 0 auto;
    order: -1;
  }
}

@media (max-width: 600px) {
  .bbs-wrap {
    padding: 0 8px;
    margin: 10px auto;
  }

  .bbs-form-card,
  .bbs-list-card {
    padding: 16px;
  }

  .bbs-msg-reply {
    margin-left: 12px;
  }

  .bbs-msg-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

svg.icon {
  width: 16px;
  height: 16px;
}