:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --card-soft: #f8fafc;
  --text: #16202d;
  --muted: #6d7a89;
  --line: #e8edf4;
  --primary: #3b82f6;
  --primary-soft: #e8f1ff;
  --azure: #00a6ff;
  --azure-soft: #e8f8ff;
  --green: #1bb56d;
  --green-soft: #eafaf2;
  --orange: #ff9f1a;
  --orange-soft: #fff5e8;
  --red: #f05263;
  --red-soft: #fff0f3;
  --purple: #7c5cff;
  --purple-soft: #f3efff;
  --shadow: 0 12px 34px rgba(43, 67, 102, .07);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: linear-gradient(180deg, #f7f8fb 0%, #eff3f8 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }

.page-shell {
  max-width: 1160px;
  margin: 0 auto;
  padding: 16px 14px 34px;
}

.card {
  background: var(--card);
  border: 1px solid rgba(229, 236, 245, .95);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.panel { padding: 18px; }
.compact-panel { padding: 16px; }

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.brand-wrap { min-width: 0; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  font-weight: 800;
}
.brand-mark {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #eef5ff, #e8fbff);
}
.brand-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(227, 235, 246, .95);
  box-shadow: 0 6px 14px rgba(38, 64, 101, .05);
}
.nav-home { background: #f4f7fb; color: #41566f; }
.nav-upload { background: var(--azure-soft); color: #1671df; }
.nav-panel { background: var(--purple-soft); color: #6847dd; }
.nav-profile { background: #eefcf5; color: #138c58; }
.nav-message { background: #eef7ff; color: #2e73da; }
.nav-login { background: #fff5eb; color: #d56d00; }
.nav-register { background: #edf4ff; color: #236cda; }
.nav-logout { background: #fff1f4; color: #d13b57; }
.nav-chip:hover { transform: translateY(-1px); }

.flash {
  padding: 12px 14px;
  margin-bottom: 14px;
  border-left: 4px solid transparent;
  font-size: 14px;
}
.flash-success { border-left-color: var(--green); }
.flash-error { border-left-color: var(--red); }
.flash-info { border-left-color: var(--primary); }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.section-title {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 800;
}
.section-title-sm {
  font-size: 17px;
  margin-bottom: 0;
}
.subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}
.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 14px;
}
.main-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 14px;
}
.compact-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.detail-single {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}
.compact-home-toolbar { margin-bottom: 14px; }
.search-box {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}
.search-box .input,
.search-box select {
  flex: 1;
  min-width: 140px;
}
.compact-search { align-items: center; }

.input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  background: #fbfcfe;
  outline: none;
  transition: .18s ease;
}
.input:focus,
textarea:focus,
select:focus {
  border-color: #b7d4ff;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .10);
}
textarea {
  min-height: 120px;
  resize: vertical;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-row { margin-bottom: 12px; }
label {
  display: block;
  margin-bottom: 7px;
  font-weight: 800;
  font-size: 14px;
}
.hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}
.is-hidden { display: none !important; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  border-radius: 999px;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 700;
  transition: transform .15s ease, opacity .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: 8px 12px; font-size: 12px; }
.btn-xs { padding: 7px 11px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, #4a8fff, #27b6ff);
  color: #fff;
  box-shadow: 0 10px 18px rgba(39, 126, 255, .18);
}
.btn-soft { background: #f3f7fd; color: #2f69c5; }
.btn-success { background: var(--green-soft); color: #118c56; }
.btn-danger { background: var(--red-soft); color: #d83d58; }
.btn-warning { background: var(--orange-soft); color: #d27b00; }
.btn-azure { background: var(--azure-soft); color: #0873d8; }

.badge, .role-badge, .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.badge-official { background: #edf4ff; color: #256fd4; }
.badge-admin { background: #f3efff; color: #7443df; }
.badge-user { background: #eafaf2; color: #148c58; }
.status-pill.pending { background: #fff5e8; color: #bb771b; }
.status-pill.approved { background: #eafaf2; color: #14915a; }
.status-pill.rejected { background: #fff0f2; color: #cc435e; }

.resource-card {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.compact-card { min-height: 0; }
.resource-top {
  display: flex;
  gap: 12px;
  align-items: center;
}
.compact-top { align-items: flex-start; }
.app-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  object-fit: cover;
  background: #eef3f8;
  border: 1px solid #edf2f7;
  flex: 0 0 auto;
}
.detail-icon {
  width: 74px;
  height: 74px;
  border-radius: 20px;
}
.app-meta { min-width: 0; }
.app-meta h3 {
  margin: 0 0 5px;
  font-size: 17px;
  line-height: 1.3;
}
.detail-title {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
}
.inline-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.meta-row { margin-bottom: 6px; }
.app-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}
.compact-stats { gap: 6px; }
.meta-chip {
  padding: 5px 9px;
  background: #f6f8fb;
  border-radius: 999px;
  border: 1px solid #edf1f6;
  font-size: 11px;
  font-weight: 700;
}
.desc {
  color: #445466;
  line-height: 1.65;
  background: #fafbfd;
  border-radius: 14px;
  padding: 12px;
  font-size: 14px;
}
.compact-desc {
  padding: 10px 12px;
  font-size: 13px;
}
.detail-text {
  margin-top: 0;
  color: #415164;
  line-height: 1.75;
  font-size: 13px;
}
.resource-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}
.compact-actions { margin-top: 2px; }
.sidebar-card { padding: 18px; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 14px;
}
th {
  color: #607081;
  font-size: 12px;
  white-space: nowrap;
}
.empty {
  padding: 22px;
  text-align: center;
  color: var(--muted);
}
.comment-empty {
  background: #fafbfd;
  border-radius: 14px;
  padding: 14px;
}

.hero {
  padding: 18px;
  margin-bottom: 14px;
}
.hero h1 { margin: 0 0 8px; font-size: 24px; }
.hero p { margin: 0; color: var(--muted); line-height: 1.65; }

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tabs a {
  padding: 9px 13px;
  border-radius: 999px;
  background: #f4f7fb;
  color: #4c627b;
  font-weight: 700;
  font-size: 13px;
}
.tabs a.active {
  background: linear-gradient(135deg, #e8f1ff, #eff8ff);
  color: #256fd4;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: #eef3f8;
}
.avatar-sm {
  width: 32px;
  height: 32px;
}
.profile-box {
  display: flex;
  gap: 16px;
  align-items: center;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.kpi { padding: 16px; }
.kpi strong {
  display: block;
  font-size: 24px;
  margin-top: 6px;
}

.detail-card { overflow: hidden; }
.interaction-panel { overflow: hidden; }
.detail-hero-card,
.detail-actions-panel,
.comment-panel { position: relative; }
.interaction-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.heart-toggle {
  min-width: 88px;
  height: 42px;
  padding: 0 15px;
  border: 1px solid #ffd2db;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff8fa, #fff1f4);
  color: #d94b67;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(240, 82, 99, .12);
}
.heart-toggle.liked {
  background: linear-gradient(180deg, #ffeff3, #ffe4eb);
  border-color: #ffb9c6;
  color: #ef3f59;
  box-shadow: 0 12px 24px rgba(239, 63, 89, .18);
}
.heart-glyph {
  font-size: 18px;
  line-height: 1;
  color: currentColor;
}
.star-rate-form {
  display: block;
}
.star-rate-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.star-rate {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 4px;
  white-space: nowrap;
}
.star-rate input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.star-rate label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  color: #ffd565;
  background: #fff9e8;
  border: 1px solid #ffe3a3;
  border-radius: 12px;
  transition: .15s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.star-rate label:hover,
.star-rate label:hover ~ label,
.star-rate input:checked ~ label {
  color: #ffb11b;
  background: linear-gradient(180deg, #fff7cf, #ffe99a);
  border-color: #ffd05a;
}
.stars {
  color: #ffb11b;
  font-size: 18px;
  letter-spacing: 1px;
}

.screenshot-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-top: 14px;
}
.compact-strip img,
.screenshot-strip img {
  width: auto;
  height: auto;
  max-width: min(88vw, 520px);
  max-height: 280px;
  border-radius: 16px;
  object-fit: contain;
  border: 1px solid #edf1f7;
  background: #f8fbff;
  padding: 4px;
  flex: 0 0 auto;
  box-shadow: 0 8px 18px rgba(40, 63, 96, .06);
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.compact-comment-list { gap: 10px; }
.comment-item {
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  border: 1px solid #e8eef7;
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 10px 20px rgba(40, 63, 96, .05);
}
.compact-comment { padding: 12px; }
.comment-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.comment-user {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.comment-user-meta {
  min-width: 0;
}
.comment-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.comment-body {
  line-height: 1.7;
  color: #425265;
  font-size: 13px;
}
.reply-form-inline {
  margin-top: 10px;
}
.comment-composer {
  margin-top: 12px;
}
.comment-input-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  border: 1px solid #dbe8fb;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 8px 18px rgba(41, 87, 150, .05);
}
.comment-input-pill input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  padding: 4px 0;
  font-size: 13px;
}
.comment-input-pill.mini {
  padding: 6px 7px 6px 12px;
}
.send-btn {
  width: 42px;
  height: 42px;
  border: 1px solid #7fc1ff;
  border-radius: 50%;
  background: linear-gradient(135deg, #4090ff, #20b4ff);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 12px 20px rgba(48, 136, 255, .22);
}
.send-btn-mini {
  width: 34px;
  height: 34px;
  font-size: 14px;
}
.login-tip {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}
.login-tip a { color: #256fd4; }

.file-type-switch {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.radio-pill {
  background: #f6f8fb;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid #ecf0f4;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.footer {
  text-align: center;
  padding: 26px 12px 8px;
  font-size: 13px;
}

@media (max-width: 980px) {
  .grid-2 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
  .nav-links { justify-content: flex-start; }
  .form-grid,
  .kpi-grid { grid-template-columns: 1fr; }
  .resource-top { align-items: flex-start; }
  .search-box .input,
  .search-box select { min-width: 100%; }
  .interaction-row,
  .section-row { align-items: flex-start; }
  .detail-title { font-size: 22px; }
}


.chip-blue { background: #eef5ff; color: #2c74e6; border-color: #dbe9ff; }
.chip-purple { background: #f3efff; color: #7650e8; border-color: #e3dafd; }
.chip-orange { background: #fff4e5; color: #d7840e; border-color: #ffe3bd; }

.detail-hero-top {
  align-items: flex-start;
  gap: 14px;
}
.detail-meta-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.detail-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.detail-mini-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.mini-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f7faff;
  border: 1px solid #e4edf8;
  color: #57677a;
  font-size: 11px;
}
.mini-meta strong {
  color: #243548;
  font-size: 11px;
}
.mini-label {
  color: #89a;
}
.detail-desc-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff, #f6f9fe);
  border: 1px solid #e7eef8;
}
.detail-subhead {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #edf4ff;
  border: 1px solid #dbe8ff;
  color: #2a72dd;
  font-size: 11px;
  font-weight: 800;
}
.detail-subhead-space {
  margin-top: 12px;
}
.detail-shot-strip {
  margin-top: 2px;
}
.action-stat-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid transparent;
}
.stat-download { background: #eef6ff; color: #2c74e6; border-color: #d9e8ff; }
.stat-view { background: #f4f6fa; color: #66788d; border-color: #e7edf5; }
.stat-comment { background: #eefbf5; color: #16915c; border-color: #d9f4e6; }
.action-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.action-main-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(39, 126, 255, .14);
}
.action-download {
  color: #fff;
  background: linear-gradient(135deg, #4a8fff, #27b6ff);
  border-color: rgba(255,255,255,.25);
}
.action-ico {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  font-size: 12px;
}
.fancy-heart {
  font-size: 13px;
}
.rate-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid #eceff6;
  background: linear-gradient(180deg, #fffdf7, #ffffff);
}
.rate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.rate-title {
  font-size: 13px;
  font-weight: 800;
  color: #2a3645;
}
.rate-summary {
  font-size: 12px;
  color: #7b8797;
}
.mini-login-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 13px;
  border-radius: 12px;
  background: #f5f8fd;
  border: 1px solid #e5edf8;
  color: #53708e;
  font-size: 12px;
  font-weight: 700;
}
.comment-total-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f4f7fb;
  border: 1px solid #e8eef5;
  color: #66788d;
  font-size: 11px;
  font-weight: 800;
}
.fancy-empty {
  background: linear-gradient(180deg, #fbfcfe, #f6f9fd);
  border: 1px dashed #dbe6f5;
  color: #7c8797;
}
.comment-head {
  margin-bottom: 10px;
}
.reply-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef5ff;
  border: 1px solid #dce9ff;
  color: #2b73dd;
  font-size: 10px;
  font-weight: 800;
}
.comment-bubble {
  position: relative;
  margin-left: 40px;
  padding: 10px 12px;
  border-radius: 16px 16px 16px 6px;
  background: linear-gradient(180deg, #f9fbff, #f4f8ff);
  border: 1px solid #e1ebfa;
}
.comment-bubble::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 14px;
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  background: #f6f9ff;
  border-left: 1px solid #e1ebfa;
  border-bottom: 1px solid #e1ebfa;
}
.reply-form-inline {
  margin-top: 10px;
  margin-left: 40px;
}
.comment-pill-main {
  margin-top: 14px;
}
.comment-input-pill.mini {
  padding: 6px 6px 6px 12px;
  border-radius: 16px;
}
.send-btn-mini {
  width: 34px;
  height: 34px;
  font-size: 13px;
}
.detail-action-head {
  margin-bottom: 10px;
}
@media (max-width: 760px) {
  .detail-title { font-size: 18px; }
  .detail-icon {
    width: 68px;
    height: 68px;
  }
  .comment-bubble,
  .reply-form-inline {
    margin-left: 0;
  }
  .action-main-row,
  .rate-head,
  .detail-title-row,
  .detail-mini-list {
    align-items: flex-start;
  }
  .star-rate label {
    width: 32px;
    height: 32px;
    font-size: 22px;
  }
}


/* ===== v4 comment like + reply toggle + star rating polish ===== */
.action-main-row form,
.comment-tool-row form {
  margin: 0;
}
.heart-toggle {
  min-width: 74px;
  height: 42px;
  padding: 0 14px;
  border-radius: 14px;
}
.heart-glyph {
  font-size: 17px;
  font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
}
.star-rate-form { display:block; }
.star-rate-wrap {
  align-items: center;
}
.star-rate-btns {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.star-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #e4e9f0;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfcfe, #f3f6fa);
  color: #c6ced9;
  font-size: 23px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
  transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.star-btn:hover { transform: translateY(-1px); }
.star-btn.active {
  color: #ffbf2f;
  border-color: #ffd67c;
  background: linear-gradient(180deg, #fff9dc, #ffefae);
  box-shadow: 0 8px 18px rgba(255, 191, 47, .18);
}
.star-btn:not(.active):hover {
  color: #ffbf2f;
  border-color: #ffd67c;
  background: linear-gradient(180deg, #fff9dc, #ffefae);
}
.comment-item {
  overflow: hidden;
}
.comment-tool-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  margin-left: 40px;
  flex-wrap: wrap;
}
.comment-like-btn {
  min-width: 52px;
  padding: 7px 10px 8px;
  border: 1px solid #ffd4dc;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff9fb, #fff2f5);
  color: #df5a78;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(240, 82, 99, .10);
}
.comment-like-btn.liked {
  color: #ef3f59;
  border-color: #ffbcc9;
  background: linear-gradient(180deg, #fff0f4, #ffe4eb);
  box-shadow: 0 12px 22px rgba(239, 63, 89, .16);
}
.comment-heart {
  line-height: 1;
  font-size: 18px;
  font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
}
.comment-like-count {
  font-size: 11px;
  font-weight: 800;
  color: #7b4d57;
}
.comment-like-btn.liked .comment-like-count { color: #d33b55; }
.reply-toggle-btn {
  height: 36px;
  padding: 0 14px;
  border: 1px solid #dce9ff;
  border-radius: 999px;
  background: linear-gradient(180deg, #f8fbff, #eef5ff);
  color: #2d74de;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.reply-toggle-btn.active {
  background: linear-gradient(180deg, #eef6ff, #e4efff);
  border-color: #bdd6ff;
}
.reply-form-inline.is-hidden { display:none; }
.mini-login-chip-light {
  min-height: 34px;
  padding: 0 12px;
}
@media (max-width: 760px) {
  .star-rate-btns { gap: 5px; }
  .star-btn {
    width: 34px;
    height: 34px;
    font-size: 21px;
  }
  .comment-tool-row,
  .reply-form-inline,
  .comment-bubble { margin-left: 0; }
}

/* ===== v5 compact like/reply tuning ===== */
.action-main-row {
  gap: 8px;
}
.heart-toggle {
  min-width: 58px;
  height: 38px;
  padding: 0 11px;
  gap: 6px;
  border-radius: 12px;
}
.heart-glyph {
  font-size: 16px;
}
.fancy-heart {
  font-size: 12px;
}

.star-rate-btns {
  gap: 5px;
}
.star-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #b9c2cf;
  background: linear-gradient(180deg, #fbfcfe, #f1f4f8);
  border-color: #e1e7ef;
}
.star-btn.active {
  color: #ffbf2f;
  border-color: #ffd67c;
  background: linear-gradient(180deg, #fff9dc, #ffefae);
}
.star-btn:not(.active):hover {
  color: #9aa6b6;
  background: linear-gradient(180deg, #ffffff, #f4f6f9);
  border-color: #dce3ec;
}

.comment-item {
  padding: 10px 12px;
}
.comment-reply-item {
  margin-top: 6px;
  padding: 8px 0 0 12px;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  border-left: 2px solid #e7edf6;
}
.comment-reply-item .comment-head {
  margin-bottom: 6px;
}
.comment-reply-item .reply-tag {
  min-width: 38px;
  padding: 3px 7px;
  font-size: 9px;
}
.comment-reply-item .comment-bubble {
  margin-left: 34px;
  padding: 8px 10px;
  border-radius: 14px 14px 14px 6px;
  background: linear-gradient(180deg, #fafcff, #f5f8fd);
  border: 1px solid #e7edf6;
}
.comment-reply-item .comment-bubble::before {
  top: 11px;
}
.comment-tool-row {
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
  margin-left: 0;
}
.comment-like-btn {
  min-width: 34px;
  padding: 4px 6px 5px;
  border-radius: 11px;
  gap: 1px;
}
.comment-heart {
  font-size: 15px;
}
.comment-like-count {
  font-size: 10px;
}
.reply-toggle-btn {
  height: 30px;
  padding: 0 10px;
  font-size: 11px;
}
.reply-form-inline {
  margin-top: 6px;
  margin-left: 34px;
}
.comment-reply-item .reply-form-inline {
  margin-left: 34px;
}
.comment-input-pill.mini {
  padding: 4px 4px 4px 10px;
  border-radius: 999px;
  background: transparent;
  border: none;
  box-shadow: none;
}
.comment-input-pill.mini input {
  border: 1px solid #d8e4f6;
  background: #fff;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
}
.send-btn-mini {
  width: 32px;
  height: 32px;
  font-size: 13px;
  box-shadow: 0 8px 16px rgba(48, 136, 255, .16);
}
@media (max-width: 760px) {
  .heart-toggle {
    min-width: 54px;
    height: 36px;
    padding: 0 10px;
  }
  .star-btn {
    width: 32px;
    height: 32px;
    font-size: 20px;
  }
  .comment-reply-item {
    padding-left: 10px;
  }
  .comment-reply-item .comment-bubble,
  .reply-form-inline,
  .comment-reply-item .reply-form-inline {
    margin-left: 0;
  }
}

/* ===== v6 inline replies closer under parent ===== */
.comment-item {
  position: relative;
}
.comment-children {
  margin-top: 8px;
  margin-left: 18px;
  padding-left: 12px;
  border-left: 2px solid #e8eef7;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comment-reply-item {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: visible;
}
.comment-reply-item .comment-head {
  margin-bottom: 4px;
}
.comment-reply-item .comment-user {
  gap: 7px;
}
.comment-reply-item .avatar.avatar-sm {
  width: 24px;
  height: 24px;
}
.comment-reply-item .comment-name-row strong {
  font-size: 13px;
}
.comment-reply-item .muted.small {
  font-size: 11px;
}
.comment-reply-item .reply-tag {
  min-width: 34px;
  padding: 2px 7px;
  font-size: 9px;
}
.comment-reply-item .comment-bubble {
  margin-left: 31px !important;
  padding: 8px 11px;
  border-radius: 14px 14px 14px 6px;
  background: linear-gradient(180deg, #fafcff, #f5f8fd) !important;
  border: 1px solid #e7edf6 !important;
}
.comment-reply-item .comment-bubble::before {
  left: -6px;
  top: 11px;
  width: 10px;
  height: 10px;
}
.comment-reply-item .comment-body {
  font-size: 12px;
  color: #536272;
}
.comment-reply-item .comment-tool-row {
  margin-top: 5px;
  margin-right: 0;
  padding-left: 31px;
}
.comment-reply-item .reply-form-inline {
  margin-top: 5px;
  margin-left: 31px !important;
}
.comment-reply-item .comment-input-pill.mini {
  padding-left: 0;
}
.comment-reply-item .comment-input-pill.mini input {
  height: 32px;
  font-size: 12px;
}
@media (max-width: 760px) {
  .comment-children {
    margin-left: 12px;
    padding-left: 10px;
  }
  .comment-reply-item .comment-bubble,
  .comment-reply-item .reply-form-inline,
  .comment-reply-item .comment-tool-row {
    margin-left: 0 !important;
    padding-left: 0;
  }
}


/* ===== v7 glass zone switch ===== */
.glass-switch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
  padding: 6px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,255,255,.72), rgba(240,247,255,.88));
  border: 1px solid rgba(219, 231, 247, .95);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 14px 26px rgba(79, 116, 173, .10);
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.glass-switch::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,0) 18%, rgba(255,255,255,.52) 50%, rgba(255,255,255,0) 78%);
  transform: translateX(-120%);
  animation: glassSheen 4.8s linear infinite;
  pointer-events: none;
}
.glass-switch-track {
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: calc(50% - 6px);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(84, 160, 255, .94), rgba(43, 195, 255, .92));
  box-shadow: 0 12px 22px rgba(56, 145, 255, .22);
  transition: transform .28s ease;
}
.glass-switch-track.is-official {
  transform: translateX(0);
}
.glass-switch-track.is-thirdparty {
  transform: translateX(calc(100% + 6px));
}
.glass-switch-btn {
  position: relative;
  z-index: 1;
  min-height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
  color: #617488;
  transition: color .22s ease, transform .16s ease;
}
.glass-switch-btn:hover {
  transform: translateY(-1px);
}
.glass-switch-btn.active {
  color: #fff;
}
.switch-icon {
  font-size: 14px;
  line-height: 1;
}
@keyframes glassSheen {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}
@media (max-width: 760px) {
  .glass-switch {
    margin-top: 10px;
    padding: 5px;
    border-radius: 20px;
  }
  .glass-switch-track {
    top: 5px;
    bottom: 5px;
    width: calc(50% - 5px);
  }
  .glass-switch-track.is-thirdparty {
    transform: translateX(calc(100% + 5px));
  }
  .glass-switch-btn {
    min-height: 42px;
    font-size: 12px;
    gap: 6px;
  }
  .switch-icon {
    font-size: 13px;
  }
}

/* ===== v8 points, shop, membership ===== */
.nav-points {
  background: linear-gradient(135deg, #fff8d8, #fff0a8);
  color: #9b6a00;
  border-color: #ffe391;
}
.name-badge-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.member-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .4px;
  border: 1px solid transparent;
}
.member-vip {
  color: #d33c55;
  border-color: #ffb4c2;
  background: linear-gradient(180deg, #fff5f7, #ffe7ec);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 8px 14px rgba(240, 82, 99, .10);
}
.member-svip {
  color: #8c6200;
  border-color: #f5d06c;
  background: linear-gradient(135deg, #fff8d7, #ffe58e, #fff3bf);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 10px 18px rgba(255, 191, 47, .18);
  position: relative;
  overflow: hidden;
}
.member-svip::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-120%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent);
  animation: svip-shine 2.8s linear infinite;
}
@keyframes svip-shine {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(140%); }
}
.uploader-meta {
  gap: 8px;
}
.stat-tip {
  background: linear-gradient(135deg, #fff7d5, #ffef9c);
  color: #9b6d00;
  border: 1px solid #fde08a;
}
.tip-card,
.rate-card {
  border: 1px solid #e8eef8;
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}
.tip-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tip-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tip-pill {
  min-width: 62px;
  height: 34px;
  border: 1px solid #dbe8ff;
  border-radius: 999px;
  background: linear-gradient(180deg, #f7fbff, #edf5ff);
  color: #2d74de;
  font-weight: 800;
  cursor: pointer;
}
.tip-custom-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.tip-input {
  max-width: 180px;
}
.points-hero {
  padding: 18px;
}
.points-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.points-balance-pill {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: #8b6200;
  background: linear-gradient(135deg, #fff8da, #ffe896);
  border: 1px solid #f7da79;
  box-shadow: 0 12px 22px rgba(255, 191, 47, .14);
}
.points-kpi-grid,
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.points-mini-card,
.shop-item {
  border: 1px solid #e8eef8;
  border-radius: 20px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff, #fafcff);
}
.points-main-text {
  margin: 6px 0 10px;
  font-size: 20px;
  font-weight: 900;
}
.success-text { color: #138c58; }
.shop-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.shop-item-title {
  font-size: 18px;
  font-weight: 900;
}
.shop-item-desc {
  color: #667689;
  font-size: 13px;
  line-height: 1.6;
}
.shop-item-price {
  font-size: 22px;
  font-weight: 900;
}
.shop-vip .shop-item-price { color: #d33c55; }
.shop-svip .shop-item-price { color: #9b6d00; }
.shop-badge-preview {
  min-height: 34px;
  display: flex;
  align-items: center;
}
.owned-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: #eafaf2;
  color: #118c56;
  font-weight: 800;
}
.display-setting-box {
  margin-top: 14px;
  border: 1px solid #e8eef8;
  border-radius: 20px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}
.display-setting-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.points-grid {
  grid-template-columns: 1.08fr .92fr;
}
.points-log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.points-log-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid #e8eef8;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}
.points-log-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 4px;
}
.points-log-side {
  text-align: right;
  white-space: nowrap;
}
.points-delta {
  font-size: 20px;
  font-weight: 900;
}
.points-delta.plus { color: #118c56; }
.points-delta.minus { color: #d33c55; }
@media (max-width: 760px) {
  .points-kpi-grid,
  .shop-grid,
  .points-grid {
    grid-template-columns: 1fr;
  }
  .tip-custom-row {
    align-items: stretch;
  }
  .tip-input {
    max-width: none;
  }
  .display-setting-form {
    flex-direction: column;
    align-items: stretch;
  }
}

.table-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.table-action-row form {
  margin: 0;
}
.review-delete-form {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}
.detail-delete-form {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}
.detail-delete-btn {
  min-width: 124px;
  border-radius: 999px;
  box-shadow: 0 10px 18px rgba(225, 58, 84, .14);
}


.detail-manage-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.category-inline-form {
  margin: 0;
}
.category-inline-grid {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 8px;
}
.category-action-row {
  justify-content: flex-end;
}
.input-sm {
  padding: 9px 12px;
  font-size: 13px;
  border-radius: 12px;
}
.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}
.edit-preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-icon-sm {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  flex: 0 0 52px;
}
@media (max-width: 760px) {
  .category-inline-grid {
    grid-template-columns: 62px 1fr;
  }
  .edit-preview-row {
    align-items: flex-start;
    flex-direction: column;
  }
}


.auth-sub-btn { margin-top: 10px; }
.sort-cycle-btn { white-space: nowrap; }
.upload-progress-wrap {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff, #f3f8ff);
  border: 1px solid #dce8fb;
}
.upload-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #4a5c73;
  margin-bottom: 8px;
}
.upload-progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e8eff8;
  overflow: hidden;
}
.upload-progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6, #17b3ff);
  box-shadow: 0 6px 12px rgba(59,130,246,.22);
}
.upload-done-text {
  margin-top: 8px;
  color: #138c58;
  font-size: 12px;
  font-weight: 700;
}
.avatar-link,
.detail-avatar-link {
  display: inline-flex;
  border-radius: 50%;
  transition: transform .15s ease, box-shadow .15s ease;
}
.avatar-link:hover,
.detail-avatar-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(43,67,102,.12);
}
.author-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #1f78d7;
  background: #eef6ff;
  border: 1px solid #d7e8ff;
}
.reject-reason-inline {
  margin-top: 6px;
  font-size: 12px;
  color: #d14b63;
  font-weight: 700;
}
.reject-reason-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid #ffd9df;
  background: linear-gradient(180deg, #fff8fa, #fff2f5);
}
.mini-chat-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid #dbe8ff;
  background: #eef5ff;
  color: #2d73da;
  font-size: 12px;
  font-weight: 800;
}
.chat-thread-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-thread-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #fafcff);
  border: 1px solid #e8eef7;
}
.chat-thread-main { min-width: 0; flex: 1; }
.chat-thread-top,
.chat-thread-sub {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.chat-preview {
  color: #5c6c80;
  font-size: 13px;
}
.chat-unread-dot {
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff6b81, #ff4765);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}
.chat-page-card { padding-bottom: 14px; }
.chat-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.chat-target-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-message-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  min-height: 240px;
  border-radius: 20px;
  background: linear-gradient(180deg, #f8fbff, #f5f8fc);
  border: 1px solid #e6edf8;
}
.chat-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.chat-row.mine { justify-content: flex-end; }
.chat-bubble-wrap { max-width: min(78%, 680px); }
.chat-bubble-name {
  margin-bottom: 4px;
  font-size: 12px;
  color: #708196;
}
.chat-row.mine .chat-bubble-name { text-align: right; }
.chat-bubble {
  padding: 11px 14px;
  border-radius: 18px;
  line-height: 1.7;
  font-size: 14px;
  box-shadow: 0 10px 18px rgba(40,63,96,.06);
}
.chat-bubble.other {
  background: #fff;
  border: 1px solid #e4edf8;
}
.chat-bubble.mine {
  color: #fff;
  background: linear-gradient(135deg, #4a8fff, #27b6ff);
}
.chat-time { margin-top: 4px; }
.chat-row.mine .chat-time { text-align: right; }
.chat-send-form { margin-top: 12px; }
.chat-compose-pill { margin-top: 2px; }
@media (max-width: 760px) {
  .chat-bubble-wrap { max-width: 100%; }
  .chat-thread-top,
  .chat-thread-sub,
  .chat-header-row { align-items: flex-start; }
}

.comment-user-link,
.uploader-link,
.user-line-card,
.user-hero-name-row a,
.profile-head-link {
  text-decoration: none;
  color: inherit;
}

.user-profile-page {
  gap: 16px;
}

.user-hero-card {
  padding: 18px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,250,255,.98));
}

.user-hero-main {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.user-hero-avatar {
  width: 92px;
  height: 92px;
  border-radius: 28px;
  box-shadow: 0 10px 22px rgba(53, 93, 155, .14);
  border: 3px solid rgba(255,255,255,.92);
  flex: 0 0 auto;
}

.user-hero-info {
  flex: 1;
  min-width: 0;
}

.user-hero-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-hero-name {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.user-hero-sub {
  margin-top: 6px;
  color: #7b8da5;
  font-size: 13px;
}

.user-hero-bio {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f8fbff, #f1f6ff);
  color: #44556f;
  line-height: 1.7;
  border: 1px solid #edf3fb;
}

.user-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.profile-follow-btn {
  min-width: 126px;
}

.user-stat-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.user-stat-card {
  padding: 12px 10px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fbfdff, #f4f8ff);
  border: 1px solid #edf2fa;
  box-shadow: 0 8px 20px rgba(36, 67, 108, .05);
  text-align: center;
}

.user-stat-label {
  display: block;
  color: #88a;
  font-size: 12px;
  margin-bottom: 6px;
}

.user-stat-card strong {
  font-size: 18px;
  color: #22324d;
}

.user-social-grid {
  align-items: start;
}

.user-section-card {
  border-radius: 26px;
}

.user-resource-grid {
  grid-template-columns: repeat(2, minmax(0,1fr));
}

.user-mini-card {
  border-radius: 22px;
}

.user-list-stack {
  display: grid;
  gap: 10px;
}

.user-line-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fcfdff, #f4f8ff);
  border: 1px solid #edf2fa;
  box-shadow: 0 8px 18px rgba(31, 57, 94, .05);
}

.user-line-main {
  min-width: 0;
  flex: 1;
}

.user-line-main .name-badge-row {
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .user-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .user-hero-main {
    flex-direction: column;
    align-items: stretch;
  }

  .user-hero-avatar {
    width: 84px;
    height: 84px;
  }

  .user-hero-name {
    font-size: 24px;
  }

  .user-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .user-resource-grid {
    grid-template-columns: 1fr;
  }
}

/* v13 user home + admin user search + chat refine */
.dashboard-user-head {
  align-items: flex-start;
  gap: 12px;
}
.dashboard-user-search {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.dashboard-user-search .input {
  min-width: min(300px, 72vw);
}
.dashboard-user-action-stack {
  display: grid;
  gap: 8px;
}
.dashboard-ban-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.user-hero-card-pro {
  padding: 20px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,250,255,.98));
}
.user-hero-main-pro {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.user-hero-avatar-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.user-hero-avatar-pro {
  width: 104px;
  height: 104px;
  border-radius: 32px;
  border: 4px solid rgba(255,255,255,.96);
  box-shadow: 0 14px 30px rgba(63, 101, 169, .16);
}
.user-hero-right {
  min-width: 0;
}
.user-top-stats-inline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.user-top-stat-block {
  padding: 12px 10px;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff, #f5f8ff);
  border: 1px solid #edf2fb;
  text-align: center;
  box-shadow: 0 10px 20px rgba(34, 61, 108, .05);
}
.user-top-stat-block strong {
  display: block;
  font-size: 26px;
  line-height: 1;
  color: #1f2f4d;
  font-weight: 900;
}
.user-top-stat-block span {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: #6f829d;
  font-weight: 700;
}
.user-hero-name-row-pro {
  gap: 8px;
  margin-top: 4px;
}
.user-hero-bio-pro {
  margin-top: 10px;
}
.user-hero-mini-kpis {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.mini-kpi-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fbfdff, #f3f7ff);
  border: 1px solid #e8effb;
  color: #43546d;
  font-size: 12px;
  font-weight: 800;
}
.user-hero-actions-pro {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.profile-follow-btn {
  min-width: 118px;
  border-radius: 999px;
  font-weight: 900;
}
.profile-follow-red {
  color: #fff;
  border: 1px solid #ff5579;
  background: linear-gradient(135deg, #ff5b81, #ff7a98);
  box-shadow: 0 10px 20px rgba(255, 89, 126, .18);
}
.profile-followed-btn {
  color: #6c7c92;
  border: 1px solid #dfe6f1;
  background: linear-gradient(180deg, #f4f6fa, #e9edf3);
  box-shadow: none;
}
.profile-chat-btn {
  border-radius: 999px;
}

.chat-page-card-pro {
  padding-bottom: 16px;
}
.chat-message-list-pro {
  min-height: 58vh;
  max-height: none;
  padding: 14px;
  border-radius: 24px;
}
.chat-bubble-wrap-pro {
  max-width: min(72%, 520px);
}
.chat-bubble-pro {
  padding: 8px 11px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.55;
}
.chat-bubble-media {
  padding: 8px;
}
.chat-text-block {
  margin-top: 4px;
  word-break: break-word;
}
.chat-bubble-media .chat-text-block {
  margin-top: 6px;
}
.chat-image {
  display: block;
  max-width: min(210px, 52vw);
  max-height: 280px;
  border-radius: 14px;
}
.chat-media-link {
  display: inline-block;
}
.chat-voice-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-audio {
  width: min(230px, 54vw);
  height: 34px;
}
.chat-voice-tag {
  font-size: 11px;
  color: #72839a;
  font-weight: 800;
}
.chat-time-pro {
  font-size: 11px;
}
.chat-compose-pill-pro {
  gap: 8px;
  align-items: center;
}
.chat-file-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid #dce7ff;
  background: linear-gradient(180deg, #f7fbff, #edf5ff);
  color: #3f6fcc;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.chat-voice-pill {
  color: #6f62d8;
  border-color: #e4defe;
  background: linear-gradient(180deg, #fbf9ff, #f1edff);
}
.chat-compose-tip {
  margin-top: 8px;
}

@media (max-width: 760px) {
  .user-hero-main-pro {
    grid-template-columns: 1fr;
  }
  .user-hero-avatar-wrap {
    justify-content: flex-start;
  }
  .user-top-stats-inline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .user-top-stat-block strong {
    font-size: 22px;
  }
  .chat-bubble-wrap-pro {
    max-width: calc(100% - 44px);
  }
  .chat-compose-pill-pro {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .chat-compose-pill-pro input[name="content"] {
    flex: 1 1 100%;
  }
}


/* v14 chat image send + direct voice record */
.chat-compose-advanced {
  align-items: center;
}
#recordVoiceBtn {
  border: none;
}
.chat-voice-pill.is-recording,
#recordVoiceBtn:active {
  color: #fff;
  border-color: #ff6489;
  background: linear-gradient(135deg, #ff6a8e, #ff8a73);
  box-shadow: 0 10px 18px rgba(255, 98, 135, .18);
}
.chat-compose-tip {
  min-height: 18px;
}
.chat-file-pill {
  user-select: none;
}

/* ===== v17 homepage upload time + comment media ===== */
.compact-time-row {
  margin-top: 8px;
}
.compact-time-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f8fbff, #eef5ff);
  border: 1px solid #dce8fb;
  color: #6f7e94;
  font-size: 11px;
  font-weight: 700;
}
.comment-compose-advanced {
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.comment-compose-advanced input[name="content"] {
  flex: 1 1 220px;
  min-width: 0;
}
.comment-file-pill,
.comment-voice-pill {
  height: 36px;
}
.comment-compose-tip {
  margin-top: 8px;
  margin-left: 4px;
}
.comment-bubble-media {
  padding: 8px;
}
.comment-media-link {
  display: inline-block;
}
.comment-image {
  max-width: min(220px, 58vw);
  max-height: 260px;
  border-radius: 12px;
}
.comment-voice-wrap {
  gap: 5px;
}
.comment-audio {
  width: min(220px, 58vw);
  height: 34px;
}
.comment-body-spaced {
  margin-top: 6px;
}
.comment-reply-item .comment-image {
  max-width: min(180px, 50vw);
  max-height: 180px;
}
.comment-reply-item .comment-audio {
  width: min(180px, 50vw);
}
.reply-form-inline .comment-compose-tip {
  margin-left: 34px;
}
@media (max-width: 760px) {
  .compact-time-chip {
    font-size: 10px;
    padding: 4px 8px;
  }
  .comment-compose-advanced {
    justify-content: flex-end;
  }
  .comment-compose-advanced input[name="content"] {
    flex: 1 1 100%;
  }
  .reply-form-inline .comment-compose-tip {
    margin-left: 0;
  }
}
