/* 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  outline: none;
  cursor: pointer;
  font-family: inherit;
}

input, textarea {
  font-family: inherit;
  border: none;
  outline: none;
}

/* 通用页面容器 */
.page {
  min-height: 100vh;
  padding-bottom: 60px;
}

/* 通用卡片样式 */
.card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.3s;
}

.card:active {
  transform: scale(0.98);
}

/* 通用按钮样式 */
.btn {
  padding: 14px 0;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s;
}

.btn:active {
  opacity: 0.9;
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: #000000;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.btn-secondary {
  background: #f3f4f6;
  color: #000000;
}

/* 通用输入框样式 */
.input-field {
  width: 100%;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  font-size: 14px;
  transition: all 0.3s;
}

.input-field:focus {
  border-color: #06b6d4;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

/* 通用标签样式 */
.tag {
  display: inline-block;
  padding: 4px 10px;
  background: #f3f4f6;
  border-radius: 8px;
  font-size: 11px;
  color: #000000;
}

/* 通用加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f4f6;
  border-top-color: #06b6d4;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 通用空状态 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-text {
  font-size: 16px;
  font-weight: 600;
  color: #000000;
  margin-bottom: 8px;
}

.empty-hint {
  font-size: 13px;
  color: #9ca3af;
}

/* 通用模态窗口 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: #ffffff;
  border-radius: 12px;
  max-width: 90%;
  max-height: 80vh;
  overflow: auto;
}

/* 通用吐司提示 */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 99999;
  animation: fadeIn 0.3s ease;
  pointer-events: none;
}

/* 顶部导航栏 */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: white;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid #e5e7eb;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.nav-back {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  width: 48px;
  height: 48px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  font-size: 24px;
  color: #000000;
  transition: all 0.3s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.nav-back:active {
  background: #f3f4f6;
  transform: scale(0.95);
}

.nav-title {
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: #000000;
  margin: 0;
  padding: 0 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* App Header 样式 */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid #e5e7eb;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.app-header h1 {
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: #000000;
  margin: 0;
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  width: 48px;
  height: 48px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.back-btn .icon {
  font-size: 24px;
  color: #000000;
  display: block;
  line-height: 1;
}

.back-btn:active {
  background: #f3f4f6;
  transform: scale(0.95);
}

.header-spacer {
  min-width: 48px;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.app-container {
  min-height: 100vh;
  padding-top: 60px;
}

/* 响应式 */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }
}
