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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.5;
  min-height: 100vh;
}

/* 顶部导航 */
.header {
  background: #fff;
  color: #fff;
  padding: 0;
  height: auto;
}

.header-banner {
  width: 100%;
  height: auto;
  display: block;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  position: relative;
}

.header-title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* 底部导航（H5 Tab栏） */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  display: flex;
  border-top: 1px solid #e8e8e8;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0;
  color: #999;
  text-decoration: none;
  font-size: 0.75rem;
  transition: color 0.2s;
}

.tab-item.active {
  color: #667eea;
}

.tab-item .icon {
  font-size: 1.25rem;
  margin-bottom: 0.125rem;
}

/* 页面容器 */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  padding-bottom: 4rem;
}

/* 卡片 */
.card {
  background: #fff;
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.card-title::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 1rem;
  background: #667eea;
  border-radius: 2px;
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* 表单 */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  color: #555;
  margin-bottom: 0.375rem;
}

.form-label .required {
  color: #ff4d4f;
  margin-right: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid #d9d9d9;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #bfbfbf;
}

.form-textarea {
  min-height: 5rem;
  resize: vertical;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.form-error {
  color: #ff4d4f;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: none;
}

.form-group.has-error .form-input,
.form-group.has-error .form-select,
.form-group.has-error .form-textarea {
  border-color: #ff4d4f;
}

.form-group.has-error .form-error {
  display: block;
}

/* 两列布局 */
.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

/* 上传区域 */
.upload-box {
  width: 120px;
  height: 120px;
  border: 2px dashed #d9d9d9;
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s;
  position: relative;
  overflow: hidden;
  background: #fafafa;
}

.upload-box:hover {
  border-color: #667eea;
}

.upload-box .upload-icon {
  font-size: 1.5rem;
  color: #bfbfbf;
  margin-bottom: 0.25rem;
}

.upload-box .upload-text {
  font-size: 0.75rem;
  color: #999;
}

.upload-box input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-box .upload-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.upload-box.has-preview .upload-preview {
  display: block;
}

.upload-box.has-preview .upload-icon,
.upload-box.has-preview .upload-text {
  display: none;
}

.upload-hint {
  font-size: 0.75rem;
  color: #ff4d4f;
  margin-top: 0.375rem;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
}

/* 登录页 */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 1rem;
}

.login-box {
  background: #fff;
  border-radius: 1rem;
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #333;
}

.login-subtitle {
  text-align: center;
  font-size: 0.875rem;
  color: #999;
  margin-bottom: 1.5rem;
}

/* 列表 */
.list-item {
  background: #fff;
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.list-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.list-item-title {
  font-weight: 600;
  font-size: 1rem;
}

.list-item-status {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 1rem;
}

.status-success {
  background: #f6ffed;
  color: #52c41a;
}

.status-pending {
  background: #fff7e6;
  color: #fa8c16;
}

.status-cancel {
  background: #fff1f0;
  color: #ff4d4f;
}

.list-item-info {
  font-size: 0.875rem;
  color: #666;
  line-height: 1.8;
}

.list-item-info span {
  display: inline-block;
  margin-right: 1rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #999;
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

/* 首页 */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 2.5rem 1rem;
  text-align: center;
  border-radius: 0 0 1.5rem 1.5rem;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero-desc {
  font-size: 0.875rem;
  opacity: 0.9;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 0 1rem;
  margin-bottom: 1.5rem;
}

.menu-card {
  background: #fff;
  border-radius: 0.75rem;
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  text-decoration: none;
  color: #333;
  transition: transform 0.2s, box-shadow 0.2s;
}

.menu-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.menu-card .icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.menu-card .title {
  font-size: 0.9375rem;
  font-weight: 600;
}

.menu-card .desc {
  font-size: 0.75rem;
  color: #999;
  margin-top: 0.25rem;
}

/* Toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  z-index: 1000;
  display: none;
}

.toast.show {
  display: block;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 响应式 */
@media (min-width: 768px) {
  .page {
    padding: 1.5rem;
    padding-bottom: 4rem;
  }

  .login-box {
    padding: 2.5rem 2rem;
  }

  .menu-grid {
    grid-template-columns: repeat(4, 1fr);
    padding: 0;
  }
}

/* 模态框 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.show {
  display: flex;
}

.modal-box {
  background: #fff;
  border-radius: 0.75rem;
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  padding: 1rem;
  border-bottom: 1px solid #f0f0f0;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 1rem;
}

.modal-footer {
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  border-top: 1px solid #f0f0f0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: #999;
}
