/* ================================================================
   Native Comment System — Mobile First
   blog.52131488.xyz
================================================================ */

/* ── 区块包裹 ── */
.nc-section {
  margin-top: 0;
}
.nc-wrap {
  width: 100%;
  box-sizing: border-box;
}

/* ════════════════════════════════════
   评论列表
════════════════════════════════════ */
.nc-list-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}
.nc-list-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  color: #3d4a5c;
  font-family: 'Montserrat', sans-serif;
}
.nc-list-title svg { color: #4a90d9; flex-shrink: 0; }

.nc-list { margin-bottom: 24px; }

.nc-item {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid #eef1f5;
}
.nc-item:first-child { border-top: 1px solid #eef1f5; }

.nc-avatar { flex-shrink: 0; }
.nc-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #e8edf3;
  object-fit: cover;
  display: block;
}

.nc-body { flex: 1; min-width: 0; }

.nc-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.nc-name {
  font-weight: 700;
  font-size: 13px;
  color: #2d3748;
}
.nc-name a { color: #4a90d9; text-decoration: none; }
.nc-name a:hover { text-decoration: underline; }
.nc-date { font-size: 11px; color: #a0aec0; }
.nc-reply-btn {
  font-size: 11px;
  color: #4a90d9;
  text-decoration: none;
  padding: 2px 7px;
  border: 1px solid #c3daf5;
  border-radius: 10px;
  transition: all 0.18s;
  margin-left: auto;
}
.nc-reply-btn:hover { background: #4a90d9; color: #fff; border-color: #4a90d9; }

.nc-content {
  font-size: 14px;
  color: #4a5568;
  line-height: 1.75;
  word-break: break-word;
}
.nc-content a { color: #4a90d9; text-decoration: underline; }

/* ════════════════════════════════════
   表单外框
════════════════════════════════════ */
.nc-form-wrap {
  background: #f7f9fc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px 16px 20px;
  box-sizing: border-box;
  overflow: hidden;       /* 防止内部元素溢出圆角边框 */
  width: 100%;
  max-width: 100%;
}

@media (min-width: 600px) {
  .nc-form-wrap { padding: 26px 24px; }
}

.nc-form-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #2d3748;
  font-family: 'Montserrat', sans-serif;
  margin-bottom: 18px;
}
.nc-form-title svg { color: #4a90d9; }

/* ── 提示框 ── */
.nc-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.6;
}
.nc-alert svg { flex-shrink: 0; margin-top: 2px; }
.nc-alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.nc-alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ════════════════════════════════════
   表单布局 — 移动优先，全宽堆叠
════════════════════════════════════ */
.nc-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 桌面端：部分字段并排 */
@media (min-width: 600px) {
  .nc-form { flex-direction: row; flex-wrap: wrap; }
  .nc-field-full  { width: 100%; }
  .nc-field-half  { width: calc(50% - 7px); }
  .nc-field-third { width: calc(33.333% - 10px); }
  .nc-field-group { /* column by default */ }
}

/* 移动端：所有字段全宽 */
.nc-field-group {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.nc-label {
  font-size: 13px;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 5px;
}
.nc-required { color: #e53e3e; margin-left: 2px; }

/* ── Textarea ── */
.nc-textarea {
  width: 100%;
  border: 1px solid #d2d8e3;
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 15px;      /* 手机 ≥15px 防止自动缩放 */
  color: #2d3748;
  line-height: 1.65;
  resize: vertical;
  min-height: 110px;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  background: #fff;
  box-sizing: border-box;
  -webkit-appearance: none;
}
.nc-textarea:focus {
  outline: none;
  border-color: #4a90d9;
  box-shadow: 0 0 0 3px rgba(74,144,217,0.12);
}
.nc-textarea::placeholder { color: #b0bec5; }

/* ── Textarea 底栏（表情按钮 + 字符计数） ── */
.nc-textarea-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
  position: relative;
}
.nc-emoji-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #718096;
  cursor: pointer;
  padding: 5px 12px;
  border: 1px solid #dde3ed;
  border-radius: 16px;
  background: #fff;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.18s, color 0.18s;
}
.nc-emoji-btn:hover,
.nc-emoji-btn:active { border-color: #4a90d9; color: #4a90d9; }

.nc-char-count { font-size: 12px; color: #a0aec0; }

/* ── Emoji 面板：默认隐藏，点击后展开 ── */
.nc-emoji-panel {
  display: none;          /* 默认完全隐藏 */
  flex-wrap: wrap;
  gap: 2px;
  padding: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 100;
  max-height: 160px;
  overflow-y: auto;
}
.nc-emoji-panel.is-open { display: flex; }  /* JS 控制 */

.nc-emoji {
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
}
.nc-emoji:hover,
.nc-emoji:active { background: #f0f4ff; }

/* ── 验证码行 ── */
.nc-captcha-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;        /* 允许换行，防止溢出 */
  width: 100%;
  box-sizing: border-box;
}
.nc-captcha-img {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, #eef3fd, #ddeafb);
  border: 1px solid #c3daf5;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 16px;
  font-weight: 800;
  font-family: 'Courier New', monospace;
  color: #1a56db;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;         /* 算式不换行 */
}
.nc-captcha-op { color: #4a90d9; }
.nc-captcha-q  { color: #e53e3e; font-style: italic; }
.nc-captcha-input {
  flex: 1 1 80px;         /* 自动伸缩，最小80px */
  max-width: 140px;       /* 桌面不过宽 */
  min-width: 0;
  box-sizing: border-box;
}

/* ── 验证码 + 私密评论：两列布局，移动端堆叠 ── */
.nc-captcha-private-wrap {
  display: flex;
  flex-direction: column;   /* 移动端：上下堆叠 */
  gap: 10px;
  width: 100%;
}

@media (min-width: 480px) {
  .nc-captcha-private-wrap {
    flex-direction: row;    /* 480px+ 以上：左右并排 */
    align-items: flex-end;
    gap: 16px;
  }
}

/* 验证码列：自适应宽度，严格不溢出 */
.nc-captcha-col {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;       /* 兜底，防止子元素撑出 */
  box-sizing: border-box;
}

/* 私密评论列：固定宽度，不被压缩 */
.nc-private-col {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

/* label 占位（桌面对齐用） */
.nc-label-spacer {
  visibility: hidden;
  margin-bottom: 5px;
}

/* 移动端隐藏占位 label */
@media (max-width: 479px) {
  .nc-label-spacer { display: none; }
}

.nc-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: #718096;
  -webkit-tap-highlight-color: transparent;
}
.nc-switch-input { display: none; }
.nc-switch-track {
  width: 38px;
  height: 22px;
  background: #cbd5e0;
  border-radius: 11px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.nc-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.nc-switch-input:checked ~ .nc-switch-track { background: #4a90d9; }
.nc-switch-input:checked ~ .nc-switch-track .nc-switch-thumb { transform: translateX(16px); }

/* ── 姓名 / 邮箱 / 网址输入框 ── */
.nc-input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}
.nc-input {
  width: 100%;
  border: 1px solid #d2d8e3;
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 15px;      /* ≥15px 防止 iOS 自动缩放 */
  color: #2d3748;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  background: #fff;
  box-sizing: border-box;
  -webkit-appearance: none;
}
.nc-input:focus {
  outline: none;
  border-color: #4a90d9;
  box-shadow: 0 0 0 3px rgba(74,144,217,0.12);
}
.nc-input::placeholder { color: #b0bec5; }

/* 姓名字段左侧头像图标 */
.nc-input-avatar {
  position: absolute;
  left: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
  z-index: 1;
}
.nc-has-avatar .nc-input { padding-left: 40px; }

/* 骰子图标 */
.nc-input-icon {
  position: absolute;
  right: 10px;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.55;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.nc-input-icon:hover { opacity: 1; }

/* ── 提交按钮 ── */
.nc-submit-row {
  width: 100%;
}
.nc-btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #4a90d9, #2c6fad);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(74,144,217,0.3);
  letter-spacing: 0.3px;
  -webkit-tap-highlight-color: transparent;
  width: 100%;          /* 移动端全宽 */
}
@media (min-width: 600px) {
  .nc-btn-submit { width: auto; }
}
.nc-btn-submit:hover  { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(74,144,217,0.4); }
.nc-btn-submit:active { transform: translateY(0); }
