.fortune-widget {
  font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Fira Code', monospace;
  font-size: 12px;
}

.fortune-widget .widget-content {
  padding: 20px 15px;
  min-height: 350px;
  background: linear-gradient(145deg, #1a1a2a, #16213e);
  border-radius: 20px;
  color: #fff;
}

.fortune-draw-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.fortune-box {
  width: 160px;
  height: 180px;
  background: #1e1e2e;
  border-radius: 15px;
  position: relative;
  box-shadow: 0 10px 0 #0a0a12, 0 15px 25px rgba(0, 255, 157, 0.3);
  cursor: pointer;
  transition: all 0.3s;
  margin: 10px auto;
  border: 2px solid #00ff9d;
}

.fortune-box:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 0 #0a0a12, 0 20px 30px rgba(0, 255, 157, 0.5);
}

.fortune-lid {
  width: 170px;
  height: 45px;
  background: #2d2d3a;
  border-radius: 10px 10px 5px 5px;
  position: absolute;
  top: -18px;
  left: -7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00ff9d;
  font-size: 1.8rem;
  border: 2px solid #00ff9d;
  border-bottom: none;
}

.code-tabs {
  display: flex;
  justify-content: center;
  gap: 15px;
  padding: 20px 0 5px;
}

.code-tabs .tab {
  font-family: 'Fira Code', monospace;
  color: #00ff9d;
  font-size: 1.3rem;
  opacity: 0.7;
}

.code-line {
  width: 80%;
  height: 4px;
  background: #4a4a5e;
  margin: 8px auto;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.code-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #00ff9d, transparent);
  animation: scan 2s linear infinite;
}

.platform-icons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
}

.platform-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
}

.luogu-icon {
  background: #f39c12;
  color: #fff;
}

.atcoder-icon {
  background: #1e4b7c;
  color: #fff;
}

.cf-icon {
  background: #3185c9;
  color: #fff;
  font-size: 0.7rem;
}

.fortune-btn {
  background: linear-gradient(135deg, #00ff9d, #00cc7a);
  color: #1a1a2a;
  border: none;
  padding: 15px 40px;
  border-radius: 50px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 8px 20px rgba(0, 255, 157, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.fortune-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}

.fortune-btn:hover::before {
  left: 100%;
}

.fortune-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 255, 157, 0.5);
}

.fortune-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-icon {
  font-size: 1.4rem;
  animation: rotate 2s linear infinite;
}

.fortune-tip {
  color: #8a8aaa;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 15px;
  background: rgba(255,255,255,0.05);
  border-radius: 30px;
  border: 1px solid #00ff9d33;
}

.fortune-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
  padding: 0 5px;
}

.fortune-luck {
  font-size: 1.3rem;
  font-weight: bold;
  background: linear-gradient(135deg, #00ff9d, #00cc7a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
}

.fortune-platform-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.fortune-platform {
  font-size: 0.9rem;
  padding: 4px 15px;
  border-radius: 30px;
  color: white;
  font-weight: 500;
}

.fortune-platform.luogu {
  background: #f39c12;
}

.fortune-platform.atcoder {
  background: #1e4b7c;
}

.fortune-platform.codeforces {
  background: #3185c9;
}

.fortune-rating {
  background: #2d2d3a;
  padding: 5px 15px;
  border-radius: 30px;
  font-size: 0.9rem;
  color: #00ff9d;
  border: 1px solid #00ff9d;
}

.fortune-title {
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 20px;
  padding-left: 5px;
  color: #fff;
}

.fortune-bar-container {
  margin-bottom: 25px;
  padding: 0 5px;
}

.fortune-bar-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #8a8aaa;
  font-size: 0.95rem;
}

.fortune-score {
  font-weight: bold;
  color: #00ff9d;
}

.fortune-bar-bg {
  height: 12px;
  background: #2d2d3a;
  border-radius: 30px;
  overflow: hidden;
}

.fortune-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 30px;
  background: linear-gradient(90deg, #00ff9d, #00cc7a);
  transition: width 1s ease;
}

.fortune-yj {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
}

.fortune-yi, .fortune-ji {
  flex: 1;
  background: #2d2d3a;
  border-radius: 20px;
  padding: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.yj-title {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fortune-yi .yj-title {
  color: #2ecc71;
  border-bottom-color: #2ecc71;
}

.fortune-ji .yj-title {
  color: #e74c3c;
  border-bottom-color: #e74c3c;
}

.yj-content {
  font-size: 0.8rem;
  line-height: 1.6;
  color: #a0a0c0;
}

.yj-content span {
  display: block;
  margin-bottom: 5px;
}

.fortune-problem {
  margin-bottom: 25px;
}

.problem-label {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 12px;
  color: #00ff9d;
  display: flex;
  align-items: center;
  gap: 8px;
}

.problem-card {
  background: #2d2d3a;
  border-radius: 20px;
  padding: 18px;
  border-left: 6px solid #00ff9d;
  transition: all 0.3s;
  cursor: pointer;
}

.problem-card:hover {
  transform: translateX(5px);
  box-shadow: 0 10px 20px rgba(0,255,157,0.1);
}

.problem-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.problem-platform {
  font-size: 0.9rem;
  font-weight: bold;
  padding: 3px 10px;
  border-radius: 20px;
  color: white;
}

.problem-platform.luogu {
  background: #f39c12;
}

.problem-platform.atcoder {
  background: #1e4b7c;
}

.problem-platform.codeforces {
  background: #3185c9;
}

.problem-id {
  font-size: 0.9rem;
  color: #00ff9d;
  font-family: monospace;
}

.problem-title {
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
  margin-bottom: 10px;
}

.problem-difficulty {
  font-size: 0.9rem;
  color: #ffaa00;
  font-weight: 500;
  margin-bottom: 8px;
}

.problem-link-hint {
  font-size: 0.85rem;
  color: #8a8aaa;
  text-align: right;
  border-top: 1px dashed #4a4a5e;
  padding-top: 8px;
  margin-top: 8px;
}

.fortune-interpretation {
  background: #00ff9d10;
  border-radius: 20px;
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid #00ff9d30;
  color: #a0a0c0;
  line-height: 1.6;
  font-size: 0.95rem;
}

.fortune-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 2px dashed #4a4a5e;
  color: #8a8aaa;
  font-size: 0.9rem;
}

.fortune-date {
  background: #2d2d3a;
  padding: 4px 15px;
  border-radius: 30px;
  color: #00ff9d;
}

.fortune-reminder {
  font-weight: 500;
  color: #00ff9d;
}

.fake-refresh-btn {
  background: linear-gradient(135deg, #9b59b6, #8e44ad) !important;
  padding: 8px 20px !important;
  font-size: 0.9rem !important;
  min-width: 100px !important;
  margin: 0;
}

.fake-refresh-btn:hover {
  background: linear-gradient(135deg, #8e44ad, #7d3c98) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(155, 89, 182, 0.4) !important;
}

.fake-refresh-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.fake-refresh-btn .btn-icon {
  font-size: 1rem !important;
}

.fake-refresh-btn .btn-text {
  font-size: 0.9rem !important;
}

@keyframes scan {
  0% { left: -100%; }
  100% { left: 200%; }
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes shakeBox {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-8deg) translateY(-5px); }
  40% { transform: rotate(8deg) translateY(-5px); }
  60% { transform: rotate(-4deg) translateY(-3px); }
  80% { transform: rotate(4deg) translateY(-3px); }
}

@keyframes slideOutLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50px);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}