*{box-sizing:border-box}
body{
  margin:0;
  font-family:"Segoe UI","Microsoft JhengHei",sans-serif;
  background:radial-gradient(circle at top,#182436,#0d1118 55%);
  color:#eef5ff;
}
.login-screen,
.app-shell{
  visibility:hidden;
}
body.boot-ready .login-screen,
body.boot-ready .app-shell{
  visibility:visible;
}
.hidden{display:none!important}

.login-screen{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:28px;
}
.login-card{
  width:min(960px,100%);
  display:grid;
  grid-template-columns:1.1fr .9fr;
  gap:20px;
  background:linear-gradient(180deg,#1a2331,#101722);
  border:1px solid #28384d;
  border-radius:28px;
  box-shadow:0 22px 60px rgba(0,0,0,.24);
  overflow:hidden;
}
.brand-block{
  padding:38px 34px;
  background:
    linear-gradient(140deg,rgba(34,175,244,.22),rgba(116,225,255,.10)),
    linear-gradient(180deg,#1c2838,#121b28);
  display:grid;
  align-content:center;
  gap:14px;
}
.brand-kicker,.page-kicker,.sidebar-kicker{
  margin:0;
  font-size:12px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:#78d8ff;
  font-weight:700;
}
.brand-block h1,.page-header h1{
  margin:0;
  font-size:42px;
  line-height:1.05;
  color:#ecf3ff;
}
.brand-copy{
  margin:0;
  color:#93a5c1;
  font-size:16px;
  line-height:1.7;
}
.login-form{
  padding:34px;
  display:grid;
  align-content:center;
  gap:16px;
}
.field{
  display:grid;
  gap:8px;
}
.field span{
  font-size:13px;
  color:#9eb6cf;
  font-weight:700;
}
.login-actions{
  display:flex;
  gap:10px;
  margin-top:4px;
}

input{
  width:100%;
  padding:13px 15px;
  border-radius:16px;
  border:1px solid #30445d;
  background:#0b1017;
  color:#edf5ff;
  outline:none;
  transition:border-color .2s ease,box-shadow .2s ease,transform .2s ease;
}
input:focus{
  border-color:#65d6ff;
  box-shadow:0 0 0 4px rgba(101,214,255,.14);
  transform:translateY(-1px);
}
button{
  border:none;
  border-radius:16px;
  padding:12px 16px;
  font-weight:700;
  cursor:pointer;
  transition:transform .18s ease,filter .18s ease,box-shadow .18s ease;
}
button:hover{
  filter:brightness(1.02);
  transform:translateY(-1px);
}
.primary-btn{
  background:linear-gradient(135deg,#22aff4,#74e1ff);
  color:#081019;
  box-shadow:0 10px 26px rgba(34,175,244,.24);
}
.ghost-btn{
  background:#111826;
  color:#b6d8f3;
  border:1px solid #2f4157;
}
.icon-btn{
  width:44px;
  height:44px;
  padding:0;
  background:#111826;
  color:#8cddff;
  border:1px solid #2f4157;
  font-size:18px;
}
.status-text{
  margin:0;
  color:#9ab4d1;
  font-size:13px;
}

.app-shell{
  min-height:100vh;
  display:grid;
  grid-template-columns:1fr;
}
.sidebar{
  display:none;
  background:linear-gradient(180deg,#1b2230,#121823);
  border-right:1px solid #253447;
  padding:18px;
  display:grid;
  grid-template-rows:auto 1fr auto;
  gap:18px;
  transition:grid-template-columns .2s ease,width .2s ease,padding .2s ease;
}
.sidebar.collapsed{
  width:88px;
  padding:18px 12px;
}
.sidebar-top{
  display:grid;
  gap:14px;
}
.sidebar-brand h2{
  margin:4px 0 0;
  color:#ecf3ff;
}
.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .sidebar-user{
  display:none;
}
.sidebar-nav{
  display:grid;
  gap:10px;
  align-content:start;
}
.nav-item{
  text-align:left;
  padding:14px 16px;
  border-radius:18px;
  background:#0d131c;
  color:#b6d8f3;
  border:1px solid #263548;
}
.nav-item.active{
  background:linear-gradient(135deg,#22aff4,#74e1ff);
  color:#081019;
  border-color:#74e1ff;
}
.nav-item.disabled{
  opacity:.55;
  cursor:not-allowed;
}
.sidebar-footer{
  display:grid;
  gap:12px;
}
.sidebar-user{
  margin:0;
  color:#9ab4d1;
  word-break:break-word;
}

.main-panel{
  padding:14px 16px;
  display:grid;
  gap:10px;
  align-content:start;
}
.page-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
}
.keyword-tools{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-start;
  align-items:center;
  width:100%;
}
.keyword-label{
  display:inline-flex;
  align-items:center;
  padding:8px 10px;
  border-radius:12px;
  background:#0d131c;
  border:1px solid #263548;
  color:#9fc8eb;
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
}
.keyword-tools input{
  min-width:220px;
  flex:1 1 220px;
}
.top-qr-btn,
.top-bridge-btn{
  padding:8px 12px;
  border-radius:999px;
  font-size:12px;
  white-space:nowrap;
}
.content-card{
  background:linear-gradient(180deg,#1b2230,#121823);
  border:1px solid #253447;
  border-radius:20px;
  padding:12px;
  box-shadow:0 18px 48px rgba(0,0,0,.22);
  display:grid;
  gap:8px;
  align-content:start;
}
.status-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.platform-filters{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}
.platform-filter{
  background:#0d131c;
  color:#9fc8eb;
  border:1px solid #263548;
  padding:6px 10px;
  border-radius:999px;
  font-size:11px;
}
.platform-filter.active{
  background:linear-gradient(135deg,#22aff4,#74e1ff);
  color:#081019;
  border-color:#74e1ff;
}
.comment-list{
  display:grid;
  grid-template-columns:1fr;
  gap:4px;
  align-content:start;
}
.comment-card{
  background:#0d131c;
  border:1px solid #263548;
  border-radius:14px;
  padding:8px 10px;
  display:grid;
  gap:4px;
}
.comment-head{
  display:flex;
  justify-content:space-between;
  gap:6px;
  align-items:center;
}
.comment-meta{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
  flex-wrap:wrap;
}
.comment-user-row{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
  flex-wrap:wrap;
}
.comment-user{
  font-weight:800;
  color:#79d8ff;
  font-size:14px;
  line-height:1.2;
}
.comment-uid{
  font-size:11px;
  line-height:1.2;
  color:#93a5c1;
  padding:2px 6px;
  border-radius:999px;
  background:rgba(147,165,193,.08);
  border:1px solid rgba(147,165,193,.2);
}
.comment-source,.comment-time{
  font-size:11px;
  color:#8ca3bd;
}
.comment-source-row{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.comment-source{
  display:inline-flex;
  align-items:center;
  padding:2px 7px;
  border-radius:999px;
  width:max-content;
  font-weight:700;
}
.comment-source.platform-facebook{
  background:rgba(34, 130, 244, .12);
  color:#8bc3ff;
  border:1px solid rgba(34, 130, 244, .22);
}
.comment-source.platform-instagram{
  background:rgba(225, 48, 108, .12);
  color:#ff9cc0;
  border:1px solid rgba(225, 48, 108, .22);
}
.comment-source.platform-tiktok{
  background:linear-gradient(135deg, rgba(37,244,238,.18), rgba(254,44,85,.16));
  color:#fff4f8;
  border:1px solid rgba(255,255,255,.22);
  box-shadow:inset 0 0 0 1px rgba(37,244,238,.08);
}
.comment-source.platform-other{
  background:rgba(140, 163, 189, .12);
  color:#b7c8da;
  border:1px solid rgba(140, 163, 189, .22);
}
.comment-text{
  font-size:13px;
  line-height:1.3;
  color:#edf5ff;
  white-space:pre-wrap;
  word-break:break-word;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.comment-body{
  display:block;
}
.order-btn{
  background:linear-gradient(135deg,#22c55e,#86efac);
  color:#07110d;
  box-shadow:none;
  min-height:24px;
  padding:4px 9px;
  border-radius:999px;
  font-size:11px;
  white-space:nowrap;
}
.comment-badge{
  display:inline-flex;
  align-items:center;
  padding:5px 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  white-space:nowrap;
}
.comment-badge.printed{
  background:rgba(220,38,38,.12);
  color:#ffb4b4;
  border:1px solid rgba(220,38,38,.25);
}
.comment-badge.pending{
  background:rgba(255,167,38,.12);
  color:#ad6800;
  border:1px solid rgba(255,167,38,.2);
}
.empty-state{
  padding:34px 18px;
  text-align:center;
  color:#8ca3bd;
  border:1px dashed #2a3c50;
  border-radius:20px;
  background:#0d131c;
}
.header-side{
  display:flex;
  align-items:center;
  justify-content:flex-end;
}
.bridge-indicator{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:auto;
  padding:8px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  border:1px solid transparent;
}
.bridge-indicator.online{
  background:rgba(50,180,110,.15);
  color:#79e6a4;
  border-color:rgba(50,180,110,.26);
}
.bridge-indicator.offline{
  background:rgba(255,92,92,.12);
  color:#ff9b9b;
  border-color:rgba(255,92,92,.22);
}
.tools-header{
  margin-top:-8px;
}
.qr-modal{
  position:fixed;
  inset:0;
  background:rgba(4,10,18,.68);
  display:grid;
  place-items:center;
  padding:24px;
  z-index:30;
}
.qr-card{
  width:min(460px,100%);
  background:linear-gradient(180deg,#1b2230,#121823);
  border:1px solid #253447;
  border-radius:28px;
  padding:22px;
  box-shadow:0 18px 48px rgba(0,0,0,.26);
  display:grid;
  gap:16px;
}
.qr-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}
.qr-head h2{
  margin:4px 0 0;
}
.qr-copy{
  margin:0;
  color:#9ab4d1;
  line-height:1.6;
}
.qr-preview{
  background:#fff;
  padding:16px;
  border-radius:22px;
  display:grid;
  place-items:center;
}
.qr-preview img{
  width:min(260px,100%);
  height:auto;
  display:block;
}

body.mobile-mode{
  background:#0b1118;
}
body.mobile-mode .sidebar{
  display:none;
}
body.mobile-mode .app-shell{
  grid-template-columns:1fr;
}
body.mobile-mode .main-panel{
  padding:0;
  gap:0;
  min-height:100vh;
}
body.mobile-mode .page-header{
  margin:0;
  padding:0 14px;
}
body.mobile-mode .bridge-indicator{
  min-width:auto;
  padding:9px 14px;
  font-size:12px;
}
body.mobile-mode .tools-header{
  position:sticky;
  top:0;
  z-index:29;
  padding:10px 14px 12px;
  background:rgba(11,17,24,.96);
  border-bottom:1px solid #203040;
  backdrop-filter:blur(10px);
}
body.mobile-mode .keyword-tools{
  width:100%;
  justify-content:flex-start;
  gap:6px;
  align-items:center;
  flex-wrap:nowrap;
}
body.mobile-mode .keyword-label{
  padding:6px 8px;
  font-size:11px;
  flex:0 0 auto;
}
body.mobile-mode .keyword-tools input{
  min-width:0;
  flex:1 1 auto;
}
body.mobile-mode #clear-comments-btn{
  display:none;
}
body.mobile-mode #bridge-indicator-mobile{
  margin-left:auto;
  flex:0 0 auto;
  padding:8px 12px;
}
body.mobile-mode .content-card{
  background:transparent;
  border:none;
  border-radius:0;
  box-shadow:none;
  padding:8px 8px 18px;
  gap:8px;
}
body.mobile-mode .status-row{
  display:none;
}
body.mobile-mode .comment-list{
  gap:4px;
}
body.mobile-mode .comment-card{
  border-radius:12px;
  padding:8px 10px;
  gap:4px;
}
body.mobile-mode .comment-user{
  font-size:14px;
  line-height:1.2;
}
body.mobile-mode .comment-source{
  display:inline-flex;
  padding:2px 6px;
  font-size:10px;
}
body.mobile-mode .comment-time{
  font-size:11px;
  white-space:nowrap;
}
body.mobile-mode .comment-text{
  font-size:13px;
  line-height:1.3;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
body.mobile-mode .order-btn{
  box-shadow:none;
}

@media (max-width: 980px){
  .login-card{
    grid-template-columns:1fr;
  }
  .app-shell{
    grid-template-columns:1fr;
  }
  .sidebar{
    border-right:none;
    border-bottom:1px solid rgba(134,103,72,.15);
  }
  .sidebar.collapsed{
    width:auto;
    padding:18px;
  }
  .sidebar.collapsed .sidebar-brand,
  .sidebar.collapsed .sidebar-user{
    display:block;
  }
  .page-header{
    flex-direction:column;
  }
  .header-side{
    width:100%;
    justify-content:flex-start;
  }
  .qr-card{
    padding:18px;
  }
}
