:root {
  color-scheme: light;
  --bg: #f7efe4;
  --panel: #fff7ec;
  --text: #25202b;
  --muted: #74695d;
  --line: #e3d2bc;
  --brand: #2f7d69;
  --brand-dark: #245f50;
  --accent: #c46a3a;
  --soft: #eadfce;
  --nav: #fff4e6;
  --info: #efe3d0;
  --info-text: #6f4d28;
  --surface-tint: #f8ead8;
  --surface-deep: #f2e2cf;
  --shadow: 0 20px 56px rgba(78, 55, 33, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--brand-dark);
}

button.secondary {
  border: 1px solid var(--line);
  background: #fff8ee;
  color: var(--text);
}

button.secondary:hover {
  background: var(--surface-deep);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  background: #fffaf3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

textarea {
  resize: vertical;
}

label,
fieldset {
  display: grid;
  gap: 7px;
  color: #344054;
  font-weight: 700;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 250, 243, 0.55);
}

legend {
  padding: 0 6px;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 250, 241, 0.92), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(232, 155, 92, 0.32), transparent 34%),
    radial-gradient(circle at 72% 84%, rgba(47, 125, 105, 0.2), transparent 36%),
    linear-gradient(135deg, #f7ead9 0%, #f2d2b1 48%, #dbe7d6 100%);
  position: relative;
  overflow: hidden;
}

.login-panel {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.97), rgba(255, 244, 230, 0.91));
  border-radius: 8px;
  box-shadow: 0 24px 72px rgba(105, 76, 44, 0.18);
  border: 1px solid rgba(223, 196, 162, 0.8);
  padding: clamp(24px, 5vw, 56px);
  backdrop-filter: blur(12px);
}

.brand-intro {
  display: grid;
  align-content: center;
  gap: 14px;
}

.brand-logo {
  width: 139px;
  max-width: 62vw;
  height: auto;
  display: block;
  padding: 9px 13px;
  border-radius: 8px;
  background: #fffaf3;
  border: 1px solid rgba(216, 190, 154, 0.95);
  box-shadow: 0 10px 28px rgba(105, 76, 44, 0.14);
}

.login-panel h1,
.topbar h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1.05;
}

.eyebrow {
  margin: 0 0 10px;
  color: #a9572d;
  font-weight: 800;
  text-transform: uppercase;
}

.muted,
.hint,
.message {
  color: var(--muted);
}

.hint {
  margin: 0;
  font-size: 0.9rem;
}

.message {
  min-height: 22px;
  margin: 0;
}

.message.error {
  color: #b42318;
}

.message.ok {
  color: var(--brand);
}

.stack {
  display: grid;
  gap: 16px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  background:
    linear-gradient(145deg, rgba(196, 106, 58, 0.15), rgba(47, 125, 105, 0.1) 260px, transparent 560px),
    var(--bg);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 248, 238, 0.98), rgba(249, 237, 221, 0.96)),
    var(--nav);
  border-right: 1px solid var(--line);
  box-shadow: 10px 0 30px rgba(78, 55, 33, 0.04);
}

.sidebar h2,
.panel h2,
.list-head h2 {
  margin: 0;
}

nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.nav-button {
  width: 100%;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.nav-button.active,
.nav-button:hover {
  background: var(--soft);
  color: var(--brand-dark);
  box-shadow: inset 3px 0 0 var(--brand);
}

.profile {
  display: grid;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.profile span {
  font-weight: 800;
}

.profile small {
  color: var(--muted);
}

.content {
  padding: clamp(18px, 3vw, 36px);
  background:
    radial-gradient(circle at 88% 12%, rgba(47, 125, 105, 0.08), transparent 260px),
    linear-gradient(180deg, rgba(255, 248, 238, 0.78), rgba(247, 239, 228, 0.26) 220px);
}

.topbar {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(196, 106, 58, 0.22);
}

.topbar h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 20px;
  align-items: start;
}

.panel {
  background:
    linear-gradient(180deg, #fff4e6, var(--surface-tint));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 14px 36px rgba(78, 55, 33, 0.075);
}

.panel h2 {
  color: #3d3023;
}

.bulletin-list {
  min-width: 0;
}

.file-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 20px;
  align-items: start;
}

.file-browser {
  min-width: 0;
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.folder-card {
  width: 100%;
  min-height: 118px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(180deg, #fff6ea, #f8ead8);
  color: var(--text);
  text-align: left;
  box-shadow: 0 8px 24px rgba(29, 36, 48, 0.06);
}

.folder-card:hover,
.folder-card.active {
  border-color: var(--brand);
  background: #e9dfcd;
}

.folder-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.file-head {
  margin-top: 6px;
}

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

.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-actions button,
.file-actions a {
  min-height: 36px;
}

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.cards,
.user-list {
  display: grid;
  gap: 12px;
}

.card {
  background:
    linear-gradient(180deg, #fff4e7, #faead6);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(78, 55, 33, 0.06);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: #33271f;
}

.card p {
  white-space: pre-wrap;
}

.meta,
.permissions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 3px 10px;
  background: #e8edf0;
  color: #26394a;
  font-size: 0.85rem;
  font-weight: 700;
}

.badge.info {
  background: var(--info);
  color: var(--info-text);
}

.badge.good {
  background: var(--soft);
  color: var(--brand-dark);
}

.badge.warn {
  background: #fff0eb;
  color: #9e321b;
}

.attachment {
  margin-top: 14px;
}

.check {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.check-grid {
  display: grid;
  gap: 8px;
}

.check input {
  width: 18px;
  height: 18px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  nav {
    grid-auto-flow: column;
    overflow-x: auto;
  }

  .nav-button {
    text-align: center;
    white-space: nowrap;
  }

  .page-grid {
    grid-template-columns: 1fr;
  }

  .file-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .login-panel {
    grid-template-columns: 1fr;
  }

  .content,
  .sidebar {
    padding: 18px;
  }

  .list-head {
    align-items: stretch;
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
