* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  background: #0f1118;
  color: #eee;
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
  line-height: 1.5;
}

header {
  padding: 20px 0;
  border-bottom: 1px solid #222;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h1 {
  color: #fff;
  font-size: clamp(20px, 4vw, 24px);
}

a {
  color: #42a5f5;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.search-box input {
  width: 100%;
  padding: 12px 16px;
  background: #252a38;
  border: 1px solid #333;
  color: #fff;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  margin: 0;
}

.search-box input:focus {
  border-color: #217ad9;
}

.category-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.category-bar button {
  padding: 8px 18px;
  background: #252a38;
  border: 0;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: clamp(13px, 3vw, 14px);
  transition: 0.2s;
  touch-action: manipulation;
}

.category-bar button.active {
  background: #217ad9;
}

.category-bar button:hover {
  background: #303748;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(140px, 30vw, 210px), 1fr));
  gap: clamp(12px, 2vw, 20px);
}

.card {
  background: #1a1d27;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s;
  -webkit-transition: transform 0.2s;
}

.card:hover {
  transform: scale(1.02);
}

.card img {
  width: 100%;
  height: clamp(100px, 18vw, 135px);
  object-fit: cover;
  background: #222;
  display: block;
}

.card-body {
  padding: clamp(10px, 2vw, 12px);
}

.card h3 {
  font-size: clamp(14px, 2.5vw, 15px);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card p {
  font-size: clamp(12px, 2vw, 13px);
  color: #aaa;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 38px;
}

.player-wrap {
  width: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  margin: 20px 0;
}

video {
  width: 100%;
  display: block;
}

.form-box {
  background: #1a1d27;
  padding: clamp(16px, 3vw, 22px);
  border-radius: 10px;
  margin-bottom: 30px;
}

input, textarea {
  width: 100%;
  padding: clamp(10px, 2vw, 11px);
  margin: 8px 0;
  background: #252a38;
  border: 1px solid #333;
  color: #fff;
  border-radius: 6px;
  font-size: clamp(14px, 2.5vw, 14px);
  outline: none;
}

input:focus, textarea:focus {
  border-color: #217ad9;
}

button {
  padding: clamp(9px, 2vw, 10px) clamp(16px, 3vw, 18px);
  background: #217ad9;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin: 4px;
  font-size: clamp(13px, 2.5vw, 14px);
  touch-action: manipulation;
}

.del-btn {
  background: #d13030;
}

.video-item {
  background: #202430;
  padding: clamp(12px, 2vw, 14px);
  border-radius: 8px;
  margin: 12px 0;
}

.login-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.login-box {
  background: #1a1d27;
  padding: clamp(20px, 4vw, 26px);
  border-radius: 10px;
  width: 100%;
  max-width: 340px;
}

.hidden {
  display: none !important;
}

#errTip {
  color: #ff6b6b;
  margin-top: 8px;
  font-size: 14px;
}

#pageBox button {
  min-width: 36px;
  height: 36px;
  line-height: 36px;
  padding: 0 12px;
}

@media (max-width: 768px) {
  body {
    padding: 12px;
  }
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  body {
    padding: 18px;
  }
}