:root {
  --md3-primary: #2196f3;
  --md3-secondary: #1769aa;
  --md3-bg: #f4f6fa;
  --md3-card-radius: 16px;
  --md3-shadow: 0 4px 24px rgba(33,150,243,0.13), 0 1.5px 4px 0 rgba(0,0,0,0.08);
  --md3-transition: cubic-bezier(.4,0,.2,1);
}
body {
  background: var(--md3-bg);
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
  color: #222;
}
.md3-card, .md3-modal, .md3-form, .md3-elevation {
  background: #fff;
  border-radius: var(--md3-card-radius);
  box-shadow: var(--md3-shadow);
  animation: md3-pop-in 0.5s var(--md3-transition);
}
@keyframes md3-pop-in {
  from { opacity: 0; transform: scale(0.96) translateY(40px);}
  to { opacity: 1; transform: scale(1) translateY(0);}
}
.md3-btn {
  background: var(--md3-primary);
  color: #fff;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
  overflow: hidden;
  border: none; /* 新增，去除黑边 */
  outline: none; /* 新增，去除聚焦黑边 */
}
.md3-btn:active { background: var(--md3-secondary);}
.md3-ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255,255,255,0.4);
  pointer-events: none;
  width: 100px;
  height: 100px;
  left: 50%;
  top: 50%;
  opacity: 0;
  transition: opacity 0.4s;
}
.md3-btn.md3-btn-anim .md3-ripple {
  animation: md3-ripple-anim 0.5s var(--md3-transition);
}
@keyframes md3-ripple-anim {
  from { opacity: 0.4; transform: scale(0); }
  60% { opacity: 0.25; transform: scale(1.2); }
  to { opacity: 0; transform: scale(1.8); }
}
.md3-form-group {
  position: relative;
  margin-bottom: 8px;
}
.md3-form-group input {
  padding: 16px 12px 8px 12px;
  border-radius: 8px;
  border: 1.5px solid #cfd8dc;
  font-size: 16px;
  outline: none;
  background: #f8fafc;
  transition: border 0.2s, box-shadow 0.2s;
  width: 100%;
  box-sizing: border-box;
}
.md3-form-group input:focus {
  border-color: var(--md3-primary);
  box-shadow: 0 0 0 2px #2196f333;
}
.md3-form-group label {
  position: absolute;
  left: 12px;
  top: 16px;
  color: #888;
  font-size: 16px;
  pointer-events: none;
  background: transparent;
  transition: all 0.18s var(--md3-transition);
  padding: 0 2px;
}
.md3-form-group input:focus + label,
.md3-form-group input:not(:placeholder-shown) + label {
  top: 3px;
  left: 10px;
  font-size: 13px;
  color: var(--md3-primary);
  background: #fff;
}
.md3-snackbar {
  min-width: 180px;
  max-width: 90vw;
  background: #222;
  color: #fff;
  border-radius: 8px;
  padding: 14px 24px;
  font-size: 15px;
  position: fixed;
  left: 50%;
  bottom: 38px;
  transform: translateX(-50%) translateY(40px);
  opacity: 0;
  z-index: 9999;
  box-shadow: var(--md3-shadow);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.md3-snackbar.md3-snackbar-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.md3-snackbar.md3-snackbar-error {
  background: #e53935;
}
.md3-snackbar.md3-snackbar-success {
  background: var(--md3-primary);
}
.md3-tab {
  display: inline-block;
  padding: 7px 22px;
  border-radius: 999px;
  background: #f0f4fa;
  color: var(--md3-secondary);
  font-size: 15px;
  font-weight: 500;
  margin: 0 2px;
  cursor: pointer;
  transition: background 0.2s;
  border: none;
}
.md3-tab.active {
  background: var(--md3-primary);
  color: #fff;
}
.md3-list-fadein {
  animation: md3-fade-in 0.5s var(--md3-transition);
}
@keyframes md3-fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
/* 保证加载更多区域始终可见且风格统一 */
.comment-load-more, .load-more {
  display: block;
  position: static;
  opacity: 1;
  background: none;
  color: #1769aa !important;
  border-radius: 0;
  padding: 12px 0 10px 0;
  font-size: 15px;
  line-height: 1.7;
  text-align: center;
  margin: 12px auto 0 auto;
  box-shadow: none;
  max-width: 98vw;
  pointer-events: auto;
  font-weight: 400;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.comment-load-more.md3-snackbar, .load-more.md3-snackbar {
  position: static;
  opacity: 1;
  left: unset;
  bottom: unset;
  transform: none;
  z-index: auto;
  box-shadow: none;
  pointer-events: auto;
  background: none;
  color: #1769aa !important;
}
.comment-load-more.error, .load-more.error {
  background: none;
  color: #1769aa !important;
  font-weight: 400;
}
.comment-load-more.success, .load-more.success {
  background: none;
  color: #1769aa !important;
  font-weight: 400;
}
.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 60px;
  z-index: 999;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--md3-primary) 60%, var(--md3-secondary) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(33,150,243,0.18), 0 1.5px 4px 0 rgba(0,0,0,0.10);
  font-size: 26px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  outline: none;
  opacity: 0.92;
  transition: box-shadow 0.18s, background 0.18s, opacity 0.18s, transform 0.18s;
  animation: backtotop-fadein 0.4s var(--md3-transition);
}
.back-to-top:hover {
  box-shadow: 0 8px 32px rgba(33,150,243,0.22), 0 2px 8px 0 rgba(0,0,0,0.13);
  opacity: 1;
  transform: translateY(-4px) scale(1.08);
  background: linear-gradient(135deg, var(--md3-secondary) 60%, var(--md3-primary) 100%);
}
@keyframes backtotop-fadein {
  from { opacity: 0; transform: scale(0.7) translateY(40px); }
  to { opacity: 0.92; transform: scale(1) translateY(0); }
}
.post-list .post-item {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(33,150,243,0.07), 0 1.5px 4px 0 rgba(0,0,0,0.06);
  margin: 5px 0;
  padding: 18px 18px 14px 18px;
  transition: box-shadow 0.18s, transform 0.18s;
}
.post-list .post-item:hover {
  box-shadow: 0 6px 24px rgba(33,150,243,0.13), 0 2px 8px 0 rgba(0,0,0,0.10);
  transform: translateY(-2px) scale(1.01);
}
@media (max-width: 700px) {
  .container.md3-card {
    margin: 18px 8px 18px 8px !important;
    padding: 16px 8px 18px 8px !important;
    border-radius: 14px !important;
    box-shadow: var(--md3-shadow);
  }
  .post-list .post-item {
    margin: 5px 0;
    padding: 14px 8px 12px 8px;
    border-radius: 12px;
  }
  .comment-modal.md3-modal {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    margin: 0 !important;
    width: 100vw !important;
    min-width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 18px 18px 0 0 !important;
    box-shadow: 0 -4px 24px rgba(33,150,243,0.13), 0 -1.5px 4px 0 rgba(0,0,0,0.08);
    animation: comment-modal-slideup 0.36s var(--md3-transition);
    z-index: 10001;
    max-height: 92vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    background: #fff;
    box-sizing: border-box;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .comment-modal .modal-body {
    width: 100vw;
    box-sizing: border-box;
    padding-bottom: env(safe-area-inset-bottom, 12px);
    overflow-y: auto;
    flex: 1 1 auto;
    background: #fff;
  }
  .comment-modal .modal-header {
    width: 100vw;
    box-sizing: border-box;
    padding: 14px 16px 8px 16px;
    border-radius: 18px 18px 0 0;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 2;
  }
  .comment-modal textarea.md3-textarea {
    min-height: 60px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
  }
  body, html {
    overscroll-behavior-y: contain;
    touch-action: manipulation;
  }
  @keyframes comment-modal-slideup {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  .modal-mask {
    position: fixed !important;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.18);
    z-index: 10000;
  }
}
