/* Bits Draft - Minimalist Black/White Design */
.bb-container {
  max-width: 100%;;
  margin: 0 auto;
  background: #ffffff;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* Header */
.bb-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.98);
  padding: 16px 20px;
  border-bottom: none;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e5e5;
}

.bb-title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  color: #000000;
  letter-spacing: -0.3px;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-box {
  display: flex;
  background: #f8f9fa;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.search-box:focus-within {
  border-color: #000000;
}

.search-box input {
  background: transparent;
  border: none;
  padding: 6px 10px;
  color: #000000;
  outline: none;
  font-size: 14px;
  width: 140px;
}

.search-box button {
  background: transparent;
  border: none;
  padding: 6px 10px;
  color: #666666;
  cursor: pointer;
  font-size: 13px;
  transition: color 0.2s;
}

.search-box button:hover {
  color: #000000;
}

.create-post-btn {
  background: #000000;
  border: none;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  white-space: nowrap;
  transition: background 0.2s;
}

.create-post-btn:hover {
  background: #333333;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1000;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e5e5;
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.close-modal,
.template-close-modal {
  cursor: pointer;
  font-size: 20px;
  color: #666666;
  background: none;
  border: none;
  padding: 0;
  transition: color 0.2s;
}

.close-modal:hover,
.template-close-modal:hover {
  color: #000000;
}

.modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.post-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  resize: vertical;
  font-size: 14px;
  line-height: 1.6;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.post-form textarea:focus {
  border-color: #000000;
}

.post-options {
  margin-top: 16px;
}

.form-row {
  margin-bottom: 12px;
}

.form-row label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 13px;
}

.form-row input[type="text"],
.form-row input[type="datetime-local"],
.form-row textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-row input:focus,
.form-row textarea:focus {
  border-color: #000000;
}

.avatar-set {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
}

.avatar-option {
  display: flex;
  align-items: center;
  gap: 6px;
}

.time-option {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.time-option input[type="radio"] {
  margin-right: 6px;
}

.modal-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid #e5e5e5;
  background: #fafafa;
}

.modal-tip {
  margin: 0;
  font-size: 12px;
  color: #888888;
  text-align: center;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.btn-cancel,
.btn-submit {
  padding: 8px 16px;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  background: #ffffff;
  color: #000000;
  transition: all 0.2s;
}

.btn-cancel:hover {
  background: #f5f5f5;
}

.btn-submit {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

.btn-submit:hover {
  background: #333333;
}

.template-output {
  background: #f8f9fa;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  padding: 12px;
  font-family: "Courier New", monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
}

/* BB Intro */
.bb-intro {
  padding: 2px 20px;
  border-bottom: none;
  color: #666666;
  font-size: 14px;
  line-height: 1.6;
}

/* Main Content */
.bb-main {
  padding: 0 20px 20px;
}
.bb-post:first-child {
  padding-top: 0px;
}

.post-feed {
  display: flex;
  flex-direction: column;
}

/* Post Card */
.bb-post {
  border-bottom: 1px solid #e5e5e5;
  padding: 16px 0;
  transition: background 0.2s;
}

.bb-post:last-child {
  border-bottom: none;
}

.bb-post:hover {
  background: #fafafa;
}

.bb-post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.bb-post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 500;
  font-size: 14px;
  overflow: hidden;
  flex-shrink: 0;
}

.bb-post-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bb-avatar-text {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bb-post-author {
  font-weight: 500;
  color: #000000;
  font-size: 14px;
  letter-spacing: -0.2px;
}

.bb-post-body {
  padding-left: 46px;
}

.bb-post-body > * {
  margin-top: 0;
  margin-bottom: 0;
}

.bb-post-content {
  color: #000000;
  line-height: 1.65;
  font-size: 16px;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 0;
}

/* 移除 Hugo 生成的 p 标签默认间距 */
.bb-post-content p {
  margin: 0;
  padding: 0;
}

.bb-post-content p + p {
  margin-top: 0.8em;
}

.bb-post-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 8px;
  margin-bottom: 0;
}

.bb-post-image {
  margin: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  background: #f5f5f5;
}

.bb-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s;
}

.bb-post-image img:hover {
  transform: scale(1.05);
}

.bb-post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #999999;
  padding-left: 46px;
  margin-top: 0px;
}

.bb-post-meta-left {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.bb-post-meta-right {
  flex-shrink: 0;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999999;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state h3 {
  margin: 0 0 6px 0;
  color: #333333;
  font-weight: 400;
  font-size: 16px;
}

.empty-state p {
  margin: 0;
  font-size: 13px;
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 10px;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .search-box input {
    width: 100px;
  }

  .bb-post-body {
    padding-left: 0;
  }

  .bb-post-footer {
    padding-left: 0;
  }

  .bb-post-images {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .create-post-btn span:last-child {
    display: none;
  }

  .bb-post-images {
    grid-template-columns: 1fr;
  }

  .bb-post-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}
