/* css/lifesim.css - 人生养成器角色面板 */

/* 属性颜色（覆盖或补充 :root） */
:root {
  --ls-strength: #E07A5F;
  --ls-wisdom: #3D8B8F;
  --ls-experience: #8B5A9F;
  --ls-wealth: #5A8F5A;
  --ls-composure: #5A7D9A;
  --ls-growth: #C9A227;
}

.life-sim-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-5);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.ls-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ls-header-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 1px;
}

.ls-edit-btn {
  padding: var(--padding-btn-md);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-size-sm);
  transition: all var(--transition-fast);
}

.ls-edit-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.ls-row {
  display: flex;
  gap: var(--space-5);
  align-items: stretch;
}

.ls-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .ls-row {
    flex-direction: column;
  }
  .life-sim-container {
    padding: var(--space-3);
  }
}

/* 角色卡 */
.ls-character-card {
  width: 35%;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
}

.ls-avatar {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary-alpha), var(--color-accent-alpha));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  border: 3px solid var(--color-border-strong);
}

.ls-name {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-text);
}

.ls-meta {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.ls-growth-force {
  margin-top: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: var(--color-accent-alpha);
  border-radius: var(--radius-md);
}

.ls-gf-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.ls-gf-value {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-accent);
}

.ls-gf-trend {
  font-size: var(--font-size-lg);
}

.ls-streak {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* 属性卡 */
.ls-attrs-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.ls-attr-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.ls-attr-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.ls-attr-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.ls-attr-name {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  font-weight: 500;
}

.ls-attr-level {
  color: var(--color-text-secondary);
  margin-left: 4px;
}

.ls-attr-title {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-left: 4px;
}

.ls-attr-bar-wrap {
  height: 10px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.ls-attr-bar {
  height: 100%;
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ls-attr-pct {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  width: 36px;
  text-align: right;
}

/* 信息卡 */
.ls-row-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.ls-info-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ls-info-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ls-info-value {
  font-size: var(--font-size-base);
  color: var(--color-text);
  font-weight: 500;
  line-height: 1.5;
}

.ls-info-sub {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.ls-empty {
  color: var(--color-text-muted);
  font-weight: 400;
}

/* 里程碑 */
.ls-section-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.ls-milestone-timeline {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  padding-bottom: var(--space-2);
}

.ls-milestone-node {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 80px;
  position: relative;
}

.ls-milestone-node:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 60%;
  width: 40px;
  height: 2px;
  background: var(--color-border-strong);
}

.ls-milestone-node.active .ls-milestone-dot {
  background: var(--color-accent);
  box-shadow: 0 0 0 4px var(--color-accent-alpha);
  transform: scale(1.2);
}

.ls-milestone-dot {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  margin-bottom: var(--space-2);
}

.ls-milestone-node.future .ls-milestone-dot {
  background: transparent;
  border: 2px dashed var(--color-border-strong);
}

.ls-milestone-title {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  font-weight: 500;
}

.ls-milestone-date {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.ls-milestone-node.future .ls-milestone-title {
  color: var(--color-text-muted);
}

/* 日志 */
.ls-log-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ls-log-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-elevated);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
}

.ls-log-time {
  color: var(--color-text-muted);
  min-width: 44px;
}

.ls-log-source {
  color: var(--color-text-secondary);
}

.ls-log-arrow {
  color: var(--color-border-strong);
}

.ls-log-attr {
  font-weight: 600;
}

.ls-log-bonus {
  margin-left: auto;
  font-size: var(--font-size-xs);
  color: var(--color-accent);
  background: var(--color-accent-alpha);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* 弹窗 */
.ls-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ls-modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay-modal);
  backdrop-filter: blur(4px);
}

.ls-modal-content {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

.ls-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
}

.ls-modal-header h3 {
  margin: 0;
  font-size: var(--font-size-lg);
  color: var(--color-text);
}

.ls-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--color-text-muted);
  cursor: pointer;
}

.ls-modal-body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.ls-form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.ls-form-group label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.ls-form-group input {
  padding: var(--padding-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--font-size-base);
}

.ls-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.ls-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-border);
}

.ls-btn-primary,
.ls-btn-secondary {
  padding: var(--padding-btn-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-size-sm);
  border: 1px solid transparent;
}

.ls-btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.ls-btn-secondary {
  background: var(--color-surface);
  border-color: var(--color-border-strong);
  color: var(--color-text-secondary);
}

@media (max-width: 768px) {
  .ls-character-card,
  .ls-attrs-card {
    width: 100%;
  }
  .ls-row-info {
    grid-template-columns: 1fr;
  }
  .ls-milestone-timeline {
    gap: var(--space-3);
  }
  .ls-home-row {
    grid-template-columns: 1fr;
  }
  .ls-attrs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ls-logs-section .ls-log-item {
    flex-wrap: wrap;
  }
  .ls-logs-section .ls-log-bonus {
    margin-left: 0;
    width: 100%;
    text-align: center;
    margin-top: var(--space-1);
  }
  .ls-logs-section .ls-log-list {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-auto-flow: row;
  }
}

