
*{box-sizing:border-box}

:root{
  --bg:#fff7fb;
  --surface:#ffffff;
  --surface-soft:#fff1f7;
  --line:#f1dce8;
  --text:#2b2030;
  --muted:#8b7284;

  --pink-1:#ff5fa2;
  --pink-2:#ff7db8;
  --rose:#f0448b;
  --magenta:#d93aa6;
  --violet:#8b5cf6;
  --blue:#5b8cff;

  --primary:#d946ef;
  --primary-strong:#c026d3;
  --primary-soft:#fae8ff;

  --success-bg:#eefcf5;
  --success-text:#18794e;
  --danger-bg:#fff0f4;
  --danger-text:#b4235f;

  --shadow:0 10px 30px rgba(191, 54, 125, .08);
}

body{
  margin:0;
  font-family:"Noto Sans TC","Microsoft JhengHei",sans-serif;
  background:
    radial-gradient(circle at 8% 10%, rgba(255,95,162,.14), transparent 28%),
    radial-gradient(circle at 92% 18%, rgba(139,92,246,.12), transparent 26%),
    radial-gradient(circle at 80% 85%, rgba(91,140,255,.10), transparent 30%),
    linear-gradient(180deg,#fff9fc 0%,#fff5fa 45%,#fff9fd 100%);
  color:var(--text);
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:22px 28px;
  background:
    linear-gradient(118deg,
      #b40f5e 0%,
      #e11d76 22%,
      #ff5fa2 43%,
      #d946ef 67%,
      #7c5cff 84%,
      #5b8cff 100%);
  color:#fff;
  position:sticky;
  top:0;
  z-index:10;
  box-shadow:0 10px 28px rgba(177,28,109,.18);
}

.eyebrow{
  font-size:13px;
  opacity:.9;
  letter-spacing:.08em;
}

.topbar h1{
  margin:6px 0 0;
  font-size:24px;
  text-shadow:0 1px 10px rgba(87,20,78,.18);
}

.top-actions{
  display:flex;
  gap:10px;
  align-items:center;
}

.badge{
  background:rgba(255,255,255,.20);
  border:1px solid rgba(255,255,255,.22);
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  backdrop-filter:blur(8px);
}

.layout{
  display:grid;
  grid-template-columns:220px 1fr;
  min-height:calc(100vh - 90px);
}

.sidebar{
  background:rgba(255,255,255,.86);
  backdrop-filter:blur(14px);
  border-right:1px solid var(--line);
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.nav{
  border:0;
  background:transparent;
  color:#5c4657;
  text-align:left;
  padding:12px 14px;
  border-radius:12px;
  font-size:15px;
  cursor:pointer;
  transition:.18s ease;
}

.nav:hover{
  background:linear-gradient(90deg,#fff0f6,#f9efff);
  color:#bd247b;
}

.nav.active{
  background:
    linear-gradient(90deg,rgba(255,95,162,.16),rgba(217,70,239,.12));
  color:#b31372;
  font-weight:800;
  box-shadow:inset 3px 0 0 #ff5fa2;
}

.side-note{
  margin-top:auto;
  background:
    linear-gradient(145deg,#fff4f8,#f9f1ff);
  border:1px solid #f2dce8;
  padding:14px;
  border-radius:14px;
  font-size:13px;
  color:#6e5669;
}

.side-note p{
  margin:6px 0 0;
  line-height:1.6;
}

.content{
  padding:28px;
  max-width:1400px;
  width:100%;
}

.view{display:none}
.view.active{display:block}

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

.section-head h2{
  margin:0;
  font-size:24px;
  color:#3a2435;
}

.section-head p{
  margin:6px 0 0;
  color:var(--muted);
}

.stat-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px;
  margin-bottom:18px;
}

.stat-card,
.panel{
  background:rgba(255,255,255,.92);
  border:1px solid rgba(242,220,232,.95);
  border-radius:18px;
  box-shadow:var(--shadow);
}

.stat-card{
  padding:18px;
  position:relative;
  overflow:hidden;
}

.stat-card::after{
  content:"";
  position:absolute;
  width:90px;
  height:90px;
  right:-30px;
  top:-35px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(255,95,162,.18),rgba(217,70,239,.05) 65%,transparent 70%);
}

.stat-card span{
  display:block;
  color:#8b7284;
  font-size:13px;
}

.stat-card strong{
  display:block;
  font-size:28px;
  margin-top:8px;
  color:#b31372;
}

.panel{padding:18px}

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

.panel-head h3{
  margin:0;
  color:#4a2c42;
}

.cards{
  display:grid;
  gap:12px;
}

.change-card{
  display:grid;
  grid-template-columns:1fr auto;
  gap:12px;
  align-items:center;
  border:1px solid #f0dfe8;
  border-radius:14px;
  padding:14px;
  background:linear-gradient(180deg,#fff,#fffafd);
}

.change-card .meta{
  color:#8b7284;
  font-size:13px;
  margin-top:4px;
}

.status{
  padding:5px 9px;
  border-radius:999px;
  font-size:12px;
  background:#fff0f7;
  color:#b31372;
  border:1px solid #f3d0e1;
}

.primary,.ghost{
  border:0;
  border-radius:11px;
  padding:10px 14px;
  cursor:pointer;
  font-weight:800;
  transition:.18s ease;
}

.primary{
  background:linear-gradient(135deg,#ef3f91,#d946ef 65%,#8b5cf6);
  color:#fff;
  box-shadow:0 8px 18px rgba(217,70,239,.18);
}

.primary:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 22px rgba(217,70,239,.24);
}

.ghost{
  background:#fff1f7;
  color:#8e3f6a;
  border:1px solid #f1d2e2;
}

.ghost:hover{
  background:#fde8f2;
}

.topbar .ghost{
  background:rgba(255,255,255,.16);
  color:#fff;
  border:1px solid rgba(255,255,255,.22);
}

.form-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}

.form-grid label{
  display:flex;
  flex-direction:column;
  gap:7px;
  font-size:14px;
  font-weight:700;
  color:#4a3243;
}

.full{grid-column:1/-1}

select,input,textarea{
  width:100%;
  padding:11px 12px;
  border:1px solid #ead4df;
  border-radius:11px;
  background:#fff;
  color:#3d2c39;
  font:inherit;
  outline:none;
  transition:.18s ease;
}

select:focus,
input:focus,
textarea:focus{
  border-color:#f46eab;
  box-shadow:0 0 0 3px rgba(255,95,162,.12);
}

.form-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

.result-box{
  padding:12px 14px;
  border-radius:11px;
  background:#faf4f8;
  color:#5d4857;
  border:1px solid #f0dce7;
}

.result-box.ok{
  background:var(--success-bg);
  color:var(--success-text);
  border-color:#d8f3e4;
}

.result-box.error{
  background:var(--danger-bg);
  color:var(--danger-text);
  border-color:#ffd5e0;
}

.schedule-wrap{
  overflow:auto;
  background:rgba(255,255,255,.94);
  border-radius:18px;
  border:1px solid #f0dce7;
  box-shadow:var(--shadow);
}

.schedule-table{
  width:100%;
  border-collapse:collapse;
  min-width:780px;
}

.schedule-table th,
.schedule-table td{
  border:1px solid #f1e3ea;
  padding:10px;
  text-align:center;
  vertical-align:middle;
}

.schedule-table th{
  background:linear-gradient(180deg,#fff5fa,#fff);
  color:#68485d;
}

.lesson{
  border-radius:10px;
  padding:8px 6px;
  min-height:58px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.45);
}

.lesson .subject{font-weight:800}
.lesson .teacher{
  font-size:12px;
  margin-top:4px;
  opacity:.82;
}

.data-table{
  width:100%;
  border-collapse:collapse;
}

.data-table th,
.data-table td{
  padding:11px;
  border-bottom:1px solid #f2e5ec;
  text-align:left;
}

.data-table th{
  color:#6d5063;
  background:#fff8fb;
}

.table-scroll{overflow:auto}

.import-panel{max-width:760px}
.upload-box{display:grid;gap:12px}
.empty{
  padding:24px;
  text-align:center;
  color:#a18495;
}

.attachment-field{
  display:grid;
  gap:10px;
}

.attachment-title-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  font-size:14px;
}

.optional,.attachment-hint{
  color:#9a7f91;
  font-size:12px;
  font-weight:500;
}

.file-drop{
  display:flex!important;
  flex-direction:row!important;
  align-items:center;
  gap:14px;
  border:1.5px dashed #e9bfd2;
  border-radius:14px;
  padding:16px;
  background:linear-gradient(145deg,#fff9fc,#fbf4ff);
  cursor:pointer;
  transition:.18s ease;
}

.file-drop:hover{
  border-color:#f46eab;
  background:linear-gradient(145deg,#fff3f8,#f8efff);
}

.file-drop input{display:none}

.file-drop-icon{
  width:40px;
  height:40px;
  border-radius:12px;
  background:linear-gradient(135deg,#ffe1ee,#f2e2ff);
  color:#ca2f8a;
  font-size:24px;
  display:grid;
  place-items:center;
  font-weight:400;
}

.file-drop strong{
  display:block;
  color:#4e3346;
}

.file-drop p{
  margin:4px 0 0;
  color:#9a7f91;
  font-size:12px;
  font-weight:400;
}

.file-preview{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border:1px solid #efd7e3;
  border-radius:14px;
  background:#fff;
}

.file-info{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.file-type-icon{
  width:44px;
  height:44px;
  border-radius:11px;
  background:linear-gradient(135deg,#ffe4ef,#efe5ff);
  display:grid;
  place-items:center;
  font-size:11px;
  font-weight:800;
  color:#b42a7a;
  flex:none;
}

.file-meta{
  font-size:12px;
  color:#9b8192;
  margin-top:3px;
}

.remove-file{
  border:0;
  background:#fff0f4;
  color:#b4235f;
  padding:8px 10px;
  border-radius:8px;
  cursor:pointer;
  font-weight:700;
}

@media(max-width:900px){
  .layout{grid-template-columns:1fr}
  .sidebar{
    position:sticky;
    top:88px;
    z-index:9;
    flex-direction:row;
    overflow:auto;
    border-right:0;
    border-bottom:1px solid var(--line);
  }
  .side-note{display:none}
  .stat-grid{grid-template-columns:repeat(2,1fr)}
  .form-grid{grid-template-columns:1fr}
  .content{padding:18px}
  .topbar{padding:18px}
  .topbar h1{font-size:19px}
  .section-head{
    align-items:flex-start;
    flex-direction:column;
  }
}

@media(max-width:700px){
  .attachment-title-row{
    align-items:flex-start;
    flex-direction:column;
  }
  .file-preview{
    align-items:flex-start;
    flex-direction:column;
  }
  .remove-file{align-self:flex-end}
}
