/* NFC塔罗牌样式 */
:root {
    --tarot-gold: #d4af37;
    --tarot-gold-light: #f4e5b2;
    --tarot-gold-dark: #8b7355;
    --tarot-black: #0a0a0a;
    --tarot-purple: #1a0a2e;
    --tarot-blue: #0d1b2a;
}

/* 覆盖主题header样式 - 塔罗页面专用 */
body.nfc-tarot-page,
body.nfc-tarot-page header,
body.nfc-tarot-page .site-header,
body.nfc-tarot-page #masthead,
body.nfc-tarot-page .header,
body.nfc-tarot-page nav,
body.nfc-tarot-page .main-navigation,
body.nfc-tarot-page .nav-menu {
    background: var(--tarot-black) !important;
    background-color: var(--tarot-black) !important;
}

body.nfc-tarot-page header a,
body.nfc-tarot-page .site-header a,
body.nfc-tarot-page #masthead a,
body.nfc-tarot-page nav a,
body.nfc-tarot-page .site-title a,
body.nfc-tarot-page .site-branding a,
body.nfc-tarot-page .main-navigation a {
    color: var(--tarot-gold) !important;
}

body.nfc-tarot-page header a:hover,
body.nfc-tarot-page nav a:hover {
    color: var(--tarot-gold-light) !important;
}

body.nfc-tarot-page {
    background: var(--tarot-black) !important;
}

.nfc-tarot-container {
    background: linear-gradient(135deg, var(--tarot-black), var(--tarot-purple), var(--tarot-blue));
    min-height: 100vh;
    padding: 20px;
    font-family: 'Noto Serif SC', serif;
    color: var(--tarot-gold-light);
    box-sizing: border-box;
}

.nfc-tarot-container * {
    box-sizing: border-box;
}

.tarot-stage {
    max-width: 900px;
    margin: 0 auto;
}

/* 头部 */
.tarot-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 25px;
    background: rgba(26, 10, 46, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 15px;
    margin-bottom: 25px;
}

