/* ===== Reset & Base ===== */
*, *::before, *::after { 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: #F8F5F0;
  color: #23232A;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, #C82323 0%, #a01c1c 100%);
  color: #fff;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  max-width: 720px;
  margin: 0 auto;
}

.header-left {
  flex: 1;
  min-width: 0;
}

.header-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-divider {
  font-size: 24px;
  font-weight: 300;
  opacity: 0.6;
}

.header-title {
  font-size: 24px;
  font-weight: 700;
  white-space: nowrap;
}

.header-date {
  font-size: 14px;
  color: rgba(255,220,220,0.9);
  margin-top: 6px;
}

.back-btn {
  font-size: 18px;
  cursor: pointer;
  white-space: nowrap;
  opacity: 0.9;
  margin-right: 10px;
  transition: opacity 0.15s;
}
.back-btn:hover { opacity: 1; }

.header-logo {
  height: 56px;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
}

.city-select {
  background: transparent;
  color: #fff;
  border: none;
  border-bottom: 1.5px solid rgba(255,255,255,0.5);
  padding: 0 20px 2px 4px;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='rgba(255,255,255,0.7)' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  font-family: inherit;
}
.city-select:hover { border-bottom-color: rgba(255,255,255,0.8); }
.city-select option { color: #333; background: #fff; font-size: 15px; }

.header-gold-line {
  height: 4px;
  background: linear-gradient(90deg, #F0C83C, #e6b832, #F0C83C);
}

/* ===== Date Navigator ===== */
.date-nav {
  background: #FFFDF7;
  border-bottom: 1px solid #E8E6E0;
  position: sticky;
  top: 0;
  z-index: 99;
}

.date-nav-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 16px;
}

.date-nav-btn {
  background: none;
  border: 1px solid #D0CEC8;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  color: #5A5A64;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  flex-shrink: 0;
}
.date-nav-btn:hover:not(:disabled) {
  background: #F0EDE6;
  border-color: #B0AEA8;
}
.date-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.date-display {
  font-size: 15px;
  font-weight: 600;
  color: #3A3A40;
  white-space: nowrap;
  min-width: 160px;
  text-align: center;
}

/* ===== Container ===== */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 12px 32px;
  min-height: calc(100vh - 100px);
}

/* ===== Content transition ===== */
.content-wrapper {
  transition: opacity 0.2s ease;
}
.content-wrapper.fade-out {
  opacity: 0;
}

/* ===== No Data Message ===== */
.no-data-msg {
  text-align: center;
  padding: 80px 24px;
  color: #A0A0A5;
}
.no-data-msg .no-data-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.no-data-msg .no-data-text {
  font-size: 18px;
  font-weight: 600;
  color: #888;
}
.no-data-msg .no-data-sub {
  font-size: 14px;
  margin-top: 8px;
}

/* ===== Weather Card ===== */
.weather-card {
  background: #F0F8FF;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border-left: 5px solid #1E8C64;
  position: relative;
}

.weather-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #23232A;
}

.weather-detail {
  font-size: 13px;
  color: #5A5A64;
  margin-bottom: 3px;
  line-height: 1.5;
}

.weather-icon {
  margin-right: 4px;
}

/* ===== Info Gap Card ===== */
.info-gap-card {
  background: #FFF8E6;
  border: 2px solid #F0BE3C;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.info-gap-title {
  font-size: 15px;
  font-weight: 700;
  color: #B46400;
  margin-bottom: 8px;
}

.info-gap-item {
  font-size: 14px;
  color: #5A5A64;
  margin-bottom: 4px;
  padding-left: 12px;
  position: relative;
  line-height: 1.6;
}
.info-gap-item::before {
  content: "·";
  position: absolute;
  left: 0;
  color: #B46400;
  font-weight: 700;
}

/* ===== News Card ===== */
.news-card {
  background: #FFFFFF;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  position: relative;
  overflow: hidden;
}

/* Left border color set via inline style border-left */

.news-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}
.news-card:active {
  transform: translateY(0);
}

.news-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.cat-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}

.urgency-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}

.news-title {
  font-size: 16px;
  font-weight: 700;
  color: #23232A;
  line-height: 1.4;
}

.news-body {
  font-size: 14px;
  color: #5A5A64;
  margin-top: 6px;
  line-height: 1.6;
}

.news-source {
  font-size: 12px;
  color: #A0A0A5;
  margin-top: 6px;
}

/* ===== Detail Page ===== */
.detail-page {
  padding: 0 0 24px;
}

