* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.5;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    background-color: #fff;
    min-height: 100vh;
    position: relative;
}

header {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: #fff;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-size: 18px;
    font-weight: 600;
}

header a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.btn-outline {
    background: transparent;
    color: #ff6b6b;
    border: 1px solid #ff6b6b;
}

.btn-outline:hover {
    background: #fff0f0;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 15px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
    color: #666;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff6b6b;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    animation: fadeIn 0.3s;
}

.toast-success {
    background: rgba(76, 175, 80, 0.9);
}

.toast-error {
    background: rgba(244, 67, 54, 0.9);
}

.toast.fade-out {
    animation: fadeOut 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.modal {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    overflow: hidden;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.btn-cancel:hover {
    background: #eee;
}

.btn-confirm {
    background: #ff6b6b;
    color: #fff;
}

.btn-confirm:hover {
    background: #ee5a5a;
}

.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 100;
}

.tab-bar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #999;
    font-size: 12px;
}

.tab-bar a.active {
    color: #ff6b6b;
}

.tab-bar a i {
    font-size: 20px;
    margin-bottom: 4px;
}

.page-content {
    padding: 15px;
    padding-bottom: 70px;
}

.live-room-card {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: transform 0.2s;
}

.live-room-card:hover {
    transform: translateY(-2px);
}

.live-room-card .cover {
    width: 120px;
    height: 80px;
    border-radius: 8px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.live-room-card .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-room-card .cover .live-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #ff4757;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.live-room-card .cover .live-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.live-room-card .info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.live-room-card .info .title {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-room-card .info .anchor {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.live-room-card .info .anchor img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #eee;
}

.live-room-card .info .stats {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #999;
}

.live-room-card .info .stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.live-container {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #000;
}

.live-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.live-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
}

.live-header .anchor-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-header .anchor-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #ff6b6b;
}

.live-header .anchor-info .name {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.live-header .anchor-info .followers {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
}

.live-header .view-count {
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.live-danmaku-container {
    position: absolute;
    top: 100px;
    left: 15px;
    right: 15px;
    bottom: 120px;
    overflow: hidden;
}

.live-danmaku {
    position: absolute;
    color: #fff;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    white-space: nowrap;
    animation: danmakuMove 8s linear forwards;
}

@keyframes danmakuMove {
    from { transform: translateX(100%); }
    to { transform: translateX(-100%); }
}

.live-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    pointer-events: auto;
}

.live-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.live-input-row input {
    flex: 1;
    padding: 10px 15px;
    border-radius: 25px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 14px;
}

.live-input-row input::placeholder {
    color: rgba(255,255,255,0.5);
}

.live-input-row button {
    background: #ff6b6b;
    color: #fff;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
}

.live-actions {
    display: flex;
    justify-content: space-around;
}

.live-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
}

.live-action-btn i {
    font-size: 28px;
    margin-bottom: 5px;
}

.live-action-btn.like i {
    color: #ff6b6b;
}

.live-action-btn.reward i {
    color: #ffd700;
}

.reward-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.reward-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.reward-panel-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.reward-panel-header .close {
    font-size: 20px;
    color: #999;
    cursor: pointer;
}

.reward-gifts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.reward-gift {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.reward-gift:hover,
.reward-gift.active {
    background: #fff0f0;
}

.reward-gift img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ffaa00);
}

.reward-gift .name {
    font-size: 13px;
    color: #333;
}

.reward-gift .price {
    font-size: 12px;
    color: #ff6b6b;
}

.reward-amount {
    margin-top: 20px;
}

.reward-amount .label {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.reward-amount .amount-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.reward-amount .amount-option {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.reward-amount .amount-option.active {
    border-color: #ff6b6b;
    background: #fff0f0;
    color: #ff6b6b;
}

.reward-submit {
    margin-top: 20px;
    width: 100%;
    padding: 15px;
    background: #ff6b6b;
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.products-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

.product-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.product-item:last-child {
    border-bottom: none;
}

.product-item img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: #f5f5f5;
    object-fit: cover;
}

.product-item .info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-item .info .name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-item .info .description {
    font-size: 12px;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-item .info .price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-item .info .price {
    color: #ff6b6b;
    font-weight: 600;
    font-size: 16px;
}

.product-item .info .original-price {
    color: #999;
    font-size: 12px;
    text-decoration: line-through;
    margin-left: 8px;
}

.product-item .buy-btn {
    background: #ff6b6b;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
}

.profile-section {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: #fff;
}

.profile-section img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.5);
    margin-bottom: 15px;
}

.profile-section .nickname {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 5px;
}

.profile-section .balance {
    font-size: 14px;
    opacity: 0.9;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background: #fff;
    margin-bottom: 15px;
}

.profile-stat {
    text-align: center;
}

.profile-stat .value {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.profile-stat .label {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.profile-menu {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.profile-menu-item:last-child {
    border-bottom: none;
}

.profile-menu-item .icon {
    font-size: 18px;
    color: #ff6b6b;
    margin-right: 15px;
}

.profile-menu-item .text {
    flex: 1;
    font-size: 15px;
    color: #333;
}

.profile-menu-item .arrow {
    font-size: 12px;
    color: #999;
}

.order-list {
    padding: 15px;
}

.order-item {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.order-item .order-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 13px;
}

.order-item .order-header .order-no {
    color: #666;
}

.order-item .order-header .status {
    color: #ff6b6b;
    font-weight: 500;
}

.order-item .product-info {
    display: flex;
    gap: 15px;
}

.order-item .product-info img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: #f5f5f5;
    object-fit: cover;
}

.order-item .product-info .details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.order-item .product-info .details .name {
    font-size: 14px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-item .product-info .details .price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.order-item .product-info .details .price {
    color: #ff6b6b;
    font-weight: 600;
}

.order-item .product-info .details .quantity {
    color: #999;
    font-size: 13px;
}

.order-item .order-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.order-item .order-footer .btn {
    padding: 8px 16px;
    font-size: 13px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state .text {
    font-size: 14px;
}

.load-more {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
    cursor: pointer;
}

.load-more:hover {
    color: #ff6b6b;
}

.pull-refresh {
    text-align: center;
    padding: 10px;
    color: #999;
    font-size: 13px;
}

@media screen and (max-width: 640px) {
    .container {
        width: 100%;
    }
}
