:root {
  --ink: #1d2a25;
  --muted: #6d746d;
  --paper: #f4f1e9;
  --panel: #fffdf7;
  --line: #d9d7cd;
  --green: #1c6545;
  --green-dark: #124b33;
  --mint: #dce9df;
  --orange: #e87542;
  --danger: #a43d35;
  --shadow: 0 16px 50px rgba(35, 52, 43, 0.09);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 8%, rgba(232, 117, 66, .13), transparent 26rem),
    radial-gradient(circle at 4% 92%, rgba(28, 101, 69, .11), transparent 28rem),
    var(--paper);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

main {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 80px;
}

.site-header {
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: var(--ink);
  display: inline-flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  font-size: 18px;
  font-weight: 760;
  letter-spacing: -.02em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--green);
  font-size: 12px;
  letter-spacing: .04em;
  box-shadow: 0 8px 22px rgba(28, 101, 69, .24);
}

.login-view {
  min-height: calc(100vh - 150px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 42px 0 90px;
}

.eyebrow {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
}

h1, h2, p { margin-top: 0; }
h1 {
  max-width: 860px;
  margin: 20px 0 24px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(46px, 7.6vw, 92px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -.055em;
}

h1 span { color: var(--green); }
.lead {
  max-width: 560px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.unlock-card {
  width: min(590px, 100%);
  margin-top: 28px;
  padding: 24px;
  border: 1px solid rgba(29, 42, 37, .1);
  border-radius: 20px;
  background: rgba(255, 253, 247, .84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.unlock-card label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
}

.password-row { display: flex; gap: 10px; }

input, textarea, select {
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(28, 101, 69, .12);
}

.password-row input {
  min-width: 0;
  flex: 1;
  padding: 13px 15px;
  border-radius: 10px;
}

.password-row button, .primary-button {
  border: 0;
  border-radius: 10px;
  padding: 13px 20px;
  color: white;
  background: var(--green);
  font-weight: 700;
  transition: background .2s, transform .2s;
}

.password-row button:hover, .primary-button:hover { background: var(--green-dark); }
.password-row button:active, .primary-button:active { transform: translateY(1px); }
.primary-button:disabled { opacity: .55; cursor: not-allowed; }

.form-message {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 13px;
}

.feature-row {
  display: flex;
  gap: 28px;
  margin-top: 42px;
  color: var(--muted);
  font-size: 13px;
}

.feature-row span::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--orange);
}

.app-view { padding-top: 40px; }
.workspace-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 34px;
}

.workspace-heading h1 {
  margin: 10px 0 0;
  font-size: clamp(42px, 6vw, 72px);
}

.storage-badge {
  margin-bottom: 10px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.5);
  font-size: 12px;
}

.tabs {
  display: flex;
  gap: 6px;
  width: fit-content;
  padding: 5px;
  border-radius: 12px;
  background: #e7e4da;
}

.tab {
  padding: 9px 19px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}
.tab.active { color: var(--ink); background: var(--panel); box-shadow: 0 2px 8px rgba(0,0,0,.06); }

.panel {
  display: none;
  margin-top: 16px;
  padding: 28px;
  border: 1px solid rgba(29, 42, 37, .1);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.panel.active { display: block; }

.drop-zone {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed #aebbb1;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(220,233,223,.42), rgba(255,255,255,.5));
  transition: border-color .2s, background .2s, transform .2s;
}
.drop-zone:hover, .drop-zone.dragging {
  border-color: var(--green);
  background: var(--mint);
  transform: translateY(-1px);
}
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone strong { margin-top: 14px; font-size: 17px; }
.drop-zone small { margin-top: 8px; color: var(--muted); }
.drop-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-size: 28px;
  font-weight: 300;
}

.file-selection {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--muted);
  background: #f1efe8;
  font-size: 13px;
}

.action-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
}

.retention-label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.retention-label select { min-width: 180px; padding: 11px 12px; border-radius: 9px; }

.progress-wrap { margin-top: 22px; }
.progress-meta { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.progress-track { height: 9px; overflow: hidden; border-radius: 99px; background: #e5e2d8; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), #4b9671); transition: width .15s; }

.text-form input, .text-form textarea {
  width: 100%;
  padding: 14px 15px;
  border-radius: 10px;
}
.text-form textarea {
  min-height: 270px;
  margin-top: 12px;
  resize: vertical;
  line-height: 1.6;
}

.library { margin-top: 56px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 18px; }
.section-heading h2 { margin: 8px 0 0; font-family: Georgia, "Songti SC", serif; font-size: 34px; font-weight: 500; }
.text-button { padding: 6px 2px; border: 0; color: var(--green); background: transparent; font-weight: 700; }

.items-list { display: grid; gap: 10px; }
.item-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 15px 16px;
  border: 1px solid rgba(29, 42, 37, .1);
  border-radius: 14px;
  background: rgba(255, 253, 247, .72);
}
.item-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--green);
  background: var(--mint);
  font-size: 12px;
  font-weight: 800;
}
.item-main { min-width: 0; }
.item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.item-meta { margin-top: 5px; color: var(--muted); font-size: 12px; }
.item-actions { display: flex; align-items: center; gap: 5px; }
.item-actions button, .item-actions a {
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--green);
  background: transparent;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}
.item-actions button:hover, .item-actions a:hover { background: var(--mint); }
.item-actions .delete-button { color: var(--danger); }
.item-actions .delete-button:hover { background: #f4e3df; }
.empty-state { padding: 44px 20px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  padding: 12px 16px;
  border-radius: 10px;
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateY(0); }

.public-text {
  width: min(780px, calc(100% - 40px));
  margin: 70px auto;
}
.public-card {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.public-card h1 { margin: 10px 0 18px; font-size: clamp(34px, 7vw, 56px); }
.public-card pre {
  overflow: auto;
  max-height: 60vh;
  margin: 0;
  padding: 18px;
  border-radius: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f0eee7;
  font: 14px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
}

@media (max-width: 680px) {
  main { width: min(100% - 24px, 1100px); }
  .site-header { height: 72px; }
  .login-view { padding-top: 36px; }
  .password-row { flex-direction: column; }
  .password-row button { width: 100%; }
  .feature-row { flex-wrap: wrap; gap: 12px 20px; }
  .workspace-heading { align-items: flex-start; flex-direction: column; }
  .storage-badge { margin: 0; }
  .panel { padding: 16px; }
  .drop-zone { min-height: 210px; text-align: center; }
  .action-row { align-items: stretch; flex-direction: column; }
  .retention-label select { width: 100%; }
  .primary-button { width: 100%; }
  .item-card { grid-template-columns: auto minmax(0,1fr); }
  .item-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .public-card { padding: 20px; }
}
