* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  color-scheme: light;
  color: #1f2937;
  background-color: #ffffff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  --primary-color: #e2e8f0;
  --secondary-color: #f1f5f9;
  --accent-color: #f8fafc;
  --bg-color: #ffffff;
  --card-bg: #f8fafc;
  --border-color: #e2e8f0;
  --text-color: #000000;
  --text-secondary: #333333;
}

body {
  min-width: 320px;
  min-height: 100vh;
  background: #ffffff;
  background-attachment: fixed;
  background-size: cover;
  color: var(--text-color);
  overflow-x: hidden;
  transition: background 0.3s ease;
}

.app-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  animation: fadeIn 0.5s ease-in-out;
}

/* 为内部元素添加间距 */
.header {
  margin: 2rem 0 1rem;
}

.table-container {
  margin: 0 0 2rem;
}

/* 响应式间距调整 */
@media (max-width: 768px) {
  .header {
    margin: 1rem 0 0.5rem;
  }
  
  .table-container {
    margin: 0 0 1rem;
  }
}

@media (min-width: 1200px) {
  .header {
    margin: 3rem 0 1rem;
  }
  
  .table-container {
    margin: 0 0 3rem;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.header:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-color);
}

.month-nav {
  padding: 0.5rem 1rem;
  background: var(--primary-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #000000;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.month-nav:hover {
  background: #cbd5e1;
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.month-nav:active {
  transform: scale(0.98);
}

.table-container {
  overflow-x: scroll;
  overflow-y: auto;
  max-height: 600px;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 0;
  border: 1px solid var(--border-color);
  position: relative;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  scroll-behavior: smooth;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.table-container:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.data-table {
  width: auto;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
  transition: all 0.3s ease;
}

.data-table th,
.data-table td {
  padding: 0.8rem;
  text-align: center;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.data-table th {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
  color: #000000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.name-header {
  position: sticky;
  left: 0;
  top: 0;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  z-index: 100;
  min-width: 100px;
  width: 100px;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.15);
  border-right: 2px solid var(--border-color);
  color: #000000;
}

.name-cell {
  position: sticky;
  left: 0;
  background: var(--primary-color);
  font-weight: 500;
  z-index: 99;
  min-width: 100px;
  width: 100px;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
  border-right: 2px solid var(--border-color);
  color: #000000;
}

.data-table th:not(.name-header),
.data-table td:not(.name-cell) {
  z-index: 1;
  position: relative;
  min-width: 50px;
  width: 50px;
}

/* 当天日期的突出显示样式 */
.today-header {
  background: linear-gradient(135deg, #93c5fd, #60a5fa) !important;
  animation: pulse 2s infinite;
  box-shadow: 0 0 20px rgba(147, 197, 253, 0.5);
  color: #000000 !important;
}

.today-cell {
  background: rgba(147, 197, 253, 0.3) !important;
  border: 2px solid #93c5fd !important;
  box-shadow: inset 0 0 10px rgba(147, 197, 253, 0.3);
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(147, 197, 253, 0.5);
  }
  50% {
    box-shadow: 0 0 30px rgba(147, 197, 253, 0.8);
  }
}



.data-table tr {
  transition: all 0.3s ease;
}

.data-table tr:hover {
  background: rgba(59, 130, 246, 0.05);
}

.data-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.table-container::-webkit-scrollbar {
  height: 10px;
  border-radius: 5px;
}

.table-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  border: 1px solid var(--border-color);
}

.table-container::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
  transform: scaleY(1.2);
}

@media (min-width: 1200px) {
  .header h1 {
    font-size: 2rem;
  }
  
  .data-table th,
  .data-table td {
    padding: 1rem;
  }
  
  .name-header,
  .name-cell {
    min-width: 120px;
    width: 120px;
  }
  
  .data-cell input {
    padding: 0.6rem;
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 1rem;
  }
  
  .table-container {
    max-height: 400px;
  }
  
  .header {
    gap: 0.5rem;
  }
  
  .header h1 {
    font-size: 1.2rem;
  }
  
  .month-nav {
    padding: 0.4rem 0.8rem;
    font-size: 1rem;
  }
  
  .data-table th,
  .data-table td {
    padding: 0.4rem;
    font-size: 0.9rem;
  }
  
  .name-header,
  .name-cell {
    min-width: 70px;
    width: 70px;
  }
  
  .data-table th:not(.name-header),
  .data-table td:not(.name-cell) {
    min-width: 45px;
    width: 45px;
  }
  
  .data-cell input {
    padding: 0.3rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .app-container {
    padding: 0.5rem;
  }
  
  .header h1 {
    font-size: 1rem;
  }
  
  .month-nav {
    padding: 0.3rem 0.6rem;
    font-size: 0.9rem;
  }
  
  .data-table th,
  .data-table td {
    padding: 0.3rem;
    font-size: 0.8rem;
  }
  
  .name-header,
  .name-cell {
    min-width: 60px;
    width: 60px;
  }
  
  .data-cell input {
    padding: 0.2rem;
    font-size: 0.7rem;
  }
}

.admin-panel {
  width: 100%;
  padding: 1rem;
  box-sizing: border-box;
  max-width: 100%;
  overflow-x: hidden;
}

.admin-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.back-btn {
  padding: 0.5rem 1rem;
  background: var(--primary-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #000000;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.back-btn:hover {
  background: #cbd5e1;
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.admin-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-color);
  word-break: break-word;
}

.admin-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
  width: 100%;
  max-width: 100%;
}

.add-form, .people-list {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  min-width: 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.add-form h2, .people-list h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 1rem;
  word-break: break-word;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-color);
}