.navbar-weather:hover {
  background: var(--color-primary-alpha);
}

/* ===== 集成到 Home 页的紧凑型样式 ===== */
.ls-attrs-section {
  margin-top: var(--space-2);
  margin-bottom: var(--space-5);
}

.ls-attrs-section .wc-section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  text-align: center;
}

.ls-attrs-section .wc-section-title::before,
.ls-attrs-section .wc-section-title::after {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--color-border-strong);
}

.ls-logs-section .wc-section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  text-align: center;
}

.ls-logs-section .wc-section-title::before,
.ls-logs-section .wc-section-title::after {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--color-border-strong);
}

.ls-home-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  align-items: stretch;
  margin-bottom: var(--space-5);
}

.ls-home-row .ls-logs-section,
.ls-home-row .wc-greeting {
  margin-top: 0;
  margin-bottom: 0;
  height: 100%;
}

.ls-home-row .wc-greeting {
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}

.ls-home-row .wc-greeting-left {
  flex-direction: column;
  gap: 12px;
}

.ls-home-row .wc-greeting-title {
  font-size: 18px;
}

.ls-home-row .wc-greeting-title span {
  font-size: 16px !important;
}

.ls-home-row .growth-days {
  font-size: 28px !important;
}

.ls-logs-section {
  margin-top: var(--space-2);
}

/* 子侧栏成长力组件（环形勋章） */
.ls-growth-card {
  position: relative;
  background: linear-gradient(145deg, var(--color-surface) 0%, #FFF9ED 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  overflow: hidden;
  cursor: default;
  margin-bottom: var(--space-3);
}

/* hover 悬浮已撤：卡片保持安静，仅保留 tooltip 提示浮现 */

.ls-growth-card::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 80px;
  background: radial-gradient(ellipse at center, rgba(201, 162, 39, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.ls-growth-card .growth-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--color-text);
  color: #fff;
  font-size: var(--font-size-xs);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.ls-growth-card .growth-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--color-text);
}

.ls-growth-card:hover .growth-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ls-growth-card .growth-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  z-index: 1;
}

.ls-growth-card .growth-header::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  box-shadow: 0 0 6px var(--color-accent);
}

.ls-growth-card .growth-ring-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  z-index: 1;
}

.ls-growth-card .growth-ring-bg,
.ls-growth-card .growth-ring-progress {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.ls-growth-card .growth-ring-bg {
  stroke: var(--color-border);
}

.ls-growth-card .growth-ring-progress {
  stroke: url(#lsRingGradient);
  stroke-dasharray: 345.6;
  stroke-dashoffset: 345.6;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 数字滚动（Motion.tickTo）期间等宽数字，防止宽度抖动 */
#life-sim-growth-force-value,
.ls-attr-level { font-variant-numeric: tabular-nums; }

.ls-growth-card .growth-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ls-growth-card .growth-value {
  font-size: 40px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
}

.ls-growth-card .growth-label-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
}

.ls-growth-card .growth-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  line-height: 1;
}

.ls-growth-card .growth-trend {
  font-size: var(--font-size-sm);
  color: var(--color-accent);
  line-height: 1;
}

.ls-growth-card .growth-stage {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-primary);
  background: rgba(201, 162, 39, 0.14);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  z-index: 1;
  text-align: center;
}

.ls-growth-card .growth-hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-align: center;
  line-height: 1.5;
  z-index: 1;
}

.ls-attrs-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-4);
}

.ls-attr-cell {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-3);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ls-attr-cell:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.ls-attr-cell .ls-attr-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin: 0 auto var(--space-2);
}

.ls-attr-cell .ls-attr-name {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  font-weight: 500;
}

.ls-attr-cell .ls-attr-level {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text);
  margin: 2px 0;
  display: block;
}

.ls-attr-cell .ls-attr-title {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.ls-attr-cell .ls-attr-bar-wrap {
  height: 8px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--space-3);
}

.ls-attr-cell .ls-attr-bar {
  height: 100%;
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.ls-logs-section .ls-log-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(6, auto);
  grid-auto-flow: column;
  gap: var(--space-2) var(--space-3);
}

.ls-logs-section .ls-log-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-sm);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}

.ls-logs-section .ls-log-time {
  color: var(--color-text-muted);
  width: 100px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.ls-logs-section .ls-log-source {
  color: var(--color-text-secondary);
  flex: 1;
  min-width: 0;
}

.ls-logs-section .ls-log-arrow {
  color: var(--color-text-muted);
}

.ls-logs-section .ls-log-attr {
  font-weight: 600;
  white-space: nowrap;
}

.ls-logs-section .ls-log-attrs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ls-logs-section .ls-log-bonus {
  font-size: var(--font-size-xs);
  color: var(--color-accent);
  background: var(--color-accent-alpha);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-left: auto;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .ls-attrs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ls-logs-section .ls-log-item {
    flex-wrap: wrap;
  }
  .ls-logs-section .ls-log-bonus {
    margin-left: 0;
    width: 100%;
    text-align: center;
    margin-top: var(--space-1);
  }
}
