:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: #22231f;
  background: #f3f0eb;
  --panel: #fffdf9;
  --ink: #22231f;
  --muted: #625f58;
  --line: #e0d9ce;
  --accent: #a7351e;
  --hot: #c0492e;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button, input, textarea { font: inherit; }
button, input, textarea, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .56; cursor: wait; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #c0492e; outline-offset: 3px; }
h1, h2, p { margin: 0; }
.wrap { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.site-header {
  height: 85px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 18px; font-weight: 750; letter-spacing: .04em; }
.mark { position: relative; width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: white; }
.mark::before, .mark::after {
  position: absolute;
  font-family: system-ui, sans-serif;
  font-size: 17px;
  font-weight: 750;
  line-height: 1;
}
.mark::before { content: '↗'; top: 5px; right: 5px; }
.mark::after { content: '↙'; bottom: 5px; left: 5px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}
.button-primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.button-primary:not(:disabled):hover { background: #902b18; border-color: #902b18; }
.button-quiet { color: var(--muted); background: transparent; }
.button-outline { background: var(--panel); border-color: var(--line); color: var(--ink); }
.button-outline:not(:disabled):hover, .button-quiet:not(:disabled):hover { background: #ede8df; color: var(--ink); }
.private-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--accent);
  letter-spacing: .09em;
}
.private-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--hot); }

