:root {
  --ink: #13251f;
  --muted: #68766f;
  --line: #dde6e1;
  --card: rgba(255, 255, 255, 0.92);
  --green: #1f7559;
  --green-dark: #155642;
  --green-pale: #e8f5ef;
  --cream: #f5f4ee;
  --gold: #c89443;
  --danger: #ad3f3f;
  --danger-pale: #fff0ee;
  --shadow: 0 22px 60px rgba(26, 52, 43, 0.1);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--cream); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 7% 8%, rgba(45, 132, 99, 0.12), transparent 30rem),
    radial-gradient(circle at 88% 84%, rgba(199, 149, 69, 0.11), transparent 32rem),
    #f7f7f2;
}

button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }

.background-orb {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(1px);
  pointer-events: none;
}

.orb-one { width: 18rem; height: 18rem; left: -8rem; top: 28%; background: rgba(31, 117, 89, 0.08); }
.orb-two { width: 22rem; height: 22rem; right: -9rem; bottom: -8rem; background: rgba(200, 148, 67, 0.08); }

.page-shell { width: min(1160px, calc(100% - 36px)); margin: 0 auto; padding: 28px 0 42px; }
.card { background: var(--card); border: 1px solid rgba(215, 226, 220, 0.95); border-radius: 22px; box-shadow: var(--shadow); }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.muted { color: var(--muted); font-size: 0.9rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.button-primary { color: white; background: linear-gradient(135deg, var(--green), var(--green-dark)); box-shadow: 0 8px 20px rgba(31, 117, 89, .18); }
.button-dark { color: white; background: var(--ink); }
.button-quiet { min-height: 36px; color: var(--muted); background: #edf1ef; }
.button-wide { width: 100%; }
.button-small { min-height: 34px; padding: 0 13px; border-radius: 10px; font-size: .82rem; }
.button-preview { color: #745315; background: #fff4d9; }
.button-share { color: #245a90; background: #e7f1fb; }
.button-download { color: var(--green-dark); background: var(--green-pale); }
.button-revoke { color: #8a5a1a; background: #fff1d7; }
.button-delete { color: var(--danger); background: var(--danger-pale); }

.login-layout { min-height: calc(100vh - 70px); display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.brand-panel { padding: 60px 7vw 60px 20px; }
.brand-mark, .wordmark-icon {
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, var(--green), #2c916d);
  box-shadow: 0 12px 28px rgba(31, 117, 89, .2);
  font-weight: 850;
  letter-spacing: -.05em;
}
.brand-mark { width: 66px; height: 66px; margin-bottom: 38px; border-radius: 19px; font-size: 1.4rem; }
.brand-panel h1 { max-width: 620px; margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(2.8rem, 4.2vw, 3.8rem); font-weight: 500; line-height: 1.03; letter-spacing: -.055em; }
.brand-copy { max-width: 480px; margin: 28px 0 24px; color: var(--muted); font-size: 1.04rem; line-height: 1.8; }
.brand-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.brand-meta span { padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--green-dark); background: rgba(255,255,255,.5); font-size: .82rem; font-weight: 700; }
.login-card { max-width: 470px; width: 100%; justify-self: end; padding: 42px; }
.card-heading h2, .storage-card h2, .security-card h2, .files-heading h2 { margin: 0; font-size: 1.55rem; letter-spacing: -.025em; }
.card-heading > p:last-child { margin: 9px 0 0; color: var(--muted); line-height: 1.6; }
.card-heading.compact h2 { font-size: 1.3rem; }
.form-stack { display: grid; gap: 18px; margin-top: 28px; }
.form-stack label { display: grid; gap: 8px; color: var(--ink); font-size: .88rem; font-weight: 700; }
input[type="text"], input[type="password"], input[type="search"], input:not([type]), select {
  width: 100%; min-height: 50px; padding: 0 15px; border: 1px solid #d5dfda; border-radius: 12px; outline: none; background: #fbfdfc; transition: border .15s, box-shadow .15s;
}
input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(31,117,89,.1); }
.privacy-note { margin: 18px 0 0; color: #8a9690; text-align: center; font-size: .78rem; }

.flash-stack { display: grid; gap: 9px; margin: 20px 0 0; }
.page-flashes { margin: 18px 0; }
.flash { padding: 12px 15px; border-radius: 12px; font-size: .88rem; font-weight: 650; }
.flash-success { color: #166147; background: #e4f5ec; }
.flash-warning { color: #795615; background: #fff6dd; }
.flash-danger { color: #9e3838; background: #ffebe8; }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.wordmark { display: flex; align-items: center; gap: 12px; }
.wordmark-icon { width: 44px; height: 44px; border-radius: 13px; font-size: .92rem; }
.wordmark > span:last-child { display: grid; }
.wordmark strong { font-size: 1rem; }
.wordmark small { margin-top: 2px; color: var(--muted); font-size: .67rem; letter-spacing: .08em; text-transform: uppercase; }
.account-actions { display: flex; align-items: center; gap: 12px; }
.account-name { font-size: .86rem; font-weight: 800; }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.storage-card, .upload-card { min-height: 250px; padding: 28px; }
.card-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.storage-card h2 span { color: #9aa49f; font-size: .95rem; font-weight: 600; }
.storage-badge { padding: 8px 11px; color: var(--green-dark); background: var(--green-pale); border-radius: 999px; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.quota-progress { display: block; width: 100%; height: 12px; margin: 40px 0 18px; overflow: hidden; border: 0; border-radius: 999px; background: #e9eeeb; appearance: none; }
.quota-progress::-webkit-progress-bar { background: #e9eeeb; border-radius: 999px; }
.quota-progress::-webkit-progress-value { background: linear-gradient(90deg, var(--green), #50a681); border-radius: 999px; }
.quota-progress::-moz-progress-bar { background: linear-gradient(90deg, var(--green), #50a681); border-radius: 999px; }
.capacity-warning { margin: 0; color: var(--danger); font-size: .88rem; font-weight: 700; }
.upload-form { display: grid; gap: 12px; margin-top: 18px; }
.file-picker { display: flex; align-items: center; gap: 14px; min-height: 74px; padding: 13px; border: 1px dashed #b9cac1; border-radius: 15px; background: #fafcfb; cursor: pointer; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease; }
.file-picker:hover { border-color: var(--green); background: #f5faf7; }
.file-picker.is-dragover { border-color: var(--green); background: #eaf7f0; box-shadow: 0 0 0 4px rgba(31, 117, 89, .1); transform: translateY(-2px); }
.file-picker.is-dragover .file-picker-icon { color: white; background: var(--green); transform: scale(1.06); }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-picker-icon { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 12px; color: var(--green); background: var(--green-pale); font-size: 1.4rem; transition: color .18s ease, background .18s ease, transform .18s ease; }
.file-picker-text { display: grid; min-width: 0; }
.file-picker-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .91rem; }
.file-picker-text small { margin-top: 4px; color: var(--muted); font-size: .75rem; }
.photo-batch-picker { display: flex; align-items: center; gap: 13px; min-height: 66px; padding: 12px 13px; border: 1px solid #cbdceb; border-radius: 15px; color: #245a90; background: #f2f7fc; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.photo-batch-picker:hover { border-color: #6b9aca; background: #eaf3fb; transform: translateY(-1px); }
.photo-batch-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-batch-icon { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 12px; color: white; background: #4d83b7; font-size: 1.25rem; }
.photo-batch-text { display: grid; min-width: 0; flex: 1; }
.photo-batch-text strong { font-size: .9rem; }
.photo-batch-text small { margin-top: 4px; color: #67829b; font-size: .74rem; line-height: 1.45; }
.photo-batch-badge { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; color: #245a90; background: #dcecf9; font-size: .68rem; font-weight: 800; }
.photo-selection { margin: -2px 2px 0; color: var(--green-dark); font-size: .8rem; font-weight: 750; }
.form-error { margin: 0; color: var(--danger); font-size: .82rem; font-weight: 700; }
.upload-status { padding: 5px 0; }
.upload-status-row { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--muted); font-size: .78rem; }
.upload-progress { display: block; width: 100%; height: 7px; overflow: hidden; border: 0; border-radius: 99px; background: #e6ece8; appearance: none; }
.upload-progress::-webkit-progress-bar { background: #e6ece8; border-radius: 99px; }
.upload-progress::-webkit-progress-value { background: var(--green); border-radius: 99px; }
.upload-progress::-moz-progress-bar { background: var(--green); border-radius: 99px; }

.security-card { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; margin-top: 20px; padding: 23px 26px; box-shadow: none; }
.security-card.is-unlocked { border-color: #b9ddcc; background: rgba(237, 249, 243, .9); }
.security-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 15px; color: var(--green); background: var(--green-pale); font-size: 1.4rem; font-weight: 850; }
.security-copy h2 { font-size: 1.1rem; }
.security-copy p:last-child { margin: 5px 0 0; color: var(--muted); font-size: .84rem; }
.unlock-form { display: flex; gap: 9px; }
.unlock-form input { width: 190px; min-height: 42px; }

.files-card { margin-top: 20px; padding: 28px; }
.files-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 20px; }
.files-heading h2 span { color: var(--green); font-size: .9rem; vertical-align: middle; }
.file-list { border-top: 1px solid var(--line); }
.file-row { display: grid; grid-template-columns: minmax(260px, 2fr) .6fr .9fr .8fr; gap: 18px; align-items: center; min-height: 72px; border-bottom: 1px solid var(--line); }
.file-row-head { min-height: 42px; color: #8b9791; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.file-name-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.file-name-cell > div { display: grid; min-width: 0; }
.file-name-cell strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .89rem; }
.file-icon { display: grid; place-items: center; flex: 0 0 39px; height: 43px; border-radius: 9px 9px 9px 4px; color: var(--green-dark); background: #e9f3ee; font-size: .62rem; font-weight: 850; }
.file-size, .file-date { color: var(--muted); font-size: .8rem; }
.file-actions { display: flex; justify-content: flex-end; gap: 7px; }
.file-actions form { display: inline-flex; }
.locked-label { color: #9ba59f; font-size: .74rem; font-weight: 700; }
.missing-file { margin-top: 3px; color: var(--danger); font-size: .7rem; }
.share-state { margin-top: 3px; color: #3673a8; font-size: .7rem; }
.empty-state { padding: 58px 20px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 18px; color: var(--green); background: var(--green-pale); font-size: 1.7rem; }
.empty-state h3 { margin: 0; font-size: 1rem; }
.empty-state p { margin: 8px 0 0; color: var(--muted); font-size: .83rem; }
.site-footer { padding: 28px 0 0; color: #8d9792; text-align: center; font-size: .74rem; }

.error-card { max-width: 620px; margin: 14vh auto 0; padding: 52px; text-align: center; }
.error-card .brand-mark { margin: 0 auto 28px; }
.error-card h1 { margin: 0 0 28px; font-size: 1.55rem; }
.public-share-card { max-width: 620px; margin: 10vh auto 0; padding: 44px; text-align: center; }
.public-share-card .brand-mark { margin: 0 auto 26px; }
.public-share-card h1 { margin: 0; overflow-wrap: anywhere; font-size: clamp(1.55rem, 4vw, 2.15rem); letter-spacing: -.035em; }
.share-description { margin: 17px auto 22px; max-width: 470px; color: var(--muted); line-height: 1.75; }
.share-file-meta { display: flex; justify-content: center; gap: 9px; flex-wrap: wrap; margin: 14px 0 0; }
.share-file-meta span { padding: 7px 10px; border-radius: 999px; color: var(--green-dark); background: var(--green-pale); font-size: .78rem; font-weight: 750; }
.share-link-label { display: block; margin: 22px 0 8px; color: var(--ink); text-align: left; font-size: .82rem; font-weight: 750; }
.share-link-row { display: flex; gap: 9px; }
.share-link-field { min-width: 0; flex: 1; font-size: .78rem; }
.wechat-tip { margin-top: 16px; padding: 12px 14px; border-radius: 12px; color: #71541d; background: #fff6df; text-align: left; font-size: .8rem; line-height: 1.6; }
.return-link { margin-top: 20px; }
.share-download { margin-top: 24px; min-height: 50px; }

.file-manager-card { margin-top: 20px; padding: 28px; }
.manager-topline { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.breadcrumbs { display: flex; align-items: center; gap: 9px; min-width: 0; overflow-x: auto; color: var(--muted); font-size: .84rem; white-space: nowrap; }
.breadcrumbs a { color: var(--green-dark); font-weight: 750; }
.breadcrumbs span { color: #a4aea9; }
.trash-link { flex: 0 0 auto; padding: 8px 12px; border-radius: 10px; color: var(--danger); background: var(--danger-pale); font-size: .8rem; font-weight: 750; }
.trash-link span { display: inline-grid; place-items: center; min-width: 19px; height: 19px; margin-left: 3px; border-radius: 99px; color: white; background: var(--danger); font-size: .68rem; }
.manager-controls { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 20px 0; }
.search-form, .new-folder-form { display: flex; gap: 9px; align-items: center; }
.search-form { flex: 1; }
.search-form input { max-width: 310px; }
.search-form select, .move-control select { min-height: 42px; padding: 0 36px 0 12px; border: 1px solid #d5dfda; border-radius: 12px; color: var(--ink); background: #fbfdfc; }
.new-folder-form input { width: 210px; min-height: 42px; }
.search-summary { margin: 4px 0 18px; color: var(--muted); font-size: .85rem; }
.folder-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0 28px; }
.folder-card { padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: #fbfdfc; }
.folder-main { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 3px; }
.folder-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.folder-icon { display: grid; place-items: center; flex: 0 0 42px; height: 34px; border-radius: 7px; color: #9a6c24; background: #fff1cf; font-size: 1.15rem; }
.folder-actions { display: grid; gap: 7px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.folder-actions form:first-child { display: flex; gap: 6px; }
.folder-actions input { min-width: 0; min-height: 34px; padding: 0 9px; font-size: .78rem; }
.folder-actions form:last-child { display: flex; justify-content: flex-end; }
.manager-files-heading { margin-top: 6px; }
.batch-toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin: 0 0 12px; padding: 11px 12px; border-radius: 13px; background: #f2f6f4; }
.batch-toolbar > span { margin-right: auto; color: var(--muted); font-size: .78rem; font-weight: 700; }
.select-all { display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: .8rem; font-weight: 750; cursor: pointer; }
.select-all input, .file-check input { width: 17px; height: 17px; accent-color: var(--green); cursor: pointer; }
.move-control { display: flex; gap: 6px; }
.move-control select { max-width: 190px; min-height: 34px; padding-block: 0; font-size: .78rem; }
.file-row.with-check { grid-template-columns: 30px minmax(230px, 2fr) .55fr .85fr minmax(260px, auto); }
.file-check { display: grid; place-items: center; }
.file-thumbnail { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: #edf2ef; }
.folder-location { margin-top: 3px; color: #8a9690; font-size: .7rem; }
.trash-card { margin-top: 20px; }
.file-row.trash-row { grid-template-columns: 30px minmax(260px, 2fr) .6fr .9fr .6fr; }
.trash-expiry { color: #8a5a1a; font-size: .8rem; font-weight: 750; }
.batch-public-card { max-width: 700px; }
.public-file-list { display: grid; gap: 8px; max-height: 380px; margin-top: 20px; overflow-y: auto; text-align: left; }
.public-file-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfc; }
.public-file-list a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; font-weight: 750; }
.public-file-list a small { color: var(--muted); font-size: .74rem; }
.public-file-list a strong { color: var(--green); font-size: .78rem; }

@media (max-width: 860px) {
  .login-layout { grid-template-columns: 1fr; gap: 24px; padding: 30px 0; }
  .brand-panel { padding: 20px 8px; }
  .brand-panel h1 { font-size: 3.3rem; }
  .brand-copy { margin: 20px 0; }
  .brand-mark { margin-bottom: 25px; }
  .login-card { max-width: none; justify-self: stretch; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .security-card { grid-template-columns: auto 1fr; }
  .unlock-form { grid-column: 1 / -1; }
  .unlock-form input { flex: 1; width: auto; }
  .file-row { grid-template-columns: minmax(210px, 1.7fr) .6fr .9fr; }
  .file-row > :nth-child(4) { grid-column: 3; }
  .file-row-head > :nth-child(4) { display: none; }
  .file-actions { justify-content: flex-start; }
  .manager-controls { align-items: stretch; flex-direction: column; }
  .search-form, .new-folder-form { width: 100%; }
  .search-form input, .new-folder-form input { max-width: none; flex: 1; width: auto; }
  .folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .file-row.with-check { grid-template-columns: 30px minmax(210px, 1.7fr) .6fr .9fr; }
  .file-row.with-check > :nth-child(5) { grid-column: 4; }
  .file-row.with-check.file-row-head > :nth-child(5) { display: none; }
  .file-row.trash-row { grid-template-columns: 30px minmax(210px, 1.7fr) .6fr .9fr .6fr; }
}

@media (max-width: 620px) {
  .page-shell { width: min(100% - 22px, 1160px); padding-top: 16px; }
  .brand-panel h1 { font-size: 2.55rem; }
  .brand-panel { padding-inline: 4px; }
  .login-card, .storage-card, .upload-card, .files-card, .file-manager-card { padding: 22px; border-radius: 18px; }
  .topbar { margin-bottom: 18px; }
  .account-name { display: none; }
  .card-row, .files-heading { align-items: flex-start; flex-direction: column; }
  .quota-progress { margin-top: 28px; }
  .security-card { grid-template-columns: 1fr; padding: 22px; }
  .security-icon { width: 43px; height: 43px; }
  .unlock-form { display: grid; grid-template-columns: 1fr; }
  .unlock-form input { width: 100%; }
  .file-row-head { display: none; }
  .file-row { grid-template-columns: 1fr auto; gap: 8px 12px; padding: 15px 0; }
  .file-name-cell { grid-column: 1 / -1; }
  .file-size, .file-date { align-self: center; }
  .file-actions { grid-column: 1 / -1; justify-content: flex-start; margin-top: 4px; }
  .file-actions .button, .file-actions form { flex: 1; }
  .file-actions form .button { width: 100%; }
  .public-share-card { margin-top: 7vh; padding: 30px 22px; }
  .share-link-row { flex-direction: column; }
  .share-link-row .button { width: 100%; }
  .site-footer { line-height: 1.7; }
  .manager-topline { align-items: flex-start; }
  .manager-controls, .search-form, .new-folder-form { align-items: stretch; }
  .search-form { display: grid; grid-template-columns: 1fr 1fr; }
  .search-form input { grid-column: 1 / -1; }
  .new-folder-form { display: grid; grid-template-columns: 1fr; }
  .new-folder-form input { width: 100%; }
  .folder-grid { grid-template-columns: 1fr; }
  .batch-toolbar { align-items: stretch; }
  .batch-toolbar > span { width: calc(100% - 70px); margin-right: 0; align-self: center; }
  .move-control { width: 100%; }
  .move-control select { max-width: none; flex: 1; }
  .file-row.with-check { grid-template-columns: 28px 1fr auto; gap: 8px 10px; }
  .file-row.with-check .file-check { grid-row: 1; grid-column: 1; }
  .file-row.with-check .file-name-cell { grid-row: 1; grid-column: 2 / -1; }
  .file-row.with-check .file-size { grid-row: 2; grid-column: 2; }
  .file-row.with-check .file-date { grid-row: 2; grid-column: 3; }
  .file-row.with-check .file-actions { grid-row: 3; grid-column: 2 / -1; }
  .file-row.trash-row { grid-template-columns: 28px 1fr auto; gap: 8px 10px; }
  .file-row.trash-row .file-check { grid-row: 1; grid-column: 1; }
  .file-row.trash-row .file-name-cell { grid-row: 1; grid-column: 2 / -1; }
  .file-row.trash-row .file-size { grid-row: 2; grid-column: 2; }
  .file-row.trash-row .file-date { grid-row: 2; grid-column: 3; }
  .file-row.trash-row .trash-expiry { grid-row: 3; grid-column: 2 / -1; }
  .public-file-list a { grid-template-columns: minmax(0, 1fr) auto; }
  .public-file-list a strong { grid-column: 2; }
  .photo-batch-picker { align-items: flex-start; order: -1; border-width: 2px; }
  .photo-batch-badge { margin-top: 3px; }
}
