:root{
  --red:#ff4d4d;
  --red-deep:#ff2f2f;
  --bg:#ffffff;
  --text:#1f1f1f;
  --muted:#6b7280;
  --card:#ffffff;
  --border:rgba(255,77,77,.18);
  --shadow:0 8px 24px rgba(255,77,77,.12);
  --radius:16px;
  --soft:rgba(255,77,77,.08);
  --soft2:rgba(255,77,77,.06);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans CJK SC",sans-serif;
  background:linear-gradient(180deg, rgba(255,77,77,.08) 0%, rgba(255,77,77,0) 180px), var(--bg);
  color:var(--text);
}
a{color:inherit;text-decoration:none}
.container{
  width:min(1200px, calc(100% - 20px));
  margin:0 auto;
  padding:12px 0 20px;
}
.topbar{
  border:1px solid var(--border);
  background:rgba(255,255,255,.82);
  backdrop-filter: blur(8px);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding:10px 12px;
}
.brand{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:8px;
}
.brand h1{
  margin:0;
  font-size:18px;
  line-height:1.1;
  letter-spacing:.5px;
}
.brand .tag{
  font-size:10px;
  color:var(--muted);
  white-space:nowrap;
}
.brand strong{
  color:var(--red);
}
.marquee{
  margin-top:8px;
  border:1px dashed rgba(255,77,77,.35);
  background:rgba(255,77,77,.06);
  border-radius:10px;
  overflow:hidden;
  height:28px;
  display:flex;
  align-items:center;
}
.marquee .label{
  flex:0 0 auto;
  padding:0 12px;
  color:var(--red);
  font-weight:700;
  font-size:12px;
  letter-spacing:.6px;
  border-right:1px solid rgba(255,77,77,.18);
}
.marquee .track{
  position:relative;
  flex:1 1 auto;
  overflow:hidden;
  height:100%;
}
.marquee .content{
  position:absolute;
  left:100%;
  top:0;
  height:100%;
  display:flex;
  align-items:center;
  white-space:nowrap;
  will-change:transform;
  animation:marquee 16s linear infinite;
  padding-left:16px;
  padding-right:16px;
  color:#b42323;
  font-size:13px;
}
@keyframes marquee{
  0%{transform:translateX(0)}
  100%{transform:translateX(-200%)}
}
@media (prefers-reduced-motion: reduce){
  .marquee .content{animation:none; left:0; position:static}
}
.tabs{
  margin-top:14px;
  display:flex;
  gap:10px;
  padding:10px;
  align-items:center;
  justify-content:flex-start;
}
.tab{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:38px;
  padding:0 16px;
  border-radius:999px;
  border:1px solid rgba(255,77,77,.18);
  background:rgba(255,255,255,.9);
  color:#b42323;
  font-weight:800;
  font-size:13px;
  letter-spacing:.2px;
  transition:transform .12s ease, background .12s ease, border-color .12s ease;
}
.tab:hover{border-color:rgba(255,77,77,.45); background:var(--soft2)}
.tab:active{transform:scale(.98)}
.tab.active{
  background:linear-gradient(180deg, rgba(255,77,77,.18), rgba(255,77,77,.10));
  border-color:rgba(255,77,77,.55);
  color:#7f1d1d;
}

