:root {
  --fg: #1f2328;
  --muted: #57606a;
  --border: #d0d7de;
  --border-soft: #d8dee4;
  --bg: #f6f8fa;
  --card: #ffffff;
  --blue: #0969da;
  --green: #1f883d;
  --green-dark: #1a7f37;
  --red: #cf222e;
  --red-dark: #82071e;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 20px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--fg);
  margin: 0;
  padding: 0 0 40px;
}

a { color: var(--blue); }

.topbar {
  position: relative;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.topbar-inner {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.brand {
  font-size: 22px;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
}

/* 顶部应用菜单（类似开始菜单） */
.start-menu { position: relative; }
.start-menu > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--fg);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.start-menu > summary::-webkit-details-marker { display: none; }
.start-menu > summary:hover,
.start-menu[open] > summary,
.start-menu > summary:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
}
.start-menu > summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.start-button svg { width: 18px; height: 18px; }
.start-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 60;
  width: min(92vw, 540px);
  max-height: min(70vh, 520px);
  overflow: auto;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}
.start-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
}
.start-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--fg);
  text-decoration: none;
}
.start-tile:hover,
.start-tile:focus-visible {
  background: var(--bg);
  outline: none;
}
.start-tile .app-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex: none;
}
.start-tile .app-icon svg { width: 22px; height: 22px; }
.start-tile-name { font-size: 15px; font-weight: 600; }

.nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-left: auto;
  font-size: 17px;
}

.nav a,
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--blue); }
.nav-icon { width: 18px; height: 18px; flex: none; }

.inline-form { display: inline; margin: 0; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 17px;
  color: var(--muted);
  cursor: pointer;
}
.link-btn:hover { color: var(--red); }

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px;
}

.card {
  max-width: 720px;
  margin: 0 auto 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px 30px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .05);
}

.card.wide { max-width: 980px; }
.auth-card { max-width: 440px; }
.home-card { max-width: 720px; }
/* 应用主页：每行两个 app */
.app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.app-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 26px 12px 20px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: var(--bg);
  color: var(--fg);
  text-decoration: none;
  transition: border-color .15s, background .15s, transform .15s;
}

.app-tile:hover {
  border-color: var(--blue);
  background: #fff;
  transform: translateY(-1px);
}

.app-tile:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.app-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: #ddf4ff;
  color: var(--blue);
}

.app-icon svg { width: 34px; height: 34px; }

