/*
 * 个人中心 — Scholar Stream 式浅色 SaaS（仅 body.yiyi-user-center）
 */

body.yiyi-user-center {
  background: #f3f4f6;
}

body.yiyi-user-center > .content {
  min-height: 100vh;
  padding-bottom: 0;
}

/* —— 顶栏 —— */
.yiyi-uc-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

.yiyi-uc-topbar-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 100%;
  padding: 0.65rem 1.25rem;
  min-height: 56px;
}

.yiyi-uc-topbar-brand {
  flex-shrink: 0;
}

.yiyi-uc-topbar-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 800;
  color: #111827;
  text-decoration: none;
}

.yiyi-uc-topbar-logo:hover {
  color: #2563eb;
  text-decoration: none;
}

.yiyi-uc-topbar-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: min(520px, 42vw);
  margin: 0 auto;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 0.35rem 0.35rem 0.35rem 0.85rem;
}

.yiyi-uc-topbar-search:focus-within {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.15);
}

.yiyi-uc-topbar-search-icon {
  font-size: 1.15rem;
  color: #9ca3af;
  flex-shrink: 0;
}

.yiyi-uc-topbar-search input[type="search"] {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  color: #111827;
  outline: none;
  box-shadow: none;
}

.yiyi-uc-topbar-search input[type="search"]::placeholder {
  color: #9ca3af;
}

.yiyi-uc-topbar-search-submit {
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.yiyi-uc-topbar-search-submit:hover {
  background: #1d4ed8;
}

.yiyi-uc-topbar-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.yiyi-uc-topbar-actions-inner {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.yiyi-uc-topbar-item {
  position: relative;
}

.yiyi-uc-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: #4b5563;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.yiyi-uc-icon-btn:hover,
.yiyi-uc-icon-btn:focus {
  background: #f3f4f6;
  color: #111827;
  text-decoration: none;
}

.yiyi-uc-balance-label {
  display: none;
}

@media (min-width: 1100px) {
  .yiyi-uc-balance-label {
    display: inline;
  }

  .yiyi-uc-topbar-item .balance-display.yiyi-uc-icon-btn {
    width: auto;
    padding: 0 0.65rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
  }
}

.yiyi-uc-btn-primary {
  border: none;
  border-radius: 10px;
  padding: 0.45rem 0.95rem;
  font-size: 0.8125rem;
  font-weight: 700;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.yiyi-uc-btn-primary:hover {
  background: #1d4ed8;
  color: #fff;
}

.yiyi-uc-dropdown-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.5rem 1.25rem;
  font-size: 14px;
  line-height: 1.42857143;
  color: #333;
  cursor: pointer;
  clear: both;
  font-weight: 400;
}

.yiyi-uc-dropdown-btn:hover {
  background: #f5f5f5;
  color: #262626;
}

.yiyi-uc-topbar-user .dropdown-menu {
  min-width: 200px;
}

.yiyi-uc-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  text-decoration: none;
  color: #111827;
  font-size: 0.8125rem;
  font-weight: 600;
  max-width: 200px;
}

.yiyi-uc-user-chip:hover {
  background: #f9fafb;
  text-decoration: none;
  color: #111827;
}

.yiyi-uc-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.yiyi-uc-user-avatar--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e5e7eb;
  color: #4b5563;
  font-size: 0.75rem;
  font-weight: 800;
}

.yiyi-uc-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yiyi-uc-topbar-guest {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

@media (max-width: 991px) {
  .yiyi-uc-topbar-inner {
    flex-wrap: wrap;
    padding: 0.5rem 0.75rem;
  }

  .yiyi-uc-topbar-search {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    margin: 0;
  }

  .yiyi-uc-user-name {
    display: none;
  }
}

/* —— 壳 + 侧栏浅色 —— */
body.yiyi-user-center .yiyi-account-shell {
  min-height: calc(100vh - 57px);
  background: #f3f4f6;
}

body.yiyi-user-center .yiyi-account-sidebar {
  width: 268px;
  background: #fff;
  color: #111827;
  border-right: 1px solid #e5e7eb;
  box-shadow: none;
  padding: 1.25rem 1rem 1rem;
  gap: 1.1rem;
}

body.yiyi-user-center .yiyi-account-eyebrow {
  color: #6b7280;
  letter-spacing: 0.18em;
  font-size: 0.65rem;
}

body.yiyi-user-center .yiyi-account-brand-title {
  margin: 0 0 0.2rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #111827;
  font-family: var(--yiyi-font);
}

body.yiyi-user-center .yiyi-account-brand-sub {
  color: #6b7280;
  font-size: 0.78rem;
}

body.yiyi-user-center .yiyi-account-profile {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

body.yiyi-user-center .yiyi-account-profile-name {
  color: #111827;
}

body.yiyi-user-center .yiyi-account-nav-wrap {
  flex: 1;
  min-height: 0;
}

body.yiyi-user-center .yiyi-account-nav > li > a {
  color: #4b5563;
  border-left: none;
  border-radius: 10px;
}

body.yiyi-user-center .yiyi-account-nav > li > a:hover {
  background: #f3f4f6;
  color: #111827;
  transform: none;
}

body.yiyi-user-center .yiyi-account-nav > li.active > a {
  background: rgb(37 99 235 / 0.1);
  color: #2563eb;
  border-left: none;
}

body.yiyi-user-center .yiyi-account-nav > li.active > a .material-symbols-outlined {
  color: #2563eb;
}

body.yiyi-user-center .yiyi-account-sidebar-footer {
  margin-top: auto;
  padding-top: 0.5rem;
}

body.yiyi-user-center .yiyi-account-new-doc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgb(37 99 235 / 0.25);
  transition: background 0.15s ease, transform 0.12s ease;
}

body.yiyi-user-center .yiyi-account-new-doc-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

/* —— 主区 —— */
body.yiyi-user-center .yiyi-account-main {
  background: #f3f4f6;
  padding: 1.5rem 1.5rem 2.5rem;
}

body.yiyi-user-center .yiyi-account-main::before {
  display: none;
}

body.yiyi-user-center .yiyi-account-shell--empty {
  background: #f3f4f6;
}

/* 子页通用卡片与工具条在用户中心下略收紧阴影 */
body.yiyi-user-center .yiyi-account-page-header {
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.06);
}

