/* css/common.css */
:root {
  --ricoh-red: #D20019;
  --black: #000000;
  --white: #FFFFFF;
  --gray-dark: #333333;
  --gray-medium: #888888;
  --gray-light: #F7F8FA;
  --gray-border: #EEEEEE;
  
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--gray-light);
  color: var(--black);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

button:focus, input:focus, select:focus, textarea:focus {
  outline: none;
}

/* 瀑布流容器 (Flex 双列实现) */
.waterfall-container {
  padding: 10px;
  display: flex;
  gap: 10px;
}

/* 列容器 */
.waterfall-col {
  flex: 1;
  min-width: 0;
}

/* 卡片样式 */
.waterfall-item {
  display: block;
  background-color: var(--white);
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: top 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  top: 0;
}

.waterfall-item:hover {
  top: -2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.waterfall-img-wrap {
  width: 100%;
  position: relative;
  overflow: hidden;
  background-color: #E0E0E0; /* 占位色 */
}

.waterfall-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

/* 分组标签 */
.group-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background-color: rgba(0, 0, 0, 0.6);
  color: var(--white);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  backdrop-filter: blur(2px);
}

.item-info {
  padding: 10px;
}

.item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--black);
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--gray-medium);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 4px;
}

.avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--gray-border);
  object-fit: cover;
}

/* 「我的作品」卡片专属：昵称和三按钮同一行，宽度不够时按钮组整体换行 */
.item-info.item-info-my-works .item-meta {
  flex-wrap: wrap;
  gap: 4px 4px;
  justify-content: flex-start;
}
.item-info.item-info-my-works .user-info {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}
.item-info.item-info-my-works .user-info .user-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}
.item-info.item-info-my-works .item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;         /* 不被压缩，宽度不够时整体换到下一行 */
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 6px;
  margin-left: auto;      /* 无论是否 wrap，按钮组都靠右 */
  font-size: 12px;
  color: var(--gray-medium);
}
.item-info.item-info-my-works .item-actions .like-btn {
  flex-shrink: 0;
  gap: 2px;
}
.item-info.item-info-my-works .item-actions .like-btn svg {
  width: 12px;
  height: 12px;
}
.item-info.item-info-my-works .avatar {
  flex-shrink: 0;
}

.like-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--gray-medium);
}

.like-btn.active {
  color: var(--ricoh-red);
}

.like-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* 表单公用样式 */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  color: var(--gray-dark);
  margin-bottom: 8px;
  font-weight: 500;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  font-size: 14px;
  background-color: var(--gray-light);
  transition: border-color 0.2s;
  font-family: var(--font-family); /* Ensure consistent font family */
  color: var(--black); /* Ensure consistent text color */
  box-sizing: border-box; /* Prevent text clipping */
  line-height: 1.5; /* Ensure enough height for text */
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px; /* Make room for the arrow */
}

.form-input::placeholder, .form-textarea::placeholder, .form-select:invalid {
  color: var(--gray-medium);
  font-family: var(--font-family);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--black);
  background-color: var(--white);
}

.btn-primary {
  display: block;
  width: 100%;
  padding: 14px;
  background-color: var(--ricoh-red);
  color: var(--white);
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  border-radius: 6px;
  letter-spacing: 1px;
}

.btn-primary:hover {
  background-color: #B20015;
}

.btn-outline {
  display: block;
  width: 100%;
  padding: 14px;
  background-color: transparent;
  color: var(--black);
  border: 1px solid var(--gray-border);
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  border-radius: 6px;
  margin-top: 10px;
}

/* 全局 Toast 提示动画 */
.global-toast {
  position: fixed;
  top: 50px;
  left: 50%;
  transform: translate(-50%, -20px);
  padding: 10px 24px;
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.global-toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.global-toast.toast-error {
  background-color: var(--ricoh-red);
}

/* 全局确认弹窗 */
.custom-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.custom-confirm-overlay.show {
  opacity: 1;
  visibility: visible;
}

.custom-confirm-modal {
  background-color: var(--white);
  width: 300px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-confirm-overlay.show .custom-confirm-modal {
  transform: scale(1);
}

.custom-confirm-text {
  padding: 30px 20px;
  text-align: center;
  font-size: 16px;
  color: var(--gray-dark);
  line-height: 1.5;
  border-bottom: 1px solid var(--gray-border);
  white-space: pre-wrap;
}

.custom-confirm-btns {
  display: flex;
}

.custom-confirm-btn {
  flex: 1;
  padding: 14px 0;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.custom-confirm-btn:active {
  background-color: var(--gray-light);
}

.custom-confirm-btn.cancel {
  color: var(--gray-medium);
  border-right: 1px solid var(--gray-border);
}

.custom-confirm-btn.confirm {
  color: var(--ricoh-red);
}
.fs-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.5); border-radius: 50%; cursor: pointer; z-index: 1000; transition: background 0.3s; }
.fs-nav-btn:hover { background: rgba(0,0,0,0.8); }
.fs-prev { left: 20px; }
.fs-next { right: 20px; }
@media (max-width: 768px) { .fs-nav-btn { width: 40px; height: 40px; } .fs-prev { left: 10px; } .fs-next { right: 10px; } }
/* 长按保存图片时隐藏左右箭头，避免被微信合成截图一起截进去。
   用 visibility:hidden 而非 opacity:0 —— opacity:0 的元素仍会被合成进截图位图，visibility:hidden 不参与绘制。 */
.mobile-modal.long-pressing .fs-nav-btn,
.mobile-modal.long-pressing .mobile-modal-close { visibility: hidden; pointer-events: none; }