.signin-wrap { display: grid; align-content: center; min-height: calc(100svh - 85px); padding-block: 48px; }
.signin {
  display: grid;
  grid-template-columns: 1.13fr 1fr;
  min-height: 492px;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: clip;
  background: var(--panel);
  box-shadow: 0 24px 54px #45352110;
}
.login-panel { display: grid; align-content: center; gap: 36px; padding: clamp(30px, 5.5vw, 76px); }
.login-panel h1 { font-size: clamp(32px, 4.5vw, 51px); line-height: 1.16; letter-spacing: -.06em; margin: 15px 0 12px; }
.login-panel p, .intro p { color: var(--muted); font-size: 15px; line-height: 1.7; }
#login-form { display: grid; gap: 10px; }
#login-form label { font-size: 14px; font-weight: 650; }
.login-submit { min-height: 49px; justify-content: space-between; padding-inline: 16px; margin-top: 4px; }
.login-submit span { font-size: 20px; }
#login-form .form-error { color: var(--accent); font-size: 13px; }
.art { position: relative; display: grid; place-items: center; overflow: hidden; background: #292a25; min-height: 235px; }
.art::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 72% 25%, #515047 0%, transparent 66%),
    radial-gradient(#eaebce40 1px, transparent 1px);
  background-size: 100% 100%, 20px 20px;
}
.art-orbit { position: absolute; border: 1px solid #fff8e633; border-radius: 50%; aspect-ratio: 1; }
.orbit-outer { width: 78%; }
.orbit-inner { width: 61%; }
.art-ticket {
  grid-area: 1 / 1;
  width: clamp(126px, 17vw, 190px);
  height: clamp(154px, 20vw, 220px);
  border-radius: 15px;
  padding: 20px;
  box-shadow: 7px 15px 36px #17171165;
}
.art-ticket-back { background: #dd694b; color: #2d211c; transform: translate(28%, -8%) rotate(16deg); }
.art-ticket-back span { display: block; text-align: right; font: 700 32px system-ui; }
.art-ticket-front {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 9px;
  background: #f7e8cf;
  color: #38342c;
  transform: translate(-23%, 12%) rotate(-13deg);
}
.ticket-icon { margin-bottom: auto; font: 600 clamp(36px, 6vw, 69px)/1 system-ui; }
.ticket-line { display: block; width: 86%; height: 4px; background: #c1ab8f; border-radius: 3px; }
.ticket-line.short { width: 58%; }

.dashboard { padding-block: 46px 65px; }
.intro { display: flex; justify-content: space-between; align-items: end; gap: 26px; margin-bottom: 30px; }
.intro h1 {
  margin: 10px 0 7px;
  font-size: clamp(36px, 5.6vw, 62px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.065em;
}
.usage { width: 190px; margin-bottom: 5px; }
.usage-label { display: block; font-variant-numeric: tabular-nums; font-size: 13px; text-align: right; color: var(--muted); margin-bottom: 7px; }
progress { width: 100%; height: 6px; appearance: none; border: 0; border-radius: 9px; background: #e9e0d3; overflow: hidden; }
progress::-webkit-progress-bar { background: #e9e0d3; }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }

.composer { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 15px; min-width: 0; }
.compose-panel { padding: 21px; display: flex; flex-direction: column; gap: 17px; }
.panel-heading { display: flex; align-items: center; gap: 13px; }
.tile { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; flex: none; font: 650 22px system-ui; }
.tile-file { background: #f7dfd5; color: var(--accent); }
.tile-text { background: #e7eadb; color: #40533c; }
.panel-heading h2 { font-size: 19px; font-weight: 740; }
.panel-heading p { font-size: 13px; color: var(--muted); margin-top: 3px; }
.dropzone {
  flex: 1;
  min-height: 195px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 15px;
  border: 1px dashed #c8bbaa;
  border-radius: 10px;
  background: #f8f5ef;
}
.dropzone.dragging { background: #f7dfd5; border-color: var(--accent); }
.dropzone p { text-align: center; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.dropzone progress { max-width: 180px; }
#text-form { display: grid; gap: 9px; justify-items: start; }
input:not([type=file]), textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fffdf9;
  min-width: 0;
  font-size: 16px;
}
input::placeholder, textarea::placeholder { color: #706b63; }
textarea { min-height: 94px; resize: vertical; }
#access-key { min-height: 49px; }

.library { margin-top: 33px; }
.library-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 13px; }
.library-heading h2 { font-size: 23px; }
#item-count { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.filters { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; gap: 2px; }
.filters button { border: 0; padding: 6px 13px; min-height: 33px; border-radius: 6px; background: transparent; color: var(--muted); font-size: 13px; }
.filters button[aria-pressed=true] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px #34302220; font-weight: 700; }
.empty { padding: 34px 15px; text-align: center; color: var(--muted); font-size: 14px; }
.record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 16px;
  padding: 13px 17px;
  min-width: 0;
}
.record + .record { border-top: 1px solid var(--line); }
.record-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.record-main:hover .record-name { color: var(--accent); text-decoration: underline; }
.record-info { min-width: 0; }
.record-name { display: block; font-weight: 675; overflow-wrap: anywhere; line-height: 1.35; }
.record-meta { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.record-actions, .detail-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.record-actions .button { min-height: 37px; padding: 6px 9px; font-size: 13px; }

.detail-wrap { padding-block: 38px 72px; max-width: 860px; }
.back { display: inline-block; padding: 5px 0; color: var(--muted); font-size: 14px; }
.back:hover { color: var(--accent); }
.detail { margin-top: 12px; padding: clamp(20px, 5vw, 48px); }
.detail .tile { margin-bottom: 16px; }
.detail h1 { font-size: clamp(24px, 4.5vw, 42px); line-height: 1.2; overflow-wrap: anywhere; }
.muted, .detail-meta { color: var(--muted); }
.detail-meta { margin: 8px 0 19px; font-size: 14px; }
.detail pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f6f2ea;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin: 0 0 18px;
  font: 14px/1.7 ui-monospace, monospace;
  max-height: 55vh;
  overflow: auto;
}
.toast {
  position: fixed;
  z-index: 1;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100% - 48px));
  background: #292a25;
  color: white;
  padding: 13px 17px;
  border-radius: 9px;
  box-shadow: 0 6px 26px #28292235;
  font-size: 14px;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .wrap { width: calc(100% - 36px); }
  .site-header { height: 66px; }
  .signin-wrap { min-height: auto; padding-block: 27px; }
  .signin { grid-template-columns: 1fr; min-height: 0; }
  .login-panel { padding: 29px 23px; gap: 24px; }
  .art { min-height: 219px; }
  .orbit-outer { width: 230px; } .orbit-inner { width: 180px; }
  .art-ticket { width: 112px; height: 145px; padding: 15px; }
  .dashboard { padding-block: 29px 48px; }
  .intro { display: grid; gap: 13px; margin-bottom: 20px; }
  .intro h1 { margin-top: 8px; }
  .usage { width: min(100%, 240px); }
  .usage-label { text-align: left; margin-bottom: 3px; }
  .composer { grid-template-columns: 1fr; gap: 12px; }
  .compose-panel { padding: 17px; }
  .dropzone { min-height: 129px; }
  .library { margin-top: 24px; }
  .record { grid-template-columns: 1fr; padding: 12px; gap: 6px; }
  .record-actions { margin-left: 45px; }
  .detail-wrap { padding-top: 24px; }
}
