/* Liquid Glass 风格样式 */

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

:root {
    --primary-color: #007AFF;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --shadow-sm: 0 2px 20px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.16);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
    background: url('https://img.cdn1.vip/i/6a19eb1614461_1780083478.webp') center/cover no-repeat fixed;
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 0;
    pointer-events: none;
}

/* 液态背景 - 隐藏但保留结构 */
.liquid-bg {
    display: none;
}

/* 容器 */
.container {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* 玻璃头部 */
.glass-header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 20px;
    z-index: 100;
}

.header-logo {
    flex-shrink: 0;
}

.header-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
}

.header-title {
    flex: 1;
    min-width: 0;
}

.header-title h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
    background: linear-gradient(135deg, var(--primary-color), #5856D6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.glass-header h1 {
    font-size: 24px;
    font-weight: 700;
    flex: 1;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), #5856D6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateX(-4px);
}

.header-spacer {
    width: 40px;
}

/* 玻璃卡片 */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    margin-bottom: 24px;
}

.card-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 表单组 */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.field-hint {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* 图标预览 */
.icon-preview-container {
    margin-bottom: 16px;
}

.current-icon-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.current-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.icon-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.current-icon-wrapper:hover .icon-overlay {
    opacity: 1;
}

.change-icon-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.change-icon-btn:hover {
    background: white;
    transform: scale(1.05);
}

.upload-hint-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.upload-hint-box svg {
    flex-shrink: 0;
}

/* 颜色选择器 */
.color-picker-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.color-picker-wrapper input[type="color"] {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    cursor: pointer;
    background: none;
    transition: all 0.3s ease;
}

.color-picker-wrapper input[type="color"]:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.8);
}

.color-value {
    flex: 1;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.5);
    text-align: center;
}

/* 颜色预设 */
.color-presets {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.color-preset {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.color-preset:hover {
    transform: scale(1.1);
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.color-preset:active {
    transform: scale(0.95);
}

/* 开关组 */
.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.toggle-item:hover {
    background: rgba(255, 255, 255, 0.6);
}

.toggle-info {
    flex: 1;
}

.toggle-info label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    cursor: pointer;
}

.toggle-hint {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 开关按钮 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 32px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(120, 120, 128, 0.32);
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 32px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 28px;
    width: 28px;
    left: 2px;
    bottom: 2px;
    background: white;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .toggle-slider {
    background: var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* 玻璃按钮 */
.glass-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 17px;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.glass-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), #5856D6);
    color: white;
    border: none;
    box-shadow: var(--shadow-md);
}

.glass-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.glass-btn.primary:active {
    transform: translateY(0);
}

.glass-btn.secondary {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
}

.glass-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateY(-2px);
}

.glass-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* 加载动画 */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 页脚 */
.glass-footer {
    text-align: center;
    padding: 20px;
    margin-top: 20px;
}

.glass-footer p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .glass-header {
        padding: 12px 16px;
        border-radius: 20px;
        top: 16px;
    }

    .header-icon {
        width: 40px;
        height: 40px;
    }

    .header-title h1 {
        font-size: 18px;
    }

    .header-subtitle {
        font-size: 12px;
    }

    .glass-header h1 {
        font-size: 20px;
    }

    .back-btn {
        width: 36px;
        height: 36px;
    }

    .header-spacer {
        width: 36px;
    }

    .glass-card {
        padding: 20px;
        border-radius: 20px;
    }

    .card-header h2 {
        font-size: 18px;
    }

    .current-icon-wrapper {
        width: 120px;
        height: 120px;
        border-radius: 28px;
    }

    .color-picker-wrapper input[type="color"] {
        width: 50px;
        height: 50px;
    }

    .color-preset {
        width: 44px;
        height: 44px;
    }

    .glass-btn {
        padding: 14px 20px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }

    .glass-header {
        padding: 10px 14px;
        border-radius: 18px;
    }

    .glass-header h1 {
        font-size: 18px;
    }

    .glass-card {
        padding: 16px;
        border-radius: 18px;
    }

    .card-header h2 {
        font-size: 17px;
    }

    .form-group input[type="text"],
    .form-group input[type="email"] {
        padding: 12px 14px;
        font-size: 15px;
    }

    .current-icon-wrapper {
        width: 100px;
        height: 100px;
        border-radius: 24px;
    }

    .change-icon-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .color-presets {
        gap: 10px;
    }

    .color-preset {
        width: 40px;
        height: 40px;
    }

    .toggle-item {
        padding: 14px;
    }

    .toggle-info label {
        font-size: 15px;
    }

    .toggle-hint {
        font-size: 12px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .glass-card:hover {
        transform: none;
    }

    .back-btn:hover {
        transform: none;
    }

    .glass-btn:hover {
        transform: none;
    }

    .glass-btn:active {
        transform: scale(0.98);
    }

    .color-preset:hover {
        transform: none;
    }

    .color-preset:active {
        transform: scale(0.9);
    }
}


/* 设置按钮 */
.settings-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: rotate(90deg);
}

