:root {
  color-scheme: light;
  --page: #f4f4f0;
  --panel: #fff;
  --ink: #171715;
  --muted: #74736d;
  --line: #dfded7;
  --line-strong: #c9c8c0;
  --accent: #ec5d3f;
  --accent-dark: #cd4328;
  --accent-soft: #fff0eb;
  --dark: #1d201f;
  --danger: #b9342d;
  --shadow: 0 18px 60px rgba(28, 28, 24, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--page);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% -5%, rgba(236, 93, 63, 0.08), transparent 28rem),
    var(--page);
}

body.access-pending {
  min-height: 100vh;
  overflow: hidden;
}

.access-gate {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 24px;
}

.access-gate::before,
.access-gate::after {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(201, 200, 192, 0.62);
  border-radius: 40px;
  content: "";
  transform: rotate(-8deg);
}

.access-gate::before {
  width: min(42vw, 540px);
  height: min(58vw, 720px);
  top: -32%;
  right: -8%;
}

.access-gate::after {
  width: min(32vw, 380px);
  height: min(44vw, 520px);
  bottom: -30%;
  left: -6%;
  transform: rotate(13deg);
}

.access-card {
  width: min(100%, 430px);
  padding: clamp(28px, 5vw, 42px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.access-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 46px;
}

.access-brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
}

.access-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.access-brand > span:last-child {
  display: grid;
  gap: 2px;
}

.access-brand strong {
  font-size: 15px;
}

.access-brand small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.access-card h1 {
  margin: 8px 0 12px;
  font-size: clamp(34px, 8vw, 48px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.access-copy {
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.access-form {
  display: grid;
  gap: 12px;
}

.access-error {
  min-height: 20px;
  margin: -2px 0 0;
  color: var(--danger);
  font-size: 12px;
}

.access-note {
  margin: 26px 0 0;
  color: #aaa9a2;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-align: center;
}

button,
input,
select {
  font: inherit;
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(236, 93, 63, 0.24);
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(236, 93, 63, 0.15);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.app {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 3vw, 44px);
  border-bottom: 1px solid rgba(201, 200, 192, 0.78);
  background: rgba(244, 244, 240, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand > span:last-child {
  display: grid;
  gap: 2px;
}

.brand strong {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
}

.topbar-actions,
.detail-actions,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 9px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 22px rgba(236, 93, 63, 0.2);
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.button-secondary {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.button-secondary:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: #fff;
}

.button-danger {
  color: #fff;
  background: var(--danger);
}

.button-full {
  width: 100%;
}

.layout {
  min-height: calc(100vh - 78px);
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 78px;
  height: calc(100vh - 78px);
  display: flex;
  flex-direction: column;
  padding: 30px 22px 22px clamp(18px, 3vw, 44px);
  border-right: 1px solid var(--line);
  background: rgba(248, 248, 245, 0.68);
}

.sidebar-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.19em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.sidebar-heading h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
}

.count-pill {
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  color: var(--muted);
  background: #e9e8e2;
  font-size: 12px;
  font-weight: 700;
}

.search-field {
  position: relative;
  display: block;
  margin-bottom: 15px;
}

.search-field > span {
  position: absolute;
  left: 12px;
  top: 50%;
  overflow: hidden;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: transparent;
  border: 1.8px solid var(--muted);
  border-radius: 50%;
}

.search-field > span::after {
  position: absolute;
  width: 7px;
  height: 2px;
  right: -5px;
  bottom: -2px;
  transform: rotate(45deg);
  background: var(--muted);
  content: "";
}

.search-field input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 12px 0 38px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
}

.task-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  overflow-y: auto;
  padding-right: 3px;
}

.task-list-empty {
  padding: 20px 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.task-list-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.task-list-item:hover {
  background: rgba(255, 255, 255, 0.65);
}

.task-list-item.active {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: 0 7px 22px rgba(28, 28, 24, 0.05);
}

.task-list-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.task-list-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.task-list-item b {
  align-self: center;
  color: var(--muted);
  font-size: 11px;
}

.sidebar-storage {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.storage-summary-row,
.storage-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.storage-summary-row {
  margin-bottom: 9px;
  font-size: 11px;
}

.storage-summary-row span {
  color: var(--muted);
}

.progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: #e3e2dc;
}

.progress-track span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--accent);
  transition: width 320ms ease;
}

.sidebar-storage p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.workspace {
  min-width: 0;
  padding: clamp(28px, 4.5vw, 62px);
}

.workspace-empty {
  min-height: calc(100vh - 202px);
  display: flex;
  max-width: 570px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  margin: 0 auto;
}

.workspace-empty h2 {
  margin-bottom: 13px;
  font-size: clamp(32px, 4.5vw, 48px);
  font-weight: 500;
  line-height: 0.98;
}

.workspace-empty > p:not(.eyebrow) {
  max-width: 480px;
  margin-bottom: 25px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.empty-art {
  width: min(100%, 520px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 34px;
  padding: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
}

.empty-art span {
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(20px, 3vw, 34px);
  font-weight: 800;
  background:
    linear-gradient(160deg, transparent 0 42%, rgba(255, 255, 255, 0.09) 42% 45%, transparent 45%),
    var(--dark);
}

.empty-art span:nth-child(2) {
  background-color: #6c6b64;
}

.empty-art span:nth-child(3) {
  background-color: var(--accent);
}

.task-detail {
  max-width: 1250px;
  margin: 0 auto;
}

.task-detail-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.title-line {
  display: flex;
  align-items: baseline;
  gap: 13px;
}

.title-line h2 {
  margin-bottom: 7px;
  font-family: inherit;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 750;
  line-height: 1;
}

.task-meta {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.text-button {
  border: 0;
  padding: 4px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.text-button:hover:not(:disabled) {
  color: var(--ink);
}

.danger-text,
.text-button.danger-text:hover {
  color: var(--danger);
}

.mobile-back {
  display: none;
  margin: 0 0 20px -4px;
}

.drop-zone {
  min-height: 104px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 15px;
  padding: 21px;
  background: rgba(255, 255, 255, 0.48);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.drop-zone:hover,
.drop-zone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-zone-number {
  width: 44px;
  height: 44px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--dark);
  font-size: 24px;
  font-weight: 300;
}

.drop-zone > span:last-child {
  display: grid;
  gap: 5px;
}

.drop-zone strong {
  font-size: 14px;
}

.drop-zone small {
  color: var(--muted);
  font-size: 11px;
}

.gallery-toolbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 18px;
  border-bottom: 1px solid var(--line);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  cursor: pointer;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent);
}

.selected-label {
  color: var(--muted);
  font-size: 11px;
}

.toolbar-spacer {
  flex: 1;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 12px;
  padding-top: 18px;
}

.image-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.image-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 13px 30px rgba(28, 28, 24, 0.09);
}

.image-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(236, 93, 63, 0.13);
}

.image-card-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 0;
  padding: 0;
  background: #e7e6e0;
  cursor: zoom-in;
}

