        /* Reset & Base */
        * { box-sizing: border-box; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            background-color: #f8fafc;
            color: #0f172a;
            margin: 0;
            padding: 0;
            overflow-x: hidden;
            font-size: 14px;
        }

        /* 插件模式：固定宽高 */
        body.is-extension {
            width: 400px;
            height: 550px; /* 根据指令调整为固定高度 */
            overflow-y: auto; /* 允许纵向滚动 */
        }

        /* 网页模式：全宽 */
        body.is-web {
            width: 100%;
            min-height: 100vh;
        }

        /* Web Landing Styles */
        .web-landing {
            padding: 80px 20px;
            text-align: center;
        }
        .web-hero-title {
            font-size: 48px;
            font-weight: 800;
            color: #0f172a;
            margin-bottom: 20px;
            line-height: 1.2;
        }
        .web-hero-subtitle {
            font-size: 20px;
            color: #64748b;
            margin-bottom: 40px;
        }
        .web-cta-group {
            margin-bottom: 60px;
        }
        .btn-install-chrome {
            display: inline-block;
            background: #0f172a;
            color: white;
            padding: 16px 32px;
            border-radius: 99px;
            text-decoration: none;
            font-weight: 700;
            font-size: 16px;
            transition: transform 0.2s;
        }
        .btn-install-chrome:hover {
            transform: translateY(-2px);
        }
        
        /* Web Auth Card 居中优化 */
        body.is-web .auth-card {
            max-width: 400px;
            margin: 0 auto;
            border: 1px solid #e2e8f0;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        }

        /* App Layout - Extension (Stack) */
        body.is-extension .app-layout {
            display: flex;
            flex-direction: column;
        }

        /* App Layout - Web (Side-by-Side) */
        body.is-web .app-layout {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 24px;
            max-width: 1200px;
            margin: 0 auto;
        }
        body.is-web .app-input-section {
            display: flex;
            flex-direction: column;
        }
        body.is-web .result-container {
            height: 100%;
            min-height: 600px;
        }
        body.is-web .card textarea {
            height: 400px; /* Web版输入框加高 */
        }

        /* Utilities */
        .hidden { display: none !important; }
        .flex { display: flex; }
        .flex-col { flex-direction: column; }
        .items-center { align-items: center; }
        .justify-between { justify-content: space-between; }
        .justify-center { justify-content: center; }
        .gap-2 { gap: 8px; }
        .gap-3 { gap: 12px; }
        .gap-4 { gap: 16px; }
        .text-center { text-align: center; }
        .w-full { width: 100%; }
        .h-full { height: 100%; }
        
        /* Nav */
        nav {
            position: sticky; top: 0; z-index: 50;
            background-color: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(8px);
            border-bottom: 1px solid #e2e8f0;
            padding: 0 16px;
            height: 56px;
            display: flex; align-items: center;
        }
        .nav-content { width: 100%; display: flex; justify-content: space-between; align-items: center; }
        .logo-box { width: 32px; height: 32px; background: #0f172a; color: white; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 12px; }
        .logo-text { font-weight: 700; font-size: 16px; color: #0f172a; margin-left: 8px; }
        
        /* Buttons */
        button { cursor: pointer; border: none; background: none; font-family: inherit; }
        .btn-link { color: #475569; font-weight: 600; font-size: 12px; transition: color 0.2s; }
        .btn-link:hover { color: #0f172a; }
        .btn-primary {
            background-color: #4f46e5; color: white;
            font-weight: 700; padding: 12px 24px;
            border-radius: 12px;
            transition: all 0.2s;
            width: 100%;
        }
        .btn-primary:hover { background-color: #4338ca; transform: translateY(-1px); }
        .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
        .btn-secondary {
            background-color: white; color: #0f172a;
            border: 1px solid #e2e8f0;
            font-weight: 700; padding: 12px 24px;
            border-radius: 12px;
            width: 100%;
        }
        .btn-secondary:hover { background-color: #f8fafc; }

        /* Main Content */
        main { padding: 16px; }
        
        /* Landing */
        .hero-title { font-size: 24px; font-weight: 800; line-height: 1.2; color: #0f172a; margin-bottom: 12px; }
        .hero-subtitle { font-size: 14px; color: #475569; line-height: 1.5; margin-bottom: 24px; }
        .auth-card {
            background: white; border-radius: 16px;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
            border: 1px solid #f1f5f9;
            padding: 24px;
            margin-bottom: 24px;
        }
        .input-group { margin-bottom: 16px; }
        .input-label { display: block; font-size: 12px; font-weight: 500; color: #334155; margin-bottom: 4px; }
        .input-field {
            width: 100%; padding: 10px 12px;
            border-radius: 8px; border: 1px solid #cbd5e1;
            font-size: 14px; outline: none;
            transition: border-color 0.2s;
        }
        .input-field:focus { border-color: #4f46e5; ring: 2px solid #e0e7ff; }

        /* App View */
        .card {
            background: white; border-radius: 16px;
            border: 1px solid #e2e8f0;
            padding: 4px; /* for textarea container */
            margin-bottom: 16px;
            box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
        }
        textarea {
            width: 100%; height: 200px;
            padding: 16px; border: none; resize: none;
            background: transparent; font-family: inherit;
            color: #334155; font-size: 14px; line-height: 1.5;
        }
        textarea:focus { outline: none; }

        /* Results */
        .result-container {
            background: white; border-radius: 16px;
            border: 1px solid #e2e8f0;
            min-height: 300px;
            position: relative;
            display: flex; flex-direction: column;
        }
        .placeholder {
            position: absolute; inset: 0;
            display: flex; flex-direction: column;
            align-items: center; justify-content: center;
            color: #94a3b8; text-align: center;
            padding: 24px;
        }
        .result-content { padding: 20px; flex: 1; overflow-y: auto; }
        
        /* Score */
        .score-box { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
        .score-val { font-size: 36px; font-weight: 800; color: #0f172a; }
        .score-badge { padding: 4px 12px; border-radius: 8px; font-size: 12px; font-weight: 700; background: #f1f5f9; color: #475569; }
        .score-badge.high { background: #fee2e2; color: #b91c1c; }
        .score-badge.medium { background: #fef3c7; color: #b45309; }
        .score-badge.safe { background: #d1fae5; color: #047857; }

        /* Details */
        .detail-item {
            border: 1px solid #f1f5f9; border-radius: 12px;
            padding: 12px; margin-bottom: 8px;
            transition: box-shadow 0.2s;
        }
        .detail-item:hover { box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
        .tag { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; border: 1px solid transparent; }
        .tag.high { color: #dc2626; background: #fef2f2; border-color: #fee2e2; }
        .tag.medium { color: #d97706; background: #fffbeb; border-color: #fef3c7; }
        .tag.low { color: #2563eb; background: #eff6ff; border-color: #dbeafe; }
        
        /* Safe Copy */
        .safe-copy-box { background: #0f172a; border-radius: 12px; padding: 16px; margin-top: 16px; position: relative; }
        .safe-copy-text { color: #cbd5e1; font-family: monospace; font-size: 12px; white-space: pre-wrap; margin: 0; }
        .copy-btn {
            font-size: 10px; font-weight: 600; color: #4f46e5;
            background: #e0e7ff; padding: 4px 8px; border-radius: 4px;
            transition: background 0.2s;
        }
        .copy-btn:hover { background: #c7d2fe; }

        /* Loading */
        .loading-overlay {
            position: absolute; inset: 0; background: white; z-index: 10;
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            padding: 24px;
        }
        .progress-bar-bg { width: 100%; height: 8px; background: #f1f5f9; border-radius: 99px; overflow: hidden; margin-top: 16px; }
        .progress-bar-fill { height: 100%; background: #4f46e5; width: 0%; transition: width 0.3s; }
        
        /* Animations */
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
        .fade-in { animation: fadeIn 0.4s ease-out forwards; }
