/* styles.css - 考勤软件移动端样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 600px;
  margin: 0 auto;
  padding: 12px;
  padding-bottom: 40px;
}

/* 应用隐藏（登录前） */
.app-hidden {
  display: none !important;
}

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

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 32px 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.login-title {
  text-align: center;
  font-size: 26px;
  color: #2c3e50;
  margin-bottom: 8px;
  font-weight: 700;
}

.login-subtitle {
  text-align: center;
  color: #888;
  margin-bottom: 28px;
  font-size: 14px;
}

.login-form .form-group {
  margin-bottom: 18px;
}

.login-form label {
  display: block;
  font-size: 14px;
  color: #555;
  margin-bottom: 6px;
  font-weight: 500;
}

.login-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.2s;
  background: #fafbfc;
}

.login-form input:focus {
  outline: none;
  border-color: #667eea;
  background: #fff;
}

.login-btn {
  width: 100%;
  padding: 13px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  background: #667eea;
  color: #fff;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s;
}

.login-btn:hover {
  background: #5568d3;
}

.login-btn:active {
  background: #4757c0;
}

.login-error {
  color: #e74c3c;
  font-size: 13px;
  min-height: 18px;
  margin-bottom: 6px;
}

.login-hint {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #f0f0f0;
  text-align: center;
}

.login-hint p {
  color: #aaa;
  font-size: 12px;
  line-height: 1.8;
}

/* ============ 用户信息 ============ */
.user-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 13px;
}

.user-info span {
  color: rgba(255, 255, 255, 0.9);
}

.btn-logout {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* 顶部标题 */
.app-header {
  text-align: center;
  padding: 24px 16px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
  margin-bottom: 16px;
}

.app-header h1 {
  font-size: 24px;
  margin-bottom: 4px;
}

.app-header .subtitle {
  font-size: 13px;
  opacity: 0.9;
}

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

.card-title {
  font-size: 16px;
  color: #333;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f0f0f0;
}

/* 表单 */
.form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.form-row label {
  font-size: 14px;
  color: #666;
  white-space: nowrap;
}

.form-row select,
.form-row input[type="text"] {
  flex: 1;
  min-width: 60px;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: white;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  cursor: pointer;
}

/* 提示文本 */
.hint {
  font-size: 12px;
  color: #999;
  margin-bottom: 8px;
  line-height: 1.5;
}

/* 文本框 */
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  margin-bottom: 8px;
}

textarea:focus {
  outline: none;
  border-color: #667eea;
}

/* 按钮 */
.btn-group {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

button {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

button:active {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: #667eea;
  color: white;
  flex: 1;
}

.btn-secondary {
  background: #f0f0f0;
  color: #333;
}

.btn-export {
  background: #28a745;
  color: white;
  flex: 1;
}

.btn-small {
  padding: 6px 10px;
  font-size: 12px;
  background: #f0f0f0;
  color: #333;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

/* 结果区域 */
.result-area {
  margin-top: 8px;
  font-size: 13px;
}

.result-item {
  background: #f8f9fa;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 4px;
  border-left: 3px solid #667eea;
}

.result-item.success {
  border-left-color: #28a745;
  background: #d4edda;
}

.result-item.error {
  border-left-color: #dc3545;
  background: #f8d7da;
}

/* 标签页 */
.tab-bar {
  display: flex;
  border-bottom: 2px solid #f0f0f0;
  margin-bottom: 12px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #666;
  font-size: 14px;
  margin-bottom: -2px;
}

.tab-btn.active {
  color: #667eea;
  border-bottom-color: #667eea;
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* 数据列表 */
.data-list {
  margin-top: 8px;
}

.data-item {
  background: #f8f9fa;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 13px;
}

.data-item .item-name {
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.data-item .item-detail {
  color: #666;
  font-size: 12px;
}

.data-item .item-actions {
  margin-top: 6px;
  display: flex;
  gap: 8px;
}

/* 底部 */
.app-footer {
  text-align: center;
  padding: 20px;
  color: #999;
  font-size: 12px;
}

/* 加载动画 */
.loading {
  text-align: center;
  padding: 20px;
  color: #999;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #ddd;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 响应式 */
@media (max-width: 400px) {
  .app-header h1 { font-size: 20px; }
  .card { padding: 12px; }
  button { padding: 8px 12px; font-size: 13px; }
}