/* Bootstrap dropdown 顶栏内对齐 */
body.yiyi-user-center .yiyi-uc-topbar .dropdown-menu {
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 40px rgb(0 0 0 / 0.12);
}

/* 文档子页 tabs */
.yiyi-uc-doc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.yiyi-uc-doc-tabs a {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #4b5563;
  text-decoration: none;
  border: 1px solid #e5e7eb;
  background: #fff;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.yiyi-uc-doc-tabs a:hover {
  background: #f9fafb;
  color: #111827;
  text-decoration: none;
}

.yiyi-uc-doc-tabs a.is-active {
  background: rgb(37 99 235 / 0.1);
  color: #2563eb;
  border-color: rgb(37 99 235 / 0.35);
}

/* 设置页双栏卡片 */
.yiyi-uc-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.yiyi-uc-settings-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.06);
}

.yiyi-uc-settings-card__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
}

.yiyi-uc-settings-card__head .material-symbols-outlined {
  color: #2563eb;
  font-size: 1.35rem;
}

.yiyi-uc-settings-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 1.25rem;
}

.yiyi-uc-settings-banner__text {
  flex: 1;
  min-width: 200px;
}

.yiyi-uc-settings-banner__text h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 800;
  color: #111827;
}

.yiyi-uc-settings-banner__text p {
  margin: 0;
  font-size: 0.875rem;
  color: #6b7280;
}

.yiyi-uc-settings-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 2rem;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  color: #b91c1c;
  text-decoration: none;
}

.yiyi-uc-settings-danger:hover {
  color: #991b1b;
  text-decoration: underline;
}

.yiyi-uc-form-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #6b7280;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.yiyi-uc-form-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .yiyi-uc-form-row2 {
    grid-template-columns: 1fr;
  }
}

/* 列表行（翻译历史等） */
.yiyi-uc-table-header {
  display: none;
}

@media (min-width: 768px) {
  .yiyi-uc-table-header {
    display: grid;
    grid-template-columns: minmax(180px, 2.2fr) minmax(100px, 0.9fr) minmax(80px, 0.6fr) minmax(120px, 0.9fr);
    gap: 1rem;
    padding: 0.5rem 1.15rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #9ca3af;
    text-transform: uppercase;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0.5rem;
  }
}

.yiyi-uc-row-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  margin-bottom: 0.65rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

@media (min-width: 768px) {
  .yiyi-uc-row-card {
    grid-template-columns: minmax(180px, 2.2fr) minmax(100px, 0.9fr) minmax(80px, 0.6fr) minmax(120px, 0.9fr);
    align-items: center;
    gap: 1rem;
  }
}

.yiyi-uc-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.yiyi-uc-badge--ok {
  background: #dcfce7;
  color: #166534;
}

.yiyi-uc-badge--progress {
  background: rgb(37 99 235 / 0.1);
  color: #2563eb;
}

.yiyi-uc-badge--fail {
  background: #fee2e2;
  color: #b91c1c;
}

.yiyi-uc-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9ca3af;
}

/* 翻译历史：三列表头与行 */
.yiyi-uc-translations-list .yiyi-uc-table-header--3 {
  grid-template-columns: minmax(140px, 2fr) minmax(64px, 0.45fr) minmax(108px, 0.85fr);
}

.yiyi-uc-row-card--translations {
  font-size: 0.875rem;
}

@media (min-width: 768px) {
  .yiyi-uc-row-card--translations {
    grid-template-columns: minmax(140px, 2fr) minmax(64px, 0.45fr) minmax(108px, 0.85fr);
  }
}

.yiyi-uc-cell-title a {
  font-weight: 600;
  color: #111827;
  text-decoration: none;
}

.yiyi-uc-cell-title a:hover {
  color: #2563eb;
}

.yiyi-uc-cell-num a {
  font-weight: 700;
  color: #2563eb;
  text-decoration: none;
}

.yiyi-uc-cell-time {
  color: #6b7280;
  font-size: 0.8125rem;
}

/* 设置页 dl 在卡片内 */
.yiyi-uc-settings-wrap .dl-horizontal dt {
  width: 100px;
  text-align: left;
  color: #6b7280;
  font-weight: 600;
  font-size: 0.8125rem;
}

.yiyi-uc-settings-wrap .dl-horizontal dd {
  margin-left: 120px;
}

@media (max-width: 600px) {
  .yiyi-uc-settings-wrap .dl-horizontal dt {
    float: none;
    width: auto;
    text-align: left;
    padding-bottom: 0.15rem;
  }

  .yiyi-uc-settings-wrap .dl-horizontal dd {
    margin-left: 0;
    margin-bottom: 1rem;
  }
}

body.yiyi-user-center .yiyi-account-page-aside .yiyi-account-tip-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.06);
}

body.yiyi-user-center .yiyi-account-page-aside .yiyi-account-tip-card h3 {
  color: #111827;
}

body.yiyi-user-center .yiyi-account-page-aside .yiyi-account-tip-card p {
  color: #6b7280;
}

/* FineUploader 锚点：隐藏但保留在布局外，供 nav.js 绑定 */
.yiyi-uc-fineupload-anchor {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}
