/* Personal reading profile: quiet cyan, generous whitespace and real content.
   This file is intentionally scoped to .mine-profile and is loaded after the
   existing shell styles. */
.mine-profile {
  position: relative;
  isolation: isolate;
  min-height: calc(100dvh - 112px);
  color: #17191c;
  background: #fff;
}
.mine-profile::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
  right: 0;
  height: 280px;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 5px, rgba(117, 168, 184, .075) 5px 6px),
    linear-gradient(180deg, #fafdfe 0%, #fff 94%);
  -webkit-mask-image: linear-gradient(#000 0 70%, transparent 100%);
  mask-image: linear-gradient(#000 0 70%, transparent 100%);
}

.mine-profile .mine-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  gap: 12px;
}
.mine-profile .mine-top-label {
  color: #178fb2;
  font-size: 14px;
  font-weight: 640;
  letter-spacing: .01em;
}
.mine-profile .mine-public-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #078cb4;
  font-size: 14px;
  font-weight: 620;
  text-decoration: none;
}
.mine-profile .mine-settings-wrap { margin-left: auto; }
.mine-profile .mine-settings-trigger {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .72);
  color: #038db5;
  box-shadow: 0 2px 12px rgba(37, 112, 140, .09), inset 0 1px 0 rgba(255,255,255,.95);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  backdrop-filter: blur(16px) saturate(1.15);
}
.mine-profile .mine-settings-trigger[aria-expanded="true"] {
  color: #006f91;
  background: rgba(211, 245, 252, .88);
}
.mine-profile .mine-settings-trigger svg circle { fill: currentColor; stroke: none; }
.mine-profile .mine-settings-popover {
  position: absolute;
  z-index: 45;
  top: 66px;
  right: 22px;
  width: min(350px, calc(100vw - 44px));
  max-height: min(calc(100dvh - 116px), 680px);
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: manipulation;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  margin: 0;
  padding: 17px;
  border: 1px solid rgba(201, 224, 231, .85);
  border-radius: 20px;
  background: rgba(250, 253, 254, .94);
  color: #1b2428;
  box-shadow: 0 18px 40px rgba(33, 91, 111, .16);
  -webkit-backdrop-filter: blur(24px) saturate(1.15);
  backdrop-filter: blur(24px) saturate(1.15);
}
.mine-profile .mine-settings-popover[hidden] { display: none; }
.mine-profile .mine-settings-heading {
  position: sticky;
  z-index: 2;
  top: -17px;
  margin: -7px -7px 7px;
  padding: 7px;
  border-radius: 12px;
  background: rgba(250, 253, 254, .97);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 16px;
}
.mine-profile .mine-settings-subtitle {
  margin: 16px 0 9px;
  color: #59737c;
  font-size: 12px;
  font-weight: 650;
}
.mine-profile .mine-settings-close {
  border: 0;
  background: rgba(229, 239, 243, .8);
  box-shadow: none;
}
.mine-profile .theme-pill.selected {
  border-color: #72cae1;
  background: #dff5fa;
  color: #006987;
}

