:root {
  --primary: #59be6c;
  --primary-dark: #45a857;
  --primary-light: #e8f7ec;
  --text: #1f2329;
  --text-sub: #8a9099;
  --line: #f0f2f5;
  --danger: #ff4d4f;
  --orange: #ff9f43;
  --card-bg: #ffffff;
  --radius: 12px;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--line);
  font-size: 15px;
  line-height: 1.5;
}

/* 登录页 */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #e8f7ec 0%, #f7fbf8 40%, #ffffff 100%);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card-bg);
  border-radius: 20px;
  padding: 32px 24px;
  box-shadow: 0 12px 40px rgba(31, 35, 41, 0.08);
}

.login-card h1 {
  font-size: 22px;
  text-align: center;
}

.login-sub {
  text-align: center;
  color: var(--text-sub);
  margin: 8px 0 24px;
  font-size: 14px;
}

/* 表单 */
.field {
  display: block;
  margin-bottom: 16px;
}

.field > span {
  display: block;
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #e3e6eb;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
}

.field textarea {
  min-height: 80px;
  resize: vertical;
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.checkbox-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.field-row .field-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #e3e6eb;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
}

.field-row .field-input:focus {
  border-color: var(--primary);
}

.field-row .field-select {
  width: 72px;
  flex-shrink: 0;
  border: 1px solid #e3e6eb;
  border-radius: 10px;
  padding: 8px 6px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
}

.field-row .field-select:focus {
  border-color: var(--primary);
}

.field-row .btn-sm {
  flex-shrink: 0;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 22px;
  padding: 10px 18px;
  font-size: 15px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:active {
  background: var(--primary-dark);
}

.btn-danger {
  background: #fff1f0;
  color: var(--danger);
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 6px 14px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 16px;
}

/* 主界面 */
.app-view {
  min-height: 100vh;
  max-width: 720px;
  margin: 0 auto;
  background: var(--line);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-title {
  font-size: 17px;
  font-weight: 600;
}

.tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 52px;
  z-index: 9;
}

.tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 0;
  font-size: 14px;
  color: var(--text-sub);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.content {
  padding: 16px;
}

/* 卡片 */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(31, 35, 41, 0.04);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-head h3 {
  font-size: 16px;
}

.section-title {
  font-size: 13px;
  color: var(--text-sub);
  margin: 16px 0 8px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.list-item:last-child {
  border-bottom: none;
}

.list-item .meta {
  flex: 1;
  min-width: 0;
}

.list-item .meta .title {
  font-weight: 600;
}

.list-item .meta .sub {
  color: var(--text-sub);
  font-size: 13px;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  background: var(--primary-light);
  color: var(--primary);
}

.tag.gray {
  background: #f0f2f5;
  color: var(--text-sub);
}

.tag.warn {
  background: #fff7e6;
  color: var(--orange);
}

.tag.success {
  background: var(--primary-light);
  color: var(--primary);
}

.tag.danger {
  background: #fff1f0;
  color: var(--danger);
}

.btn-success {
  background: var(--primary-light);
  color: var(--primary);
}

.empty {
  text-align: center;
  color: var(--text-sub);
  padding: 40px 0;
  font-size: 14px;
}

.error-text {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 12px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  background: rgba(31, 35, 41, 0.9);
  color: #fff;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 100;
  max-width: 80%;
  text-align: center;
}

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal {
  width: 100%;
  max-width: 720px;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 20px 16px 28px;
  max-height: 88vh;
  overflow-y: auto;
}

.modal h3 {
  text-align: center;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.modal-actions .btn {
  flex: 1;
}

.inline-actions {
  display: flex;
  gap: 8px;
}
