/* 每日一签 · 样式（.g-dailydraw 前缀） */

.g-dailydraw {
  gap: 10px;
}

/* ---------------- 顶部 ---------------- */

.g-dailydraw .dl-head { min-height: 40px; align-items: center; }
.g-dailydraw .dl-head .g-title { font-size: 15px; font-weight: 800; }
.g-dailydraw .dl-sub { min-height: 16px; }

/* ---------------- 舞台 ---------------- */

.g-dailydraw .dl-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.g-dailydraw .dl-card-wrap {
  position: relative;
  width: min(76vw, 290px);
  aspect-ratio: 5 / 7;
  max-height: 416px;
  flex: none;
  perspective: 1000px;
  transition: filter 0.2s ease;
}

.g-dailydraw .dl-card-wrap.tap { animation: dlTap 0.3s ease; }

@keyframes dlTap {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.025); }
}

.g-dailydraw .dl-card {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.3, 1);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.g-dailydraw .dl-card.flipped { transform: rotateY(180deg); }

.g-dailydraw .dl-face {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* 正面：深色签筒纹样 */
.g-dailydraw .dl-front {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 209, 102, 0.16), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255, 209, 102, 0.05) 0 1px, transparent 1px 11px),
    linear-gradient(160deg, #3a2030 0%, #261322 55%, #180d16 100%);
  border: 1px solid rgba(255, 209, 102, 0.42);
  box-shadow: 0 26px 60px -26px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.g-dailydraw .dl-front::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 209, 102, 0.34);
  border-radius: 12px;
  pointer-events: none;
}

.g-dailydraw .dl-front::after {
  content: "";
  position: absolute;
  inset: 19px;
  border: 1px dashed rgba(255, 209, 102, 0.16);
  border-radius: 9px;
  pointer-events: none;
}

.g-dailydraw .dl-front-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.g-dailydraw .dl-front-kicker {
  font-size: 9.5px;
  letter-spacing: 0.32em;
  color: rgba(255, 209, 102, 0.62);
}

.g-dailydraw .dl-front-glyph {
  font-size: 76px;
  font-weight: 900;
  line-height: 1;
  color: #ffd166;
  text-shadow: 0 0 28px rgba(255, 209, 102, 0.45), 0 2px 0 rgba(0, 0, 0, 0.3);
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", serif;
}

.g-dailydraw .dl-front-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.42em;
  padding-left: 0.42em;
  color: #f3e4c6;
}

.g-dailydraw .dl-front-tip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(243, 228, 198, 0.62);
}

/* 背面：米色签文 */
.g-dailydraw .dl-back {
  transform: rotateY(180deg);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.65), transparent 60%),
    linear-gradient(165deg, #fbf3e2 0%, #efe0c2 55%, #e4cfa8 100%);
  border: 1px solid rgba(210, 170, 100, 0.75);
  box-shadow: 0 26px 60px -26px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.g-dailydraw .dl-back::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(120, 88, 40, 0.26);
  border-radius: 12px;
  pointer-events: none;
}

.g-dailydraw .dl-back-inner {
  position: relative;
  height: 100%;
  padding: 20px 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  color: #4a3520;
}

.g-dailydraw .dl-date {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: rgba(74, 53, 32, 0.62);
}

.g-dailydraw .dl-level {
  font-size: 30px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0.18em;
  padding-left: 0.18em;
  color: var(--lc, #3d7fc4);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.g-dailydraw .dl-poem-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.g-dailydraw .dl-poem {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.5;
  color: #4a3520;
  max-height: 100%;
}

.g-dailydraw .dl-yiji-row {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
}

.g-dailydraw .dl-yiji {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  min-width: 0;
}

.g-dailydraw .dl-yiji b {
  display: inline-flex;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.g-dailydraw .dl-yi b { background: #3f8f54; }
.g-dailydraw .dl-ji b { background: #b4505c; }

.g-dailydraw .dl-yiji span {
  color: #54402a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.g-dailydraw .dl-back-foot {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: rgba(74, 53, 32, 0.45);
}

/* 翻开后的高光扫过 */
.g-dailydraw .dl-shine {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 48%, transparent 62%);
}

.g-dailydraw .dl-card-wrap.revealed .dl-shine { animation: dlShine 0.9s ease-out; }

@keyframes dlShine {
  0% { opacity: 0; transform: translateX(-45%); }
  30% { opacity: 0.9; }
  100% { opacity: 0; transform: translateX(45%); }
}

/* ---------------- 底部 ---------------- */

.g-dailydraw .dl-tip {
  min-height: 18px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--dim);
}

.g-dailydraw .dl-actions {
  display: flex;
  gap: 9px;
  width: min(76vw, 290px);
}

.g-dailydraw .dl-actions .btn { flex: 1; min-height: 46px; }

/* ---------------- 历史 sheet ---------------- */

.g-dailydraw .dl-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(4, 6, 11, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.g-dailydraw .dl-mask.show { display: flex; animation: fadeIn 0.18s ease both; }

.g-dailydraw .dl-sheet {
  width: 100%;
  max-width: 430px;
  padding: 16px 16px calc(16px + var(--safe-b));
  border-radius: 20px 20px 0 0;
  border: 1px solid var(--line-2);
  border-bottom: 0;
  background: linear-gradient(180deg, #161c2b, #111623);
  box-shadow: 0 -22px 60px -18px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: dlSheetIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

@keyframes dlSheetIn {
  from { transform: translateY(26px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

.g-dailydraw .dl-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 12px;
}

.g-dailydraw .dl-x {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--dim);
  font-size: 19px;
  line-height: 1;
  touch-action: manipulation;
}

.g-dailydraw .dl-hist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 46vh;
  overflow-y: auto;
}

.g-dailydraw .dl-hist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  min-height: 42px;
}

.g-dailydraw .dl-hist-row.today {
  border-color: rgba(255, 180, 84, 0.4);
  background: rgba(255, 180, 84, 0.08);
}

.g-dailydraw .dl-hist-date {
  flex: none;
  min-width: 92px;
  color: var(--dim);
}

.g-dailydraw .dl-hist-level {
  flex: none;
  font-weight: 800;
  color: var(--lc, #3d7fc4);
}

.g-dailydraw .dl-hist-yi {
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.g-dailydraw .dl-hist-empty {
  padding: 30px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--faint);
}

.g-dailydraw .dl-sheet-tip { margin-top: 12px; text-align: center; }

/* ---------------- 窄屏 ---------------- */

@media (max-width: 359px) {
  .g-dailydraw .dl-head .g-title { font-size: 14px; }
  .g-dailydraw .dl-front-glyph { font-size: 66px; }
  .g-dailydraw .dl-level { font-size: 27px; }
  .g-dailydraw .dl-poem { font-size: 15px; }
  .g-dailydraw .dl-card-wrap { width: min(78vw, 270px); }
}
