:root{
  --bg:#f6f8fc;
  --panel:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --primary:#5b7cff;
  --primary-dark:#4167ff;
  --nav:#ffffff;
  --sidebar:#0f172a;
  --sidebar-text:#cbd5e1;
  --shadow:0 12px 30px rgba(15,23,42,.08);
  --radius:20px;
  --topbar-h:72px;
  --sidebar-w:240px;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",Arial,sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(91,124,255,.08), transparent 28%),
    linear-gradient(180deg,#fbfcff 0%,#f4f7fb 100%);
}
a{text-decoration:none;color:inherit}
img{max-width:100%}
button,input,select,textarea{font:inherit}

.page-shell{min-height:100vh}
.topbar{
  height:var(--topbar-h);
  background:rgba(15,23,42,.96);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 18px;
  position:sticky;
  top:0;
  z-index:80;
  box-shadow:0 2px 18px rgba(0,0,0,.12);
}
.portal-topbar{
  background:#fff;
  color:#111827;
  box-shadow:0 2px 16px rgba(15,23,42,.05);
  border-bottom:1px solid #eef2f7;
}
.portal-topbar .top-nav a{color:#111827}
.portal-topbar .top-nav a:hover{background:#f5f7fb}
.portal-topbar .menu-toggle{
  background:#f3f4f6;
  color:#111827;
}
.topbar-left,.topbar-right{display:flex;align-items:center;gap:12px;min-width:0}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  font-size:20px;
  min-width:0;
}
.brand-badge{
  width:40px;
  height:40px;
  border-radius:14px;
  background:linear-gradient(135deg,#6e8cff,#4f6fff);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  box-shadow:0 8px 18px rgba(91,124,255,.28);
  flex:0 0 auto;
}
.brand-text{min-width:0;line-height:1.15}
.top-nav{display:flex;align-items:center;gap:8px}
.top-nav a{
  padding:10px 14px;
  border-radius:999px;
}
.top-btn{
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.12);
  color:#fff;
  padding:10px 14px;
  border-radius:999px;
  white-space:nowrap;
}
.portal-topbar .top-btn{
  background:#fff;
  color:#111827;
  border:1px solid #e5e7eb;
}
.portal-topbar .top-btn.primary{
  background:linear-gradient(135deg,#6e8cff,#4f6fff);
  color:#fff;
  border:none;
}
.menu-toggle{
  display:none;
  width:42px;
  height:42px;
  border:none;
  border-radius:12px;
  background:rgba(255,255,255,.08);
  color:#fff;
  cursor:pointer;
}

.site-container{
  max-width:1280px;
  margin:0 auto;
  padding:28px 18px 40px;
}

.aliyun-hero{
  min-height:calc(100vh - 120px);
  display:grid;
  grid-template-columns:1.05fr .95fr;
  gap:36px;
  align-items:center;
  padding:40px 0 30px;
}
.aliyun-copy h1{
  font-size:72px;
  line-height:1.06;
  margin:0 0 22px;
  letter-spacing:-.02em;
}
.aliyun-copy p{
  margin:0;
  font-size:20px;
  line-height:1.9;
  color:#8b93a7;
  max-width:760px;
}
.aliyun-actions{
  display:flex;
  gap:18px;
  flex-wrap:wrap;
  margin-top:34px;
}
.aliyun-art{
  position:relative;
  min-height:540px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.aliyun-bg{
  position:absolute;
  inset:40px 10px 40px 10px;
  border-radius:36px;
  background:linear-gradient(135deg,#ece8ff 0%,#eff9ff 100%);
  box-shadow:0 30px 80px rgba(91,124,255,.12) inset;
}
.aliyun-device{
  position:relative;
  width:78%;
  max-width:460px;
  min-height:380px;
  border-radius:28px;
  background:rgba(255,255,255,.7);
  backdrop-filter: blur(3px);
  border:12px solid rgba(255,255,255,.7);
  box-shadow:0 30px 80px rgba(91,124,255,.14);
  display:flex;
  align-items:center;
  justify-content:center;
}
.aliyun-ring{
  width:180px;
  height:180px;
  border-radius:999px;
  border:22px solid rgba(91,124,255,.25);
  border-right-color:#6e8cff;
  border-top-color:#8fa6ff;
  transform:rotate(-28deg);
  box-shadow:0 0 40px rgba(91,124,255,.12);
}
.aliyun-bubble{
  position:absolute;
  padding:16px 22px;
  border-radius:999px;
  background:rgba(255,255,255,.72);
  color:#6e8cff;
  font-weight:800;
  box-shadow:0 10px 30px rgba(91,124,255,.08);
}
.b1{top:42px;right:50px}
.b2{left:24px;top:190px}
.b3{right:18px;top:250px}

.card{
  background:#fff;
  border:1px solid #eef2f7;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:24px;
}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:18px}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.grid-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}

.kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}
.kpi{
  background:#fff;
  border:1px solid #eef2f7;
  border-radius:20px;
  padding:24px;
  box-shadow:var(--shadow);
}
.kpi-label{font-size:14px;color:var(--muted);margin-bottom:12px}
.kpi-value{font-size:36px;font-weight:800;line-height:1}
.kpi-foot{font-size:13px;color:#94a3b8;margin-top:10px}

.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:22px}
.page-head h1{margin:0 0 8px;font-size:32px}
.page-head p{margin:0;color:var(--muted)}

.input,.select,.textarea,.form-input,.form-textarea{
  width:100%;
  border:1px solid #dbe3ef;
  border-radius:16px;
  background:#fff;
  padding:14px 16px;
  outline:none;
  transition:.2s ease;
  color:var(--text);
}
.form-textarea{min-height:140px;resize:vertical}
.input:focus,.select:focus,.textarea:focus,.form-input:focus,.form-textarea:focus{
  border-color:#9eb2ff;
  box-shadow:0 0 0 4px rgba(91,124,255,.12);
}
.form-group{margin-bottom:16px}
.form-label{display:block;font-size:14px;margin-bottom:8px;color:#334155;font-weight:700}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:46px;
  padding:0 18px;
  border:none;
  border-radius:999px;
  cursor:pointer;
  font-weight:800;
  transition:.18s ease;
}
.btn:hover{transform:translateY(-1px)}
.btn-primary{
  background:linear-gradient(135deg,#6e8cff,#4f6fff);
  color:#fff;
  box-shadow:0 10px 24px rgba(91,124,255,.24);
}
.btn-light{
  background:#fff;
  color:#334155;
  border:1px solid #dbe3ef;
}
.btn-success{background:#16a34a;color:#fff}
.btn-danger{background:#ef4444;color:#fff}
.btn-warning{background:#f59e0b;color:#fff}
.btn-sm{min-height:36px;padding:0 14px;font-size:13px}

.alert{
  padding:12px 14px;
  border-radius:14px;
  margin-bottom:16px;
  font-size:14px;
}
.alert-success{background:#f0fdf4;color:#166534;border:1px solid #bbf7d0}
.alert-danger{background:#fef2f2;color:#991b1b;border:1px solid #fecaca}

.toolbar{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
  margin-bottom:16px;
}

.table-wrap{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  border:1px solid #e5e7eb;
  border-radius:18px;
  background:#fff;
}
.table{
  width:100%;
  border-collapse:collapse;
  min-width:980px;
}
.table th{
  background:#f8fafc;
  padding:16px;
  text-align:left;
  color:#334155;
  font-size:13px;
  border-bottom:1px solid #e5e7eb;
  white-space:nowrap;
}
.table td{
  padding:16px;
  border-bottom:1px solid #eef2f7;
  vertical-align:top;
  white-space:nowrap;
}
.table tr:hover td{background:#fbfcff}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:66px;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
}
.badge-success{background:#dcfce7;color:#166534}
.badge-danger{background:#fee2e2;color:#991b1b}
.badge-primary{background:#dbeafe;color:#1d4ed8}
.badge-gray{background:#eef2f7;color:#475569}

.url-text{
  max-width:480px;
  word-break:break-all;
  line-height:1.7;
  color:#334155;
  white-space:normal;
}
.path-link{color:#4f6fff;word-break:break-all}

.pagination{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
  margin-top:18px;
}
.pagination-links{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.page-link{
  min-width:40px;
  height:40px;
  padding:0 14px;
  border:1px solid #dbe3ef;
  background:#fff;
  border-radius:14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#334155;
  font-size:14px;
}
.page-link.active{
  background:#4f6fff;
  color:#fff;
  border-color:#4f6fff;
}

.app-layout{min-height:calc(100vh - var(--topbar-h));display:flex}
.sidebar{
  width:var(--sidebar-w);
  background:linear-gradient(180deg,#0b1738 0%,#091530 100%);
  color:var(--sidebar-text);
  border-right:1px solid rgba(255,255,255,.06);
  padding:18px 14px;
  position:sticky;
  top:var(--topbar-h);
  height:calc(100vh - var(--topbar-h));
  overflow-y:auto;
}
.sidebar-title{
  font-size:12px;
  color:#94a3b8;
  text-transform:uppercase;
  letter-spacing:.12em;
  padding:10px 14px;
}
.sidebar-nav{display:flex;flex-direction:column;gap:8px}
.sidebar-nav a{
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--sidebar-text);
  padding:13px 14px;
  border-radius:16px;
  min-height:48px;
  line-height:1.35;
}
.sidebar-nav a:hover{background:rgba(255,255,255,.06);color:#fff}
.sidebar-nav a.active{
  background:linear-gradient(135deg,rgba(91,124,255,.28),rgba(79,111,255,.14));
  color:#fff;
  border:1px solid rgba(128,149,255,.16);
}
.sidebar-dot{
  width:9px;height:9px;border-radius:999px;background:#60a5fa;
  box-shadow:0 0 0 4px rgba(96,165,250,.12);
  flex:0 0 auto;
}
.main{flex:1;min-width:0;padding:28px}

.mobile-backdrop{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.38);
  z-index:70;
}

.mobile-cards{display:none;gap:14px;flex-direction:column}
.mobile-record{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:18px;
  padding:16px;
}
.mobile-record h4{margin:0 0 10px;font-size:16px;word-break:break-all}
.mobile-meta{font-size:13px;color:#64748b;line-height:1.8;word-break:break-word}
.mobile-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}

.empty{color:#64748b;text-align:center;padding:40px 20px}

.auth-shell{
  min-height:100vh;
  display:grid;
  grid-template-columns:1.04fr .96fr;
}
.auth-left{
  padding:34px 42px;
  background:
    radial-gradient(circle at 12% 12%, rgba(91,124,255,.1), transparent 24%),
    linear-gradient(180deg,#fbfcff 0%,#f5f7fc 100%);
}
.auth-nav{
  height:72px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.auth-nav-left,.auth-nav-right{display:flex;align-items:center;gap:14px}
.auth-hero{
  max-width:720px;
  padding-top:78px;
}
.auth-hero h1{
  font-size:68px;
  line-height:1.08;
  margin:0 0 18px;
  letter-spacing:-.02em;
}
.auth-hero p{
  font-size:20px;
  line-height:1.9;
  color:#8b93a7;
  margin:0;
}
.auth-actions{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  margin-top:34px;
}
.auth-right{
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:28px;
  border-left:1px solid #eef2f7;
}
.auth-card{
  width:100%;
  max-width:620px;
  background:#fff;
}
.auth-panel{
  background:#fff;
  border:1px solid #eef2f7;
  border-radius:26px;
  box-shadow:0 16px 50px rgba(15,23,42,.08);
  padding:28px;
}
.auth-split{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
}

@media (max-width:1100px){
  .kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .grid-3{grid-template-columns:1fr 1fr}
  .aliyun-copy h1{font-size:56px}
}

@media (max-width:860px){
  .top-nav{
    display:none;
    position:absolute;
    top:var(--topbar-h);
    left:0;right:0;
    background:#fff;
    padding:12px;
    flex-direction:column;
    align-items:stretch;
    z-index:90;
    border-top:1px solid #eef2f7;
  }
  .top-nav.open{display:flex}
  .top-nav a{padding:12px}
  .menu-toggle{display:inline-flex;align-items:center;justify-content:center}

  .topbar{padding:0 10px;gap:8px}
  .topbar-left,.topbar-right{gap:8px}
  .topbar-right span{display:none}
  .top-btn{padding:8px 12px;font-size:13px}
  .brand{font-size:16px;gap:8px}
  .brand-badge{width:36px;height:36px;border-radius:12px}
  .brand-text{font-size:15px;line-height:1.2;max-width:150px;white-space:normal}

  .aliyun-hero{grid-template-columns:1fr;min-height:auto;padding-top:16px}
  .aliyun-copy h1{font-size:42px}
  .aliyun-copy p{font-size:17px}
  .aliyun-art{min-height:360px}
  .aliyun-device{width:88%;min-height:280px}
  .aliyun-ring{width:130px;height:130px;border-width:16px}
  .b1,.b2,.b3{font-size:14px;padding:10px 14px}

  .app-layout{display:block}
  .sidebar{
    position:fixed;
    left:-260px;
    top:var(--topbar-h);
    z-index:90;
    transition:.2s ease;
    box-shadow:12px 0 30px rgba(15,23,42,.15);
  }
  .sidebar.open{left:0}
  .mobile-backdrop.open{display:block}
  .main{padding:18px}
  .grid,.grid-2,.grid-3,.auth-split{grid-template-columns:1fr}
  .kpi-grid{grid-template-columns:1fr}
  .site-container{padding:18px 16px 28px}

  .table-wrap{display:none}
  .mobile-cards{display:flex}

  .auth-shell{grid-template-columns:1fr}
  .auth-left{padding:24px 18px 18px}
  .auth-right{padding:18px}
  .auth-hero{padding-top:34px}
  .auth-hero h1{font-size:44px}
  .auth-hero p{font-size:17px}
}

.upload-dropzone{
  border:1px dashed #cfd8e6;
  background:linear-gradient(180deg,#fbfcfe 0%,#f5f8fc 100%);
  border-radius:20px;
  padding:28px;
}
.upload-title{
  font-size:22px;
  font-weight:800;
  color:#0f172a;
  margin-bottom:8px;
}
.upload-desc{
  color:#64748b;
  font-size:14px;
  margin-bottom:18px;
}
.upload-input-wrap{
  background:#fff;
  border:1px solid #dbe3ef;
  border-radius:16px;
  padding:14px;
}
.toolbar-stack{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.toolbar-stack .form-input,
.toolbar-stack .select{
  max-width:none !important;
  width:100%;
}

/* ===== log table fix ===== */
.log-table{
  table-layout: fixed;
  width: 100%;
}

.log-table th,
.log-table td{
  vertical-align: middle;
}

.log-col-id{width:72px}
.log-col-user{width:92px}
.log-col-email{width:190px}
.log-col-ip{width:150px}
.log-col-status{width:110px}
.log-col-time{width:190px}
.log-col-action{width:160px}
.log-col-type{width:120px}
.log-col-target{width:100px}
.log-col-code{width:100px}
.log-col-method{width:100px}
.log-col-endpoint{width:180px}

.log-ellipsis{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-time{
  white-space: nowrap;
}

.log-cell-wrap{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

@media (max-width: 1024px){
  .log-table{
    display:none;
  }
}
