        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
            -webkit-tap-highlight-color: transparent;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        *:focus {
            outline: none;
        }

        body {
            background-color: #F2F2F7;
            color: #000000;
            margin: 0;
            padding: 0;
            max-width: 600px;
            margin: 0 auto;
            -webkit-overflow-scrolling: touch;
        }

        /* 容器 */
        .container {
            padding: 16px;
            padding-top: 8px;
        }

        /* 导航栏样式 */
        .nav-bar {
            padding: 0 0 24px 0;
            margin-bottom: 8px;
            position: relative;
        }

        .nav-bar h1 {
            font-size: 34px;
            font-weight: 700;
            color: #000000;
            letter-spacing: -0.4px;
            line-height: 41px;
            margin: 0;
        }

        /* 卡片容器 */
        .card {
            background-color: #FFFFFF;
            border-radius: 16px;
            margin-bottom: 16px;
            overflow: hidden;
            box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04), 0 0.5px 1px rgba(0, 0, 0, 0.08);
            transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            animation: fadeInUp 0.4s ease-out;
            border: 0.5px solid rgba(0, 0, 0, 0.04);
        }

        /* 输入区域 */
        .input-row {
            display: flex;
            align-items: center;
            padding: 16px 20px;
            transition: background-color 0.2s ease;
            position: relative;
        }

        .input-row:after {
            content: '';
            position: absolute;
            left: 20px;
            right: 20px;
            bottom: 0;
            height: 0.5px;
            background-color: #E5E5EA;
        }

        .input-row:last-child:after {
            display: none;
        }

        .input-label {
            font-size: 17px;
            color: #000000;
            width: 100px;
            flex-shrink: 0;
            font-weight: 500;
            letter-spacing: -0.3px;
        }

        .input-field {
            flex: 1;
            font-size: 17px;
            border: none;
            outline: none;
            background: transparent;
            color: #000000;
            text-align: right;
            font-weight: 400;
            letter-spacing: -0.3px;
        }

        .input-field::placeholder {
            color: #8E8E93;
            font-weight: 400;
        }

        /* 按钮 */
        .btn-primary {
            width: 100%;
            margin: 0 0 24px 0;
            padding: 17px;
            background: linear-gradient(180deg, #007AFF 0%, #0063D6 100%);
            color: #FFFFFF;
            border: none;
            border-radius: 14px;
            font-size: 17px;
            font-weight: 590;
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            animation: fadeInUp 0.4s 0.1s ease-out both;
            position: relative;
            overflow: hidden;
            letter-spacing: -0.3px;
            box-shadow: 0 4px 12px rgba(0, 122, 255, 0.16), 0 0 0.5px rgba(0, 122, 255, 0.4);
        }

        .btn-primary:active {
            background: linear-gradient(180deg, #0063D6 0%, #0051B3 100%);
            transform: translateY(1px) scale(0.99);
            box-shadow: 0 2px 6px rgba(0, 122, 255, 0.16), 0 0 0.5px rgba(0, 122, 255, 0.4);
        }

        .btn-primary:after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(255, 255, 255, 0);
            transition: background-color 0.2s ease;
        }

        .btn-primary:active:after {
            background-color: rgba(255, 255, 255, 0.1);
        }

        /* 结果区域 */
        #result {
            display: none;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .result-row {
            display: flex;
            justify-content: space-between;
            padding: 18px 20px;
            position: relative;
            transition: background-color 0.2s ease;
            cursor: default;
        }

        .result-row:after {
            content: '';
            position: absolute;
            left: 20px;
            right: 20px;
            bottom: 0;
            height: 0.5px;
            background-color: #E5E5EA;
        }

        .result-row:last-child:after {
            display: none;
        }

        .result-key {
            font-size: 17px;
            color: #000000;
            font-weight: 500;
            letter-spacing: -0.3px;
        }

        .result-value {
            font-size: 17px;
            color: #3C3C43;
            text-align: right;
            flex: 1;
            margin-left: 16px;
            word-break: break-all;
            font-weight: 400;
            letter-spacing: -0.3px;
            opacity: 0.8;
        }

        /* 历史记录 */
        .history-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 22px;
            font-weight: 700;
            color: #000000;
            margin-bottom: 12px;
            padding: 0 4px;
            animation: fadeInUp 0.4s 0.2s ease-out both;
            letter-spacing: -0.4px;
        }

        .clear-btn {
            font-size: 17px;
            color: #007AFF;
            cursor: pointer;
            transition: all 0.2s ease;
            font-weight: 500;
            letter-spacing: -0.3px;
            padding: 8px 12px;
            margin: -8px -12px;
            border-radius: 8px;
        }

        .clear-btn:active {
            color: #0051D5;
            background-color: rgba(0, 122, 255, 0.08);
        }

        /* 历史记录项 */
        .history-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 20px;
            cursor: pointer;
            transition: background-color 0.2s ease;
            position: relative;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
        }

        .history-item:after {
            content: '';
            position: absolute;
            left: 20px;
            right: 20px;
            bottom: 0;
            height: 0.5px;
            background-color: #E5E5EA;
            z-index: 1;
        }

        .history-item:last-child:after {
            display: none;
        }

        .history-item:active {
            background-color: #F2F2F7;
        }

        .history-item:active:after {
            background-color: transparent;
        }

        .history-query {
            font-size: 17px;
            color: #000000;
            font-weight: 500;
            letter-spacing: -0.3px;
            position: relative;
            z-index: 2;
        }

        .history-time {
            font-size: 15px;
            color: #8E8E93;
            font-weight: 400;
            letter-spacing: -0.3px;
            position: relative;
            z-index: 2;
        }

        .empty-history {
            text-align: center;
            color: #8E8E93;
            padding: 40px 0;
            font-size: 17px;
            font-weight: 400;
            opacity: 0.6;
        }

        /* 加载和错误 */
        .loading, .error {
            text-align: center;
            padding: 40px 0;
            font-size: 17px;
            font-weight: 500;
        }

        .loading {
            color: #8E8E93;
        }

        .loading:after {
            content: '...';
            animation: dots 1.5s steps(4, end) infinite;
        }

        .error {
            color: #FF3B30;
        }

        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transition: background-color 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                        opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            backdrop-filter: blur(0px);
            -webkit-backdrop-filter: blur(0px);
            padding: 20px;
        }

        .modal-overlay.show {
            background-color: rgba(0, 0, 0, 0.4);
            opacity: 1;
            visibility: visible;
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
        }

        .modal-dialog {
            background-color: #F2F2F7;
            border-radius: 14px;
            width: 280px;
            max-width: calc(100vw - 40px);
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            transform: scale(0.8) translateY(30px);
            opacity: 0;
            transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                        opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            will-change: transform, opacity;
        }

        .modal-overlay.show .modal-dialog {
            transform: scale(1) translateY(0);
            opacity: 1;
        }

        /* 弹入动画 */
        @keyframes modalIn {
            0% {
                transform: scale(0.8) translateY(30px);
                opacity: 0;
            }
            70% {
                transform: scale(1.05) translateY(-5px);
                opacity: 1;
            }
            100% {
                transform: scale(1) translateY(0);
                opacity: 1;
            }
        }

        /* 弹出动画 */
        @keyframes modalOut {
            0% {
                transform: scale(1) translateY(0);
                opacity: 1;
            }
            30% {
                transform: scale(1.05) translateY(-5px);
                opacity: 1;
            }
            100% {
                transform: scale(0.8) translateY(30px);
                opacity: 0;
            }
        }

        /* 为弹窗添加独立动画类 */
        .modal-dialog.animating-in {
            animation: modalIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
        }

        .modal-dialog.animating-out {
            animation: modalOut 0.5s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
        }

        .modal-content {
            padding: 24px 20px 20px;
            text-align: center;
        }

        .modal-title {
            font-size: 17px;
            font-weight: 600;
            color: #000000;
            margin-bottom: 4px;
            letter-spacing: -0.3px;
        }

        .modal-message {
            font-size: 13px;
            color: #8E8E93;
            line-height: 1.4;
            margin-bottom: 20px;
            letter-spacing: -0.2px;
        }

        .modal-actions {
            display: flex;
            border-top: 0.5px solid #C6C6C8;
            height: 44px;
        }

        .modal-button {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 17px;
            font-weight: 590;
            color: #007AFF;
            cursor: pointer;
            transition: background-color 0.2s ease;
            letter-spacing: -0.3px;
            position: relative;
            overflow: hidden;
        }

        .modal-button:after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0);
            transition: background-color 0.2s ease;
        }

        .modal-button:active:after {
            background-color: rgba(0, 0, 0, 0.08);
        }

        .modal-button.destructive {
            color: #FF3B30;
        }

        .modal-button + .modal-button {
            border-left: 0.5px solid #C6C6C8;
        }

        /* 单按钮弹窗样式 */
        .modal-actions.single {
            border-top: none;
            height: 44px;
        }

        .modal-actions.single .modal-button {
            border-top: 0.5px solid #C6C6C8;
        }

        /* 暗色模式弹窗支持 */
        @media (prefers-color-scheme: dark) {
            .modal-dialog {
                background-color: #1C1C1E;
            }
            
            .modal-title {
                color: #FFFFFF;
            }
            
            .modal-message {
                color: #8E8E93;
            }
            
            .modal-actions {
                border-top-color: #38383A;
            }
            
            .modal-button:active:after {
                background-color: rgba(255, 255, 255, 0.08);
            }
            
            .modal-button + .modal-button {
                border-left-color: #38383A;
            }
            
            .modal-actions.single .modal-button {
                border-top-color: #38383A;
            }
        }

        /* iOS 风格动画 */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(12px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes fadeInDown {
            from {
                opacity: 0;
                transform: translateY(-12px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

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

        @keyframes dots {
            0%, 20% { content: '.'; }
            40% { content: '..'; }
            60%, 100% { content: '...'; }
        }

        /* 滚动条样式 */
        ::-webkit-scrollbar {
            width: 0;
            background: transparent;
        }

        /* 输入框聚焦样式 */
        .input-field:focus {
            color: #007AFF;
        }

        /* 安全区域 */
        .safe-area-bottom {
            height: 20px;
            width: 100%;
        }

        /* 暗色模式支持 */
        @media (prefers-color-scheme: dark) {
            body {
                background-color: #000000;
                color: #FFFFFF;
            }
            
            .nav-bar h1 {
                color: #FFFFFF;
            }
            
            .card {
                background-color: #1C1C1E;
                border-color: rgba(255, 255, 255, 0.04);
                box-shadow: 0 2px 12px rgba(0, 0, 0, 0.24), 0 0.5px 1px rgba(0, 0, 0, 0.48);
            }
            
            .input-label {
                color: #FFFFFF;
            }
            
            .input-field {
                color: #FFFFFF;
            }
            
            .input-field::placeholder {
                color: #8E8E93;
            }
            
            .input-row:after {
                background-color: #3A3A3C;
            }
            
            .result-key {
                color: #FFFFFF;
            }
            
            .result-value {
                color: #8E8E93;
            }
            
            .result-row:after {
                background-color: #3A3A3C;
            }
            
            .history-header {
                color: #FFFFFF;
            }
            
            .history-query {
                color: #FFFFFF;
            }
            
            .history-item:after {
                background-color: #3A3A3C;
            }
            
            .history-item:active {
                background-color: #2C2C2E;
            }
            
            .history-item:active:after {
                background-color: transparent;
            }
            
            .clear-btn:active {
                background-color: rgba(10, 132, 255, 0.16);
            }
        }

        /* Safari 安全区域适配 */
        @supports (padding: max(0px)) {
            .container {
                padding-left: max(16px, env(safe-area-inset-left));
                padding-right: max(16px, env(safe-area-inset-right));
                padding-top: max(8px, env(safe-area-inset-top));
                padding-bottom: max(16px, env(safe-area-inset-bottom));
            }
            
            .safe-area-bottom {
                height: max(20px, env(safe-area-inset-bottom));
            }
            
            .modal-overlay {
                padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
            }
        }