* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
  background: #f5f5f5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

#root {
  min-height: 100vh;
  min-height: 100dvh;
}

a {
  color: inherit;
}

.page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px 32px;
  padding-bottom: max(32px, env(safe-area-inset-bottom));
}

.page-header {
  margin-bottom: 16px;
  width: 100%;
}

.student-tabs .ant-tabs-nav {
  margin-bottom: 12px;
}

.wq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 16px;
}

.wq-card {
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.wq-card-click {
  cursor: pointer;
  flex: 1;
}

.wq-card-click:active {
  opacity: 0.95;
}

.wq-card-actions {
  padding: 4px 8px 8px;
  border-top: 1px solid #f5f5f5;
  text-align: right;
}

.wq-card-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #fafafa;
}

.wq-card-body {
  padding: 12px;
}

.upload-actions .ant-btn {
  min-height: 44px;
}

.upload-mobile-only {
  display: none;
}

.upload-desktop-only {
  display: inline-flex;
}

@media (max-width: 768px) {
  .page-container {
    padding: 12px 12px 24px;
  }

  .ant-tabs-tab {
    padding: 8px 10px !important;
    font-size: 14px;
  }

  .ant-modal {
    max-width: calc(100vw - 16px) !important;
    margin: 8px auto !important;
  }

  .ant-table {
    font-size: 12px;
  }

  .upload-actions {
    width: 100%;
  }

  .upload-mobile-only {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .upload-desktop-only {
    display: none;
  }

  .upload-actions .ant-btn {
    flex: 1;
    min-width: 120px;
  }
}

@media (max-width: 576px) {
  .wq-card-img {
    height: 120px;
  }
}
