/* 文件（files.html）。放在 home.css、ui.css 之后。 */

body.docked main {
  padding-bottom: 120px;
}

.search {
  margin-top: 20px;
}

.sec {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 24px 0 10px;
}

.sec h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.sec h2.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.sec small {
  color: var(--muted);
  font-size: 13px;
}

.hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* 证件快到期的提醒 */
.remind {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.remind a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 12px 10px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  font-size: 15px;
  line-height: 1.4;
}

.remind .rtext {
  flex: 1;
}

.remind a:active,
.fcard:active,
.dcard:active {
  transform: scale(0.97);
}

/* 最近打开：小的纸页预览 */
.dcard {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  transition: transform 150ms ease;
}

.dcard .thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  margin-bottom: 6px;
  border-radius: 14px;
  background: var(--soft);
}

.dcard b {
  display: -webkit-box;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.dcard small {
  color: var(--muted);
  font-size: 12px;
}

/* 纸页的小样：文件、证件、小票、报告 */
.mini {
  position: relative;
  flex: none;
  display: block;
  width: 30px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    linear-gradient(#ddd6c9, #ddd6c9) 5px 8px / 60% 3px no-repeat,
    linear-gradient(#e7e1d5, #e7e1d5) 5px 15px / 70% 2px no-repeat,
    linear-gradient(#e7e1d5, #e7e1d5) 5px 21px / 55% 2px no-repeat,
    linear-gradient(#e7e1d5, #e7e1d5) 5px 27px / 65% 2px no-repeat,
    #fff;
}

.mini.idc {
  width: 38px;
  height: 26px;
  margin: 6px 0;
  border-radius: 5px;
  background:
    radial-gradient(circle at 76% 45%, #d6cfc2 0 5px, transparent 5.5px),
    linear-gradient(#ddd6c9, #ddd6c9) 5px 6px / 40% 3px no-repeat,
    linear-gradient(#e7e1d5, #e7e1d5) 5px 13px / 45% 2px no-repeat,
    linear-gradient(#e7e1d5, #e7e1d5) 5px 18px / 35% 2px no-repeat,
    #fbf6ea;
}

.mini.slip {
  width: 24px;
}

.dcard .mini {
  width: 58%;
  height: auto;
  aspect-ratio: 3 / 4;
  background-size: auto;
  box-shadow: 0 2px 8px rgba(26, 24, 20, 0.08);
}

.dcard .mini.idc {
  width: 78%;
  aspect-ratio: 1.586;
}

.dcard .mini.slip {
  width: 44%;
  aspect-ratio: 1 / 2;
}

.dcard .mini {
  background:
    linear-gradient(#ddd6c9, #ddd6c9) 12% 14% / 60% 6% no-repeat,
    linear-gradient(#e7e1d5, #e7e1d5) 12% 30% / 72% 4% no-repeat,
    linear-gradient(#e7e1d5, #e7e1d5) 12% 42% / 56% 4% no-repeat,
    linear-gradient(#e7e1d5, #e7e1d5) 12% 54% / 66% 4% no-repeat,
    linear-gradient(#e7e1d5, #e7e1d5) 12% 66% / 50% 4% no-repeat,
    #fff;
}

.dcard .mini.idc {
  background:
    radial-gradient(circle at 78% 45%, #d6cfc2 0 13%, transparent 13.5%),
    linear-gradient(#ddd6c9, #ddd6c9) 10% 18% / 40% 9% no-repeat,
    linear-gradient(#e7e1d5, #e7e1d5) 10% 45% / 45% 6% no-repeat,
    linear-gradient(#e7e1d5, #e7e1d5) 10% 65% / 35% 6% no-repeat,
    #fbf6ea;
}

/* 文件夹卡片 */
.folders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.fcard {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 124px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  transition: transform 150ms ease;
}

.fcard .icon {
  width: 28px;
  height: 28px;
  margin-bottom: 6px;
}

.fcard b {
  font-size: 17px;
  font-weight: 600;
}

.fcard small {
  color: var(--muted);
  font-size: 13px;
}

.fcard .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
  padding-top: 6px;
}

.tag .icon {
  width: 12px;
  height: 12px;
  margin: 0;
  stroke-width: 2;
}

/* 空间 */
.store {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.store-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 15px;
}

.store-top span {
  color: var(--muted);
  font-size: 14px;
}

.meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.meter i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--ink);
}

.store p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.store a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin: -4px 0 -8px;
  font-size: 15px;
}

.store a .icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

/* 文件列表的行 */
.rows + .sec,
.rows + .years,
.folders + .card {
  margin-top: 24px;
}

.file-row {
  gap: 12px;
  padding-right: 10px;
}

.file-row .row-name {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.file-row .fname {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  font-size: 16px;
  white-space: nowrap;
}

.file-row .fname span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-row .fname .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2;
  color: var(--muted);
}

.file-row .row-sub {
  overflow: hidden;
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.row.start-row {
  gap: 12px;
}

.row.start-row .row-sub {
  margin-left: auto;
}

/* 按年收起来，点开才看 */
.years {
  display: grid;
  gap: 10px;
}

.year {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  overflow: hidden;
}

.year summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 16px;
  font-size: 17px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.year summary::-webkit-details-marker {
  display: none;
}

.year summary small {
  flex: 1;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.year summary .icon {
  width: 20px;
  height: 20px;
  color: var(--muted);
  transition: transform 150ms ease;
}

.year[open] summary .icon {
  transform: rotate(90deg);
}

.year .mh {
  margin: 0;
  padding: 10px 16px 6px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.year .rows {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.year .mh + .rows {
  border-top: 0;
}

.empty.me {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.empty.me .avatar {
  width: 64px;
  height: 64px;
}

/* 预览：一页一页的纸，上面盖着「只能看」 */
.ptags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.pages {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.pg {
  position: relative;
  overflow: hidden;
  padding: 20px 18px 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(26, 24, 20, 0.06);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.pg.doc,
.pg.report {
  aspect-ratio: 1 / 1.414;
}

.pg.slip {
  justify-self: center;
  width: 72%;
  aspect-ratio: 1 / 1.8;
}

.pg.idc {
  display: grid;
  grid-template-columns: 1fr 30%;
  grid-template-rows: auto 1fr;
  gap: 4px 12px;
  aspect-ratio: 1.586;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fbf6ea;
}

.pg-title {
  display: block;
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.pg.idc .pg-title {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 14px;
  text-align: left;
}

.pg .pb {
  display: block;
  height: 7px;
  margin: 9px 0;
  border-radius: 4px;
  background: #ebe5d9;
}

.pg .fld {
  display: grid;
  gap: 3px;
  margin-bottom: 6px;
  color: #a39c8f;
  font-size: 10px;
}

.pg .fld .pb {
  margin: 0;
}

.pg .face {
  align-self: start;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  background: #e9e2d4 center bottom / 92% no-repeat;
}

.pg .line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pg .line .pb:last-child {
  flex: none;
  width: 18%;
}

.pg .line .pb:first-child {
  flex: 1;
}

.pg .cut {
  margin: 12px 0;
  border-top: 1px dashed #d9d1c3;
}

.pg .cells {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  border-top: 1px solid #ebe5d9;
  border-left: 1px solid #ebe5d9;
}

.pg .cells span {
  padding: 6px;
  border-right: 1px solid #ebe5d9;
  border-bottom: 1px solid #ebe5d9;
}

.pg .cells .pb {
  margin: 0;
  height: 5px;
}

.pg .sign {
  margin-top: 20px;
  color: #a39c8f;
  font-size: 11px;
}

.pg-n {
  position: absolute;
  right: 12px;
  bottom: 8px;
  color: #a39c8f;
  font-size: 11px;
}

.wm {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.wm-in {
  position: absolute;
  inset: -40%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-content: space-around;
  justify-items: center;
  row-gap: 40px;
  color: rgba(26, 24, 20, 0.1);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1em;
  transform: rotate(-28deg);
}

/* 底部：改名、移动、删除 */
.dock {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(243, 239, 230, 0.96);
}

.dock-in {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: min(100%, 380px);
  margin: 0 auto;
}

.dock-in.one {
  grid-template-columns: 1fr;
}

.dock-in .btn {
  padding: 0 8px;
}

.demo-links {
  margin: 32px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.demo-links a {
  display: inline-block;
  padding: 6px 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.demo-links + .demo {
  margin-top: 8px;
}

.sheet-card .rows {
  max-height: 56dvh;
  overflow: auto;
}

.trash .row {
  gap: 12px;
  padding-right: 12px;
}

.trash .row-name {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.trash .row-name b {
  overflow: hidden;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.trash .row-name small {
  color: var(--muted);
  font-size: 13px;
}

/* 测试版加的：每一页是真的扫描件（一张图），放在原型的页框里，水印和页码照旧 */
.pg.real {
  padding: 0;
  aspect-ratio: auto;
  min-height: 120px;
  background: var(--soft);
}

.pg.real .pg-img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.pg.real .pg-n {
  background: rgba(255, 255, 255, 0.86);
  border-radius: 8px;
  padding: 0 6px;
}
