* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    min-height: 100vh;
    padding-bottom: 20px;
    /* 禁止长按和选择 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    /* 禁止缩放 */
    touch-action: pan-y;
}

.container {
    max-width: 428px;
    margin: 0 auto;
    background: #0a0a0a;
    min-height: 100vh;
}

/* View Management */
.view {
    display: block;
    /* 为固定导航栏留出空间（导航栏高度约 56px） */
    padding-top: 56px;
}

/* 首页不需要导航栏，所以不需要 padding-top */
#homeView {
    padding-top: 0;
}

/* Top Section: User Info */
.top-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 20px 20px 30px;
    border-radius: 0 0 24px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-picture {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.profile-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details {
    flex: 1;
}

.welcome-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 4px;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
}

.user-email {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.top-actions {
    display: flex;
    gap: 8px;
}

.action-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

.action-icon:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Promotional Banner */
.banner {
    padding: 12px 16px;
    text-align: center;
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
    margin: 12px 20px;
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.banner-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.banner-subtitle {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 4px;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(135deg, #fff 0%, #ffeb3b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.banner-description {
    font-size: 11px;
    opacity: 0.95;
    margin-top: 2px;
    line-height: 1.3;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 20px 20px;
}

.action-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

.action-icon-large {
    font-size: 32px;
    margin-bottom: 8px;
}

.action-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #ffffff;
}

.action-subtitle {
    font-size: 12px;
    color: #9ca3af;
}

/* Platforms Section */
.platforms-section {
    padding: 0 20px 20px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #ffffff;
    background: linear-gradient(135deg, #ffffff 0%, #e5e7eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* List Styles */
.platforms-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.services-list,
.products-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 20px 0; /* 添加顶部和左右间距 */
}

.platform-item,
.service-item,
.product-item {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.platform-item:hover,
.service-item:hover,
.product-item:hover {
    transform: translateX(4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

.platform-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}

/* 有图片的图标不显示背景 */
.platform-icon-with-image {
    background: none;
}

.platform-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.platform-content,
.service-content,
.product-content {
    flex: 1;
}

.platform-name,
.service-name,
.product-name {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.platform-services,
.service-products {
    font-size: 12px;
    color: #9ca3af;
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Product item layout: name on left, price on right */
.product-item {
    justify-content: space-between; /* 确保左右分布 */
}

.product-name {
    flex: 1; /* 占据剩余空间 */
}

.product-price {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    flex-shrink: 0; /* 不收缩 */
}

.item-arrow {
    color: #9ca3af;
    font-size: 20px;
    font-weight: 300;
}

/* View Header */
.view-header {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 100%;
    max-width: 428px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.back-btn {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 0;
    position: absolute;
    left: 20px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    transition: background 0.2s;
}

.back-btn svg {
    width: 20px;
    height: 20px;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.view-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    flex: 1;
    text-align: center;
    margin: 0;
}

/* Checkout View */
.checkout-content {
    padding: 20px;
    /* 确保内容不被固定导航栏遮挡 */
    margin-top: 0;
}

/* Orders View */
.orders-content {
    padding: 12px 20px 20px;
    /* 确保内容不被固定导航栏遮挡 */
    margin-top: 0;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-item {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.order-id {
    font-size: 14px;
    font-weight: 600;
    color: #9ca3af;
}

.order-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    text-transform: uppercase;
}

.order-status-pending {
    background: #fff3cd;
    color: #856404;
}

.order-status-processing {
    background: #cfe2ff;
    color: #084298;
}

.order-status-completed {
    background: #d1e7dd;
    color: #0f5132;
}

.order-status-failed {
    background: #f8d7da;
    color: #842029;
}

.order-status-cancelled {
    background: #e2e3e5;
    color: #41464b;
}

.order-status-refunded {
    background: #fff3cd;
    color: #856404;
}

.order-status-unpaid {
    background: #f8d7da;
    color: #842029;
}

.order-status-in-progress {
    background: #cfe2ff;
    color: #084298;
}

.order-status-partial {
    background: #fff3cd;
    color: #856404;
}

.order-target-url-section {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.order-target-url-label {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 6px;
}

.order-target-url-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.order-target-url-text {
    flex: 1;
    font-size: 13px;
    color: #ffffff;
    word-break: break-all;
    line-height: 1.4;
    /* 允许选择文本 */
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.order-copy-btn {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.order-copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.order-copy-btn:active {
    transform: scale(0.95);
}

.order-copy-btn svg {
    width: 16px;
    height: 16px;
}

.order-items {
    margin-bottom: 12px;
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.order-item-info {
    color: #ffffff;
    flex: 1;
}

.order-item-price {
    color: #ffffff;
    font-weight: 600;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    gap: 12px;
}

.order-footer-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.order-date {
    font-size: 12px;
    color: #9ca3af;
}

.order-total {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.order-feedback-btn {
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.order-feedback-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

.order-feedback-btn:active {
    transform: translateY(0);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 16px;
}

.checkout-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 20px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.warning-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.warning-text {
    font-size: 12px;
    color: #ffc107;
    line-height: 1.4;
}

.product-summary {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-label {
    font-size: 14px;
    color: #9ca3af;
    font-weight: 500;
}

.summary-value {
    font-size: 16px;
    color: #ffffff;
    font-weight: 600;
    text-align: right;
}

.summary-price-row {
    margin-top: 4px;
    padding-top: 16px;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
}

.summary-price-value {
    font-size: 20px;
    color: #ffffff;
    font-weight: 700;
}

.checkout-form {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.checkout-form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}

/* 允许输入框选择文本 */
.input-field,
textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 8px;
    transition: border-color 0.2s;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.input-field:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.input-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-large {
    padding: 16px 24px;
    font-size: 18px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #ffffff;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    margin-top: 16px;
    text-align: center;
}

.modal-footer a {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
}

.modal-footer a:hover {
    text-decoration: underline;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 14px;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10000;
    max-width: 90%;
    text-align: center;
    animation: toastSlideIn 0.3s ease-out;
}

.toast.toast-success {
    background: #4caf50;
}

.toast.toast-error {
    background: #f44336;
}

.toast.toast-info {
    background: #2196f3;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

.toast.toast-hide {
    animation: toastSlideOut 0.3s ease-out forwards;
}
