html,
body {
    height: 100%;
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body.app-page {
    margin: 0;
    padding-top: 0 !important;
    min-height: 100%;
    background: #fff8f0;
    color: #2b2b2b;
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans JP", "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

.app-page a,
.app-page a:hover,
.app-page a:focus {
    text-decoration: none;
}

.app-shell {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    background: #fff8f0;
}

.app-inner {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    box-sizing: border-box;
}

.app-home .app-inner {
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    background:
        url("../img/home/bg.png") center / cover no-repeat,
        linear-gradient(180deg, #fff6ea 0%, #ffe3c4 48%, #ffb36a 78%, #fff4e8 100%);
}

.app-lang {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 8;
}

.app-home-title {
    display: block;
    width: 84%;
    max-width: 360px;
    margin: 20px auto 0;
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
}

.app-wheel {
    position: relative;
    width: min(86%, 56vh);
    max-width: 360px;
    margin: -8px auto 0;
    aspect-ratio: 1;
    flex: 0 0 auto;
    overflow: visible;
}

.app-wheel-outer {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(180deg, #ff9aaf 0%, #ff5b7a 100%);
    box-shadow: 0 16px 32px rgba(255, 91, 122, 0.22);
}

.app-light {
    position: absolute;
    inset: 0;
    transform: rotate(var(--a));
}

.app-light i {
    position: absolute;
    left: 50%;
    top: 8px;
    width: 8px;
    height: 8px;
    margin-left: -4px;
    border-radius: 50%;
    background: #fff4b0;
    box-shadow: 0 0 6px rgba(255, 244, 176, 0.95);
}

.app-wheel-disc {
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    overflow: hidden;
    --slice: 30deg;
    background: repeating-conic-gradient(from calc(var(--slice) / -2), #fff 0 var(--slice), #ffe8dc var(--slice) calc(var(--slice) * 2));
    box-shadow: inset 0 0 0 1px rgba(255, 180, 160, 0.25);
    transition: transform 4s cubic-bezier(0.12, 0.7, 0.15, 1);
}

.app-wheel-item {
    position: absolute;
    inset: 0;
    transform: rotate(var(--a));
}

.app-wheel-prize {
    --icon: min(40px, calc(sin(calc(180deg / var(--prize-count, 12))) * 145px));
    position: absolute;
    left: 50%;
    top: 7%;
    width: var(--icon);
    margin-left: calc(var(--icon) / -2);
    text-align: center;
    transform: rotate(calc(var(--a) * -1));
}

.app-wheel-prize img {
    display: block;
    width: var(--icon);
    height: var(--icon);
    margin: 0 auto;
    object-fit: contain;
    pointer-events: none;
}

.app-wheel-go {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 38%;
    border: 0;
    padding: 0;
    background: transparent;
    transform: translate(-50%, -50%);
    z-index: 3;
}

.app-wheel-go img {
    display: block;
    width: 100%;
    height: auto;
}

.app-home-actions {
    display: flex;
    gap: 10px;
    margin: 10px 16px 0;
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
}

.app-home-spacer {
    flex: 1 1 auto;
    min-height: 72px;
}

.app-home-action {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 62px;
    padding: 10px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 22px rgba(255, 110, 50, 0.1);
    color: #3a3a3a;
}

.app-home-action img {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
}

.app-home-action strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.app-home-action em {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    font-style: normal;
    color: #b0b0b0;
}

.app-invite {
    margin: 10px 16px 0;
    padding: 14px 14px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 22px rgba(255, 110, 50, 0.1);
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
}

.app-invite-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    color: #3a3a3a;
    font-size: 14px;
    font-weight: 600;
}

.app-invite-title span {
    flex: 1;
}

.app-invite-select {
    margin-left: auto;
    color: #ff6a3d;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.app-invite-title img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.app-invite-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-invite-form input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 16px;
    border: 1px solid #f0e6dc;
    border-radius: 20px;
    background: #fff;
    box-shadow: none;
    outline: none;
    font-size: 13px;
    color: #333;
}

.app-invite-form input::placeholder {
    color: #c8c0b8;
}

.app-invite-form button {
    flex: 0 0 auto;
    height: 40px;
    padding: 0 18px;
    border: 0;
    border-radius: 20px;
    background: linear-gradient(90deg, #ffb347 0%, #ff6a3d 48%, #ff4d6d 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.app-invite-tip {
    display: none;
    margin-top: 8px;
    color: #ff4d4f;
    font-size: 12px;
}

.app-invite-tip.is-ok {
    color: #2f9d55;
}

.app-exchange {
    margin: 10px 16px 0;
    padding: 14px 14px 8px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 22px rgba(255, 110, 50, 0.1);
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
}

.app-exchange-title {
    margin-bottom: 10px;
    color: #3a3a3a;
    font-size: 14px;
    font-weight: 600;
}

.app-exchange-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px 0 12px;
    border-top: 1px solid #f3e8de;
}

.app-exchange-item:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.app-exchange-side {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 120px;
    min-width: 0;
}

.app-exchange-side img {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    object-fit: contain;
}

.app-exchange-side strong {
    display: block;
    color: #3a3a3a;
    font-size: 13px;
    font-weight: 600;
}

.app-exchange-side em {
    display: block;
    margin-top: 2px;
    color: #b0b0b0;
    font-size: 11px;
    font-style: normal;
}

.app-exchange-arrow {
    flex: 0 0 auto;
    color: #ff6a3d;
    font-size: 12px;
    font-weight: 600;
}

.app-exchange-btn {
    flex: 0 0 auto;
    height: 32px;
    padding: 0 14px;
    margin-left: auto;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(90deg, #ffb347 0%, #ff6a3d 48%, #ff4d6d 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.app-exchange-btn:disabled {
    background: #ece6e1;
    color: #b8aea6;
}

.app-explain {
    margin: 10px 16px 16px;
    padding: 14px 16px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 22px rgba(255, 110, 50, 0.1);
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
}

.app-explain-item + .app-explain-item {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f3e8de;
}

.app-explain-title {
    margin-bottom: 8px;
    color: #3a3a3a;
    font-size: 14px;
    font-weight: 600;
}

.app-explain-content {
    color: #8a7a70;
    font-size: 12px;
    line-height: 1.7;
    white-space: normal;
}

.app-logout {
    margin: 0 16px 20px;
    text-align: center;
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
}

.app-logout button {
    min-width: 160px;
    height: 40px;
    padding: 0 20px;
    border: 0;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 22px rgba(255, 110, 50, 0.08);
    color: #8a7a70;
    font-size: 13px;
    font-weight: 600;
}

@media (max-height: 720px) {
    .app-home-title {
        width: 76%;
        margin-top: 12px;
    }

    .app-wheel {
        width: min(78%, 48vh);
    }

    .app-home-spacer {
        min-height: 24px;
    }

    .app-invite {
        margin-top: 8px;
        padding: 12px;
    }

    .app-explain {
        margin-top: 8px;
        padding: 12px 14px;
    }

    .app-exchange {
        margin-top: 8px;
        padding: 12px 12px 6px;
    }
}

@media (min-height: 860px) {
    .app-home-title {
        margin-top: 28px;
    }

    .app-home-actions {
        margin-top: 14px;
    }
}

.app-prize-toast {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 30;
    align-items: center;
    justify-content: center;
    background: rgba(40, 20, 10, 0.35);
}

.app-prize-toast.is-show {
    display: flex;
}

.app-prize-toast-card {
    position: relative;
    width: 260px;
    padding: 26px 20px 22px;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(80, 40, 20, 0.18);
    text-align: center;
}

.app-prize-toast-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #c0b4ac;
    font-size: 22px;
    line-height: 26px;
}

.app-prize-toast-card img {
    display: block;
    width: 64px;
    height: 64px;
    margin: 0 auto 10px;
    object-fit: contain;
}

.app-prize-toast-card strong {
    display: block;
    color: #ff4d4f;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0;
    word-spacing: normal;
}

.app-prize-toast-card em {
    display: block;
    margin-top: 8px;
    color: #3a3a3a;
    font-size: 15px;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0;
    word-spacing: normal;
}

.app-prize-toast-card em:empty {
    display: none;
}

.app-prize-toast-mobile {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f3e8de;
    color: #8a7a70;
    font-size: 13px;
    letter-spacing: 0;
    word-spacing: normal;
}

.app-records .app-inner {
    background: #fff8f0;
    padding-bottom: 28px;
}

.app-records-bar {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 12px 118px 8px 16px;
}

.app-records-back {
    width: 32px;
    height: 32px;
    border-radius: 16px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3C/svg%3E") center / 16px no-repeat;
    box-shadow: 0 4px 12px rgba(80, 40, 20, 0.06);
    color: transparent !important;
    font-size: 0;
    line-height: 0;
    overflow: hidden;
}

.app-records-back:hover,
.app-records-back:focus,
.app-records-back:active,
.app-records-back:visited {
    color: transparent !important;
}

.app-records-bar h1 {
    flex: 1;
    margin: 0;
    color: #2b2b2b;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
}

.app-records .app-lang {
    top: 16px;
}

.app-records-list {
    padding: 8px 16px 0;
}

.app-record-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 14px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(255, 140, 90, 0.06);
}

.app-record-item img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex: 0 0 48px;
}

.app-record-info {
    flex: 1;
    min-width: 0;
}

.app-record-info strong {
    display: block;
    color: #2b2b2b;
    font-size: 15px;
}

.app-record-info em {
    display: block;
    margin-top: 4px;
    color: #b0b0b0;
    font-size: 12px;
    font-style: normal;
}

.app-record-status {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 10px;
    background: #fff4e8;
    color: #ff8a3d;
    font-size: 11px;
    white-space: nowrap;
}

.app-record-status.is-issued,
.app-record-status.is-received,
.app-record-status.is-unused {
    background: #eef9f1;
    color: #2f9d55;
}

.app-record-status.is-used,
.app-record-status.is-disabled {
    background: #f4f1ee;
    color: #b0b0b0;
}

.app-invite-choose {
    flex: 0 0 auto;
    height: 32px;
    padding: 0 14px;
    border-radius: 16px;
    background: linear-gradient(90deg, #ffb347 0%, #ff6a3d 48%, #ff4d6d 100%);
    color: #fff !important;
    font-size: 12px;
    font-weight: 600;
    line-height: 32px;
}

.app-records-empty {
    padding: 80px 24px 0;
    text-align: center;
}

.app-records-empty img {
    width: 56px;
    height: 56px;
    opacity: 0.7;
}

.app-records-empty p {
    margin: 14px 0 0;
    color: #b0b0b0;
    font-size: 14px;
}

.app-records-page {
    padding: 8px 16px 0;
    text-align: center;
}

.app-mine {
    background: #fff7ef;
}

.app-mine-head {
    padding: 28px 20px 18px;
}

.app-mine-user {
    display: flex;
    align-items: center;
    gap: 14px;
}

.app-mine-user img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

.app-mine-user h2 {
    margin: 0 0 6px;
    font-size: 18px;
}

.app-mine-user p {
    margin: 0;
    color: #9a9a9a;
    font-size: 13px;
}

.app-mine-card {
    margin: 0 20px;
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
}

.app-mine-card a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    color: #333;
    font-size: 15px;
    border-bottom: 1px solid #f6f0ea;
}

.app-mine-card a:last-child {
    border-bottom: 0;
}

.app-mine-card a span {
    color: #c8c8c8;
}