.mine-profile .mine-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  min-height: 146px;
  margin-top: 20px;
}
.mine-profile .mine-identity { min-width: 0; }
.mine-profile .mine-display-name {
  margin: 0;
  color: #101317;
  font-size: clamp(28px, 7.8vw, 36px);
  font-weight: 720;
  line-height: 1.14;
  letter-spacing: -.035em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.mine-profile .mine-bio {
  margin: 12px 0 0;
  color: #687983;
  font-size: 15px;
  line-height: 1.6;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
.mine-profile .mine-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 88px;
  height: 88px;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #d9f3f8;
  color: #007f9e;
  box-shadow: 0 6px 22px rgba(32, 102, 122, .12);
  font-size: 28px;
  font-weight: 650;
}
.mine-profile .mine-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* 本地自定义背景保留柔和遮罩，避免照片使姓名和设置按钮失去对比度。 */
.mine-profile.has-custom-cover::before { display: none; }
.mine-custom-cover { position: absolute; z-index: -1; inset: 0 0 auto; height: 280px; overflow: hidden; pointer-events: none; }
.mine-custom-cover img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: .44; }
.mine-custom-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.38), rgba(255,255,255,.76) 65%, #fff); }
.mine-media-settings { margin-top: 16px; padding-top: 1px; border-top: 1px solid #e2ebee; }
.mine-media-note { margin: 6px 0 12px; color: #60737d; font-size: 12px; line-height: 1.5; }
.mine-media-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.mine-media-option { display: grid; justify-items: center; min-width: 0; gap: 4px; }
.mine-media-preview { display: grid; place-items: center; overflow: hidden; height: 68px; color: #18778d; background: #e2f2f5; font-size: 13px; }
.mine-media-preview.avatar { width: 68px; border-radius: 50%; font-size: 23px; font-weight: 650; }
.mine-media-preview.background { width: 100%; border-radius: 12px; background: repeating-linear-gradient(90deg,#f5fafb 0 5px,#e7f0f3 5px 6px); }
.mine-media-preview img { width: 100%; height: 100%; object-fit: cover; }
.mine-media-choose { display: grid; place-items: center; width: 100%; min-height: 44px; border: 1px solid #d5e1e6; border-radius: 12px; color: #16657d; background: rgba(255,255,255,.65); font-size: 13px; font-weight: 600; cursor: pointer; }
.mine-media-file { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; clip-path: inset(50%); }
.mine-media-option:has(.mine-media-file:focus-visible) .mine-media-choose { outline: 2px solid #087fa5; outline-offset: 2px; }
.mine-media-remove { min-height: 44px; padding: 3px 6px; border: 0; border-radius: 8px; color: #60737d; background: transparent; font-size: 12px; }
.mine-media-status { margin: 0 0 10px; color: #21647b; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.mine-media-status:empty { display: none; }
.mine-media-status.is-error { color: #a03632; }
.mine-media-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.mine-media-actions button { min-height: 44px; padding: 0 8px; border: 1px solid #c4d5dd; border-radius: 12px; background: #edf4f6; color: #245b6c; font-size: 13px; font-weight: 600; }
.mine-media-actions .mine-media-save { border-color: #087f9e; background: #087f9e; color: #fff; }
.mine-media-actions button:disabled { opacity: .48; cursor: not-allowed; }
.mine-media-settings.is-processing .mine-media-choose { opacity: .5; cursor: wait; }
html[data-theme="dark"] .mine-custom-cover img { opacity: .48; }
html[data-theme="dark"] .mine-custom-cover::after { background: linear-gradient(180deg,rgba(28,28,30,.25),rgba(28,28,30,.74) 65%,#1c1c1e); }
html[data-theme="dark"] .mine-media-settings { border-color: #3c474c; }
html[data-theme="dark"] :is(.mine-media-note,.mine-media-remove) { color: #b6c5cc; }
html[data-theme="dark"] .mine-media-preview { color: #c8e5ee; background: #29454f; }
html[data-theme="dark"] .mine-media-preview.background { background: repeating-linear-gradient(90deg,#26333a 0 5px,#2c3a40 5px 6px); }
html[data-theme="dark"] :is(.mine-media-choose,.mine-media-actions button) { border-color: #536870; background: #2b3a42; color: #d5edf4; }
html[data-theme="dark"] .mine-media-actions .mine-media-save { border-color: #3f92ad; background: #176e8a; color: #fff; }
html[data-theme="dark"] .mine-media-status { color: #a4ddec; }
html[data-theme="dark"] .mine-media-status.is-error { color: #ffc0b7; }
.mine-profile .mine-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}
.mine-profile .mine-profile-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #01a8ce;
  border-radius: 11px;
  background: #0aaed3;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}
.mine-profile .mine-profile-button.secondary {
  border-color: #d5e7eb;
  background: rgba(255,255,255,.84);
  color: #126e86;
}
.mine-profile .mine-profile-button:disabled { cursor: wait; opacity: .62; }
.mine-profile .mine-account-note {
  flex-basis: 100%;
  margin: 2px 0 0;
  color: #607680;
  font-size: 13px;
  line-height: 1.55;
}
.mine-profile .mine-account-note.is-error { color: #9a4f43; }
html[data-theme="dark"] .mine-profile .mine-account-note { color: #a7b3ba; }
html[data-theme="dark"] .mine-profile .mine-account-note.is-error { color: #efb4a9; }

.mine-profile .mine-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 36px 0 0;
  padding: 0 0 26px;
  border-bottom: 1px solid #e8edef;
}
.mine-profile .mine-stat { min-width: 0; }
.mine-profile .mine-stat strong,
.mine-profile .mine-stat .mine-stat-value {
  display: block;
  color: #111418;
  font-size: clamp(20px, 5.8vw, 27px);
  font-weight: 680;
  line-height: 1.15;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.mine-profile .mine-stat:last-child strong,
.mine-profile .mine-stat:last-child .mine-stat-value { font-size: clamp(17px, 4.6vw, 22px); }
.mine-profile .mine-stat span,
.mine-profile .mine-stat .mine-stat-label {
  display: block;
  margin-top: 7px;
  color: #83949b;
  font-size: 13px;
  line-height: 1.4;
}

.mine-profile .mine-privacy-hint { margin: 8px 0 0; color: #687e88; font-size: 12px; line-height: 1.45; }
.mine-profile .mine-empty {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 150px;
  padding: 22px 16px;
  color: #74858c;
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
}
.mine-profile .mine-empty strong { display: block; color: #33464f; font-size: 15px; }
.mine-profile .mine-empty p { max-width: 27ch; margin: 7px 0 0; }

.mine-profile .mine-privacy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 60px;
  padding: 10px 1px;
  border-top: 1px solid #e2ebee;
  color: #25353b;
  font-size: 14px;
  font-weight: 600;
}
.mine-profile .mine-privacy-copy { min-width: 0; }
.mine-profile .mine-privacy-note { display: block; margin-top: 4px; color: #6c818a; font-size: 12px; font-weight: 400; line-height: 1.4; }
.mine-profile .mine-privacy-row input[type="checkbox"] {
  position: relative;
  flex: 0 0 46px;
  width: 46px;
  height: 28px;
  margin: 0;
  border: 1px solid #c3d1d6;
  border-radius: 999px;
  appearance: none;
  background: #dce5e8;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease;
}
.mine-profile .mine-privacy-row input[type="checkbox"]::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(22, 62, 75, .22);
  transition: transform .18s ease;
}
.mine-profile .mine-privacy-row input[type="checkbox"]:checked { border-color: #0ba9ce; background: #0ba9ce; }
.mine-profile .mine-privacy-row input[type="checkbox"]:checked::before { transform: translateX(18px); }
.mine-profile .mine-privacy-row input[type="checkbox"]:focus-visible,
.mine-profile :is(button, a):focus-visible { outline: 2px solid #087fa5; outline-offset: 3px; }
.mine-profile .mine-profile-button:active { transform: scale(.985); }

.mine-profile .mine-profile-form {
  display: grid;
  gap: 12px;
}
.mine-profile .mine-profile-form { padding-top: 13px; border-top: 1px solid #e2ebee; }
.mine-profile .mine-profile-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #344a53;
  font-size: 13px;
  font-weight: 600;
}
.mine-profile .mine-profile-form :is(input:not([type="checkbox"]), textarea, select) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cddce2;
  border-radius: 10px;
  background: rgba(255,255,255,.94);
  color: #14232a;
  font-size: 16px;
  line-height: 1.45;
  outline: none;
}
.mine-profile .mine-profile-form textarea {
  min-height: 92px;
  max-height: 240px;
  resize: vertical;
}
.mine-profile .mine-profile-form :is(input, textarea, select):focus-visible {
  border-color: #138bb0;
  box-shadow: 0 0 0 3px rgba(21, 157, 194, .17);
}
.mine-profile .mine-profile-form :is(input, textarea)::placeholder { color: #82939b; }
.mine-profile .mine-profile-form :is(button, input[type="submit"]) {
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid #a7dce9;
  border-radius: 10px;
  background: #e8f8fb;
  color: #086b86;
  font-size: 13px;
  font-weight: 650;
}
.mine-profile .mine-profile-form :is(button[type="submit"], input[type="submit"]) {
  border-color: #079fc5;
  background: #0aaed3;
  color: #fff;
}
.mine-profile .mine-profile-form :is(button, input[type="submit"]):disabled {
  opacity: .52;
  cursor: not-allowed;
}
.mine-profile .mine-form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.mine-profile .mine-panel {
  margin-top: 34px;
  padding: 18px;
  border: 1px solid #e3e9eb;
  border-radius: 16px;
  background: #fff;
  box-shadow: none;
}
.mine-profile .mine-panel-title { color: #172026; font-size: 18px; }
.mine-profile .sync-panel { border-radius: 12px; background: #f5f9fa; }
.mine-profile .section-head { margin-top: 36px; }
.mine-profile .mark-card { border-color: #e3e9eb; background: #fff; }

html[data-theme="dark"] .mine-profile { color: #f5f6f7; background: #1c1c1e; }
html[data-theme="dark"] .mine-profile::before {
  background: repeating-linear-gradient(90deg, transparent 0 5px, rgba(111, 178, 201, .055) 5px 6px),
    linear-gradient(180deg, #20262a 0%, #1c1c1e 94%);
}
html[data-theme="dark"] .mine-profile :is(.mine-display-name, .mine-stat strong, .mine-stat .mine-stat-value,
  .mine-section-head h2, .mine-section-head .mine-section-title, .mine-panel-title) { color: #f5f6f7; }
html[data-theme="dark"] .mine-profile :is(.mine-bio, .mine-stat span, .mine-stat .mine-stat-label,
  .mine-privacy-hint, .mine-empty, .mine-privacy-note) { color: #a7b3ba; }
html[data-theme="dark"] .mine-profile .mine-stats { border-bottom-color: #353e43; }
html[data-theme="dark"] .mine-profile .mine-avatar { border-color: #303c40; background: #20424b; color: #9cdeee; }
html[data-theme="dark"] .mine-profile .mine-empty strong { color: #e2e8eb; }
html[data-theme="dark"] .mine-profile .mine-privacy-row { border-top-color: #3c474c; color: #f1f4f5; }
html[data-theme="dark"] .mine-profile .mine-privacy-row input[type="checkbox"]:not(:checked) { border-color: #5d6a70; background: #47545a; }
html[data-theme="dark"] .mine-profile .mine-panel { border-color: #363e42; background: #222628; }
html[data-theme="dark"] .mine-profile .sync-panel { background: #2a3134; }
html[data-theme="dark"] .mine-profile .mark-card { border-color: #363e42; background: #222628; }
html[data-theme="dark"] .mine-profile .account-actions .primary-button {
  border-color: #0aaed3;
  background: #0aaed3;
  color: #062c37;
}
html[data-theme="dark"] .mine-profile .mine-settings-popover { border-color: #415057; background: rgba(34, 42, 46, .96); color: #f4f6f7; }
html[data-theme="dark"] .mine-profile .mine-settings-close { background: #3a464c; }
html[data-theme="dark"] .mine-profile .mine-settings-heading { background: rgba(34, 42, 46, .97); }
html[data-theme="dark"] .mine-profile :is(.mine-top-label, .mine-public-back) { color: #77cde7; }
html[data-theme="dark"] .mine-profile .mine-settings-subtitle { color: #b9ccd3; }
html[data-theme="dark"] .mine-profile .theme-pill.selected { border-color: #3baccb; background: #1f4c5a; color: #b6ecf9; }
html[data-theme="dark"] .mine-profile .mine-profile-form { border-top-color: #3c474c; }
html[data-theme="dark"] .mine-profile .mine-profile-form label { color: #dae3e7; }
html[data-theme="dark"] .mine-profile .mine-profile-form :is(input:not([type="checkbox"]), textarea, select) {
  border-color: #56666d;
  background: #20292d;
  color: #f5f7f8;
}
html[data-theme="dark"] .mine-profile .mine-profile-form :is(input, textarea)::placeholder { color: #a2b0b6; }
html[data-theme="dark"] .mine-profile .mine-profile-form :is(button, input[type="submit"]) {
  border-color: #436775;
  background: #24414b;
  color: #bcebf6;
}
html[data-theme="dark"] .mine-profile .mine-profile-form :is(button[type="submit"], input[type="submit"]) {
  border-color: #2eafcc;
  background: #087fa1;
  color: #fff;
}

@media (max-width: 719px) {
  .mine-profile { margin: -22px -22px 0; padding: 22px 22px calc(20px + env(safe-area-inset-bottom)); }
}
@media (max-width: 359px) {
  .mine-profile { margin: -22px -16px 0; padding-inline: 16px; }
  .mine-profile .mine-hero { min-height: 128px; margin-top: 14px; gap: 12px; }
  .mine-profile .mine-avatar { width: 70px; height: 70px; font-size: 23px; }
  .mine-profile .mine-stats { gap: 6px; margin-top: 28px; }
  .mine-profile .mine-stat strong,
  .mine-profile .mine-stat .mine-stat-value { font-size: 19px; }
  .mine-profile .mine-stat:last-child strong,
  .mine-profile .mine-stat:last-child .mine-stat-value { font-size: 16px; }
  .mine-profile .mine-stat span,
  .mine-profile .mine-stat .mine-stat-label { font-size: 12px; }
  .mine-profile .mine-settings-popover { right: 16px; width: calc(100vw - 32px); }
}
@media (min-width: 720px) {
  .mine-profile { max-width: 720px; margin-inline: auto; padding: 12px 28px 44px; }
  .mine-profile .mine-hero { min-height: 180px; }
  .mine-profile .mine-settings-popover { right: 28px; }
}
.app-shell.public-profile-mode { display: block; padding-bottom: 0; }
.app-shell.public-profile-mode .bottom-nav { display: none; }
.app-shell.public-profile-mode .main-view {
  min-height: 100dvh;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}
@media (prefers-reduced-motion: reduce) {
  .mine-profile .mine-privacy-row input[type="checkbox"],
  .mine-profile .mine-privacy-row input[type="checkbox"]::before,
  .mine-profile .mine-profile-button { transition: none; }
}
