/* ===== 成就 (paper / ink) ===== */

/* Home: streak pill and achievements pill share one row (wraps on very narrow phones). */
.ha-pillrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 8px;
  margin: 0 0 6px;
  flex: none;
}
.ha-pillrow:not(:has(.is-on)) {
  display: none;
}
.ha-pillrow .ha-streak {
  margin: 0;
}

.ha-ach {
  display: none;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--ha-panel, var(--paper, #f7f1e6));
  border: 1px solid var(--line, #3a3530);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink, #2a2a2a);
  position: relative;
  z-index: 1;
  cursor: pointer;
  transition: transform 90ms ease;
  -webkit-tap-highlight-color: transparent;
}
.ha-ach.is-on {
  display: inline-flex;
}
.ha-ach::after {
  content: "";
  position: absolute;
  inset: -11px -4px;
}
.ha-ach:active {
  transform: scale(0.965);
}
.ha-ach.is-claimable {
  background: var(--ink, #2a2a2a);
  color: var(--paper, #fff1c9);
  border-color: var(--ink, #2a2a2a);
}
[data-theme="dark"] .ha-ach.is-claimable {
  background: var(--paper, #efe6d4);
  color: var(--ink, #1c1a16);
}

/* Sheet */
.ach-dialog {
  width: min(480px, 100%);
}
.ach-dialog h2 {
  margin-bottom: 4px;
}
.ach-sub {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: var(--mute, #7a7066);
}
.ach-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin: 0 -6px;
  padding: 0 6px;
}
.ach-group {
  margin: 0 0 8px;
}
.ach-group-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1.5px solid var(--line, #3a3530);
  border-radius: 12px;
  background: var(--paper-2, #efe4cc);
  color: var(--ink, #2a2a2a);
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ach-group-head:active {
  transform: scale(0.99);
}
.ach-group-name {
  font-family: var(--kaiti, serif);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.ach-group-head small {
  font: 600 0.72rem/1 var(--sans, system-ui);
  color: var(--mute, #7a7066);
}
.ach-group-badge {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--ink, #2a2a2a);
  color: var(--paper, #fff1c9);
  font: 800 0.7rem/1 var(--sans, system-ui);
  font-style: normal;
}
[data-theme="dark"] .ach-group-badge {
  background: var(--paper, #efe6d4);
  color: var(--ink, #1c1a16);
}
.ach-chev {
  flex: none;
  width: 8px;
  height: 8px;
  margin: 0 4px 3px 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}
.ach-group-head small + .ach-chev {
  margin-left: auto;
}
.ach-group.is-expanded .ach-chev {
  transform: rotate(-135deg) translate(-2px, -2px);
}
.ach-group.is-expanded .ach-group-head {
  border-style: dashed;
}
.ach-group-body {
  padding-top: 8px;
}
.ach-group-body[hidden] {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .ach-chev {
    transition: none;
  }
}
.ach-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  margin-bottom: 6px;
  border: 1.5px dashed var(--line, #3a3530);
  border-radius: 12px;
  background: var(--paper-2, #efe4cc);
}
.ach-item.is-claimable {
  border-style: solid;
  border-color: var(--ink, #2a2a2a);
  background: var(--paper, #fff1c9);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.14);
}
.ach-item.is-claimed {
  opacity: 0.6;
}
.ach-main {
  flex: 1 1 auto;
  min-width: 0;
}
.ach-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  font-weight: 800;
  font-size: 0.92rem;
}
.ach-reward {
  font-size: 0.72rem;
  font-weight: 700;
  color: #b4572a;
}
.ach-desc {
  margin-top: 1px;
  font-size: 0.78rem;
  color: var(--mute, #7a7066);
}
.ach-bar {
  margin-top: 6px;
  height: 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.1);
  overflow: hidden;
}
.ach-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--ink, #2a2a2a);
}
.ach-side {
  flex: 0 0 auto;
  min-width: 56px;
  text-align: right;
}
.ach-prog {
  font-size: 0.74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--mute, #7a7066);
  white-space: nowrap;
}
.ach-done {
  font-weight: 800;
  color: #c0392b;
}
.ach-claim {
  position: relative;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--ink, #2a2a2a);
  background: var(--ink, #2a2a2a);
  color: var(--paper, #fff1c9);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}
.ach-claim::after {
  content: "";
  position: absolute;
  inset: -6px -4px;
}
.ach-claim:active {
  transform: scale(0.96);
}
[data-theme="dark"] .ach-claim {
  background: var(--paper, #efe6d4);
  color: var(--ink, #1c1a16);
}
[data-theme="dark"] .ach-item.is-claimable {
  background: var(--paper, #1c1a16);
}
.ach-actions {
  margin-top: 10px;
}
.ach-actions .announcements-primary {
  flex: 1;
}
.ach-actions .announcements-primary:disabled {
  opacity: 0.6;
  cursor: default;
}
