* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #F7F8FA;
    min-height: 100vh;
    padding: 0;
    overflow-x: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    background: #F7F8FA;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.header {
    background: #FFD100;
    padding: 50px 24px 30px;
    text-align: center;
    position: relative;
}

.header h1 {
    color: #000;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.subtitle {
    color: #000;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-block;
    padding: 6px 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
}

.subtitle:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.12);
}

.tutorial-link {
    color: #000;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-block;
    padding: 6px 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
    margin-top: 8px;
}

.tutorial-link:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.12);
}

.main-content {
    padding: 16px;
}

.input-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
}

#linkInput {
    width: 100%;
    min-height: 110px;
    padding: 14px;
    border: 1px solid #E5E6EB;
    border-radius: 12px;
    font-size: 14px;
    resize: vertical;
    transition: all 0.2s;
    background: #FAFBFC;
    color: #1F2329;
    line-height: 1.6;
}

#linkInput:focus {
    outline: none;
    border-color: #FF6146;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 97, 70, 0.08);
}

#linkInput::placeholder {
    color: #8F959E;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.btn {
    flex: 1;
    padding: 13px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
    transform: scale(1);
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: #FFD100;
    color: #000;
    box-shadow: 0 2px 8px rgba(255, 209, 0, 0.3);
}

.btn-primary:active {
    box-shadow: 0 1px 4px rgba(255, 209, 0, 0.4);
}

.btn-secondary {
    background: #F2F3F5;
    color: #646A73;
}

.btn-secondary:active {
    background: #E5E6EB;
}

#pasteBtn {
    background: #07C160;
    color: white;
}

#pasteBtn:active {
    background: #06AD56;
}

#clearBtn {
    background: #FF6146;
    color: white;
}

#clearBtn:active {
    background: #E55740;
}

.hint {
    margin-top: 8px;
    font-size: 12px;
    color: #1F2329;
    text-align: center;
    line-height: 1.5;
}

.hint:first-of-type {
    margin-top: 10px;
}

.hint-example {
    margin-top: 4px;
    font-size: 11px;
    color: #1F2329 !important;
    text-align: center;
    font-family: 'Courier New', monospace;
    background: #F7F8FA;
    padding: 4px 8px;
    border-radius: 4px;
    word-break: break-all;
    user-select: none;
    pointer-events: none;
    text-decoration: none !important;
    border-bottom: none !important;
}

.hint-example a,
.hint-example a:link,
.hint-example a:visited,
.hint-example a:hover,
.hint-example a:active {
    color: #1F2329 !important;
    text-decoration: none !important;
    border-bottom: none !important;
    pointer-events: none;
}

.saved-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
}

.saved-section h3 {
    font-size: 16px;
    margin-bottom: 14px;
    color: #1F2329;
    font-weight: 600;
}

.saved-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.saved-item {
    padding: 14px 16px;
    background: #FAFBFC;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #E5E6EB;
    transform: scale(1);
}

.saved-item:active {
    transform: scale(0.98);
    background: #F2F3F5;
}

.saved-item-name {
    font-weight: 500;
    color: #1F2329;
    font-size: 14px;
}

.saved-item-delete {
    color: #FF6146;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
}

.saved-item-delete:active {
    background: rgba(255, 97, 70, 0.1);
}

.footer {
    background: transparent;
    padding: 30px 20px 20px;
    text-align: center;
    color: #8F959E;
    font-size: 12px;
}

.icp-link {
    color: #646A73;
    text-decoration: none;
    transition: color 0.2s;
    padding: 2px 4px;
    border-radius: 4px;
}

.icp-link:hover {
    color: #1F2329;
    background: rgba(0, 0, 0, 0.05);
}

.icp-link:active {
    color: #FF6146;
    background: rgba(255, 97, 70, 0.1);
}

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(31, 35, 41, 0.92);
    backdrop-filter: blur(10px);
    color: white;
    padding: 14px 24px;
    border-radius: 12px;
    display: none;
    z-index: 1000;
    font-size: 14px;
    font-weight: 400;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    max-width: 80%;
    text-align: center;
    line-height: 1.5;
}

.toast.show {
    display: block;
    animation: toastIn 0.2s ease-out;
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    margin: 50% auto;
    padding: 28px 24px;
    border-radius: 20px;
    width: 85%;
    max-width: 340px;
    position: relative;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
}

.modal-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #E5E6EB;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 16px;
    transition: all 0.2s;
    background: #FAFBFC;
}

.modal-input:focus {
    outline: none;
    border-color: #FF6146;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 97, 70, 0.08);
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.modal-btn {
    flex: 1;
    padding: 11px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    transform: scale(1);
}

.modal-btn:active {
    transform: scale(0.96);
}

.modal-btn-primary {
    background: linear-gradient(135deg, #FF6146 0%, #FF9068 100%);
    color: white;
}

.modal-btn-secondary {
    background: #F2F3F5;
    color: #646A73;
}

.close {
    position: absolute;
    right: 14px;
    top: 14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #F2F3F5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #8F959E;
    cursor: pointer;
    transition: all 0.15s;
}

.close:active {
    transform: scale(0.9);
    background: #E5E6EB;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes toastIn {
    from { 
        opacity: 0; 
        transform: translate(-50%, -50%);
    }
    to { 
        opacity: 1; 
        transform: translate(-50%, -50%);
    }
}

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

.qrcode-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s;
}

.qrcode-content {
    background: white;
    margin: 40% auto;
    padding: 28px;
    border-radius: 20px;
    width: 85%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
    position: relative;
}

.qrcode-content h3 {
    margin-bottom: 18px;
    color: #1F2329;
    font-size: 17px;
    font-weight: 600;
}

.qrcode-content img {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    margin: 0 auto 14px;
    display: block;
    background: #FAFBFC;
    border: 1px solid #E5E6EB;
}

.qrcode-content p {
    color: #646A73;
    font-size: 13px;
    line-height: 1.6;
}

.qrcode-close {
    position: absolute;
    right: 14px;
    top: 14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #F2F3F5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #8F959E;
    cursor: pointer;
    transition: all 0.15s;
    transform: scale(1);
}

.qrcode-close:active {
    transform: scale(0.9);
    background: #E5E6EB;
}

@media (max-width: 480px) {
    .header {
        padding: 50px 20px 35px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .main-content {
        padding: 16px 12px 60px;
    }
    
    .input-section {
        padding: 20px;
    }
    
    .modal-content {
        width: 90%;
        margin: 40% auto;
    }
}
