/* ClipFlow · 跨设备文字快传 —— 亮色主题 */
:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --text: #1f2937;
  --muted: #6b7280;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 640px;
  margin: 0 auto;
  /* 避开 iOS 灵动岛（顶部）与 home indicator（底部）安全区 */
  padding:
    calc(env(safe-area-inset-top, 0px) + 16px)
    16px
    calc(env(safe-area-inset-bottom, 0px) + 48px);
  min-height: 100dvh;
}

/* ======== Header ======== */
.app-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.app-header .logo { font-size: 26px; }
.app-header h1 {
  font-size: 22px;
  margin: 0;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.app-version {
  font-size: .72rem;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
  user-select: none;
}
.app-header .subtitle {
  font-size: .8rem;
  color: var(--muted);
}
.refresh-btn {
  margin-left: auto;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
}
.refresh-btn:active { background: #f3f4f6; }

.toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, .92);
  color: #fff;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 1000;
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; }

/* ======== Composer ======== */
.composer {
  margin: 16px 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
}
.composer textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-size: 16px;
  line-height: 1.5;
  background: transparent;
  color: var(--text);
  min-height: 64px;
}
.composer textarea::placeholder { color: #9ca3af; }
.composer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.composer-row .hint {
  font-size: .75rem;
  color: var(--muted);
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 9px 22px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease;
}
.btn-primary:active { background: var(--primary-dark); }

/* ======== Feed ======== */
.feed { display: flex; flex-direction: column; gap: 12px; }
.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 16px;
  font-size: .95rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.card-content {
  font-size: 19px;
  line-height: 1.6;
  font-weight: 500;
  word-break: break-word;
  white-space: pre-wrap;
}
.card-content a {
  color: var(--primary);
  text-decoration: underline;
  word-break: break-all;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}
.btn {
  display: inline-block;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 16px;
  padding: 12px 22px;
  min-height: 44px;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease;
}
.btn:active { background: #f3f4f6; }
.btn.danger { color: var(--danger); }
.btn.copied { color: #16a34a; border-color: #bbf7d0; background: #f0fdf4; }