/* 上传区域 - Glass 风格 */
.upload-area-glass {
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    padding: 40px 32px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.upload-area-glass:hover {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.upload-area-glass input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-area-glass .upload-placeholder svg {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.upload-area-glass .upload-placeholder p {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.upload-area-glass .upload-hint {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 图标预览 - Glass 风格 */
.icon-preview-glass {
    position: relative;
    display: inline-block;
    margin-top: 16px;
}

.icon-preview-glass img {
    width: 120px;
    height: 120px;
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    display: block;
    border: 3px solid rgba(255, 255, 255, 0.5);
}

.remove-icon-glass {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF3B30, #FF2D55);
    color: white;
    border: 3px solid white;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
}

.remove-icon-glass:hover {
    transform: scale(1.1) rotate(90deg);
}

/* 历史记录列表 - Glass 风格 */
.history-list-glass {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.history-item-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-item-glass:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.history-icon-glass {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.history-info-glass {
    flex: 1;
    min-width: 0;
}

.history-info-glass h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-url-glass {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-time-glass {
    font-size: 13px;
    color: var(--text-secondary);
}

.history-actions-glass {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-icon-glass {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-primary);
    text-decoration: none;
}

.btn-icon-glass:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
}

.btn-delete-glass {
    color: #FF3B30;
}

.btn-delete-glass:hover {
    background: rgba(255, 59, 48, 0.2);
}

/* 模态框 - Glass 风格 */
.modal-glass {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-glass.active {
    display: flex;
}

.modal-content-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content-glass h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
}

.modal-content-glass p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.modal-actions-glass {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-actions-glass button {
    flex: 1;
}

.glass-btn.danger {
    background: linear-gradient(135deg, #FF3B30, #FF2D55);
    color: white;
    border: none;
    box-shadow: var(--shadow-md);
}

.glass-btn.danger:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* 成功页面样式 */
.download-card-glass {
    text-align: center;
}

.app-info-glass {
    margin-bottom: 24px;
}

.app-icon-large-glass {
    width: 120px;
    height: 120px;
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    margin: 0 auto 16px;
    display: block;
    border: 3px solid rgba(255, 255, 255, 0.5);
}

.app-info-glass h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.app-url-glass {
    font-size: 15px;
    color: var(--text-secondary);
    word-break: break-all;
}

.download-btn-glass {
    font-size: 18px;
}

/* 步骤卡片 - Glass 风格 */
.step-card-glass {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    gap: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-card-glass:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateX(4px);
}

.step-number-glass {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), #5856D6);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.step-content-glass h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.step-content-glass p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 17px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* 错误消息 */
.error-message {
    display: block;
    color: #FF3B30;
    font-size: 13px;
    margin-top: 6px;
    min-height: 18px;
    font-weight: 500;
}
