* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background-color: #f8fafc;
  color: #2d3748;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  background: white;
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
  border-bottom: 3px solid #3498db;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.75rem;
  font-weight: bold;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo::before {
  content: "💰";
  font-size: 2rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 500;
}

.btn {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.95rem;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2980b9, #2573a7);
}

.btn-success {
  background: linear-gradient(135deg, #27ae60, #219a52);
  color: white;
}

.btn-success:hover {
  background: linear-gradient(135deg, #219a52, #1e8449);
}

.btn-danger {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #c0392b, #a93226);
}

.btn-secondary {
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
  color: white;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #7f8c8d, #6c7b7d);
}

.form-container {
  max-width: 420px;
  margin: 3rem auto;
  background: white;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  border: 1px solid #e2e8f0;
}

.form-container h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #2c3e50;
  font-size: 1.75rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #4a5568;
  font-size: 0.95rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: white;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
  transform: translateY(-1px);
}

.form-group input::placeholder {
  color: #a0aec0;
}

.card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  margin-bottom: 1.5rem;
  border: 1px solid #f1f5f9;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.card h3 {
  color: #2c3e50;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  border-bottom: 2px solid #3498db;
  padding-bottom: 0.5rem;
  display: inline-block;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.table th,
.table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.table th {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
}

.table tr {
  transition: background-color 0.2s ease;
}

.table tr:hover {
  background-color: #f8fafc;
}

.table tr:last-child td {
  border-bottom: none;
}

.alert {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-weight: 500;
  border: 1px solid transparent;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-error {
  background: #fed7d7;
  color: #c53030;
  border-color: #feb2b2;
}

.alert-success {
  background: #c6f6d5;
  color: #276749;
  border-color: #9ae6b4;
}

.alert-warning {
  background: #feebc8;
  color: #744210;
  border-color: #fbd38d;
}

.alert-info {
  background: #bee3f8;
  color: #2c5aa0;
  border-color: #90cdf4;
}

.grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.permission-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.toggle-label:hover {
  background-color: #f7fafc;
}

.toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.toggle-label input[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}

.toggle-label input[disabled] + span {
  color: #a0aec0;
  cursor: not-allowed;
}

/* 下拉菜单特殊样式 */
select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25em 1.25em;
  padding-right: 3rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
}

select:focus {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%233498db' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

select option {
  padding: 0.75rem;
  font-size: 0.95rem;
}

select option:hover {
  background-color: #ebf8ff !important;
}

select option:checked {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
}

/* 搜索区域的表单组布局 */
#fetchSection .form-group {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

#fetchSection .form-group input,
#fetchSection .form-group select {
  flex: 1;
  min-width: 180px;
  margin-bottom: 0;
}

#fetchSection .form-group button {
  white-space: nowrap;
  margin-bottom: 0;
}

/* 状态徽章样式 */
.status-badge {
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-block;
  text-align: center;
  min-width: 80px;
}

.status-approved {
  background: linear-gradient(135deg, #c6f6d5, #9ae6b4);
  color: #22543d;
  border: 1px solid #48bb78;
}

.status-pending {
  background: linear-gradient(135deg, #feebc8, #fbd38d);
  color: #744210;
  border: 1px solid #ed8936;
}

.status-rejected {
  background: linear-gradient(135deg, #fed7d7, #feb2b2);
  color: #742a2a;
  border: 1px solid #f56565;
}

.permission-stats {
  background: linear-gradient(135deg, #ebf8ff, #e6fffa);
  border-left: 4px solid #3498db;
  padding: 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  color: #2d3748;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.permission-stats strong {
  color: #2c3e50;
  font-size: 1.05rem;
}

/* 权限信息样式 */
#permissionsInfo {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#permissionsInfo p {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 4px solid #3498db;
  font-weight: 500;
}

/* 链接样式 */
a {
  color: #3498db;
  text-decoration: none;
  transition: color 0.3s ease;
  font-weight: 500;
}

a:hover {
  color: #2980b9;
  text-decoration: underline;
}

/* 小屏幕适配 */
@media (max-width: 640px) {
  .container {
    padding: 15px;
  }
  
  .nav {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .user-info {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .form-container {
    margin: 1.5rem auto;
    padding: 1.5rem;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .table {
    font-size: 0.9rem;
  }
  
  .table th,
  .table td {
    padding: 0.75rem 0.5rem;
  }
  
  #fetchSection .form-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  #fetchSection .form-group input,
  #fetchSection .form-group select {
    min-width: auto;
  }
}

/* 加载状态 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 200px;
  background-color: #2d3748;
  color: white;
  text-align: center;
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.85rem;
  font-weight: normal;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* 按钮组样式 */
.button-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.button-group .btn {
  margin: 0;
}

/* 表单验证样式 */
.form-group input:invalid:not(:focus):not(:placeholder-shown) {
  border-color: #e74c3c;
  background-color: #fed7d7;
}

.form-group input:valid:not(:focus):not(:placeholder-shown) {
  border-color: #27ae60;
  background-color: #c6f6d5;
}

/* 价格输入特殊样式 */
input[type="number"] {
  font-family: 'Courier New', monospace;
  font-weight: 600;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

/* 选择框选项分组样式 */
optgroup {
  font-weight: bold;
  color: #2c3e50;
  font-style: normal;
}

optgroup option {
  font-weight: normal;
  padding-left: 1rem;
}

/* 空状态样式 */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: #718096;
}

.empty-state::before {
  content: "📊";
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

.empty-state h3 {
  color: #4a5568;
  margin-bottom: 0.5rem;
}

/* 成功状态动画 */
@keyframes successPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(39, 174, 96, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(39, 174, 96, 0);
  }
}

.success-pulse {
  animation: successPulse 1s;
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
}

/* 小按钮样式 */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* 表格复选框样式 */
.table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 警告样式 */
.alert-warning {
    background: #feebc8;
    color: #744210;
    border: 1px solid #fbd38d;
}

/* 批量操作区域 */
.bulk-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

/* 选中计数 */
.selected-count {
    font-weight: 600;
    color: #e74c3c;
}