:root {
    --primary-color: #007AFF;
    --primary-light: #4DA3FF;
    --primary-dark: #0056B3;
    --success-color: #34C759;
    --warning-color: #FF9500;
    --danger-color: #FF3B30;
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --text-tertiary: #AEAEB2;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F7;
    --bg-tertiary: #E8E8ED;
    --border-color: #D2D2D7;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --border-radius-xl: 28px;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-md: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 22px;
    --font-size-2xl: 28px;
    --font-size-3xl: 34px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-size: var(--font-size-md);
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-secondary);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    background: rgba(255, 255, 255, 0.8);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--primary-color);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.hero-section {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.hero-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -1px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.6;
}

.hero-highlight {
    color: var(--primary-color);
    font-weight: 600;
}

.card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    padding: 32px;
    margin-bottom: 24px;
}

.card-header {
    text-align: center;
    margin-bottom: 24px;
}

.card-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.card-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: var(--font-size-md);
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.btn-lg {
    padding: 18px 36px;
    font-size: var(--font-size-lg);
    border-radius: var(--border-radius-lg);
}

.btn-block {
    width: 100%;
}

.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    font-size: var(--font-size-md);
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--border-radius-md);
    outline: none;
    transition: all var(--transition-fast);
    word-break: break-all;
}

.input-field:focus {
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

.input-field[readonly] {
    cursor: default;
    background: var(--bg-tertiary);
}

.result-box {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: var(--border-radius-md);
    padding: 20px;
    margin: 16px 0;
    border: 1px solid var(--border-color);
}

.result-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

.result-device {
    font-size: var(--font-size-md);
    color: var(--primary-color);
    font-weight: 500;
}

.notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #FFF9E6;
    border-radius: var(--border-radius-md);
    border-left: 4px solid var(--warning-color);
    margin: 16px 0;
}

.notice-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--warning-color);
}

.notice-text {
    font-size: var(--font-size-sm);
    color: #856404;
    line-height: 1.6;
}

.footer {
    text-align: center;
    padding: 24px 20px;
    color: var(--text-tertiary);
    font-size: var(--font-size-xs);
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer a:hover {
    color: var(--primary-color);
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 24px 0;
}

.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary-color);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-success {
    color: var(--success-color);
}

.text-warning {
    color: var(--warning-color);
}

.text-danger {
    color: var(--danger-color);
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mt-40 { margin-top: 40px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mb-40 { margin-bottom: 40px; }

.service-section {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}
.service-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    text-align: center;
}
.service-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.service-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}
.service-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}
.service-link:hover .service-icon,
.service-link:hover .service-text {
    color: white;
}
.service-icon {
    font-size: 18px;
    flex-shrink: 0;
}
.service-text {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.hidden {
    display: none !important;
}

@media (max-width: 767px) {
    :root {
        --font-size-3xl: 28px;
        --font-size-2xl: 24px;
    }
    
    .hero-section {
        padding: 0 10px;
    }
    
    .card {
        padding: 24px 20px;
        border-radius: var(--border-radius-lg);
    }
    
    .btn-lg {
        padding: 16px 28px;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 0 40px;
    }
    
    .main-content {
        padding: 60px 40px;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1D1D1F;
        --bg-secondary: #000000;
        --bg-tertiary: #2C2C2E;
        --text-primary: #F5F5F7;
        --text-secondary: #AEAEB2;
        --text-tertiary: #636366;
        --border-color: #38383A;
    }
    
    .header {
        background: rgba(29, 29, 31, 0.8);
    }
    
    .input-field {
        background: var(--bg-tertiary);
    }
    
    .input-field:focus {
        background: var(--bg-secondary);
    }
    
    .notice {
        background: rgba(255, 149, 0, 0.15);
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* iOS Page Specific Styles */
.ios-hero {
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    border-radius: 24px;
    padding: 40px 24px;
    margin-bottom: 30px;
    text-align: center;
    color: white;
}
.ios-hero h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}
.ios-hero p {
    font-size: 14px;
    opacity: 0.9;
}
.ios-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ios-icon svg {
    width: 48px;
    height: 48px;
    fill: white;
}
.steps {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
}
.step-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}
.step-item:last-child {
    border-bottom: none;
}
.step-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}
.step-content h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.step-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.btn-ios {
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 17px;
    font-weight: 600;
    border-radius: 14px;
    cursor: pointer;
    width: 100%;
    max-width: 300px;
    display: block;
    margin: 0 auto 24px;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.4);
    transition: all 0.2s ease;
}
.btn-ios:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(90, 200, 250, 0.5);
}
.btn-ios:active {
    transform: translateY(0);
}
.ios-notice {
    background: rgba(0, 122, 255, 0.1);
    border: 1px solid rgba(0, 122, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-top: 20px;
}
.ios-notice-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.ios-notice-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* UDID Result Page Styles */
.result-header {
    background: linear-gradient(135deg, #34C759 0%, #30D158 100%);
    border-radius: 24px;
    padding: 40px 24px;
    margin-bottom: 30px;
    text-align: center;
    color: white;
}
.result-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}
.result-header p {
    font-size: 14px;
    opacity: 0.9;
}
.success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s ease;
}
@keyframes scaleIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}
.success-icon svg {
    width: 40px;
    height: 40px;
    fill: white;
}
.info-card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.info-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}
.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.info-item:first-child {
    padding-top: 0;
}
.info-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.info-value {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
}
.info-value.udid {
    font-size: 15px;
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 8px;
    letter-spacing: 1px;
}
.info-value.device {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
}
.btn-copy {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 14px;
    cursor: pointer;
    width: 100%;
    max-width: 300px;
    display: block;
    margin: 20px auto 0;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}
.btn-copy:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}
.btn-copy:active {
    transform: translateY(0);
}
.btn-copy.copied {
    background: var(--success-color);
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3);
}
.back-link {
    display: block;
    text-align: center;
    margin-top: 24px;
    color: var(--primary-color);
    font-size: 14px;
    text-decoration: none;
    padding: 12px;
}
.back-link:hover {
    text-decoration: underline;
}
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 16px;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.toast.show {
    opacity: 1;
}