:root {
  --bg: #0f172a;
  --bg-soft: #1e293b;
  --bg-card: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --text-dim: #94a3b8;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --danger: #f87171;
  --ok: #34d399;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

[v-cloak] { display: none; }

#app {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 顶部栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  max-width: 720px;
  margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { width: 26px; height: 26px; color: var(--accent); }
.brand-title { font-size: 20px; font-weight: 700; letter-spacing: 0.5px; }

.btn-add {
  display: flex; align-items: center; gap: 6px;
  background: var(--accent);
  color: #0f172a;
  border: none;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s, background 0.2s;
}
.btn-add:active { transform: scale(0.95); background: var(--accent-strong); }
.btn-add svg { width: 18px; height: 18px; }

/* 搜索 */
.search-wrap { padding: 14px 18px 4px; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
}
.search-icon { width: 18px; height: 18px; color: var(--text-dim); flex-shrink: 0; }
.search-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 15px;
}
.search-input::placeholder { color: var(--text-dim); }
.search-clear {
  background: none; border: none; color: var(--text-dim);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 0 2px;
}

/* 状态 */
.state-tip, .empty {
  text-align: center; color: var(--text-dim);
  padding: 50px 20px; font-size: 15px;
}
.empty-icon { width: 52px; height: 52px; color: var(--border); margin-bottom: 14px; }
.empty p { line-height: 1.6; }

/* 列表 */
.list { flex: 1; padding: 10px 18px 20px; }

.clip {
  display: flex; align-items: stretch;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 14px 14px 16px;
  margin-bottom: 12px;
  gap: 10px;
  transition: border-color 0.2s;
}
.clip:active { border-color: var(--accent); }

.clip-body { flex: 1; min-width: 0; }
.clip-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  margin-bottom: 5px; word-break: break-word;
}
.clip-content {
  font-size: 14px; color: var(--text-dim);
  word-break: break-all; white-space: pre-wrap; line-height: 1.55;
}
.clip-content.content-only { color: var(--text); font-size: 15px; }

.clip-actions {
  display: flex; flex-direction: column; gap: 8px;
  justify-content: center; flex-shrink: 0;
}
.btn-copy, .btn-edit, .btn-del {
  display: flex; align-items: center; gap: 5px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-copy svg, .btn-edit svg, .btn-del svg { width: 16px; height: 16px; }
.btn-copy { color: var(--accent); border-color: rgba(56,189,248,0.4); font-weight: 600; }
.btn-copy.copied { color: var(--ok); border-color: rgba(52,211,153,0.5); background: rgba(52,211,153,0.08); }
.btn-copy:active { background: var(--accent); color: #0f172a; }
.btn-edit { color: var(--text-dim); }
.btn-edit:active { color: var(--accent); }
.btn-del { color: var(--danger); border-color: rgba(248,113,113,0.35); }
.btn-del:active { background: var(--danger); color: #0f172a; }

/* 底部 */
.footbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px 20px;
  color: var(--text-dim); font-size: 13px;
}
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.sync-dot.online { background: var(--ok); }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 600px) {
  .modal-mask { align-items: center; }
}
.modal {
  width: 100%; max-width: 520px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  padding: 20px;
  max-height: 85vh;
  overflow-y: auto;
}
@media (min-width: 600px) {
  .modal { border-radius: 18px; }
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h3 { font-size: 18px; font-weight: 700; }
.modal-close {
  background: none; border: none; color: var(--text-dim);
  font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.field-label { display: block; font-size: 13px; color: var(--text-dim); margin: 12px 0 6px; }
.field {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; color: var(--text); font-size: 15px;
  outline: none; font-family: inherit;
}
.field:focus { border-color: var(--accent); }
.field-area { resize: vertical; min-height: 120px; line-height: 1.6; }
.modal-foot { display: flex; gap: 10px; margin-top: 18px; }
.btn {
  flex: 1; padding: 12px; border-radius: 10px; border: none;
  font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.btn-cancel { background: var(--bg); color: var(--text-dim); border: 1px solid var(--border); }
.btn-save { background: var(--accent); color: #0f172a; }
.btn-save:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:active { transform: scale(0.98); }

/* 提示 */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  z-index: 60;
  background: var(--text); color: #0f172a;
  padding: 10px 20px; border-radius: 20px; font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  white-space: nowrap;
}

/* 动画 */
.fade-enter-active, .fade-leave-active { transition: opacity 0.25s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

.pop-enter-active, .pop-leave-active { transition: opacity 0.2s; }
.pop-enter-active .modal, .pop-leave-active .modal { transition: transform 0.25s; }
.pop-enter-from, .pop-leave-to { opacity: 0; }
.pop-enter-from .modal { transform: translateY(40px); }
.pop-leave-to .modal { transform: translateY(40px); }

.list-item-enter-active, .list-item-leave-active { transition: all 0.25s; }
.list-item-enter-from, .list-item-leave-to { opacity: 0; transform: translateY(10px); }
.list-item-move { transition: transform 0.25s; }