.tarot-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--tarot-gold), var(--tarot-gold-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.tarot-info h2 {
    color: var(--tarot-gold);
    font-size: 1.4rem;
    margin: 0 0 5px 0;
}

.tarot-info p, .tarot-info .status {
    color: var(--tarot-gold-dark);
    margin: 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 问题选择 */
.question-section {
    padding: 30px;
    background: rgba(26, 10, 46, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 15px;
    text-align: center;
}

.question-section h3 {
    color: var(--tarot-gold);
    font-size: 1.3rem;
    margin-bottom: 25px;
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.question-btn {
    padding: 15px 25px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 25px;
    color: var(--tarot-gold-light);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.question-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--tarot-gold);
    transform: translateY(-2px);
}

.custom-question {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.custom-question input {
    flex: 1;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 25px;
    color: var(--tarot-gold-light);
    font-size: 1rem;
}

.custom-question input:focus {
    outline: none;
    border-color: var(--tarot-gold);
}

.custom-question input::placeholder {
    color: var(--tarot-gold-dark);
}

.custom-question button,
.btn-primary {
    padding: 15px 35px;
    background: linear-gradient(135deg, var(--tarot-gold), var(--tarot-gold-dark));
    color: var(--tarot-black);
    border: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 抽牌阶段 */
.draw-header {
    text-align: center;
    margin-bottom: 20px;
}

.user-question {
    color: var(--tarot-gold);
    font-size: 1.2rem;
    padding: 15px 25px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    display: inline-block;
}

.draw-instruction {
    text-align: center;
    margin-bottom: 30px;
}

.draw-instruction p {
    color: var(--tarot-gold);
    font-size: 1.1rem;
    margin: 0;
}

.draw-instruction .sub-text {
    color: var(--tarot-gold-dark);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* 卡牌组 */
.cards-deck {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 30px;
    background: rgba(26, 10, 46, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 15px;
    margin-bottom: 25px;
}

.deck-card {
    width: 60px;
    height: 95px;
    background: linear-gradient(135deg, var(--tarot-purple), var(--tarot-blue));
    border: 2px solid var(--tarot-gold);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.deck-card::before {
    content: '✦';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--tarot-gold);
    font-size: 1.5rem;
    opacity: 0.5;
}

.deck-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
}

.deck-card.selected {
    opacity: 0.3;
    pointer-events: none;
}

/* 已选卡牌槽 */
.selected-cards {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 25px;
}

.card-slot {
    width: 100px;
    height: 160px;
    border: 2px dashed rgba(212, 175, 55, 0.4);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.card-slot.filled {
    border-style: solid;
    border-color: var(--tarot-gold);
    background: rgba(26, 10, 46, 0.6);
}

.slot-label {
    position: absolute;
    bottom: -25px;
    color: var(--tarot-gold-dark);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.card-slot .card-image {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.card-slot .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-slot .card-image.reversed {
    transform: rotate(180deg);
}

.card-slot .card-name {
    position: absolute;
    bottom: -45px;
    color: var(--tarot-gold);
    font-size: 0.85rem;
    text-align: center;
    width: 120%;
}

/* 解读阶段 */
.reading-question {
    padding: 18px 25px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: center;
}

.reading-question label {
    color: var(--tarot-gold-dark);
    font-size: 0.9rem;
}

.reading-question p {
    color: var(--tarot-gold);
    font-size: 1.15rem;
    margin: 8px 0 0 0;
    font-weight: 500;
}

.reading-cards {
    display: flex;
    justify-content: center;
    gap: 25px;
    padding: 30px;
    background: rgba(26, 10, 46, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.reading-card {
    text-align: center;
}

.reading-card .card-img {
    width: 100px;
    height: 160px;
    border: 2px solid var(--tarot-gold);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.3);
}

.reading-card .card-img.reversed {
    transform: rotate(180deg);
}

.reading-card .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reading-card .card-name {
    color: var(--tarot-gold);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.reading-card .card-status {
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
}

.reading-card .card-status.upright {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.4);
}

.reading-card .card-status.reversed {
    color: #f87171;
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.4);
}

.reading-card .card-position {
    font-size: 0.75rem;
    color: var(--tarot-gold-dark);
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

/* 聊天区域 */
.chat-container {
    background: rgba(26, 10, 46, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 25px;
}

.chat-messages {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    padding: 25px;
}

.message {
    margin-bottom: 20px;
    max-width: 90%;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.ai {
    background: linear-gradient(135deg, rgba(26, 10, 46, 0.9), rgba(13, 27, 42, 0.9));
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 15px 15px 15px 5px;
    padding: 20px 25px;
}

.message.user {
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 15px 15px 5px 15px;
    padding: 16px 22px;
    margin-left: auto;
}

.message p {
    margin: 0;
    line-height: 1.9;
    font-size: 1rem;
}

.message.user p {
    color: var(--tarot-gold);
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 25px;
    color: var(--tarot-gold-dark);
}

.typing-dots {
    display: flex;
    gap: 5px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--tarot-gold);
    border-radius: 50%;
    animation: bounce 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

.chat-input {
    display: flex;
    gap: 12px;
    padding: 18px 22px;
    background: rgba(0, 0, 0, 0.35);
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.chat-input input {
    flex: 1;
    padding: 15px 22px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 25px;
    color: var(--tarot-gold-light);
    font-size: 1rem;
}

.chat-input input:focus {
    outline: none;
    border-color: var(--tarot-gold);
}

.chat-input input::placeholder {
    color: var(--tarot-gold-dark);
}

.chat-input button {
    padding: 15px 35px;
    background: linear-gradient(135deg, var(--tarot-gold), var(--tarot-gold-dark));
    color: var(--tarot-black);
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-input button:hover {
    transform: scale(1.05);
}

.chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 二维码区域 */
.qr-section {
    padding: 40px;
    background: rgba(26, 10, 46, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 15px;
    text-align: center;
    animation: fadeIn 0.6s ease-out;
}

.qr-section h3 {
    color: var(--tarot-gold);
    font-size: 1.3rem;
    margin: 0 0 15px 0;
}

.qr-section > p {
    color: var(--tarot-gold-light);
    margin: 0 0 25px 0;
    opacity: 0.9;
}

.qr-image {
    width: 180px;
    height: 180px;
    margin: 0 auto 25px;
    border: 3px solid var(--tarot-gold);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}

.qr-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 无数据提示 */
.no-data-message {
    padding: 60px 30px;
    background: rgba(26, 10, 46, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 15px;
    text-align: center;
}

.no-data-message h3 {
    color: var(--tarot-gold);
    font-size: 1.4rem;
    margin: 0 0 15px 0;
}

.no-data-message p {
    color: var(--tarot-gold-light);
    margin: 0 0 30px 0;
    opacity: 0.8;
    font-size: 1.05rem;
}

/* 抽牌确认框 */
.draw-confirm {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(26, 10, 46, 0.8));
    border: 2px solid var(--tarot-gold);
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
    text-align: center;
    animation: fadeIn 0.4s ease-out;
}

.draw-confirm p {
    color: var(--tarot-gold);
    font-size: 1.1rem;
    margin: 0 0 20px 0;
}

.draw-confirm-btns {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary {
    padding: 12px 30px;
    background: transparent;
    border: 2px solid var(--tarot-gold);
    border-radius: 25px;
    color: var(--tarot-gold);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(212, 175, 55, 0.1);
}

.btn-draw {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(212, 175, 55, 0.3); }
    50% { box-shadow: 0 0 25px rgba(212, 175, 55, 0.6); }
}

/* 响应式 */
@media (max-width: 600px) {
    .nfc-tarot-container {
        padding: 15px;
    }
    
    .tarot-header {
        padding: 15px 20px;
    }
    
    .tarot-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .tarot-info h2 {
        font-size: 1.2rem;
    }
    
    .deck-card {
        width: 50px;
        height: 80px;
    }
    
    .card-slot {
        width: 80px;
        height: 130px;
    }
    
    .reading-card .card-img {
        width: 80px;
        height: 130px;
    }
    
    .custom-question {
        flex-direction: column;
    }
    
    .chat-input {
        flex-direction: column;
    }
    
    .chat-input button {
        width: 100%;
    }
}

/* ========== 次数限制弹窗 ========== */
.limit-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 20px;
}

.limit-modal-content {
    background: linear-gradient(135deg, var(--tarot-purple), var(--tarot-mystical));
    border: 2px solid var(--tarot-gold);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    max-width: 420px;
    width: 100%;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.limit-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.limit-modal-content h2 {
    color: var(--tarot-gold);
    font-size: 1.5rem;
    margin: 0 0 12px 0;
}

.limit-modal-content > p {
    color: var(--tarot-gold-light);
    margin: 0 0 25px 0;
    opacity: 0.9;
    line-height: 1.6;
}

.limit-modal-content strong {
    color: var(--tarot-gold);
}

.limit-divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: var(--tarot-gold-dark);
    font-size: 0.85rem;
}

.limit-divider::before,
.limit-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--tarot-gold-dark), transparent);
}

.limit-divider span {
    padding: 0 15px;
}

.limit-qr {
    width: 160px;
    height: 160px;
    margin: 0 auto 20px;
    border: 3px solid var(--tarot-gold);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.3);
}

.limit-qr img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.limit-btn-secondary {
    display: inline-block;
    padding: 12px 35px;
    background: transparent;
    border: 2px solid var(--tarot-gold);
    color: var(--tarot-gold);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.limit-btn-secondary:hover {
    background: rgba(212, 175, 55, 0.1);
}

.limit-tip {
    color: var(--tarot-gold-dark);
    font-size: 0.85rem;
    margin-top: 20px;
}

.limit-back-link {
    display: inline-block;
    margin-top: 15px;
    color: var(--tarot-gold-dark);
    text-decoration: underline;
    font-size: 0.9rem;
}

.limit-back-link:hover {
    color: var(--tarot-gold);
}

/* 分享按钮 */
.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    padding: 15px 30px;
    background: linear-gradient(135deg, var(--tarot-gold), var(--tarot-gold-dark));
    color: var(--tarot-black);
    border: none;
    border-radius: 30px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.share-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.6);
}

.share-icon {
    font-size: 1.2rem;
}

/* 激活码输入 */
.activate-input-group {
    display: flex;
    gap: 10px;
    max-width: 320px;
    margin: 0 auto;
}

.activate-input {
    flex: 1;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--tarot-gold-dark);
    border-radius: 10px;
    color: var(--tarot-gold-light);
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.activate-input:focus {
    outline: none;
    border-color: var(--tarot-gold);
}

.activate-input::placeholder {
    color: var(--tarot-gold-dark);
    text-transform: none;
    letter-spacing: normal;
    font-family: inherit;
    font-size: 0.85rem;
}

.activate-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, var(--tarot-gold), var(--tarot-gold-dark));
    border: none;
    border-radius: 10px;
    color: var(--tarot-black);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.activate-btn:hover {
    transform: scale(1.05);
}

.activate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.activate-error {
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-top: 10px;
    text-align: center;
}

/* 取消按钮 */
.cancel-btn {
    display: block;
    margin: 15px auto 0;
    padding: 10px 30px;
    background: transparent;
    border: 1px solid var(--tarot-gold-dark);
    border-radius: 20px;
    color: var(--tarot-gold-dark);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    border-color: var(--tarot-gold);
    color: var(--tarot-gold);
}

/* 成功提示 */
.share-success-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: linear-gradient(135deg, var(--tarot-purple), var(--tarot-mystical));
    border: 2px solid var(--tarot-gold);
    border-radius: 15px;
    padding: 15px 30px;
    z-index: 10002;
    transition: transform 0.3s ease;
}

.share-success-toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--tarot-gold);
    font-size: 1rem;
}
