
:root{
  --bg:#f5f3ef;--card:#fff;--ink:#242321;--muted:#77726c;--line:#ded9d2;
  --accent:#2f5f4f;--accent2:#e8f0ec;--danger:#a94242;--warn:#8a6519;
  --shadow:0 8px 24px rgba(35,31,27,.08);--radius:18px
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans TC","PingFang TC","Microsoft JhengHei",sans-serif}
button,input,textarea,select{font:inherit}
button{cursor:pointer}
.loading{padding:60px;text-align:center;color:var(--muted)}
.shell{max-width:1180px;margin:0 auto;padding:18px}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}
.brand{font-size:24px;font-weight:800;letter-spacing:.02em}
.userbox{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.pill{background:#fff;border:1px solid var(--line);border-radius:999px;padding:8px 12px;color:var(--muted)}
.btn{border:0;border-radius:12px;padding:10px 14px;background:var(--accent);color:#fff;font-weight:700}
.btn.secondary{background:#fff;color:var(--ink);border:1px solid var(--line)}
.btn.danger{background:var(--danger)}
.btn.small{padding:7px 10px;font-size:14px}
.tabs{display:flex;gap:8px;overflow:auto;padding-bottom:4px;margin-bottom:16px}
.tab{white-space:nowrap;border:1px solid var(--line);background:#fff;color:var(--ink);padding:10px 14px;border-radius:999px}
.tab.active{background:var(--accent);color:#fff;border-color:var(--accent)}
.grid{display:grid;grid-template-columns:1fr 320px;gap:16px}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:18px}
.card + .card{margin-top:14px}
h1,h2,h3,p{margin-top:0}
h2{font-size:20px}
.muted{color:var(--muted)}
.meta{display:flex;gap:8px;flex-wrap:wrap;font-size:14px;color:var(--muted)}
.tag{display:inline-flex;align-items:center;border-radius:999px;padding:5px 9px;background:var(--accent2);color:var(--accent);font-size:13px;font-weight:700}
.tag.important{background:#fff1cf;color:var(--warn)}
.announcement-title{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.announcement-content{white-space:pre-wrap;line-height:1.75;margin:14px 0}
.progress{height:9px;background:#eeeae5;border-radius:999px;overflow:hidden}
.progress > div{height:100%;background:var(--accent)}
.read-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:10px 0 0}
.read-person{border:1px solid var(--line);border-radius:12px;padding:10px;background:#faf9f7}
.read-person.done{background:#eef6f1;border-color:#cddfd5}
.comment{padding:12px 0;border-top:1px solid var(--line)}
.comment:first-child{border-top:0}
.comment-head{font-size:14px;font-weight:700}
.comment-time{font-size:12px;color:var(--muted);font-weight:400}
.comment-body{margin-top:5px;white-space:pre-wrap;line-height:1.6}
.form-row{display:grid;gap:7px;margin-bottom:14px}
label{font-weight:700}
input,textarea,select{width:100%;border:1px solid var(--line);border-radius:12px;padding:11px 12px;background:#fff;color:var(--ink)}
textarea{min-height:120px;resize:vertical}
.actions{display:flex;gap:8px;flex-wrap:wrap}
.auth-wrap{min-height:100vh;display:grid;place-items:center;padding:20px}
.auth-card{width:min(460px,100%);background:#fff;border:1px solid var(--line);border-radius:24px;box-shadow:var(--shadow);padding:26px}
.auth-title{font-size:28px;font-weight:850;margin-bottom:8px}
.notice{padding:12px;border-radius:12px;background:#fff7dd;color:#6f5516;margin-bottom:14px}
.error{padding:11px 12px;background:#fdeaea;color:#8d2b2b;border-radius:12px;margin-bottom:12px}
.success{padding:11px 12px;background:#eaf5ee;color:#276143;border-radius:12px;margin-bottom:12px}
.member-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 0;border-top:1px solid var(--line)}
.member-row:first-child{border-top:0}
.empty{text-align:center;padding:44px 16px;color:var(--muted)}
.stat{font-size:30px;font-weight:850}
.side-title{font-weight:800;margin-bottom:10px}
.archive-row{display:block;width:100%;text-align:left;border:0;border-top:1px solid var(--line);background:transparent;padding:12px 0;color:var(--ink)}
.archive-row:first-of-type{border-top:0}
hr{border:0;border-top:1px solid var(--line);margin:16px 0}
@media(max-width:820px){
  .grid{grid-template-columns:1fr}
  .shell{padding:12px}
  .brand{font-size:21px}
}
@media(max-width:560px){
  .read-list{grid-template-columns:1fr}
  .card{padding:15px;border-radius:15px}
  .topbar{align-items:flex-start}
  .userbox{gap:6px}
  .pill{font-size:13px;padding:7px 9px}
}

.tag.folder{background:#f1eee7;color:#66573f}
.folder-large{font-size:18px;font-weight:800;padding:12px 0}
#archiveFilter{min-width:210px}
.archive-row{display:flex;align-items:center;justify-content:space-between;gap:8px}
@media(max-width:560px){
  #archiveFilter{min-width:0;width:100%}
  .announcement-title{flex-direction:column}
}

.member-main{min-width:0;flex:1}
.member-title-line{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.member-note{
  display:inline-flex;align-items:center;
  padding:4px 9px;border-radius:999px;
  background:#eef3f0;color:#2f5f4f;
  font-size:13px;font-weight:700
}
.member-note.empty-note{background:#f3f0eb;color:#8b8379;font-weight:500}
@media(max-width:560px){
  .member-row{align-items:flex-start}
  .member-row>.actions{justify-content:flex-start}
}

.select-box{
  display:inline-flex;align-items:center;gap:6px;
  border:1px solid var(--line);border-radius:10px;
  padding:7px 10px;background:#fff;font-size:14px;font-weight:700
}
.select-box input{width:auto;margin:0}
.batch-bar{display:flex;align-items:center;justify-content:space-between;gap:12px}
@media(max-width:560px){
  .batch-bar{align-items:flex-start;flex-direction:column}
}

.search-grid{
  display:grid;
  grid-template-columns:2fr 1fr 1fr 1fr 1fr;
  gap:12px;
  align-items:end
}
.search-grid .form-row{margin-bottom:0}
@media(max-width:900px){
  .search-grid{grid-template-columns:1fr 1fr}
  .search-wide{grid-column:1/-1}
}
@media(max-width:560px){
  .search-grid{grid-template-columns:1fr}
  .search-wide{grid-column:auto}
}

.mode-select{
  width:auto;
  min-width:92px;
  border:1px solid var(--line);
  border-radius:999px;
  padding:8px 12px;
  background:#fff;
  color:var(--ink);
  font-weight:700;
}

/* 手機版：不論裝置寬度，都強制使用單欄、較大的操作區 */
html.force-mobile .shell{max-width:760px}
html.force-mobile .grid{grid-template-columns:1fr}
html.force-mobile .topbar{align-items:flex-start;flex-direction:column}
html.force-mobile .userbox{width:100%;justify-content:flex-start}
html.force-mobile .tabs{flex-wrap:wrap;overflow:visible}
html.force-mobile .announcement-title{flex-direction:column}
html.force-mobile .read-list{grid-template-columns:1fr}
html.force-mobile .search-grid{grid-template-columns:1fr}
html.force-mobile .search-wide{grid-column:auto}
html.force-mobile .btn{min-height:44px}
html.force-mobile input,
html.force-mobile textarea,
html.force-mobile select{font-size:16px}

/* 電腦版：不論裝置寬度，都維持桌面配置；手機上可能需要左右滑動 */
html.force-desktop body{min-width:1180px}
html.force-desktop .shell{max-width:1180px}
html.force-desktop .grid{grid-template-columns:1fr 320px}
html.force-desktop .topbar{flex-direction:row;align-items:center}
html.force-desktop .tabs{flex-wrap:nowrap;overflow:auto}
html.force-desktop .announcement-title{flex-direction:row}
html.force-desktop .read-list{grid-template-columns:repeat(2,minmax(0,1fr))}
html.force-desktop .search-grid{grid-template-columns:2fr 1fr 1fr 1fr 1fr}
html.force-desktop .search-wide{grid-column:auto}

.backup-preview{line-height:1.8}
button:disabled{opacity:.45;cursor:not-allowed}