.image-card-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.image-checkbox {
  position: absolute;
  z-index: 2;
  top: 9px;
  left: 9px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 9px;
  background: rgba(20, 20, 18, 0.68);
  backdrop-filter: blur(8px);
}

.image-checkbox input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.image-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 11px;
}

.image-card-body strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
}

.image-card-body small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.image-download {
  align-self: center;
  border: 0;
  padding: 4px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.image-download:hover {
  color: var(--accent);
}

.gallery-empty {
  padding: 70px 20px;
  text-align: center;
  color: var(--muted);
}

.gallery-empty p {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.gallery-empty span {
  font-size: 11px;
}

.dialog {
  width: min(620px, calc(100vw - 30px));
  max-height: calc(100vh - 30px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.dialog::backdrop,
.lightbox::backdrop {
  background: rgba(27, 27, 24, 0.56);
  backdrop-filter: blur(6px);
}

.dialog > form {
  padding: 25px;
}

.dialog-compact {
  width: min(460px, calc(100vw - 30px));
}

.dialog-wide {
  width: min(760px, calc(100vw - 30px));
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.dialog h2 {
  margin-bottom: 0;
  font-size: 27px;
  font-weight: 500;
}

.close-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: #fafaf8;
  cursor: pointer;
  font-size: 21px;
  line-height: 1;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span,
.choice-group legend {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.field > small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--ink);
  background: #fff;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 24px;
}

.sheet-preview {
  height: 130px;
  display: grid;
  grid-template-columns: 52px 1fr 60px;
  align-items: center;
  gap: 16px;
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 18px;
  background:
    linear-gradient(90deg, transparent 0 68%, #eee 68% 69%, transparent 69%),
    #f9f9f6;
}

.sheet-preview img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.sheet-preview span {
  display: grid;
  gap: 6px;
  text-align: center;
}

.sheet-preview strong {
  font-size: 26px;
  font-weight: 500;
}

.sheet-preview small {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.sheet-preview b {
  font-size: 26px;
}

.choice-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 0 0 18px;
  border: 0;
  padding: 0;
}

.choice-group legend {
  grid-column: 1 / -1;
  margin-bottom: 1px;
}

.choice-card {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px;
  cursor: pointer;
}

.choice-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.choice-card:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.45;
}

.choice-card span {
  display: grid;
  gap: 3px;
}

.choice-card strong {
  font-size: 12px;
}

.choice-card small {
  color: var(--muted);
  font-size: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
}

.toggle-field {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px;
  cursor: pointer;
}

.toggle-field span {
  display: grid;
  gap: 4px;
}

.toggle-field strong {
  font-size: 12px;
}

.toggle-field small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.privacy-note {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.settings-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.section-copy h3 {
  margin-bottom: 6px;
  font-size: 14px;
}

.section-copy p {
  max-width: 460px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.logo-control {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-preview {
  width: 66px;
  height: 66px;
  display: grid;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafaf8;
}

.logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-control > div {
  display: grid;
  justify-items: start;
  gap: 7px;
}

.file-button {
  cursor: pointer;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.storage-section,
.cleanup-section {
  grid-template-columns: 1fr;
}

.storage-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.storage-grid article {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px;
  background: #fafaf8;
}

.storage-grid span {
  color: var(--muted);
  font-size: 9px;
}

.storage-grid strong {
  font-size: 14px;
}

.progress-large {
  height: 7px;
}

.storage-foot {
  color: var(--muted);
  font-size: 10px;
}

.cleanup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.field-inline {
  grid-template-columns: minmax(130px, auto) minmax(150px, 1fr);
  align-items: center;
}

.confirm-dialog p:not(.eyebrow) {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.lightbox {
  width: min(92vw, 1100px);
  height: min(92vh, 900px);
  overflow: hidden;
  border: 0;
  padding: 0;
  background: transparent;
}

.lightbox img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.66);
  cursor: pointer;
  font-size: 24px;
}

.toast {
  position: fixed;
  z-index: 80;
  right: 22px;
  bottom: 22px;
  max-width: min(380px, calc(100vw - 44px));
  transform: translateY(20px);
  border-radius: 11px;
  padding: 12px 15px;
  color: #fff;
  background: var(--dark);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  font-size: 12px;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  background: var(--danger);
}

@media (max-width: 820px) {
  .topbar {
    position: relative;
    min-height: 70px;
    padding: 12px 16px;
  }

  .brand small {
    display: none;
  }

  .topbar-actions .button {
    min-height: 38px;
    padding: 8px 11px;
    font-size: 11px;
  }

  .layout {
    min-height: calc(100vh - 70px);
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    top: auto;
    height: calc(100vh - 70px);
    padding: 25px 16px 18px;
    border-right: 0;
  }

  .app.has-active-task .sidebar {
    display: none;
  }

  .workspace {
    display: none;
    padding: 24px 16px 50px;
  }

  .app.has-active-task .workspace {
    display: block;
  }

  .mobile-back {
    display: inline-flex;
  }

  .task-detail-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-actions {
    width: 100%;
  }

  .detail-actions .button {
    flex: 1;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .settings-section {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .storage-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .access-gate {
    padding: 16px;
  }

  .access-card {
    border-radius: 22px;
  }

  .access-brand {
    margin-bottom: 36px;
  }

  .brand strong {
    font-size: 13px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .topbar-actions {
    gap: 6px;
  }

  #open-storage-button {
    width: 50px;
    min-width: 50px;
    overflow: hidden;
    padding: 8px 6px;
    color: transparent;
    white-space: nowrap;
  }

  #open-storage-button::after {
    color: var(--ink);
    content: "设置";
  }

  .form-grid,
  .choice-group,
  .cleanup-row {
    grid-template-columns: 1fr;
  }

  .field-inline {
    grid-template-columns: 1fr;
  }

  .dialog > form {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
