/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
    padding: 0 var(--spacing-md);
    background-color: var(--color-white);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-transparent {
    background-color: transparent;
    position: absolute;
    width: 100%;
}

.header-left, .header-right {
    width: 60px;
    font-size: var(--font-size-lg);
    font-weight: bold;
}

.header-right {
    text-align: right;
}

.header-center {
    flex: 1;
    text-align: center;
    font-size: var(--font-size-lg);
    font-weight: bold;
}

/* 返回按钮 */
.back-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--color-black);
}

/* 按钮 */
button {
    border: none;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    -webkit-appearance: none;
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none !important;
    filter: grayscale(20%);
}

.btn-small {
    padding: 4px 12px;
    border-radius: 100px;
    font-size: var(--font-size-xs);
    font-weight: bold;
}

.btn-large {
    padding: 12px 0;
    border-radius: var(--radius-md);
    font-size: var(--font-size-lg);
    font-weight: bold;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-image: var(--color-primary-gradient);
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: var(--font-size-md);
    box-shadow: var(--shadow-primary);
    transition: transform 0.1s, box-shadow 0.2s;
}

.btn-primary:active {
    transform: scale(0.97);
    box-shadow: none;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: var(--font-size-md);
}

/* 标签 Tag */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: var(--font-size-xs);
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    margin-right: 6px;
}

.tag-sm {
    padding: 1px 4px;
    font-size: 10px;
    border-radius: 2px;
}

.tag-new {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 2px 6px;
    border-radius: 100px;
    font-size: 10px;
}

.gold-tag {
    background: rgba(255,255,255,0.85);
    color: #B27C12;
}

.tag-outline {
    background: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
}

/* 底部操作栏 */
.bottom-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 480px;
    background-color: var(--color-white);
    padding: 10px var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.05);
    z-index: 95;
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-action-bar {
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
}

/* 复选框协议区 */
.agreement-check {
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--color-gray);
    display: flex;
    align-items: center;
}

.agreement-check input[type="checkbox"] {
    margin-right: 6px;
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

/* 弹窗系统 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.55);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal-overlay.z-high {
    z-index: 1020;
}

.modal-overlay.active {
    display: block;
    opacity: 1;
}

.modal-content {
    background-color: var(--color-white);
    position: absolute;
    transition: transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
}

/* 底部弹窗 */
.modal-bottom {
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 480px;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%) translateZ(0);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
    max-height: 85vh;
    overflow-y: auto;
    will-change: transform;
    backface-visibility: hidden;
}

.modal-overlay.active .modal-bottom {
    transform: translateY(0);
}

/* 居中弹窗 */
.modal-center {
    top: 50%;
    left: 50%;
    width: 86%;
    max-width: 340px;
    border-radius: 16px;
    transform: translate(-50%, -50%) scale(0.92) translateZ(0);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    max-height: 82vh;
    overflow-y: auto;
    will-change: transform;
    backface-visibility: hidden;
}

.modal-overlay.active .modal-center {
    transform: translate(-50%, -50%) scale(1) translateZ(0);
}

.modal-header {
    padding: 16px;
    position: relative;
    border-bottom: 1px solid var(--color-border);
}

.modal-header.center {
    text-align: center;
    padding-bottom: 12px;
}

.modal-header h3 {
    font-size: var(--font-size-lg);
    margin: 0;
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 22px;
    color: var(--color-gray);
    cursor: pointer;
    line-height: 1;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-bg);
}

.modal-body {
    padding: 16px;
}

.modal-footer {
    padding: 12px 16px 16px;
    border-top: 1px solid var(--color-border);
}

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.78);
    color: var(--color-white);
    padding: 8px 20px;
    border-radius: 100px;
    font-size: var(--font-size-sm);
    z-index: 2000;
    display: none;
    opacity: 0;
    white-space: nowrap;
    pointer-events: none;
}

.toast.show {
    display: block;
    opacity: 1;
    animation: toastPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes toastPop {
    0% { transform: translate(-50%, 20px); opacity: 0; }
    100% { transform: translate(-50%, 0); opacity: 1; }
}

/* 输入框 */
input[type="text"] {
    width: 100%;
    border: none;
    outline: none;
    font-size: var(--font-size-md);
    font-family: inherit;
    background: transparent;
}

.input-bordered {
    border: 1px solid var(--color-border) !important;
    padding: 10px;
    border-radius: var(--radius-sm);
}