.app-icon-todo { background: #ddf4ff; color: #0969da; }
.app-icon-users { background: #fbefff; color: #8250df; }
.app-icon-invites { background: #fff0f6; color: #bf3989; }
.app-icon-audit { background: #f6f8fa; color: #57606a; }

.app-name {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}

.breadcrumb {
  margin: 0 0 14px;
  font-size: 16px;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--blue); }

.filter-bar {
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-actions { align-items: center; }

.search-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.search-form input[type="search"] {
  flex: 1;
  min-width: 180px;
  padding: 8px 10px;
  font: inherit;
  font-size: 16px;
  color: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.search-form input[type="search"]:focus {
  outline: 2px solid var(--blue);
  outline-offset: -1px;
  border-color: var(--blue);
}

.search-form select {
  padding: 8px 10px;
  font: inherit;
  font-size: 16px;
  color: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.search-form button {
  flex: none;
  padding: 8px 16px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--green);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.search-form button:hover { background: var(--green-dark); }
.search-form .btn-cancel { font-size: 16px; }

.filter-label {
  color: var(--muted);
  font-size: 15px;
  margin-right: 2px;
}

.filter-chip {
  display: inline-block;
  padding: 3px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
}
.filter-chip:hover { border-color: var(--blue); color: var(--blue); }
.filter-chip.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

h1 { font-size: 26px; margin: 0 0 6px; }

.sub {
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 17px;
}

.flash {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-left: 4px solid var(--border);
  border-radius: 4px;
  font-size: 17px;
  background: #f6f8fa;
}

.flash-error {
  background: #fff1f0;
  border-left-color: var(--red);
  color: var(--red-dark);
}

.flash-ok {
  background: #dafbe1;
  border-left-color: var(--green);
  color: #116329;
}

.flash code { font-size: 15px; }

/* 登录 / 注册 / 改密表单 */
.form { display: flex; flex-direction: column; gap: 14px; }

.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 17px;
  font-weight: 600;
}

.form input[type="text"],
.form input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  font-size: 17px;
  font-family: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 400;
}

.form input:focus,
.add input[type="text"]:focus,
.table input:focus {
  outline: 2px solid var(--blue);
  outline-offset: -1px;
  border-color: var(--blue);
}

.form .check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.hint { color: var(--muted); font-size: 15px; font-weight: 400; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-cancel {
  color: var(--muted);
  font-size: 17px;
  text-decoration: none;
}
button.btn-cancel {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 17px;
  cursor: pointer;
}
.btn-cancel:hover { color: var(--blue); }

.btn-primary {
  display: inline-block;
  padding: 10px 20px;
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--green);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.btn-primary:hover { background: var(--green-dark); }


/* 事务列表 */
.add { display: flex; gap: 8px; margin: 4px 0 18px; }

.add input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  font-size: 17px;
  font-family: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.add button {
  flex: none;
  padding: 10px 20px;
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--green);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.add button:hover { background: var(--green-dark); }

.add-block { margin: 4px 0 18px; }
.add-block .add { margin: 0 0 12px; }

.date-fields {
  margin: 0 0 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: #fff;
}

.date-fields summary {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
}

.date-fields[open] summary {
  border-bottom: 1px solid var(--border-soft);
}

.date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 14px;
}

.date-group {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.date-group legend {
  padding: 0;
  margin-bottom: 2px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

.date-group label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 15px;
}

.date-group input[type="date"],
.date-group input[type="time"] {
  padding: 6px 8px;
  font: inherit;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.date-group .inline-check { justify-content: flex-start; }
.date-fields .hint { padding: 0 14px 12px; margin: 0; }

.audience {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: #fff;
  font-size: 16px;
}

.audience legend {
  padding: 0 6px;
  font-weight: 600;
}

.audience .radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 18px;
  font-weight: 400;
  cursor: pointer;
}

.member-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 10px;
}

.member {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
  cursor: pointer;
}

.audience .hint {
  display: block;
  margin: 8px 0 0;
}

.items { list-style: none; margin: 0; padding: 0; }

.item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border-soft);
}

.item-main { flex: 1; min-width: 0; }

.item-text {
  display: block;
  font-size: 18px;
  font-weight: 600;
  word-break: break-word;
}

.item-time {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  color: var(--muted);
}

.item-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.date-pill,
.scope-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 14px;
}

.date-pill { white-space: nowrap; }
.scope-badge { white-space: normal; }

.assign-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 14px;
  white-space: normal;
}
.assign-pending { background: #fff8c5; color: #7d4e00; }
.assign-accepted { background: #dafbe1; color: #116329; }

.pill-occur { background: #dafbe1; color: #116329; }
.pill-due { background: #fff8c5; color: #7d4e00; }

.scope-private { background: #f6f8fa; color: #57606a; }
.scope-all { background: #ddf4ff; color: #0550ae; }
.scope-selected { background: #fbefff; color: #8250df; }

.btn-edit {
  display: inline-block;
  padding: 6px 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--blue);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
}
.btn-edit:hover { background: #ddf4ff; border-color: var(--blue); }

.item-actions { flex: none; display: flex; gap: 6px; flex-wrap: wrap; }

.item-actions button {
  padding: 6px 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.btn-done { color: var(--green-dark); }
.btn-done:hover { background: #dafbe1; border-color: var(--green-dark); }

.btn-accept { color: var(--green-dark); }
.btn-accept:hover { background: #dafbe1; border-color: var(--green-dark); }

.btn-decline { color: #7d4e00; }
.btn-decline:hover { background: #fff8c5; border-color: #9a6700; }

.btn-del { color: var(--red); }
.btn-del:hover { background: #ffebe9; border-color: var(--red); }

.table .btn-buy {
  min-width: 88px;
  padding: 6px 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--green-dark);
  background: #fff;
  border: 1px solid var(--green-dark);
  border-radius: 6px;
  cursor: pointer;
}
.table .btn-buy:hover {
  background: #dafbe1;
}
.table .btn-buy-purchased {
  color: var(--muted);
  background: #f6f8fa;
  border-color: var(--border);
}
.table .btn-buy-purchased:hover {
  color: var(--fg);
  background: #fff;
  border-color: var(--muted);
}

.empty, .note {
  color: var(--muted);
  font-size: 17px;
  margin: 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--border-soft);
}
.note { padding-top: 12px; }

/* 管理表格 */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.table th, .table td {
  border-top: 1px solid var(--border-soft);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.table code {
  font-size: 16px;
  white-space: nowrap;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
}

.table input[type="password"],
.table input[type="text"] {
  width: 150px;
  max-width: 100%;
  padding: 5px 8px;
  font: inherit;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.table button {
  padding: 5px 10px;
  font: inherit;
  font-size: 15px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.row-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 190px;
}

.row-actions form { display: flex; gap: 6px; margin: 0; }

.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 14px;
  white-space: nowrap;
}
.badge-active { background: #dafbe1; color: #116329; }
.badge-used { background: #ddf4ff; color: #0550ae; }
.badge-expired { background: #f6f8fa; color: var(--muted); }
.badge-revoked { background: #ffebe9; color: var(--red-dark); }

.form-grid {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-soft);
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 16px;
  font-weight: 600;
}

.form-grid input[type="number"],
.form-grid input[type="text"] {
  padding: 8px 10px;
  font: inherit;
  font-weight: 400;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.form-grid input[type="number"] { width: 100px; }
.form-grid input[type="text"] { width: 220px; }

.muted { color: var(--muted); font-size: 15px; }

/* 物品清单 */
.app-icon-inventory { background: #fff8c5; color: #9a6700; }
.app-icon-people { background: #dafbe1; color: #1a7f37; }
.app-icon-shopping { background: #ffebe9; color: #cf222e; }
.app-icon-menu { background: #fff3e0; color: #d97706; }
.app-icon-files { background: #ddf4ff; color: #0969da; }

.inventory-nav {
  max-width: 980px;
  margin: 0 auto 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.inventory-nav a {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}
.inventory-nav a:hover { border-color: var(--blue); color: var(--blue); }
.inventory-nav a.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.section-head h1 { margin-bottom: 4px; }
.section-head .sub { margin: 0; }
.head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inventory-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
}
.inventory-filter-form input[type="search"],
.inventory-filter-form select {
  padding: 8px 10px;
  font: inherit;
  font-size: 16px;
  color: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.inventory-filter-form input[type="search"] {
  flex: 1;
  min-width: 180px;
}
.inventory-filter-form button {
  padding: 8px 16px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--green);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.inventory-filter-form button:hover { background: var(--green-dark); }

.form select,
.form textarea,
.form input[type="file"] {
  width: 100%;
  padding: 10px 14px;
  font: inherit;
  font-size: 17px;
  color: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.form textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.form input[type="file"] { padding: 8px 10px; background: var(--bg); }
.form select:focus,
.form textarea:focus {
  outline: 2px solid var(--blue);
  outline-offset: -1px;
  border-color: var(--blue);
}
.form-grid-inline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-grid-inline label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 17px;
  font-weight: 600;
}

.inventory-checks {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.inventory-checks legend { padding: 0 6px; font-weight: 600; font-size: 17px; }
.inventory-checks .hint { flex-basis: 100%; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin: 8px 0 16px;
}
.photo-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.photo-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}
.photo-delete {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 15px;
  color: var(--red);
}
.photo-manage {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: #fff;
}
.photo-manage legend { padding: 0 6px; font-weight: 600; font-size: 17px; }

.meta-list {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px 16px;
  margin: 16px 0;
  font-size: 17px;
}
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; }
.detail-text { white-space: pre-wrap; font-size: 18px; line-height: 1.7; }
.subhead { font-size: 20px; margin: 22px 0 8px; }

.confirm-form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.confirm-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  color: var(--muted);
}

.data-table {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
}

/* 购物清单 */
.list-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.thumb-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}
.shop-add-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}
.shop-add-form select,
.shop-add-form input[type="number"] {
  padding: 8px 10px;
  font: inherit;
  font-size: 16px;
  color: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.shop-add-form select { flex: 1; min-width: 180px; }
.shop-add-form input[type="number"] { width: 110px; }
.add-items-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}
.add-items-filter input[type="search"] {
  flex: 1;
  min-width: 220px;
  padding: 8px 12px;
  font: inherit;
  font-size: 16px;
  color: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.add-qty {
  width: 110px;
  padding: 6px 8px;
  font: inherit;
  font-size: 15px;
  color: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.add-item-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 16px;
}
.add-item-summary .sub { margin: 2px 0 0; }
.qty-form { display: flex; align-items: center; gap: 6px; margin: 0; }
.qty-form input[type="number"] {
  width: 88px;
  padding: 5px 8px;
  font: inherit;
  font-size: 14px;
  color: var(--fg);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.table .btn-save {
  min-width: 56px;
  padding: 6px 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--fg);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.table .btn-save:hover {
  color: var(--blue);
  background: #ddf4ff;
  border-color: var(--blue);
}
.purchased-row td { color: var(--muted); }
.purchased-row a { color: var(--muted); text-decoration: line-through; }

/* 菜单 */
.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin: 8px 0 14px;
}
.nutrition-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: #fff;
}
.nutrition-card strong { font-size: 20px; }
.nutrition-card small { font-size: 13px; font-weight: normal; }
.nutrition-card > .muted { font-size: 14px; }
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px 12px;
  margin: 6px 0 10px;
}
.check-grid .inline-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
}
.signup-form { margin: 8px 0 16px; }
.shop-add-form input[type="text"] {
  padding: 8px 10px;
  font: inherit;
  font-size: 16px;
  color: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* 文件服务 */
.file-badge {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #eaeef2;
  color: #57606a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.file-name { word-break: break-all; }
.file-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.file-actions form { margin: 0; }
.file-subhead { align-items: center; }
.file-subhead .subhead { margin: 22px 0 8px; }
.file-preview {
  max-width: 100%;
  max-height: 380px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  display: block;
}
.permission-form select {
  padding: 7px 10px;
  font: inherit;
  font-size: 15px;
  color: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.permission-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.permission-form button {
  padding: 5px 10px;
  font: inherit;
  font-size: 14px;
  color: var(--blue);
  background: #f6f8fa;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

@media (max-width: 640px) {
  body { font-size: 18px; padding-bottom: 24px; }
  .topbar-inner { gap: 10px; }
  .nav { gap: 10px; font-size: 16px; margin-left: 0; }
  .start-menu { position: static; }
  .start-panel {
    left: 12px;
    right: 12px;
    top: calc(100% + 6px);
    width: auto;
    max-height: 70vh;
  }
  .wrap { padding: 0 10px; }
  .card { padding: 20px 16px; border-radius: 10px; }
  .app-grid { gap: 10px; }
  .app-tile { padding: 20px 8px 16px; gap: 10px; border-radius: 12px; }
  .app-icon { width: 54px; height: 54px; border-radius: 15px; }
  .app-icon svg { width: 28px; height: 28px; }
  .app-name { font-size: 16px; }
  .breadcrumb { padding: 0 4px; }
  .filter-actions { flex-direction: column; align-items: stretch; }
  .search-form {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .search-form select { width: 100%; }
  .search-form button { width: 100%; }
  .new-item-link { margin-left: 0; }
  .date-grid { grid-template-columns: 1fr; }
  .add { flex-direction: column; }
  .add button { padding: 12px; }
  .item { flex-wrap: wrap; }
  .item-actions { width: 100%; justify-content: flex-end; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
  .row-actions { min-width: 160px; }
  .form-grid input[type="text"] { width: 100%; }
  .inventory-nav { gap: 6px; }
  .inventory-nav a { padding: 5px 10px; font-size: 15px; }
  .form-grid-inline { grid-template-columns: 1fr; }
  .inventory-filter-form { flex-direction: column; align-items: stretch; }
  .inventory-filter-form input[type="search"],
  .inventory-filter-form select { width: 100%; }
  .section-head { flex-direction: column; }
  .head-actions { width: 100%; }
  .meta-list { grid-template-columns: 80px 1fr; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .photo-card img { height: 110px; }
  .shop-add-form { flex-direction: column; align-items: stretch; }
  .shop-add-form select,
  .shop-add-form input[type="number"] { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .app-tile { transition: none; }
  .app-tile:hover { transform: none; }
}