.searchbar{margin-top:8px}
.searchwrap{
  position:relative;
  display:flex;
  align-items:center;
  gap:8px;
}
.searchicon{
  position:absolute;
  left:12px;
  top:50%;
  transform:translateY(-50%);
  z-index:10;
  width:14px;
  height:14px;
  fill:#4b5563; /* 深灰色 */
  opacity:1;
  pointer-events:none; /* 防止挡住点击/选中 */
}
.searchinput{
  width:100%;
  border:1px solid rgba(17,24,39,.14); /* 极细淡灰 */
  border-radius:12px;
  padding:8px 36px 8px 36px;
  outline:none;
  background:#fff;
  color:var(--text);
  font-size:14px;
  font-weight:700;
  letter-spacing:.2px;
  text-align:center;
  transition:border-color .12s ease, box-shadow .12s ease;
}
.searchinput::placeholder{text-align:center}
.searchinput:focus{
  border-color:rgba(255,77,77,.85);
  box-shadow:0 0 0 3px rgba(255,77,77,.16);
}
.searchinput::-webkit-search-decoration,
.searchinput::-webkit-search-results-button{
  -webkit-appearance:none;
}
.searchinput::-webkit-search-cancel-button{
  -webkit-appearance:none;
  height:14px;
  width:14px;
  margin-right:2px;
  border-radius:999px;
  background:
    linear-gradient(45deg, transparent 43%, #9ca3af 43%, #9ca3af 57%, transparent 57%),
    linear-gradient(-45deg, transparent 43%, #9ca3af 43%, #9ca3af 57%, transparent 57%);
  opacity:.9;
  cursor:pointer;
}

.list{
  margin-top:8px;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.item{
  border:1px solid rgba(255,77,77,.20);
  background:rgba(255,255,255,.90);
  backdrop-filter: blur(8px);
  border-radius:14px;
  box-shadow:0 10px 20px rgba(255,77,77,.10);
  padding:10px 10px;
  display:flex;
  align-items:center;
  gap:10px;
  transition:transform .12s ease, border-color .12s ease, box-shadow .12s ease;
  user-select:none;
}
.item:hover{
  border-color:rgba(255,77,77,.46);
  box-shadow:0 18px 36px rgba(255,77,77,.16);
}
.item:active{transform:scale(.985)}
.item-left{flex:0 0 auto}
.item-body{flex:1 1 auto; min-width:0}
.item-right{
  flex:0 0 auto;
  width:50px;
  height:50px;
  border-radius:999px;
  background:transparent;
  border:2px solid var(--red);
  box-shadow:none;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:0; /* 隐藏原来的箭头字符 */
  line-height:1;
  color:var(--red);
  transition:transform .12s ease, background .12s ease, border-color .12s ease;
}
.item:hover .item-right{background:rgba(255,77,77,.08); border-color:var(--red-deep)}
.item:active .item-right{transform:scale(.98)}
.item-right::before{
  content:'下载';
  color:var(--red);
  font-size:14px;
  font-weight:900;
  letter-spacing:.5px;
}

/* 兼容别名：如果后续把按钮单独做成 .download-btn */
.download-btn{all:unset}
.download-btn{
  width:42px;height:42px;
  border-radius:999px;
  border:1.5px solid var(--red);
  background:transparent;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:var(--red);
  font-size:12px;
  font-weight:900;
  letter-spacing:.5px;
  cursor:pointer;
  transition:transform .12s ease, background .12s ease, border-color .12s ease;
}
.download-btn:hover{background:rgba(255,77,77,.08); border-color:var(--red-deep)}
.download-btn:active{transform:scale(.98)}
.item-title{
  font-size:16px;
  font-weight:900;
  color:#7f1d1d;
  letter-spacing:.2px;
  margin-top:1px;
}
.item-meta{
  margin-top:4px;
  display:flex;
  align-items:center;
  gap:6px;
  color:#b42323;
  font-weight:800;
  font-size:11px;
}
.meta{opacity:1}
.dot{display:none}
.item-meta .meta:first-child{
  background:var(--red);
  color:#fff;
  padding:2px 7px;
  border-radius:4px;
  font-weight:600;
  letter-spacing:.2px;
  box-shadow:0 4px 10px rgba(255,77,77,.18);
}
.item-meta .meta:last-child{
  background:#3f51b5;
  color:#fff;
  padding:2px 7px;
  border-radius:4px;
  font-weight:600;
  letter-spacing:.2px;
}
.item-desc{
  margin-top:6px;
  font-size:11px;
  color:#fff;
  background:#6b7280;
  padding:2px 7px;
  border-radius:4px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.icon{
  width:72px;height:72px;
  border-radius:20px;
  background:var(--soft);
  border:1px solid rgba(255,77,77,.22);
  object-fit:cover;
  display:block;
}
.icon.fallback{
  display:flex;
  align-items:center;
  justify-content:center;
  color:#ff4d4d;
  font-weight:900;
}
.footer{
  margin-top:14px;
  color:var(--muted);
  font-size:12px;
  text-align:center;
}
.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid rgba(255,77,77,.22);
  background:rgba(255,77,77,.06);
  padding:10px 12px;
  border-radius:999px;
}
.btn{
  appearance:none;
  border:1px solid rgba(255,77,77,.3);
  background:var(--red);
  color:#fff;
  border-radius:12px;
  padding:10px 12px;
  font-weight:700;
  cursor:pointer;
  transition:transform .12s ease, background .12s ease, opacity .12s ease;
}
.btn:hover{background:var(--red-deep)}
.btn:active{transform:scale(.98)}
.btn.secondary{
  background:#fff;
  color:var(--red);
}
.btn.secondary:hover{background:rgba(255,77,77,.06)}
.btn.danger{
  background:#fff;
  color:#b42323;
  border-color:rgba(180,35,35,.28);
}
.btn.danger:hover{background:rgba(180,35,35,.06)}
.panel{
  margin-top:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.84);
  backdrop-filter: blur(8px);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding:14px;
}
.row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}
.row.space{justify-content:space-between}
.field{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:220px;
  flex:1 1 220px;
}
label{
  font-size:12px;
  color:var(--muted);
}
input[type="text"], input[type="password"], textarea{
  width:100%;
  border:1px solid rgba(255,77,77,.22);
  border-radius:12px;
  padding:10px 12px;
  outline:none;
  background:#fff;
  color:var(--text);
}
textarea{min-height:84px; resize:vertical}
input:focus, textarea:focus{border-color:rgba(255,77,77,.55); box-shadow:0 0 0 3px rgba(255,77,77,.12)}
.hint{font-size:12px;color:var(--muted)}
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 10px;
}
.table th{
  text-align:left;
  font-size:12px;
  color:var(--muted);
  font-weight:600;
  padding:0 8px;
}
.table td{
  background:#fff;
  border:1px solid rgba(255,77,77,.18);
  padding:10px 8px;
  vertical-align:middle;
}
.table td:first-child{border-radius:14px 0 0 14px}
.table td:last-child{border-radius:0 14px 14px 0}
.badge{
  display:inline-flex;
  align-items:center;
  padding:4px 8px;
  border-radius:999px;
  background:rgba(255,77,77,.08);
  border:1px solid rgba(255,77,77,.2);
  color:var(--red);
  font-size:12px;
  font-weight:700;
}
.toggle-visible-btn{
  min-width:78px;
  border:none;
  border-radius:999px;
  padding:8px 12px;
  font-weight:800;
  cursor:pointer;
  color:#fff;
  transition:transform .12s ease, opacity .12s ease, background .12s ease;
}
.toggle-visible-btn:hover{opacity:.92}
.toggle-visible-btn:active{transform:scale(.98)}
.toggle-visible-btn:disabled{cursor:not-allowed; opacity:.65}
.toggle-visible-btn.is-visible{background:#16a34a}
.toggle-visible-btn.is-hidden{background:#9ca3af}
.msg{
  margin-top:12px;
  border-radius:14px;
  padding:10px 12px;
  border:1px solid rgba(16,185,129,.28);
  background:rgba(16,185,129,.06);
  color:#065f46;
  font-size:13px;
}
.msg.err{
  border-color:rgba(180,35,35,.28);
  background:rgba(180,35,35,.06);
  color:#7f1d1d;
}
.back-to-top{
  margin-top:20px;
  padding:16px;
  text-align:center;
  cursor:pointer;
}
.back-to-top span{
  color:var(--red);
  font-weight:900;
  font-size:14px;
  letter-spacing:.5px;
}
.back-to-top:hover span{
  color:var(--red-deep);
  text-decoration:underline;
}

/* 移动端响应式适配 */
@media (max-width: 768px) {
  .container {
    width: 100%;
    padding: 8px;
  }

  .mobile-hide {
    display: none !important;
  }

  .table {
    width: 100%;
    table-layout: fixed;
  }

  .table thead th:nth-child(1),
  .table tbody td:nth-child(1) {
    width: 40px;
  }

  .table thead th:nth-child(2),
  .table tbody td:nth-child(2) {
    width: 50px;
  }

  .table thead th:nth-child(3),
  .table tbody td:nth-child(3) {
    width: calc(100% - 200px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .table thead th:last-child,
  .table tbody td:last-child {
    width: 110px;
  }

  .table td, .table th {
    padding: 6px 4px;
    font-size: 12px;
    text-align: left;
  }

  .toggle-visible-btn {
    min-width: 60px !important;
    padding: 4px 8px !important;
    font-size: 11px !important;
  }

  .expand-btn {
    display: inline-block !important;
    padding: 4px 8px !important;
    font-size: 11px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .detail-row {
    background: #f9fafb;
  }

  .detail-row td {
    padding: 12px;
    font-size: 12px;
    white-space: normal;
    word-break: break-all;
  }

  .btn-group {
    flex-direction: column;
    gap: 3px;
  }

  .btn-group .btn {
    width: 100%;
    padding: 4px 8px;
    font-size: 11px;
  }

  .mobile-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    margin-top: 0 !important;
  }

  .mobile-actions .btn,
  .mobile-actions a.btn,
  .mobile-actions button.btn {
    padding: 4px 8px !important;
    font-size: 11px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    min-width: auto !important;
  }

  .mobile-actions form {
    margin: 0 !important;
  }
}

@media (min-width: 769px) {
  .expand-btn {
    display: none;
  }

  .mobile-actions {
    display: flex !important;
    flex-direction: row !important;
  }
}
