/* WeChat H5 Hospital Portal - Editorial Style */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2c3e50;
  --primary-dark: #1a2a3a;
  --accent: #8a9e82;
  --bg: #f8f6f0;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-sub: #6b6b6b;
  --border: #e8e4d9;
  --tag-bg: #f2efe6;
  --tag-text: #6b6b6b;
  --radius: 10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
}

/* Header */
.header {
  background: var(--card-bg);
  color: var(--text);
  padding: 24px 20px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.header-logo {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--primary);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.header-logo-by {
  font-weight: 400;
  color: var(--text-sub);
  letter-spacing: 1.5px;
}

.header-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

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

/* Notice bar */
.notice {
  background: #faf7ee;
  padding: 10px 20px;
  font-size: 11px;
  color: #8a7548;
  text-align: center;
  line-height: 1.5;
  border-bottom: 1px solid var(--border);
}

/* Language Toggle */
.lang-toggle {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 14px 16px 6px;
}

.lang-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 5px 14px;
  font-size: 12px;
  color: var(--text-sub);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

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

/* Hospital Cards */
.card-list {
  padding: 14px 12px 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hospital-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 3px rgba(44,62,80,0.06), 0 1px 2px rgba(44,62,80,0.04);
  transition: transform 0.15s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
}

.hospital-card:active {
  transform: scale(0.98);
  box-shadow: 0 1px 2px rgba(44,62,80,0.08);
}

.card-banner {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  background-color: var(--border);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-banner-initial {
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Noto Sans JP", serif;
  font-size: 44px;
  font-weight: 300;
  color: rgba(255,255,255,0.9);
  letter-spacing: 1.5px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.card-body {
  padding: 10px 12px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  line-height: 1.35;
  /* 最大2行 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-name-sub {
  font-size: 10.5px;
  color: var(--text-sub);
  margin-bottom: 8px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 8px;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

/* Footer */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 10px;
  color: var(--text-sub);
  letter-spacing: 0.5px;
  z-index: 100;
}

/* Chat Page */
.chat-header {
  background: var(--card-bg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.chat-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--primary);
  flex-shrink: 0;
}

.chat-header-info {
  flex: 1;
}

.chat-header-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.chat-header-desc {
  font-size: 12px;
  color: var(--text-sub);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 0;
  -webkit-tap-highlight-color: transparent;
}

/* Chat embed area */
.chat-embed {
  flex: 1;
  width: 100%;
  border: none;
  min-height: calc(100vh - 200px);
}

/* Escalation button */
.escalate-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  z-index: 100;
}

.escalate-btn {
  display: block;
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

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

/* Quick menu */
.quick-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 16px;
}

.quick-item {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(44,62,80,0.05);
  -webkit-tap-highlight-color: transparent;
}

.quick-item:active {
  background: var(--bg);
}

/* Responsive */
@media (min-width: 600px) {
  .card-list {
    max-width: 760px;
    margin: 0 auto;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
  .header {
    padding: 32px 20px 24px;
  }
  .header-title {
    font-size: 26px;
  }
  .card-name {
    font-size: 14px;
  }
  .card-name-sub {
    font-size: 11.5px;
  }
}

@media (min-width: 900px) {
  .card-list {
    max-width: 1040px;
    grid-template-columns: repeat(4, 1fr);
  }
}
