/* 哆啦工具袋 Web 版 - 共享样式 */
/* 移动优先，模拟微信小程序视觉 */

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

:root {
  --primary: #07c160;
  --primary-dark: #06ad56;
  --danger: #fa5151;
  --warning: #ffc300;
  --bg: #f5f5f5;
  --card-bg: #fff;
  --text: #333;
  --text-secondary: #999;
  --border: #e5e5e5;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

/* 导航栏 */
.navbar {
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}
.navbar .back {
  background: none; border: none; color: #fff;
  font-size: 20px; cursor: pointer; padding: 4px 8px;
}
.navbar .title { font-size: 18px; font-weight: 500; flex: 1; }

/* 页面容器 */
.page {
  display: none;
  padding: 16px;
  max-width: 800px;
  margin: 0 auto;
}
.page.active { display: block; }

/* 卡片 */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border: none; border-radius: 6px;
  font-size: 15px; cursor: pointer; gap: 6px;
  transition: opacity .2s;
}
.btn:active { opacity: .8; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { display: flex; width: 100%; }

/* 输入框 */
.input, .textarea, .select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 15px; background: #fff;
}
.input:focus, .textarea:focus { border-color: var(--primary); outline: none; }
.textarea { min-height: 80px; resize: vertical; }
.label { font-size: 14px; color: var(--text-secondary); margin-bottom: 4px; display: block; }

/* 列表 */
.list-item {
  display: flex; align-items: center; padding: 14px 16px;
  background: var(--card-bg); border-bottom: 1px solid var(--border);
  gap: 12px; cursor: pointer;
}
.list-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.list-item:last-child { border-radius: 0 0 var(--radius) var(--radius); border-bottom: none; }
.list-item:only-child { border-radius: var(--radius); }

/* 标签/徽章 */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 12px; font-weight: 500;
}
.tag-green { background: #e8f5e9; color: #2e7d32; }
.tag-red { background: #ffebee; color: #c62828; }
.tag-orange { background: #fff3e0; color: #e65100; }
.tag-blue { background: #e3f2fd; color: #1565c0; }

/* 统计数字 */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.stat-item { text-align: center; padding: 12px 8px; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-value { font-size: 24px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* 工具网格（首页用） */
.tool-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.tool-card {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 12px;
  text-align: center; cursor: pointer; transition: transform .15s;
  text-decoration: none; color: var(--text); display: block;
}
.tool-card:active { transform: scale(.97); }
.tool-card .icon { font-size: 36px; margin-bottom: 8px; display: block; }
.tool-card .name { font-size: 14px; font-weight: 500; }

/* Toast */
.toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: rgba(0,0,0,.75); color: #fff; padding: 12px 24px;
  border-radius: 6px; font-size: 14px; z-index: 999;
  pointer-events: none; opacity: 0; transition: opacity .3s;
}
.toast.show { opacity: 1; }

/* Modal */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 200; display: flex; align-items: center; justify-content: center;
}
.modal {
  background: #fff; border-radius: 12px; padding: 24px;
  width: 90%; max-width: 400px; max-height: 80vh; overflow-y: auto;
}
.modal h3 { margin-bottom: 16px; font-size: 18px; }
.modal .actions { display: flex; gap: 12px; margin-top: 20px; justify-content: flex-end; }

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab {
  flex: 1; text-align: center; padding: 10px;
  font-size: 14px; color: var(--text-secondary); cursor: pointer;
  border-bottom: 2px solid transparent; transition: .2s;
}
.tab.active { color: var(--primary); border-color: var(--primary); font-weight: 500; }

/* 表单行 */
.form-row { margin-bottom: 14px; }
.form-row .label { margin-bottom: 4px; }

/* 工具条 */
.toolbar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }

/* 空状态 */
.empty { text-align: center; padding: 40px 20px; color: var(--text-secondary); }
.empty .icon { font-size: 48px; display: block; margin-bottom: 12px; }

/* 响应式 */
@media (min-width: 768px) {
  .page { padding: 24px; }
  .tool-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
