/* styles.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    min-height: 100vh;
}

/* 导航栏 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.username {
    color: #333;
    font-weight: 500;
    white-space: nowrap;
}

.btn-logout, .btn-history {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    flex-shrink: 0;
}

.btn-logout {
    background-color: #ff4d4d;
    color: white;
}

.btn-logout:hover {
    background-color: #ff3333;
}

.btn-history {
    background-color: #4CAF50;
    color: white;
}

.btn-history:hover {
    background-color: #45a049;
}

.nav-notice {
    flex: 1;
    color: #666;
    font-size: 0.85rem;
    padding: 0 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    max-width: 50%;
}

/* 认证界面 */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    flex-direction: column;
}

.auth-box {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-box h2 {
    color: #333;
    margin-bottom: 1.5rem;
}

.auth-box input {
    width: 100%;
    padding: 0.8rem;
    margin: 0.5rem 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.auth-btn {
    width: 100%;
    padding: 0.8rem;
    margin: 1rem 0;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.auth-btn:hover {
    background-color: #45a049;
}

.auth-link {
    background: none;
    border: none;
    color: #4CAF50;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem;
}

/* 游戏标题样式 */
.game-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ff9800;
    text-shadow: 0 0 5px rgba(255, 152, 0, 0.6), 0 0 10px rgba(255, 152, 0, 0.4), 0 0 15px rgba(255, 152, 0, 0.2);
    animation: breathe 2s infinite ease-in-out;
    margin-bottom: 2rem;
    text-align: center;
}

/* 呼吸灯动画 */
@keyframes breathe {
    0% { opacity: 0.9; }
    50% { opacity: 1; }
    100% { opacity: 0.9; }
}

/* 制作人信息样式 */
.creator-info-login {
    font-size: 0.9rem;
    color: #888;
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px dashed #eee;
}

/* 主界面布局 */
.container {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
}

.probability-panel {
    flex: 1;
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.probability-panel h3 {
    color: #333;
    margin-bottom: 1rem;
}

.probability-panel li {
    list-style: none;
    padding: 0.5rem 0;
    color: #666;
}

.highlight {
    color: #4CAF50;
    font-weight: bold;
}

/* 新增制作人信息 */
.creator-info {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed #eee;
    color: #888;
    font-size: 0.9rem;
    line-height: 1.6;
}

.creator-info p {
    margin: 0.3rem 0;
}

.draw-area {
    flex: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* 卡牌容器 */
.card-container {
    position: relative;
    width: 300px;
    height: 420px;
    margin: 20px auto;
    border-radius: 15px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 0 25px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

/* 卡牌边框流光效果 */
.card-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, rgba(255,255,255,0) 25%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 75%);
    animation: borderFlow 3s linear infinite;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

/* R 卡边框流光 */
.card-container.r-card::before {
    background: linear-gradient(45deg, rgba(33, 150, 243, 0) 25%, rgba(33, 150, 243, 0.6) 50%, rgba(33, 150, 243, 0) 75%);
    opacity: 1;
}

/* SR 卡边框流光 */
.card-container.sr-card::before {
    background: linear-gradient(45deg, rgba(156, 39, 176, 0) 25%, rgba(156, 39, 176, 0.6) 50%, rgba(156, 39, 176, 0) 75%);
    opacity: 1;
}

/* SSR 卡边框流光 */
.card-container.ssr-card::before {
    background: linear-gradient(45deg, rgba(255, 152, 0, 0) 25%, rgba(255, 152, 0, 0.6) 50%, rgba(255, 152, 0, 0) 75%);
    opacity: 1;
}

/* UR 卡边框流光 */
.card-container.ur-card::before {
    background: linear-gradient(45deg, rgba(244, 67, 54, 0) 25%, rgba(244, 67, 54, 0.6) 50%, rgba(244, 67, 54, 0) 75%);
    opacity: 1;
}

@keyframes borderFlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 全屏光效 */
.fullscreen-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2000;
    animation: glowFade 1.2s ease-out;
}

@keyframes glowFade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* SSR 金光特效 */
.ssr-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.6) 0%, transparent 70%);
    animation: ssrGlow 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
}

@keyframes ssrGlow {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* UR 红光特效 */
.ur-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(244, 67, 54, 0.6) 0%, transparent 70%);
    animation: urGlow 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
}

@keyframes urGlow {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.card-image {
    position: relative;
    z-index: 2;
    width: calc(100% - 12px);
    height: calc(100% - 12px);
    margin: 6px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.15);
}

.default-card {
    font-size: 3rem;
    color: #666;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.stars {
    font-size: 2rem;
    color: gold;
    margin: 1rem auto 0;
    width: 100%;
    text-align: center;
    display: block;
    perspective: 500px;
    position: relative;
    padding: 0 20px;
}

.stars-container {
    display: inline-block;
    position: relative;
}

.stars span {
    display: inline-block;
    animation: starPop 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
    animation-delay: calc(var(--index) * 0.1s);
}

.btn-draw {
    padding: 1rem 3rem;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    overflow: hidden;
}

.btn-draw:hover {
    transform: scale(1.05);
}

.btn-draw::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, rgba(255,255,255,0) 25%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 75%);
    animation: btnBreath 2s infinite;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
}

.stats {
    margin: 1rem 0;
    padding: 0.5rem;
    background: #f8f8f8;
    border-radius: 5px;
    color: #666;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1rem;
    gap: 1.5rem;
}

.btn-provider {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.2s;
    font-size: 1rem;
}

.btn-provider:hover {
    transform: scale(1.05);
}

.button-group {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 1rem;
}

/* 动画效果 */
@keyframes flip {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

@keyframes shine {
    0% { opacity: 0; transform: scale(0); }
    20% { opacity: 1; transform: scale(1.5); }
    80% { opacity: 1; transform: scale(1.5); }
    100% { opacity: 0; transform: scale(2); }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

audio {
    display: none;
    preload: auto;
}

.provider-info {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f8f8;
    border-radius: 8px;
}

.provider-info p {
    margin: 0.5rem 0;
    color: #333;
    font-size: 1.1rem;
}

/* 新增特效 */
@keyframes particle-explode {
  0% { opacity: 1; transform: translate(0,0) scale(1); }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(0); }
}

.ur-particle {
  position: fixed;
  width: 8px;
  height: 8px;
  background: linear-gradient(45deg, #ffd700, #ff4500);
  border-radius: 50%;
  pointer-events: none;
  animation: particle-explode 1.5s ease-out forwards;
}

@keyframes btnBreath {
  0% { transform: translate(-100%, -100%) rotate(45deg); }
  100% { transform: translate(100%, 100%) rotate(45deg); }
}

@keyframes starPop {
  0% {
    transform: scale(0) rotateY(0deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.5) rotateY(180deg);
  }
  100% {
    transform: scale(1) rotateY(360deg);
    opacity: 1;
  }
}