.detail-card {
  background: #fff;
  border-radius: 14px;
  padding: 28px 24px 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}

.detail-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.detail-tags .cat-tag {
  font-size: 13px;
  padding: 4px 14px;
  border-radius: 12px;
}
.detail-tags .urgency-tag {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 12px;
}

.detail-title {
  font-size: 24px;
  font-weight: 800;
  color: #23232A;
  line-height: 1.5;
  margin: 0 0 14px;
}

.detail-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.detail-source-badge {
  font-size: 13px;
  padding: 3px 10px;
  border: 1.5px solid;
  border-radius: 14px;
  font-weight: 600;
}

.detail-date {
  font-size: 13px;
  color: #A0A0A5;
}

.detail-share-btn {
  font-size: 13px;
  padding: 3px 10px;
  border: 1.5px solid #C82323;
  border-radius: 14px;
  font-weight: 600;
  color: #C82323;
  background: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.detail-share-btn:hover {
  background: #C82323;
  color: #fff;
}

.detail-divider {
  border: none;
  border-top: 1px solid #EDEDEB;
  margin: 0 0 20px;
}

.detail-article {
  margin-bottom: 4px;
}

.detail-paragraph {
  font-size: 16px;
  color: #3a3a40;
  line-height: 1.9;
  margin: 0 0 18px;
  text-align: justify;
}
.detail-paragraph:last-child {
  margin-bottom: 0;
}

/* ===== Original Article Link ===== */
.detail-original-link {
  display: inline-block;
  margin-top: 20px;
  margin-bottom: 8px;
  padding: 10px 20px;
  border: 1.5px solid;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.detail-original-link:hover {
  color: #fff !important;
}

.detail-nav {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.detail-nav-btn {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid #E8E6E2;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  color: #5A5A64;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.detail-nav-btn:first-child {
  justify-content: flex-start;
}
.detail-nav-btn:last-child {
  justify-content: flex-end;
  text-align: right;
}
.detail-nav-btn:hover:not(:disabled) {
  background: #f8f6f2;
  border-color: #ccc;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.detail-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.nav-arrow {
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid #DCDAD4;
  padding: 20px 0 8px;
  text-align: center;
  margin-top: 20px;
}

.footer-share {
  font-size: 14px;
  color: #5A5A64;
  margin-bottom: 12px;
}

.footer-disclaimer {
  font-size: 11px;
  color: #A0A0A5;
  line-height: 1.5;
  padding: 0 16px;
}

/* ===== Share Modal ===== */
.share-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.share-modal-card {
  background: #fff;
  border-radius: 20px;
  padding: 20px 20px 24px;
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,0.3);
  text-align: center;
  display: flex;
  flex-direction: column;
}

.share-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding: 0 4px;
}

.share-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #23232A;
}

.share-modal-close {
  background: #f0eee9;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #999;
  transition: all 0.15s;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.share-modal-close:hover { background: #e5e2dc; color: #333; }

.share-canvas-wrapper {
  flex: 1;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid #EDEDEB;
  margin-bottom: 16px;
  background: #F8F5F0;
}

.share-canvas-wrapper canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 11px;
}

.share-modal-actions {
  display: flex;
  gap: 10px;
}

.share-action-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.share-action-btn.primary {
  background: #C82323;
  color: #fff;
}
.share-action-btn.primary:hover {
  background: #a91e1e;
}
.share-action-btn.secondary {
  background: #F0EEE9;
  color: #23232A;
}
.share-action-btn.secondary:hover {
  background: #E5E2DC;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .header-content { padding: 14px 12px 10px; }
  .header-title { font-size: 22px; }
  .city-select { font-size: 16px; padding-right: 16px; }
  .header-date { font-size: 11px; margin-top: 4px; }
  .header-logo { height: 40px; }
  .city-select { font-size: 13px; padding: 4px 22px 4px 6px; }
  .container { padding: 8px 8px 24px; }
  .detail-title { font-size: 20px; }
  .detail-card { padding: 20px 16px 18px; }
  .detail-paragraph { font-size: 15px; }
  .detail-nav-btn { padding: 12px 10px; font-size: 12px; }
  .news-title { font-size: 15px; }
  .news-body { font-size: 13px; }
  .date-nav-inner { gap: 10px; padding: 6px 12px; }
  .date-display { font-size: 14px; min-width: 140px; }
}

@media (min-width: 600px) and (max-width: 900px) {
  .container { padding: 16px 24px 32px; }
}

@media (min-width: 900px) {
  .container { padding: 16px 16px 40px; }
}