.form-group input {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text-color);
  font-size: 1rem;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.add-btn {
  width: 100%;
  padding: 0.8rem 1.5rem;
  background: linear-gradient(135deg, #ea580c, #ea580c);
  border: none;
  border-radius: 8px;
  color: #000000;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.add-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 600px;
}

.admin-table th,
.admin-table td {
  padding: 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  word-break: break-word;
}

.admin-table th {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  font-weight: 600;
  color: #000000;
  position: sticky;
  top: 0;
  white-space: nowrap;
}

.admin-table td a {
  color: #64748b;
  text-decoration: none;
  transition: color 0.3s ease;
  display: inline-block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.admin-table td a:hover {
  color: #475569;
  text-decoration: underline;
}

.delete-btn {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.delete-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

@media (max-width: 1024px) {
  .admin-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .admin-panel {
    padding: 0.5rem;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
  }

  .admin-header h1 {
    font-size: 1.3rem;
  }

  .add-form, .people-list {
    padding: 1rem;
  }

  .admin-table {
    min-width: 500px;
  }

  .admin-table th,
  .admin-table td {
    padding: 0.5rem;
    font-size: 0.85rem;
  }

  .modal-content {
    padding: 1.5rem;
  }

  .modal-actions {
    flex-direction: column;
  }

  .cancel-btn, .confirm-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .admin-header {
    padding: 0.8rem;
  }

  .admin-header h1 {
    font-size: 1.1rem;
  }

  .add-form, .people-list {
    padding: 0.8rem;
  }

  .add-form h2, .people-list h2 {
    font-size: 1rem;
  }

  .admin-table {
    min-width: 450px;
  }

  .admin-table th,
  .admin-table td {
    padding: 0.4rem;
    font-size: 0.8rem;
  }

  .delete-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
}

.published-cell {
  background: linear-gradient(135deg, #f97316, #ea580c) !important;
  cursor: pointer;
  transition: all 0.3s ease;
}

.published-cell:hover {
  background: linear-gradient(135deg, #ea580c, #c2410c) !important;
  transform: scale(1.02);
}

.unpublished-cell {
  background: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
}

.unpublished-cell:hover {
  background: #f8fafc;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-in-out;
}

.modal-content {
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 1.5rem;
  text-align: center;
}

.modal-info {
  background: #f8fafc;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.modal-info p {
  margin: 0.5rem 0;
  color: var(--text-color);
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.cancel-btn {
  padding: 0.7rem 1.5rem;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.cancel-btn:hover {
  background: #e2e8f0;
}

.confirm-btn {
  padding: 0.7rem 1.5rem;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  border: none;
  border-radius: 8px;
  color: #000000;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.confirm-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.query-results {
  background: #f8fafc;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.query-results h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.query-results pre {
  background: #e2e8f0;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #000000;
}


