:root{
  --bg:#f5f7fb;
  --card:#ffffff;
  --muted:#6b7280;
  --accent:#7c3aed;
  --accent-light:#bda5ff;
  --line:#e5e7eb;
  
  --shadow-soft:0 4px 12px rgba(0,0,0,0.06);
  --radius:14px;
  --gap:16px;

  font-family: "Noto Sans TC", Inter, system-ui, -apple-system, "Helvetica Neue", Arial;
}

*{box-sizing:border-box; -webkit-tap-highlight-color: transparent;}
html,body{
  height:100%;
  margin:0;
  background:var(--bg);
  color:#333;
}

/* layout */
.wrap{
  max-width:1100px;
  margin:40px auto;
  padding:20px;
}

/* header */
header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
}

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

.logo{
  width:58px;
  height:58px;
  border-radius:14px;
  background:linear-gradient(135deg,#a78bfa,#c4b5fd);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  color:white;
  font-size:18px;
  box-shadow:var(--shadow-soft);
}

h1{
  font-size:22px;
  margin:0;
  font-weight:700;
  color:#3f3f46;
}

p.lead{
  margin:0;
  color:var(--muted);
  font-size:14px;
}

/* main */
main{
  display:grid;
  grid-template-columns:340px 1fr;
  gap:20px;
  margin-top:20px;
}

.panel{
  background:var(--card);
  padding:18px;
  border-radius:var(--radius);
  box-shadow:var(--shadow-soft);
  border:1px solid var(--line);
}

/* profile left column */
.profile{
  display:flex;
  align-items:center;
  gap:12px;
}

.avatar{
  width:70px;
  height:70px;
  border-radius:14px;
  background:#fafafa;
  border:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
  color:var(--accent);
}

.stats{
  margin-top:14px;
  display:flex;
  gap:12px;
}

.stat{
  background:#fafafa;
  padding:12px;
  border-radius:12px;
  flex:1;
  text-align:center;
  border:1px solid var(--line);
}

.stat strong{
  display:block;
  font-size:18px;
  color:#4b5563;
}

/* quest list */
.quests-list{margin-top:18px}

.quest{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px;
  border-radius:12px;
  background:#fafafa;
  border:1px solid var(--line);
  margin-bottom:12px;
}

.quest .type{
  font-size:12px;
  padding:6px 10px;
  border-radius:8px;
  background:#eef2ff;
  color:#6366f1;
}

/* buttons */
.btn{
  display:inline-block;
  padding:9px 14px;
  border-radius:10px;
  background:var(--accent);
  color:white;
  font-weight:600;
  border:none;
  cursor:pointer;
  text-decoration:none;
  transition:0.2s;
}

.btn:hover{
  background:#6d28d9;
}

.btn.ghost{
  background:white;
  border:1px solid var(--line);
  color:#4b5563;
}

.btn.ghost:hover{
  background:#f3f4f6;
}

/* right side */
.controls{
  display:flex;
  gap:12px;
  align-items:center;
}

.search{flex:1}

input,select,textarea{
  background:white;
  border:1px solid var(--line);
  padding:10px;
  border-radius:10px;
  color:#333;
  width:100%;
  font-size:14px;
}

label{
  display:block;
  font-size:13px;
  color:var(--muted);
  margin-bottom:6px;
}

/* tasks grid */
.task-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
  gap:14px;
  margin-top:16px;
}

.task{
  padding:14px;
  border-radius:14px;
  background:white;
  border:1px solid var(--line);
  box-shadow:var(--shadow-soft);
}

.task h3{
  margin:0 0 10px 0;
  font-size:17px;
  color:#3f3f46;
}

.task .meta{
  font-size:12px;
  color:var(--muted);
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.task .actions{
  margin-top:12px;
  display:flex;
  gap:10px;
}

/* progress bar */
.progress-wrap{
  display:flex;
  align-items:center;
  gap:12px;
}
.progress{
  flex:1;
  height:12px;
  background:#eef2ff;
  border-radius:999px;
  overflow:hidden;
}
.progress-bar{
  height:100%;
  background:linear-gradient(90deg,#7c3aed,#9f75ff);
  width:0%;
}

/* footer */
footer{
  margin-top:20px;
  color:var(--muted);
  font-size:13px;
  text-align:center;
}

/* modal */
.modal{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
}

.modal.open{
  display:flex;
  background:rgba(0,0,0,0.25);
}

.modal .box{
  width:760px;
  max-width:100%;
  background:white;
  padding:20px;
  border-radius:16px;
  box-shadow:var(--shadow-soft);
}

/* responsive */
@media (max-width:960px){
  main{grid-template-columns:1fr}
  .wrap{padding:14px}
  .brand h1{font-size:18px}
}

/* navbar */
.navbar {
  width: 100%;
  background: #7c3aed;
  color: white;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  box-shadow:var(--shadow-soft);
}

.nav-left .nav-item {
  margin-right: 20px;
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: 0.2s;
}

.nav-left .nav-item:hover {
  color: #f1e9ff;
}

.nav-right .btn-danger.small {
  padding: 6px 12px;
  font-size: 14px;
}
